Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: cc/picture_layer.cc

Issue 11293188: cc: Make Picture/PicturePile handle recording/raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android_dbg Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "cc/picture_layer.h" 7 #include "cc/picture_layer.h"
8 #include "cc/picture_layer_impl.h" 8 #include "cc/picture_layer_impl.h"
9 #include "ui/gfx/rect_conversions.h"
9 10
10 namespace cc { 11 namespace cc {
11 12
12 scoped_refptr<PictureLayer> PictureLayer::create(ContentLayerClient* client) { 13 scoped_refptr<PictureLayer> PictureLayer::create(ContentLayerClient* client) {
13 return make_scoped_refptr(new PictureLayer(client)); 14 return make_scoped_refptr(new PictureLayer(client));
14 } 15 }
15 16
16 PictureLayer::PictureLayer(ContentLayerClient* client) : 17 PictureLayer::PictureLayer(ContentLayerClient* client) :
17 client_(client) { 18 client_(client) {
18 } 19 }
19 20
20 PictureLayer::~PictureLayer() { 21 PictureLayer::~PictureLayer() {
21 } 22 }
22 23
23 bool PictureLayer::drawsContent() const { 24 bool PictureLayer::drawsContent() const {
24 return Layer::drawsContent() && client_; 25 return Layer::drawsContent() && client_;
25 } 26 }
26 27
27 scoped_ptr<LayerImpl> PictureLayer::createLayerImpl() { 28 scoped_ptr<LayerImpl> PictureLayer::createLayerImpl() {
28 return PictureLayerImpl::create(id()).PassAs<LayerImpl>(); 29 return PictureLayerImpl::create(id()).PassAs<LayerImpl>();
29 } 30 }
30 31
31 void PictureLayer::pushPropertiesTo(LayerImpl* baseLayerImpl) { 32 void PictureLayer::pushPropertiesTo(LayerImpl* base_layer) {
32 PictureLayerImpl* layerImpl = static_cast<PictureLayerImpl*>(baseLayerImpl); 33 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
33 pile_.pushPropertiesTo(layerImpl->pile_); 34 pile_.PushPropertiesTo(layer_impl->pile_);
35
36 // TODO(nduca): Need to invalidate tiles here from pile's invalidation info.
37 }
38
39 void PictureLayer::setNeedsDisplayRect(const gfx::RectF& layer_rect) {
40 gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
41 pile_.Invalidate(rect);
42 }
43
44 void PictureLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
45 RenderingStats& stats) {
46 pile_.Resize(bounds());
47 pile_.Update(client_, stats);
34 } 48 }
35 49
36 } // namespace cc 50 } // namespace cc
OLDNEW
« cc/picture.cc ('K') | « cc/picture_layer.h ('k') | cc/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698