Index: samplecode/SamplePictFile.cpp |
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp |
index 9203cbad7778fa2610a70d1958dde7dd33e2e8f4..ae107969013fe0d4582ce209ddddfefa3c4e7cdc 100644 |
--- a/samplecode/SamplePictFile.cpp |
+++ b/samplecode/SamplePictFile.cpp |
@@ -117,7 +117,7 @@ protected: |
#endif |
if (!*picture) { |
- *picture = LoadPicture(fFilename.c_str(), fBBox); |
+ *picture = LoadPicture(fFilename.c_str(), fBBox).release(); |
} |
if (*picture) { |
SkCounterDrawFilter filter(fCount); |
@@ -149,8 +149,8 @@ private: |
SkSize fTileSize; |
int fCount; |
- SkPicture* LoadPicture(const char path[], BBoxType bbox) { |
- SkAutoTUnref<SkPicture> pic; |
+ sk_sp<SkPicture> LoadPicture(const char path[], BBoxType bbox) { |
+ sk_sp<SkPicture> pic; |
SkBitmap bm; |
if (SkImageDecoder::DecodeFile(path, &bm)) { |
@@ -160,11 +160,11 @@ private: |
SkIntToScalar(bm.height()), |
nullptr, 0); |
can->drawBitmap(bm, 0, 0, nullptr); |
- pic.reset(recorder.endRecording()); |
+ pic = recorder.finishRecordingAsPicture(); |
} else { |
SkFILEStream stream(path); |
if (stream.isValid()) { |
- pic.reset(SkPicture::CreateFromStream(&stream)); |
+ pic = SkPicture::MakeFromStream(&stream); |
} else { |
SkDebugf("coun't load picture at \"path\"\n", path); |
} |
@@ -174,7 +174,7 @@ private: |
pic->playback(recorder.beginRecording(pic->cullRect().width(), |
pic->cullRect().height(), |
nullptr, 0)); |
- SkAutoTUnref<SkPicture> p2(recorder.endRecording()); |
+ sk_sp<SkPicture> p2(recorder.finishRecordingAsPicture()); |
SkString path2(path); |
path2.append(".new.skp"); |
@@ -191,7 +191,7 @@ private: |
switch (bbox) { |
case kNo_BBoxType: |
// no bbox playback necessary |
- return pic.release(); |
+ return std::move(pic); |
case kRTree_BBoxType: |
factory.reset(new SkRTreeFactory); |
break; |
@@ -203,7 +203,7 @@ private: |
pic->playback(recorder.beginRecording(pic->cullRect().width(), |
pic->cullRect().height(), |
factory.get(), 0)); |
- return recorder.endRecording(); |
+ return recorder.finishRecordingAsPicture(); |
} |
typedef SampleView INHERITED; |