| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return; | 71 return; |
| 72 | 72 |
| 73 proto->mutable_drawing_item()->mutable_id()->set_unique_id( | 73 proto->mutable_drawing_item()->mutable_id()->set_unique_id( |
| 74 picture_->uniqueID()); | 74 picture_->uniqueID()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 sk_sp<const SkPicture> DrawingDisplayItem::GetPicture() const { | 77 sk_sp<const SkPicture> DrawingDisplayItem::GetPicture() const { |
| 78 return picture_; | 78 return picture_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 DISABLE_CFI_PERF |
| 81 void DrawingDisplayItem::Raster(SkCanvas* canvas, | 82 void DrawingDisplayItem::Raster(SkCanvas* canvas, |
| 82 SkPicture::AbortCallback* callback) const { | 83 SkPicture::AbortCallback* callback) const { |
| 83 if (canvas->quickReject(picture_->cullRect())) | 84 if (canvas->quickReject(picture_->cullRect())) |
| 84 return; | 85 return; |
| 85 | 86 |
| 86 // SkPicture always does a wrapping save/restore on the canvas, so it is not | 87 // SkPicture always does a wrapping save/restore on the canvas, so it is not |
| 87 // necessary here. | 88 // necessary here. |
| 88 if (callback) | 89 if (callback) |
| 89 picture_->playback(canvas, callback); | 90 picture_->playback(canvas, callback); |
| 90 else | 91 else |
| (...skipping 27 matching lines...) Expand all Loading... |
| 118 } | 119 } |
| 119 | 120 |
| 120 void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const { | 121 void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const { |
| 121 item->SetNew(picture_); | 122 item->SetNew(picture_); |
| 122 } | 123 } |
| 123 | 124 |
| 124 size_t DrawingDisplayItem::ExternalMemoryUsage() const { | 125 size_t DrawingDisplayItem::ExternalMemoryUsage() const { |
| 125 return SkPictureUtils::ApproximateBytesUsed(picture_.get()); | 126 return SkPictureUtils::ApproximateBytesUsed(picture_.get()); |
| 126 } | 127 } |
| 127 | 128 |
| 129 DISABLE_CFI_PERF |
| 128 int DrawingDisplayItem::ApproximateOpCount() const { | 130 int DrawingDisplayItem::ApproximateOpCount() const { |
| 129 return picture_->approximateOpCount(); | 131 return picture_->approximateOpCount(); |
| 130 } | 132 } |
| 131 | 133 |
| 132 } // namespace cc | 134 } // namespace cc |
| OLD | NEW |