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 11 matching lines...) Expand all Loading... |
22 pile_(make_scoped_refptr(new PicturePile())), | 22 pile_(make_scoped_refptr(new PicturePile())), |
23 instrumentation_object_tracker_(id()), | 23 instrumentation_object_tracker_(id()), |
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 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 31 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
32 return PictureLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); | 32 return PictureLayerImpl::Create(tree_impl, id()); |
33 } | 33 } |
34 | 34 |
35 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { | 35 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { |
36 Layer::PushPropertiesTo(base_layer); | 36 Layer::PushPropertiesTo(base_layer); |
37 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 37 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
38 | 38 |
39 if (layer_impl->bounds().IsEmpty()) { | 39 if (layer_impl->bounds().IsEmpty()) { |
40 // Update may not get called for an empty layer, so resize here instead. | 40 // Update may not get called for an empty layer, so resize here instead. |
41 // Using layer_impl because either bounds() or paint_properties().bounds | 41 // Using layer_impl because either bounds() or paint_properties().bounds |
42 // may disagree and either one could have been pushed to layer_impl. | 42 // may disagree and either one could have been pushed to layer_impl. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 bool PictureLayer::HasDrawableContent() const { | 204 bool PictureLayer::HasDrawableContent() const { |
205 return client_ && Layer::HasDrawableContent(); | 205 return client_ && Layer::HasDrawableContent(); |
206 } | 206 } |
207 | 207 |
208 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 208 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
209 benchmark->RunOnLayer(this); | 209 benchmark->RunOnLayer(this); |
210 } | 210 } |
211 | 211 |
212 } // namespace cc | 212 } // namespace cc |
OLD | NEW |