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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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. | 150 // order to avoid rerastering when a mask's transform is being animated. |
151 if (mask_type_ == LayerMaskType::SINGLE_TEXTURE_MASK && | 151 if (mask_type_ == LayerMaskType::SINGLE_TEXTURE_MASK && |
152 LayerMaskType::MULTI_TEXTURE_MASK) | 152 mask_type == LayerMaskType::MULTI_TEXTURE_MASK) |
153 return; | 153 return; |
154 mask_type_ = mask_type; | 154 mask_type_ = mask_type; |
155 } | 155 } |
156 | 156 |
157 sk_sp<SkPicture> PictureLayer::GetPicture() const { | 157 sk_sp<SkPicture> PictureLayer::GetPicture() const { |
158 // We could either flatten the RecordingSource into a single SkPicture, or | 158 // 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 | 159 // 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. | 160 // just paint a fresh one to get consistent results. |
161 if (!DrawsContent()) | 161 if (!DrawsContent()) |
162 return nullptr; | 162 return nullptr; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 return false; | 281 return false; |
282 | 282 |
283 return true; | 283 return true; |
284 } | 284 } |
285 | 285 |
286 const DisplayItemList* PictureLayer::GetDisplayItemList() { | 286 const DisplayItemList* PictureLayer::GetDisplayItemList() { |
287 return picture_layer_inputs_.display_list.get(); | 287 return picture_layer_inputs_.display_list.get(); |
288 } | 288 } |
289 | 289 |
290 } // namespace cc | 290 } // namespace cc |
OLD | NEW |