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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 DCHECK(recording_invalidation_.IsEmpty()); | 78 DCHECK(recording_invalidation_.IsEmpty()); |
79 } | 79 } |
80 | 80 |
81 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 81 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
82 Layer::SetLayerTreeHost(host); | 82 Layer::SetLayerTreeHost(host); |
83 if (host) { | 83 if (host) { |
84 if (!recording_source_) { | 84 if (!recording_source_) { |
85 if (host->settings().use_display_lists) { | 85 if (host->settings().use_display_lists) { |
86 recording_source_.reset(new DisplayListRecordingSource); | 86 recording_source_.reset(new DisplayListRecordingSource); |
87 } else { | 87 } else { |
88 recording_source_.reset(new PicturePile); | 88 recording_source_.reset( |
| 89 new PicturePile(host->settings().minimum_contents_scale, |
| 90 host->settings().default_tile_grid_size)); |
89 } | 91 } |
90 } | 92 } |
91 recording_source_->SetMinContentsScale( | |
92 host->settings().minimum_contents_scale); | |
93 recording_source_->SetTileGridSize(host->settings().default_tile_grid_size); | |
94 recording_source_->SetSlowdownRasterScaleFactor( | 93 recording_source_->SetSlowdownRasterScaleFactor( |
95 host->debug_state().slow_down_raster_scale_factor); | 94 host->debug_state().slow_down_raster_scale_factor); |
96 } | 95 } |
97 } | 96 } |
98 | 97 |
99 void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { | 98 void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) { |
100 if (!layer_rect.IsEmpty()) { | 99 if (!layer_rect.IsEmpty()) { |
101 // Clamp invalidation to the layer bounds. | 100 // Clamp invalidation to the layer bounds. |
102 pending_invalidation_.Union( | 101 pending_invalidation_.Union( |
103 gfx::IntersectRects(layer_rect, gfx::Rect(bounds()))); | 102 gfx::IntersectRects(layer_rect, gfx::Rect(bounds()))); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 217 |
219 bool PictureLayer::HasDrawableContent() const { | 218 bool PictureLayer::HasDrawableContent() const { |
220 return client_ && Layer::HasDrawableContent(); | 219 return client_ && Layer::HasDrawableContent(); |
221 } | 220 } |
222 | 221 |
223 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 222 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
224 benchmark->RunOnLayer(this); | 223 benchmark->RunOnLayer(this); |
225 } | 224 } |
226 | 225 |
227 } // namespace cc | 226 } // namespace cc |
OLD | NEW |