Chromium Code Reviews| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 recording_source_->SetBackgroundColor(SafeOpaqueBackgroundColor()); | 125 recording_source_->SetBackgroundColor(SafeOpaqueBackgroundColor()); |
| 126 recording_source_->SetRequiresClear(!contents_opaque() && | 126 recording_source_->SetRequiresClear(!contents_opaque() && |
| 127 !client_->FillsBoundsCompletely()); | 127 !client_->FillsBoundsCompletely()); |
| 128 | 128 |
| 129 TRACE_EVENT1("cc", "PictureLayer::Update", | 129 TRACE_EVENT1("cc", "PictureLayer::Update", |
| 130 "source_frame_number", | 130 "source_frame_number", |
| 131 layer_tree_host()->source_frame_number()); | 131 layer_tree_host()->source_frame_number()); |
| 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 WebKit 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. | |
|
enne (OOO)
2015/11/18 21:31:58
This isn't a thing to fix in this patch, but simil
chrishtr
2015/11/18 22:33:11
Ok I'll do that in a followup, nice.
| |
| 138 // Try to remove this code. | |
| 137 pending_invalidation_.Swap(&recording_invalidation_); | 139 pending_invalidation_.Swap(&recording_invalidation_); |
| 138 pending_invalidation_.Clear(); | 140 pending_invalidation_.Clear(); |
| 139 | 141 |
| 142 // TODO(chrishtr): implement this for synchronized paint. | |
| 140 if (layer_tree_host()->settings().record_full_layer) { | 143 if (layer_tree_host()->settings().record_full_layer) { |
| 141 // Workaround for http://crbug.com/235910 - to retain backwards compat | 144 // Workaround for http://crbug.com/235910 - to retain backwards compat |
| 142 // the full page content must always be provided in the picture layer. | 145 // the full page content must always be provided in the picture layer. |
| 143 update_rect = gfx::Rect(layer_size); | 146 update_rect = gfx::Rect(layer_size); |
| 144 } | 147 } |
| 145 | 148 |
| 146 // UpdateAndExpandInvalidation will give us an invalidation that covers | 149 // UpdateAndExpandInvalidation will give us an invalidation that covers |
| 147 // anything not explicitly recorded in this frame. We give this region | 150 // anything not explicitly recorded in this frame. We give this region |
| 148 // to the impl side so that it drops tiles that may not have a recording | 151 // to the impl side so that it drops tiles that may not have a recording |
| 149 // for them. | 152 // for them. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 | 211 |
| 209 bool PictureLayer::HasDrawableContent() const { | 212 bool PictureLayer::HasDrawableContent() const { |
| 210 return client_ && Layer::HasDrawableContent(); | 213 return client_ && Layer::HasDrawableContent(); |
| 211 } | 214 } |
| 212 | 215 |
| 213 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 216 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 214 benchmark->RunOnLayer(this); | 217 benchmark->RunOnLayer(this); |
| 215 } | 218 } |
| 216 | 219 |
| 217 } // namespace cc | 220 } // namespace cc |
| OLD | NEW |