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

Unified Diff: gm/gmmain.cpp

Issue 19677002: Add a detachAsStream to SkDynamicMemoryWStream. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Line length. Created 7 years, 5 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/SkStream.h » ('j') | include/core/SkStream.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 10125)
+++ gm/gmmain.cpp (working copy)
@@ -411,10 +411,10 @@
}
static bool write_document(const SkString& path,
- const SkDynamicMemoryWStream& document) {
+ SkDynamicMemoryWStream& document) {
SkFILEWStream stream(path.c_str());
- SkAutoDataUnref data(document.copyToData());
- return stream.write(data->data(), data->size());
+ SkAutoTUnref<SkStreamAsset> data(document.detatchAsStream());
+ return stream.writeStream(data.get(), data->getLength());
}
/**
« no previous file with comments | « no previous file | include/core/SkStream.h » ('j') | include/core/SkStream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698