| 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 return; | 84 return; |
| 85 | 85 |
| 86 if (!recording_source_) { | 86 if (!recording_source_) { |
| 87 if (host->settings().use_display_lists) { | 87 if (host->settings().use_display_lists) { |
| 88 recording_source_.reset(new DisplayListRecordingSource); | 88 recording_source_.reset(new DisplayListRecordingSource( |
| 89 host->settings().default_tile_grid_size)); |
| 89 } else { | 90 } else { |
| 90 recording_source_.reset( | 91 recording_source_.reset( |
| 91 new PicturePile(host->settings().minimum_contents_scale, | 92 new PicturePile(host->settings().minimum_contents_scale, |
| 92 host->settings().default_tile_grid_size)); | 93 host->settings().default_tile_grid_size)); |
| 93 } | 94 } |
| 94 } | 95 } |
| 95 recording_source_->DidMoveToNewCompositor(); | 96 recording_source_->DidMoveToNewCompositor(); |
| 96 recording_source_->SetSlowdownRasterScaleFactor( | 97 recording_source_->SetSlowdownRasterScaleFactor( |
| 97 host->debug_state().slow_down_raster_scale_factor); | 98 host->debug_state().slow_down_raster_scale_factor); |
| 98 | 99 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 208 |
| 208 bool PictureLayer::HasDrawableContent() const { | 209 bool PictureLayer::HasDrawableContent() const { |
| 209 return client_ && Layer::HasDrawableContent(); | 210 return client_ && Layer::HasDrawableContent(); |
| 210 } | 211 } |
| 211 | 212 |
| 212 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 213 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 213 benchmark->RunOnLayer(this); | 214 benchmark->RunOnLayer(this); |
| 214 } | 215 } |
| 215 | 216 |
| 216 } // namespace cc | 217 } // namespace cc |
| OLD | NEW |