diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 1464fe7af..d561c8514 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -781,7 +781,7 @@ void SampleWindow::afterChildren(SkCanvas* orig) { #ifdef SK_BUILD_FOR_IOS SkDynamicMemoryWStream mstream; doc.emitPDF(&mstream); - fPDFData = SkData::NewWithCopy(mstream.getStream(),mstream.getOffset()); + fPDFData = mstream.copyToData(); #endif SkFILEWStream stream(name.c_str()); if (stream.isValid()) {