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

Unified Diff: samplecode/SampleApp.cpp

Issue 17113004: Replace SkPicture(SkStream) constructors with a factory. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove a change in behavior Created 7 years, 6 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') | samplecode/SamplePictFile.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 380511f7baadff387c457e29fe0de3670538950a..3825197690395c80deb79f575e4a50aec83fcab1 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1379,8 +1379,10 @@ void SampleWindow::afterChildren(SkCanvas* orig) {
SkAutoDataUnref data(ostream.copyToData());
SkMemoryStream istream(data->data(), data->size());
- SkPicture pict(&istream);
- orig->drawPicture(pict);
+ SkAutoTUnref<SkPicture> pict(SkPicture::CreateFromStream(&istream));
+ if (pict.get() != NULL) {
+ orig->drawPicture(*pict.get());
+ }
} else {
fPicture->draw(orig);
fPicture->unref();
« no previous file with comments | « include/core/SkPicture.h ('k') | samplecode/SamplePictFile.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698