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. | |
129 DCHECK(client_); | 124 DCHECK(client_); |
130 updated |= | 125 updated |= pile_->Update(client_, |
131 pile_->UpdateAndExpandInvalidation(client_, | 126 SafeOpaqueBackgroundColor(), |
132 &pile_invalidation_, | 127 contents_opaque(), |
133 SafeOpaqueBackgroundColor(), | 128 client_->FillsBoundsCompletely(), |
134 contents_opaque(), | 129 pile_invalidation_, |
135 client_->FillsBoundsCompletely(), | 130 visible_layer_rect, |
136 visible_layer_rect, | 131 update_source_frame_number_, |
137 update_source_frame_number_, | 132 RecordingMode(), |
138 RecordingMode(), | 133 rendering_stats_instrumentation()); |
139 rendering_stats_instrumentation()); | |
140 last_updated_visible_content_rect_ = visible_content_rect(); | 134 last_updated_visible_content_rect_ = visible_content_rect(); |
141 | 135 |
142 if (updated) { | 136 if (updated) { |
143 SetNeedsPushProperties(); | 137 SetNeedsPushProperties(); |
144 } else { | 138 } else { |
145 // If this invalidation did not affect the pile, then it can be cleared as | 139 // If this invalidation did not affect the pile, then it can be cleared as |
146 // an optimization. | 140 // an optimization. |
147 pile_invalidation_.Clear(); | 141 pile_invalidation_.Clear(); |
148 } | 142 } |
149 | 143 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 195 |
202 bool PictureLayer::IsSuitableForGpuRasterization() const { | 196 bool PictureLayer::IsSuitableForGpuRasterization() const { |
203 return pile_->is_suitable_for_gpu_rasterization(); | 197 return pile_->is_suitable_for_gpu_rasterization(); |
204 } | 198 } |
205 | 199 |
206 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 200 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
207 benchmark->RunOnLayer(this); | 201 benchmark->RunOnLayer(this); |
208 } | 202 } |
209 | 203 |
210 } // namespace cc | 204 } // namespace cc |
OLD | NEW |