| Index: cc/playback/drawing_display_item.cc
|
| diff --git a/cc/playback/drawing_display_item.cc b/cc/playback/drawing_display_item.cc
|
| index a6d2274c26fb0324c9ea97cfdda6262dca53696a..989f85689082ad814a82402f5eefa0bf85709db2 100644
|
| --- a/cc/playback/drawing_display_item.cc
|
| +++ b/cc/playback/drawing_display_item.cc
|
| @@ -4,66 +4,27 @@
|
|
|
| #include "cc/playback/drawing_display_item.h"
|
|
|
| -#include <stddef.h>
|
| -
|
| -#include <string>
|
| -
|
| -#include "base/strings/stringprintf.h"
|
| -#include "base/trace_event/trace_event.h"
|
| -#include "base/trace_event/trace_event_argument.h"
|
| -#include "base/values.h"
|
| -#include "cc/debug/picture_debug_util.h"
|
| -#include "third_party/skia/include/core/SkCanvas.h"
|
| -#include "ui/gfx/skia_util.h"
|
| +#include "third_party/skia/include/core/SkPicture.h"
|
|
|
| namespace cc {
|
|
|
| DrawingDisplayItem::DrawingDisplayItem() : DisplayItem(DRAWING) {}
|
|
|
| DrawingDisplayItem::DrawingDisplayItem(sk_sp<const PaintRecord> record)
|
| - : DisplayItem(DRAWING) {
|
| - SetNew(std::move(record));
|
| -}
|
| + : DisplayItem(DRAWING), picture(std::move(record)) {}
|
|
|
| DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item)
|
| - : DisplayItem(DRAWING) {
|
| - item.CloneTo(this);
|
| -}
|
| + : DisplayItem(DRAWING), picture(item.picture) {}
|
|
|
| -DrawingDisplayItem::~DrawingDisplayItem() {
|
| -}
|
| -
|
| -void DrawingDisplayItem::SetNew(sk_sp<const PaintRecord> record) {
|
| - picture_ = std::move(record);
|
| -}
|
| -
|
| -DISABLE_CFI_PERF
|
| -void DrawingDisplayItem::Raster(SkCanvas* canvas,
|
| - SkPicture::AbortCallback* callback) const {
|
| - if (canvas->quickReject(picture_->cullRect()))
|
| - return;
|
| -
|
| - // SkPicture always does a wrapping save/restore on the canvas, so it is not
|
| - // necessary here.
|
| - if (callback) {
|
| - picture_->playback(canvas, callback);
|
| - } else {
|
| - // TODO(enne): switch this to playback once PaintRecord is real.
|
| - canvas->drawPicture(ToSkPicture(picture_.get()));
|
| - }
|
| -}
|
| -
|
| -void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const {
|
| - item->SetNew(picture_);
|
| -}
|
| +DrawingDisplayItem::~DrawingDisplayItem() = default;
|
|
|
| size_t DrawingDisplayItem::ExternalMemoryUsage() const {
|
| - return picture_->approximateBytesUsed();
|
| + return picture->approximateBytesUsed();
|
| }
|
|
|
| DISABLE_CFI_PERF
|
| int DrawingDisplayItem::ApproximateOpCount() const {
|
| - return picture_->approximateOpCount();
|
| + return picture->approximateOpCount();
|
| }
|
|
|
| } // namespace cc
|
|
|