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 "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/layers/content_layer_client.h" | 9 #include "cc/layers/content_layer_client.h" |
10 #include "cc/layers/picture_layer_impl.h" | 10 #include "cc/layers/picture_layer_impl.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } else { | 139 } else { |
140 // If this invalidation did not affect the recording source, then it can be | 140 // If this invalidation did not affect the recording source, then it can be |
141 // cleared as an optimization. | 141 // cleared as an optimization. |
142 last_updated_invalidation_.Clear(); | 142 last_updated_invalidation_.Clear(); |
143 } | 143 } |
144 | 144 |
145 return updated; | 145 return updated; |
146 } | 146 } |
147 | 147 |
148 void PictureLayer::SetLayerMaskType(LayerMaskType mask_type) { | 148 void PictureLayer::SetLayerMaskType(LayerMaskType mask_type) { |
| 149 // We do not allow converting SINGLE_TEXTURE_MASK to MULTI_TEXTURE_MASK in |
| 150 // order to avoid rerastering when a mask's transform is being animated. |
| 151 if (mask_type_ == LayerMaskType::SINGLE_TEXTURE_MASK && |
| 152 LayerMaskType::MULTI_TEXTURE_MASK) |
| 153 return; |
149 mask_type_ = mask_type; | 154 mask_type_ = mask_type; |
150 } | 155 } |
151 | 156 |
152 sk_sp<SkPicture> PictureLayer::GetPicture() const { | 157 sk_sp<SkPicture> PictureLayer::GetPicture() const { |
153 // We could either flatten the RecordingSource into a single SkPicture, or | 158 // We could either flatten the RecordingSource into a single SkPicture, or |
154 // paint a fresh one depending on what we intend to do with it. For now we | 159 // paint a fresh one depending on what we intend to do with it. For now we |
155 // just paint a fresh one to get consistent results. | 160 // just paint a fresh one to get consistent results. |
156 if (!DrawsContent()) | 161 if (!DrawsContent()) |
157 return nullptr; | 162 return nullptr; |
158 | 163 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return false; | 281 return false; |
277 | 282 |
278 return true; | 283 return true; |
279 } | 284 } |
280 | 285 |
281 const DisplayItemList* PictureLayer::GetDisplayItemList() { | 286 const DisplayItemList* PictureLayer::GetDisplayItemList() { |
282 return picture_layer_inputs_.display_list.get(); | 287 return picture_layer_inputs_.display_list.get(); |
283 } | 288 } |
284 | 289 |
285 } // namespace cc | 290 } // namespace cc |
OLD | NEW |