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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // If update called, then pile size must match bounds pushed to impl layer. | 44 // If update called, then pile size must match bounds pushed to impl layer. |
45 DCHECK_IMPLIES( | 45 DCHECK_IMPLIES( |
46 update_source_frame_number_ == layer_tree_host()->source_frame_number(), | 46 update_source_frame_number_ == layer_tree_host()->source_frame_number(), |
47 layer_impl->bounds().ToString() == pile_.tiling_size().ToString()); | 47 layer_impl->bounds().ToString() == pile_.tiling_size().ToString()); |
48 } | 48 } |
49 | 49 |
50 // Unlike other properties, invalidation must always be set on layer_impl. | 50 // Unlike other properties, invalidation must always be set on layer_impl. |
51 // See PictureLayerImpl::PushPropertiesTo for more details. | 51 // See PictureLayerImpl::PushPropertiesTo for more details. |
52 layer_impl->invalidation_.Clear(); | 52 layer_impl->invalidation_.Clear(); |
53 layer_impl->invalidation_.Swap(&pile_invalidation_); | 53 layer_impl->invalidation_.Swap(&pile_invalidation_); |
54 layer_impl->pile_ = PicturePileImpl::CreateFromOther(&pile_); | 54 layer_impl->UpdatePile(PicturePileImpl::CreateFromOther(&pile_)); |
55 } | 55 } |
56 | 56 |
57 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 57 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
58 Layer::SetLayerTreeHost(host); | 58 Layer::SetLayerTreeHost(host); |
59 if (host) { | 59 if (host) { |
60 pile_.SetMinContentsScale(host->settings().minimum_contents_scale); | 60 pile_.SetMinContentsScale(host->settings().minimum_contents_scale); |
61 pile_.SetTileGridSize(host->settings().default_tile_grid_size); | 61 pile_.SetTileGridSize(host->settings().default_tile_grid_size); |
62 pile_.set_slow_down_raster_scale_factor( | 62 pile_.set_slow_down_raster_scale_factor( |
63 host->debug_state().slow_down_raster_scale_factor); | 63 host->debug_state().slow_down_raster_scale_factor); |
64 pile_.set_show_debug_picture_borders( | 64 pile_.set_show_debug_picture_borders( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 bool PictureLayer::HasDrawableContent() const { | 190 bool PictureLayer::HasDrawableContent() const { |
191 return client_ && Layer::HasDrawableContent(); | 191 return client_ && Layer::HasDrawableContent(); |
192 } | 192 } |
193 | 193 |
194 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 194 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
195 benchmark->RunOnLayer(this); | 195 benchmark->RunOnLayer(this); |
196 } | 196 } |
197 | 197 |
198 } // namespace cc | 198 } // namespace cc |
OLD | NEW |