| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // See PictureLayerImpl::PushPropertiesTo for more details. | 53 // See PictureLayerImpl::PushPropertiesTo for more details. |
| 54 layer_impl->invalidation_.Clear(); | 54 layer_impl->invalidation_.Clear(); |
| 55 layer_impl->invalidation_.Swap(&pile_invalidation_); | 55 layer_impl->invalidation_.Swap(&pile_invalidation_); |
| 56 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); | 56 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 59 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
| 60 Layer::SetLayerTreeHost(host); | 60 Layer::SetLayerTreeHost(host); |
| 61 if (host) { | 61 if (host) { |
| 62 pile_->SetMinContentsScale(host->settings().minimum_contents_scale); | 62 pile_->SetMinContentsScale(host->settings().minimum_contents_scale); |
| 63 pile_->SetTileGridSize(host->settings().default_tile_size); | 63 pile_->SetTileGridSize(host->settings().default_tile_grid_size); |
| 64 pile_->set_slow_down_raster_scale_factor( | 64 pile_->set_slow_down_raster_scale_factor( |
| 65 host->debug_state().slow_down_raster_scale_factor); | 65 host->debug_state().slow_down_raster_scale_factor); |
| 66 pile_->set_show_debug_picture_borders( | 66 pile_->set_show_debug_picture_borders( |
| 67 host->debug_state().show_picture_borders); | 67 host->debug_state().show_picture_borders); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { | 71 void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { |
| 72 if (!layer_rect.IsEmpty()) { | 72 if (!layer_rect.IsEmpty()) { |
| 73 // Clamp invalidation to the layer bounds. | 73 // Clamp invalidation to the layer bounds. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 bool PictureLayer::HasDrawableContent() const { | 203 bool PictureLayer::HasDrawableContent() const { |
| 204 return client_ && Layer::HasDrawableContent(); | 204 return client_ && Layer::HasDrawableContent(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 207 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 208 benchmark->RunOnLayer(this); | 208 benchmark->RunOnLayer(this); |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace cc | 211 } // namespace cc |
| OLD | NEW |