| 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/playback/display_list_recording_source.h" | 10 #include "cc/playback/display_list_recording_source.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 devtools_instrumentation::ScopedLayerTreeTask update_layer( | 132 devtools_instrumentation::ScopedLayerTreeTask update_layer( |
| 133 devtools_instrumentation::kUpdateLayer, id(), layer_tree_host()->id()); | 133 devtools_instrumentation::kUpdateLayer, id(), layer_tree_host()->id()); |
| 134 | 134 |
| 135 // Calling paint in Blink can sometimes cause invalidations, so save | 135 // Calling paint in Blink can sometimes cause invalidations, so save |
| 136 // off the invalidation prior to calling update. | 136 // off the invalidation prior to calling update. |
| 137 // TODO(chrishtr): Blink should no longer be invalidating during paint. | 137 // TODO(chrishtr): Blink should no longer be invalidating during paint. |
| 138 // Try to remove this code. | 138 // Try to remove this code. |
| 139 pending_invalidation_.Swap(&recording_invalidation_); | 139 pending_invalidation_.Swap(&recording_invalidation_); |
| 140 pending_invalidation_.Clear(); | 140 pending_invalidation_.Clear(); |
| 141 | 141 |
| 142 // TODO(chrishtr): implement this for synchronized paint. | |
| 143 if (layer_tree_host()->settings().record_full_layer) { | |
| 144 // Workaround for http://crbug.com/235910 - to retain backwards compat | |
| 145 // the full page content must always be provided in the picture layer. | |
| 146 update_rect = gfx::Rect(layer_size); | |
| 147 } | |
| 148 | |
| 149 // UpdateAndExpandInvalidation will give us an invalidation that covers | 142 // UpdateAndExpandInvalidation will give us an invalidation that covers |
| 150 // anything not explicitly recorded in this frame. We give this region | 143 // anything not explicitly recorded in this frame. We give this region |
| 151 // to the impl side so that it drops tiles that may not have a recording | 144 // to the impl side so that it drops tiles that may not have a recording |
| 152 // for them. | 145 // for them. |
| 153 DCHECK(client_); | 146 DCHECK(client_); |
| 154 updated |= recording_source_->UpdateAndExpandInvalidation( | 147 updated |= recording_source_->UpdateAndExpandInvalidation( |
| 155 client_, &recording_invalidation_, layer_size, update_rect, | 148 client_, &recording_invalidation_, layer_size, update_rect, |
| 156 update_source_frame_number_, DisplayListRecordingSource::RECORD_NORMALLY); | 149 update_source_frame_number_, DisplayListRecordingSource::RECORD_NORMALLY); |
| 157 last_updated_visible_layer_rect_ = visible_layer_rect(); | 150 last_updated_visible_layer_rect_ = visible_layer_rect(); |
| 158 | 151 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 204 |
| 212 bool PictureLayer::HasDrawableContent() const { | 205 bool PictureLayer::HasDrawableContent() const { |
| 213 return client_ && Layer::HasDrawableContent(); | 206 return client_ && Layer::HasDrawableContent(); |
| 214 } | 207 } |
| 215 | 208 |
| 216 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 209 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 217 benchmark->RunOnLayer(this); | 210 benchmark->RunOnLayer(this); |
| 218 } | 211 } |
| 219 | 212 |
| 220 } // namespace cc | 213 } // namespace cc |
| OLD | NEW |