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

Unified Diff: dm/DMSrcSink.cpp

Issue 2341693004: add helpers for using SkData with picture serialization (Closed)
Patch Set: update sampleview Created 4 years, 3 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 | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 0cdb70e933bc3dd6cd30bb15d1ad4a06ac627614..26d90f24606c18087e6621d5acc9a2762cc7f034 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1428,10 +1428,7 @@ Error ViaSerialization::draw(
sk_sp<SkPicture> pic(recorder.finishRecordingAsPicture());
// Serialize it and then deserialize it.
- SkDynamicMemoryWStream wStream;
- pic->serialize(&wStream);
- SkAutoTDelete<SkStream> rStream(wStream.detachAsStream());
- sk_sp<SkPicture> deserialized(SkPicture::MakeFromStream(rStream));
+ sk_sp<SkPicture> deserialized(SkPicture::MakeFromData(pic->serialize().get()));
return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) {
canvas->drawPicture(deserialized);
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698