| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 last_updated_invalidation_.Clear(); | 134 last_updated_invalidation_.Clear(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 return updated; | 137 return updated; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void PictureLayer::SetIsMask(bool is_mask) { | 140 void PictureLayer::SetIsMask(bool is_mask) { |
| 141 is_mask_ = is_mask; | 141 is_mask_ = is_mask; |
| 142 } | 142 } |
| 143 | 143 |
| 144 sk_sp<PaintRecord> PictureLayer::GetPicture() const { | 144 sk_sp<SkPicture> PictureLayer::GetPicture() const { |
| 145 // We could either flatten the RecordingSource into a single | 145 // We could either flatten the RecordingSource into a single SkPicture, or |
| 146 // PaintRecord, or paint a fresh one depending on what we intend to do with | 146 // paint a fresh one depending on what we intend to do with it. For now we |
| 147 // the record. For now we just paint a fresh one to get consistent results. | 147 // just paint a fresh one to get consistent results. |
| 148 if (!DrawsContent()) | 148 if (!DrawsContent()) |
| 149 return nullptr; | 149 return nullptr; |
| 150 | 150 |
| 151 gfx::Size layer_size = bounds(); | 151 gfx::Size layer_size = bounds(); |
| 152 RecordingSource recording_source; | 152 RecordingSource recording_source; |
| 153 Region recording_invalidation; | 153 Region recording_invalidation; |
| 154 | 154 |
| 155 gfx::Rect new_recorded_viewport = | 155 gfx::Rect new_recorded_viewport = |
| 156 picture_layer_inputs_.client->PaintableRegion(); | 156 picture_layer_inputs_.client->PaintableRegion(); |
| 157 scoped_refptr<DisplayItemList> display_list = | 157 scoped_refptr<DisplayItemList> display_list = |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 picture_layer_inputs_.display_list = nullptr; | 226 picture_layer_inputs_.display_list = nullptr; |
| 227 picture_layer_inputs_.painter_reported_memory_usage = 0; | 227 picture_layer_inputs_.painter_reported_memory_usage = 0; |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 const DisplayItemList* PictureLayer::GetDisplayItemList() { | 231 const DisplayItemList* PictureLayer::GetDisplayItemList() { |
| 232 return picture_layer_inputs_.display_list.get(); | 232 return picture_layer_inputs_.display_list.get(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace cc | 235 } // namespace cc |
| OLD | NEW |