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

Unified Diff: gm/etc1bitmap.cpp

Issue 1340803002: discardable pixelrefs are gone, update tests accordingly (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/astcbitmap.cpp ('k') | gm/pictureimagegenerator.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 11a700eabc0206ead378e324ea525b51a9ae6b8b..bbe75610ef6cec68200eb405074f91363c653a2d 100644
--- a/gm/etc1bitmap.cpp
+++ b/gm/etc1bitmap.cpp
@@ -103,12 +103,8 @@ protected:
return;
}
- if (!SkInstallDiscardablePixelRef(fileData, &bm)) {
- SkDebugf("Could not install discardable pixel ref.\n");
- return;
- }
-
- canvas->drawBitmap(bm, 0, 0);
+ SkAutoTUnref<SkImage> image(SkImage::NewFromEncoded(fileData));
+ canvas->drawImage(image, 0, 0);
}
private:
@@ -202,12 +198,8 @@ protected:
size_t dataSz = etc1_get_encoded_data_size(width, height) + ETC_PKM_HEADER_SIZE;
SkAutoDataUnref nonPOTData(SkData::NewWithCopy(am.get(), dataSz));
- if (!SkInstallDiscardablePixelRef(nonPOTData, &bm)) {
- SkDebugf("Could not install discardable pixel ref.\n");
- return;
- }
-
- canvas->drawBitmap(bm, 0, 0);
+ SkAutoTUnref<SkImage> image(SkImage::NewFromEncoded(nonPOTData));
+ canvas->drawImage(image, 0, 0);
}
private:
« no previous file with comments | « gm/astcbitmap.cpp ('k') | gm/pictureimagegenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698