| 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 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 39 scoped_ptr<LayerImpl> PictureLayer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
| 40 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); | 40 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { | 43 void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { |
| 44 Layer::PushPropertiesTo(base_layer); | 44 Layer::PushPropertiesTo(base_layer); |
| 45 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); | 45 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); |
| 46 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. | 46 // TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer. |
| 47 DCHECK_EQ(layer_impl->is_mask_, is_mask_); | 47 DCHECK_EQ(layer_impl->is_mask(), is_mask_); |
| 48 | 48 |
| 49 int source_frame_number = layer_tree_host()->source_frame_number(); | 49 int source_frame_number = layer_tree_host()->source_frame_number(); |
| 50 gfx::Size impl_bounds = layer_impl->bounds(); | 50 gfx::Size impl_bounds = layer_impl->bounds(); |
| 51 gfx::Size recording_source_bounds = recording_source_->GetSize(); | 51 gfx::Size recording_source_bounds = recording_source_->GetSize(); |
| 52 | 52 |
| 53 // If update called, then recording source size must match bounds pushed to | 53 // If update called, then recording source size must match bounds pushed to |
| 54 // impl layer. | 54 // impl layer. |
| 55 DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number, | 55 DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number, |
| 56 impl_bounds == recording_source_bounds) | 56 impl_bounds == recording_source_bounds) |
| 57 << " bounds " << impl_bounds.ToString() << " recording source " | 57 << " bounds " << impl_bounds.ToString() << " recording source " |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 bool PictureLayer::HasDrawableContent() const { | 208 bool PictureLayer::HasDrawableContent() const { |
| 209 return client_ && Layer::HasDrawableContent(); | 209 return client_ && Layer::HasDrawableContent(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 212 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 213 benchmark->RunOnLayer(this); | 213 benchmark->RunOnLayer(this); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace cc | 216 } // namespace cc |
| OLD | NEW |