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

Unified Diff: samplecode/GMSampleView.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 | « include/core/SkPicture.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/GMSampleView.cpp
diff --git a/samplecode/GMSampleView.cpp b/samplecode/GMSampleView.cpp
index 5e48391787bdab8190d3c6af78905e0ec053928c..19cbcc8b5763abc6a20222cf6572b41f5e0ea949 100644
--- a/samplecode/GMSampleView.cpp
+++ b/samplecode/GMSampleView.cpp
@@ -47,12 +47,8 @@ bool GMSampleView::onEvent(const SkEvent& evt) {
}
#include "SkPicture.h"
-#include "SkStream.h"
static sk_sp<SkPicture> round_trip_serialize(SkPicture* src) {
- SkDynamicMemoryWStream stream;
- src->serialize(&stream);
- SkAutoTDelete<SkStream> reader(stream.detachAsStream());
- return SkPicture::MakeFromStream(reader);
+ return SkPicture::MakeFromData(src->serialize().get());
}
#include "SkPictureRecorder.h"
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698