| 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/paint/drawing_display_item.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
| 13 #include "base/trace_event/trace_event_argument.h" | 13 #include "base/trace_event/trace_event_argument.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "cc/debug/picture_debug_util.h" | 15 #include "cc/debug/picture_debug_util.h" |
| 16 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
| 17 #include "ui/gfx/skia_util.h" | 17 #include "ui/gfx/skia_util.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 DrawingDisplayItem::DrawingDisplayItem() : DisplayItem(DRAWING) {} | 21 DrawingDisplayItem::DrawingDisplayItem() : DisplayItem(DRAWING) {} |
| 22 | 22 |
| 23 DrawingDisplayItem::DrawingDisplayItem(sk_sp<const PaintRecord> record) | 23 DrawingDisplayItem::DrawingDisplayItem(sk_sp<const PaintRecord> record) |
| 24 : DisplayItem(DRAWING) { | 24 : DisplayItem(DRAWING) { |
| 25 SetNew(std::move(record)); | 25 SetNew(std::move(record)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item) | 28 DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item) |
| 29 : DisplayItem(DRAWING) { | 29 : DisplayItem(DRAWING) { |
| 30 item.CloneTo(this); | 30 item.CloneTo(this); |
| 31 } | 31 } |
| 32 | 32 |
| 33 DrawingDisplayItem::~DrawingDisplayItem() { | 33 DrawingDisplayItem::~DrawingDisplayItem() {} |
| 34 } | |
| 35 | 34 |
| 36 void DrawingDisplayItem::SetNew(sk_sp<const PaintRecord> record) { | 35 void DrawingDisplayItem::SetNew(sk_sp<const PaintRecord> record) { |
| 37 picture_ = std::move(record); | 36 picture_ = std::move(record); |
| 38 } | 37 } |
| 39 | 38 |
| 40 DISABLE_CFI_PERF | 39 DISABLE_CFI_PERF |
| 41 void DrawingDisplayItem::Raster(SkCanvas* canvas, | 40 void DrawingDisplayItem::Raster(SkCanvas* canvas, |
| 42 SkPicture::AbortCallback* callback) const { | 41 SkPicture::AbortCallback* callback) const { |
| 43 if (canvas->quickReject(picture_->cullRect())) | 42 if (canvas->quickReject(picture_->cullRect())) |
| 44 return; | 43 return; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 60 size_t DrawingDisplayItem::ExternalMemoryUsage() const { | 59 size_t DrawingDisplayItem::ExternalMemoryUsage() const { |
| 61 return picture_->approximateBytesUsed(); | 60 return picture_->approximateBytesUsed(); |
| 62 } | 61 } |
| 63 | 62 |
| 64 DISABLE_CFI_PERF | 63 DISABLE_CFI_PERF |
| 65 int DrawingDisplayItem::ApproximateOpCount() const { | 64 int DrawingDisplayItem::ApproximateOpCount() const { |
| 66 return picture_->approximateOpCount(); | 65 return picture_->approximateOpCount(); |
| 67 } | 66 } |
| 68 | 67 |
| 69 } // namespace cc | 68 } // namespace cc |
| OLD | NEW |