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

Unified Diff: gm/etc1bitmap.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage Created 4 years, 9 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 | « gm/drawminibitmaprect.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/etc1bitmap.cpp
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp
index 0e639fe062093df3a283c36805110222d7efd1a7..9d479991516fbab933a1713c7fea5612280d7fcc 100644
--- a/gm/etc1bitmap.cpp
+++ b/gm/etc1bitmap.cpp
@@ -98,13 +98,13 @@ protected:
SkBitmap bm;
SkString filename = GetResourcePath("mandrill_128.");
filename.append(this->fileExtension());
- SkAutoTUnref<SkData> fileData(SkData::NewFromFileName(filename.c_str()));
+ sk_sp<SkData> fileData(SkData::MakeFromFileName(filename.c_str()));
if (nullptr == fileData) {
SkDebugf("Could not open the file. Did you forget to set the resourcePath?\n");
return;
}
- SkAutoTUnref<SkImage> image(SkImage::NewFromEncoded(fileData));
+ sk_sp<SkImage> image(SkImage::MakeFromEncoded(std::move(fileData)));
if (nullptr == image) {
SkDebugf("Could not decode the ETC file. ETC may not be included in this platform.\n");
return;
@@ -201,10 +201,8 @@ protected:
SkASSERT(124 == height);
size_t dataSz = etc1_get_encoded_data_size(width, height) + ETC_PKM_HEADER_SIZE;
- SkAutoDataUnref nonPOTData(SkData::NewWithCopy(am.get(), dataSz));
-
- SkAutoTUnref<SkImage> image(SkImage::NewFromEncoded(nonPOTData));
- canvas->drawImage(image, 0, 0);
+ sk_sp<SkData> nonPOTData(SkData::MakeWithCopy(am.get(), dataSz));
+ canvas->drawImage(SkImage::MakeFromEncoded(std::move(nonPOTData)).get(), 0, 0);
}
private:
« no previous file with comments | « gm/drawminibitmaprect.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698