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

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

Issue 196343005: cc: Replace recorded region with direct map lookup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partial invalidation test case Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/gfx/rect_conversions.h" 10 #include "ui/gfx/rect_conversions.h"
(...skipping 25 matching lines...) Expand all
36 36
37 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { 37 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
38 Layer::PushPropertiesTo(base_layer); 38 Layer::PushPropertiesTo(base_layer);
39 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); 39 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
40 40
41 if (layer_impl->bounds().IsEmpty()) { 41 if (layer_impl->bounds().IsEmpty()) {
42 // Update may not get called for an empty layer, so resize here instead. 42 // Update may not get called for an empty layer, so resize here instead.
43 // Using layer_impl because either bounds() or paint_properties().bounds 43 // Using layer_impl because either bounds() or paint_properties().bounds
44 // may disagree and either one could have been pushed to layer_impl. 44 // may disagree and either one could have been pushed to layer_impl.
45 pile_->Resize(gfx::Size()); 45 pile_->Resize(gfx::Size());
46 pile_->UpdateRecordedRegion();
47 } else if (update_source_frame_number_ == 46 } else if (update_source_frame_number_ ==
48 layer_tree_host()->source_frame_number()) { 47 layer_tree_host()->source_frame_number()) {
49 // If update called, then pile size must match bounds pushed to impl layer. 48 // If update called, then pile size must match bounds pushed to impl layer.
50 DCHECK_EQ(layer_impl->bounds().ToString(), pile_->size().ToString()); 49 DCHECK_EQ(layer_impl->bounds().ToString(), pile_->size().ToString());
51 } 50 }
52 51
53 layer_impl->SetIsMask(is_mask_); 52 layer_impl->SetIsMask(is_mask_);
54 layer_impl->SetHasGpuRasterizationHint(has_gpu_rasterization_hint_); 53 layer_impl->SetHasGpuRasterizationHint(has_gpu_rasterization_hint_);
55 54
56 // Unlike other properties, invalidation must always be set on layer_impl. 55 // Unlike other properties, invalidation must always be set on layer_impl.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); 163 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque);
165 picture->endRecording(); 164 picture->endRecording();
166 return picture; 165 return picture;
167 } 166 }
168 167
169 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 168 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
170 benchmark->RunOnLayer(this); 169 benchmark->RunOnLayer(this);
171 } 170 }
172 171
173 } // namespace cc 172 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698