OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |