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

Unified Diff: tools/LazyDecodeBitmap.cpp

Issue 1017293002: guarded change to SkImageGenerator to make getInfo() const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « tests/SurfaceTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/LazyDecodeBitmap.cpp
diff --git a/tools/LazyDecodeBitmap.cpp b/tools/LazyDecodeBitmap.cpp
index 0dca16b3f1bba7b2f5c3a3f0138f714b7875f064..3b6f17e741195e8e6ab362a5e737f932db4748cf 100644
--- a/tools/LazyDecodeBitmap.cpp
+++ b/tools/LazyDecodeBitmap.cpp
@@ -22,19 +22,17 @@ DEFINE_bool(useVolatileCache, false, "Use a volatile cache for deferred image de
// Fits SkPicture::InstallPixelRefProc call signature.
// Used in SkPictureData::CreateFromStream
-bool sk_tools::LazyDecodeBitmap(const void* src,
- size_t length,
- SkBitmap* dst) {
+bool sk_tools::LazyDecodeBitmap(const void* src, size_t length, SkBitmap* dst) {
SkAutoDataUnref data(SkData::NewWithCopy(src, length));
if (NULL == data.get()) {
return false;
}
SkAutoTDelete<SkImageGenerator> gen(SkImageGenerator::NewFromData(data));
- SkImageInfo info;
- if ((NULL == gen.get()) || !gen->getInfo(&info)) {
+ if (NULL == gen.get()) {
return false;
}
+ const SkImageInfo info = gen->getInfo();
SkDiscardableMemory::Factory* pool = NULL;
if ((!FLAGS_useVolatileCache) || (info.width() * info.height() < 32 * 1024)) {
// how to do switching with SkDiscardableMemory.
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698