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

Side by Side Diff: cc/layers/picture_layer.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months 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
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 "cc/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 #include "third_party/skia/include/core/SkPictureRecorder.h" 10 #include "third_party/skia/include/core/SkPictureRecorder.h"
(...skipping 10 matching lines...) Expand all
21 pile_(make_scoped_refptr(new PicturePile())), 21 pile_(make_scoped_refptr(new PicturePile())),
22 instrumentation_object_tracker_(id()), 22 instrumentation_object_tracker_(id()),
23 is_mask_(false), 23 is_mask_(false),
24 update_source_frame_number_(-1), 24 update_source_frame_number_(-1),
25 can_use_lcd_text_last_frame_(can_use_lcd_text()) { 25 can_use_lcd_text_last_frame_(can_use_lcd_text()) {
26 } 26 }
27 27
28 PictureLayer::~PictureLayer() { 28 PictureLayer::~PictureLayer() {
29 } 29 }
30 30
31 bool PictureLayer::DrawsContent() const { 31 bool PictureLayer::HasDrawableContent() const {
danakj 2014/07/17 17:21:25 can you move this by ClearClient? I liked them clo
awoloszyn 2014/07/17 20:45:00 Done.
32 return Layer::DrawsContent() && client_; 32 return client_ && Layer::HasDrawableContent();
33 } 33 }
34 34
35 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { 35 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
36 return PictureLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); 36 return PictureLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
37 } 37 }
38 38
39 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { 39 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
40 Layer::PushPropertiesTo(base_layer); 40 Layer::PushPropertiesTo(base_layer);
41 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); 41 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
42 42
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 &opaque, 193 &opaque,
194 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED); 194 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
195 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 195 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
196 return picture; 196 return picture;
197 } 197 }
198 198
199 bool PictureLayer::IsSuitableForGpuRasterization() const { 199 bool PictureLayer::IsSuitableForGpuRasterization() const {
200 return pile_->is_suitable_for_gpu_rasterization(); 200 return pile_->is_suitable_for_gpu_rasterization();
201 } 201 }
202 202
203 void PictureLayer::ClearClient() {
204 client_ = NULL;
205 UpdateDrawsContent(HasDrawableContent());
206 }
207
203 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 208 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
204 benchmark->RunOnLayer(this); 209 benchmark->RunOnLayer(this);
205 } 210 }
206 211
207 } // namespace cc 212 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698