Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3486)

Unified Diff: cc/playback/drawing_display_item.cc

Issue 2710153004: cc: Fix up code to work with concrete cc paint types (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/playback/display_item_list_unittest.cc ('k') | cc/playback/recording_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/drawing_display_item.cc
diff --git a/cc/playback/drawing_display_item.cc b/cc/playback/drawing_display_item.cc
index f040dfe080509c56f3a633e13ddd94b5241f0ddf..90f1030dec11e90139f6b6a29bf1842cd59d7547 100644
--- a/cc/playback/drawing_display_item.cc
+++ b/cc/playback/drawing_display_item.cc
@@ -46,10 +46,12 @@ void DrawingDisplayItem::Raster(SkCanvas* canvas,
// SkPicture always does a wrapping save/restore on the canvas, so it is not
// necessary here.
- if (callback)
+ if (callback) {
picture_->playback(canvas, callback);
- else
- canvas->drawPicture(picture_.get());
+ } else {
+ // TODO(enne): switch this to playback once PaintRecord is real.
+ canvas->drawPicture(ToSkPicture(picture_.get()));
+ }
}
void DrawingDisplayItem::AsValueInto(
@@ -73,7 +75,8 @@ void DrawingDisplayItem::AsValueInto(
array->EndArray();
std::string b64_picture;
- PictureDebugUtil::SerializeAsBase64(picture_.get(), &b64_picture);
+ PictureDebugUtil::SerializeAsBase64(ToSkPicture(picture_.get()),
+ &b64_picture);
array->SetString("skp64", b64_picture);
array->EndDictionary();
}
@@ -83,7 +86,7 @@ void DrawingDisplayItem::CloneTo(DrawingDisplayItem* item) const {
}
size_t DrawingDisplayItem::ExternalMemoryUsage() const {
- return SkPictureUtils::ApproximateBytesUsed(ToSkPicture(picture_.get()));
+ return picture_->approximateBytesUsed();
}
DISABLE_CFI_PERF
« no previous file with comments | « cc/playback/display_item_list_unittest.cc ('k') | cc/playback/recording_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698