| 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 "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 #include "third_party/skia/include/core/SkPictureRecorder.h" | 10 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Calling paint in WebKit can sometimes cause invalidations, so save | 114 // Calling paint in WebKit can sometimes cause invalidations, so save |
| 115 // off the invalidation prior to calling update. | 115 // off the invalidation prior to calling update. |
| 116 pending_invalidation_.Swap(&pile_invalidation_); | 116 pending_invalidation_.Swap(&pile_invalidation_); |
| 117 pending_invalidation_.Clear(); | 117 pending_invalidation_.Clear(); |
| 118 | 118 |
| 119 if (layer_tree_host()->settings().using_synchronous_renderer_compositor) { | 119 if (layer_tree_host()->settings().using_synchronous_renderer_compositor) { |
| 120 // Workaround for http://crbug.com/235910 - to retain backwards compat | 120 // Workaround for http://crbug.com/235910 - to retain backwards compat |
| 121 // the full page content must always be provided in the picture layer. | 121 // the full page content must always be provided in the picture layer. |
| 122 visible_layer_rect = gfx::Rect(bounds()); | 122 visible_layer_rect = gfx::Rect(bounds()); |
| 123 } | 123 } |
| 124 |
| 125 // UpdateAndExpandInvalidation will give us an invalidation that covers |
| 126 // anything not explicitly recorded in this frame. We give this region |
| 127 // to the impl side so that it drops tiles that may not have a recording |
| 128 // for them. |
| 124 DCHECK(client_); | 129 DCHECK(client_); |
| 125 updated |= pile_->Update(client_, | 130 updated |= |
| 126 SafeOpaqueBackgroundColor(), | 131 pile_->UpdateAndExpandInvalidation(client_, |
| 127 contents_opaque(), | 132 &pile_invalidation_, |
| 128 client_->FillsBoundsCompletely(), | 133 SafeOpaqueBackgroundColor(), |
| 129 pile_invalidation_, | 134 contents_opaque(), |
| 130 visible_layer_rect, | 135 client_->FillsBoundsCompletely(), |
| 131 update_source_frame_number_, | 136 visible_layer_rect, |
| 132 RecordingMode(), | 137 update_source_frame_number_, |
| 133 rendering_stats_instrumentation()); | 138 RecordingMode(), |
| 139 rendering_stats_instrumentation()); |
| 134 last_updated_visible_content_rect_ = visible_content_rect(); | 140 last_updated_visible_content_rect_ = visible_content_rect(); |
| 135 | 141 |
| 136 if (updated) { | 142 if (updated) { |
| 137 SetNeedsPushProperties(); | 143 SetNeedsPushProperties(); |
| 138 } else { | 144 } else { |
| 139 // If this invalidation did not affect the pile, then it can be cleared as | 145 // If this invalidation did not affect the pile, then it can be cleared as |
| 140 // an optimization. | 146 // an optimization. |
| 141 pile_invalidation_.Clear(); | 147 pile_invalidation_.Clear(); |
| 142 } | 148 } |
| 143 | 149 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 201 |
| 196 bool PictureLayer::IsSuitableForGpuRasterization() const { | 202 bool PictureLayer::IsSuitableForGpuRasterization() const { |
| 197 return pile_->is_suitable_for_gpu_rasterization(); | 203 return pile_->is_suitable_for_gpu_rasterization(); |
| 198 } | 204 } |
| 199 | 205 |
| 200 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 206 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 201 benchmark->RunOnLayer(this); | 207 benchmark->RunOnLayer(this); |
| 202 } | 208 } |
| 203 | 209 |
| 204 } // namespace cc | 210 } // namespace cc |
| OLD | NEW |