| 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 mask_type == LayerMaskType::MULTI_TEXTURE_MASK) | |
| 153 return; | |
| 154 mask_type_ = mask_type; | 149 mask_type_ = mask_type; |
| 155 } | 150 } |
| 156 | 151 |
| 157 sk_sp<SkPicture> PictureLayer::GetPicture() const { | 152 sk_sp<SkPicture> PictureLayer::GetPicture() const { |
| 158 // We could either flatten the RecordingSource into a single SkPicture, or | 153 // We could either flatten the RecordingSource into a single SkPicture, or |
| 159 // paint a fresh one depending on what we intend to do with it. For now we | 154 // paint a fresh one depending on what we intend to do with it. For now we |
| 160 // just paint a fresh one to get consistent results. | 155 // just paint a fresh one to get consistent results. |
| 161 if (!DrawsContent()) | 156 if (!DrawsContent()) |
| 162 return nullptr; | 157 return nullptr; |
| 163 | 158 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 return false; | 276 return false; |
| 282 | 277 |
| 283 return true; | 278 return true; |
| 284 } | 279 } |
| 285 | 280 |
| 286 const DisplayItemList* PictureLayer::GetDisplayItemList() { | 281 const DisplayItemList* PictureLayer::GetDisplayItemList() { |
| 287 return picture_layer_inputs_.display_list.get(); | 282 return picture_layer_inputs_.display_list.get(); |
| 288 } | 283 } |
| 289 | 284 |
| 290 } // namespace cc | 285 } // namespace cc |
| OLD | NEW |