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

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

Issue 519583003: Use the solid color detection to create solid layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Passed the right color to the quad Created 6 years, 3 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 "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "cc/layers/content_layer_client.h" 8 #include "cc/layers/content_layer_client.h"
9 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { 32 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
33 return PictureLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); 33 return PictureLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
34 } 34 }
35 35
36 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { 36 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
37 Layer::PushPropertiesTo(base_layer); 37 Layer::PushPropertiesTo(base_layer);
38 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); 38 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
39 39
40 layer_impl->SetSolidColorState(pile_->IsSolidColor(), pile_->GetSolidColor());
41
40 if (layer_impl->bounds().IsEmpty()) { 42 if (layer_impl->bounds().IsEmpty()) {
41 // Update may not get called for an empty layer, so resize here instead. 43 // Update may not get called for an empty layer, so resize here instead.
42 // Using layer_impl because either bounds() or paint_properties().bounds 44 // Using layer_impl because either bounds() or paint_properties().bounds
43 // may disagree and either one could have been pushed to layer_impl. 45 // may disagree and either one could have been pushed to layer_impl.
44 pile_->SetEmptyBounds(); 46 pile_->SetEmptyBounds();
45 } else if (update_source_frame_number_ == 47 } else if (update_source_frame_number_ ==
46 layer_tree_host()->source_frame_number()) { 48 layer_tree_host()->source_frame_number()) {
47 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect 49 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect
48 // is identical to the layer_rect. 50 // is identical to the layer_rect.
49 // If update called, then pile size must match bounds pushed to impl layer. 51 // If update called, then pile size must match bounds pushed to impl layer.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 210
209 bool PictureLayer::HasDrawableContent() const { 211 bool PictureLayer::HasDrawableContent() const {
210 return client_ && Layer::HasDrawableContent(); 212 return client_ && Layer::HasDrawableContent();
211 } 213 }
212 214
213 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 215 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
214 benchmark->RunOnLayer(this); 216 benchmark->RunOnLayer(this);
215 } 217 }
216 218
217 } // namespace cc 219 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698