| Index: cc/playback/drawing_display_item.cc
|
| diff --git a/cc/playback/drawing_display_item.cc b/cc/playback/drawing_display_item.cc
|
| index 05935778582c5d8d11b716610cac185db21816d5..b038e1268386d49dc0445e4fda23347887fb56f1 100644
|
| --- a/cc/playback/drawing_display_item.cc
|
| +++ b/cc/playback/drawing_display_item.cc
|
| @@ -21,17 +21,25 @@
|
|
|
| namespace cc {
|
|
|
| -DrawingDisplayItem::DrawingDisplayItem() {
|
| +DrawingDisplayItem::DrawingDisplayItem() {}
|
| +
|
| +DrawingDisplayItem::DrawingDisplayItem(skia::RefPtr<SkPicture> picture) {
|
| + SetNew(picture);
|
| +}
|
| +
|
| +DrawingDisplayItem::DrawingDisplayItem(const proto::DisplayItem& proto) {
|
| + FromProtobuf(proto);
|
| +}
|
| +
|
| +DrawingDisplayItem::DrawingDisplayItem(const DrawingDisplayItem& item) {
|
| + item.CloneTo(this);
|
| }
|
|
|
| DrawingDisplayItem::~DrawingDisplayItem() {
|
| }
|
|
|
| void DrawingDisplayItem::SetNew(skia::RefPtr<SkPicture> picture) {
|
| - picture_ = std::move(picture);
|
| - DisplayItem::SetNew(picture_->suitableForGpuRasterization(NULL),
|
| - picture_->approximateOpCount(),
|
| - SkPictureUtils::ApproximateBytesUsed(picture_.get()));
|
| + picture_ = picture;
|
| }
|
|
|
| void DrawingDisplayItem::ToProtobuf(proto::DisplayItem* proto) const {
|
| @@ -119,4 +127,16 @@ void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const {
|
| item->SetNew(picture_);
|
| }
|
|
|
| +size_t DrawingDisplayItem::ExternalMemoryUsage() const {
|
| + return SkPictureUtils::ApproximateBytesUsed(picture_.get());
|
| +}
|
| +
|
| +int DrawingDisplayItem::ApproximateOpCount() const {
|
| + return picture_->approximateOpCount();
|
| +}
|
| +
|
| +bool DrawingDisplayItem::IsSuitableForGpuRasterization() const {
|
| + return picture_->suitableForGpuRasterization(NULL);
|
| +}
|
| +
|
| } // namespace cc
|
|
|