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/resources/display_list_recording_source.h" | 10 #include "cc/resources/display_list_recording_source.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 40 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
41 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); | 41 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); |
42 } | 42 } |
43 | 43 |
44 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { | 44 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { |
45 Layer::PushPropertiesTo(base_layer); | 45 Layer::PushPropertiesTo(base_layer); |
46 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 46 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
47 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. | 47 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. |
48 DCHECK_EQ(layer_impl->is_mask_, is_mask_); | 48 DCHECK_EQ(layer_impl->is_mask(), is_mask_); |
49 | 49 |
50 int source_frame_number = layer_tree_host()->source_frame_number(); | 50 int source_frame_number = layer_tree_host()->source_frame_number(); |
51 gfx::Size impl_bounds = layer_impl->bounds(); | 51 gfx::Size impl_bounds = layer_impl->bounds(); |
52 gfx::Size recording_source_bounds = recording_source_->GetSize(); | 52 gfx::Size recording_source_bounds = recording_source_->GetSize(); |
53 | 53 |
54 // If update called, then recording source size must match bounds pushed to | 54 // If update called, then recording source size must match bounds pushed to |
55 // impl layer. | 55 // impl layer. |
56 DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number, | 56 DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number, |
57 impl_bounds == recording_source_bounds) | 57 impl_bounds == recording_source_bounds) |
58 << " bounds " << impl_bounds.ToString() << " recording source " | 58 << " bounds " << impl_bounds.ToString() << " recording source " |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 bool PictureLayer::HasDrawableContent() const { | 219 bool PictureLayer::HasDrawableContent() const { |
220 return client_ && Layer::HasDrawableContent(); | 220 return client_ && Layer::HasDrawableContent(); |
221 } | 221 } |
222 | 222 |
223 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 223 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
224 benchmark->RunOnLayer(this); | 224 benchmark->RunOnLayer(this); |
225 } | 225 } |
226 | 226 |
227 } // namespace cc | 227 } // namespace cc |
OLD | NEW |