| 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/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Workaround for http://crbug.com/235910 - to retain backwards compat | 117 // Workaround for http://crbug.com/235910 - to retain backwards compat |
| 118 // the full page content must always be provided in the picture layer. | 118 // the full page content must always be provided in the picture layer. |
| 119 visible_layer_rect = gfx::Rect(layer_size); | 119 visible_layer_rect = gfx::Rect(layer_size); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // UpdateAndExpandInvalidation will give us an invalidation that covers | 122 // UpdateAndExpandInvalidation will give us an invalidation that covers |
| 123 // anything not explicitly recorded in this frame. We give this region | 123 // anything not explicitly recorded in this frame. We give this region |
| 124 // to the impl side so that it drops tiles that may not have a recording | 124 // to the impl side so that it drops tiles that may not have a recording |
| 125 // for them. | 125 // for them. |
| 126 DCHECK(client_); | 126 DCHECK(client_); |
| 127 updated |= | 127 updated |= pile_.UpdateAndExpandInvalidation( |
| 128 pile_.UpdateAndExpandInvalidation(client_, | 128 client_, &pile_invalidation_, SafeOpaqueBackgroundColor(), |
| 129 &pile_invalidation_, | 129 contents_opaque(), client_->FillsBoundsCompletely(), layer_size, |
| 130 SafeOpaqueBackgroundColor(), | 130 visible_layer_rect, update_source_frame_number_, |
| 131 contents_opaque(), | 131 Picture::RECORD_NORMALLY); |
| 132 client_->FillsBoundsCompletely(), | |
| 133 layer_size, | |
| 134 visible_layer_rect, | |
| 135 update_source_frame_number_, | |
| 136 Picture::RECORD_NORMALLY, | |
| 137 rendering_stats_instrumentation()); | |
| 138 last_updated_visible_content_rect_ = visible_content_rect(); | 132 last_updated_visible_content_rect_ = visible_content_rect(); |
| 139 | 133 |
| 140 if (updated) { | 134 if (updated) { |
| 141 SetNeedsPushProperties(); | 135 SetNeedsPushProperties(); |
| 142 } else { | 136 } else { |
| 143 // If this invalidation did not affect the pile, then it can be cleared as | 137 // If this invalidation did not affect the pile, then it can be cleared as |
| 144 // an optimization. | 138 // an optimization. |
| 145 pile_invalidation_.Clear(); | 139 pile_invalidation_.Clear(); |
| 146 } | 140 } |
| 147 | 141 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 189 |
| 196 bool PictureLayer::HasDrawableContent() const { | 190 bool PictureLayer::HasDrawableContent() const { |
| 197 return client_ && Layer::HasDrawableContent(); | 191 return client_ && Layer::HasDrawableContent(); |
| 198 } | 192 } |
| 199 | 193 |
| 200 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 194 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 201 benchmark->RunOnLayer(this); | 195 benchmark->RunOnLayer(this); |
| 202 } | 196 } |
| 203 | 197 |
| 204 } // namespace cc | 198 } // namespace cc |
| OLD | NEW |