OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/playback/drawing_display_item.h" | 5 #include "cc/playback/drawing_display_item.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 item.CloneTo(this); | 35 item.CloneTo(this); |
36 } | 36 } |
37 | 37 |
38 DrawingDisplayItem::~DrawingDisplayItem() { | 38 DrawingDisplayItem::~DrawingDisplayItem() { |
39 } | 39 } |
40 | 40 |
41 void DrawingDisplayItem::SetNew(sk_sp<const SkPicture> picture) { | 41 void DrawingDisplayItem::SetNew(sk_sp<const SkPicture> picture) { |
42 picture_ = std::move(picture); | 42 picture_ = std::move(picture); |
43 } | 43 } |
44 | 44 |
45 sk_sp<const SkPicture> DrawingDisplayItem::GetPicture() const { | |
46 return picture_; | |
47 } | |
48 | |
49 DISABLE_CFI_PERF | 45 DISABLE_CFI_PERF |
50 void DrawingDisplayItem::Raster(SkCanvas* canvas, | 46 void DrawingDisplayItem::Raster(SkCanvas* canvas, |
51 SkPicture::AbortCallback* callback) const { | 47 SkPicture::AbortCallback* callback) const { |
52 if (canvas->quickReject(picture_->cullRect())) | 48 if (canvas->quickReject(picture_->cullRect())) |
53 return; | 49 return; |
54 | 50 |
55 // SkPicture always does a wrapping save/restore on the canvas, so it is not | 51 // SkPicture always does a wrapping save/restore on the canvas, so it is not |
56 // necessary here. | 52 // necessary here. |
57 if (callback) | 53 if (callback) |
58 picture_->playback(canvas, callback); | 54 picture_->playback(canvas, callback); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 size_t DrawingDisplayItem::ExternalMemoryUsage() const { | 89 size_t DrawingDisplayItem::ExternalMemoryUsage() const { |
94 return SkPictureUtils::ApproximateBytesUsed(picture_.get()); | 90 return SkPictureUtils::ApproximateBytesUsed(picture_.get()); |
95 } | 91 } |
96 | 92 |
97 DISABLE_CFI_PERF | 93 DISABLE_CFI_PERF |
98 int DrawingDisplayItem::ApproximateOpCount() const { | 94 int DrawingDisplayItem::ApproximateOpCount() const { |
99 return picture_->approximateOpCount(); | 95 return picture_->approximateOpCount(); |
100 } | 96 } |
101 | 97 |
102 } // namespace cc | 98 } // namespace cc |
OLD | NEW |