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

Unified Diff: dm/DMSrcSink.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
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 6f6664f27ce2266bd12156f1ae973cada399ec25..89629491663406bde9c50f54f2e0e90ef319428c 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -55,10 +55,7 @@ Error ImageSrc::draw(SkCanvas* canvas) const {
if (!codec) {
return SkStringPrintf("Couldn't decode %s.", fPath.c_str());
}
- SkImageInfo info;
- if (!codec->getInfo(&info)) {
- return SkStringPrintf("Couldn't getInfo %s.", fPath.c_str());
- }
+ SkImageInfo info = codec->getInfo();
scroggo 2015/03/19 13:27:46 Yay! FYI: this (and the code in ImageSrc::size())
reed1 2015/03/19 15:20:45 Acknowledged.
info = info.makeColorType(dstColorType);
if (info.alphaType() == kUnpremul_SkAlphaType) {
// FIXME: Currently we cannot draw unpremultiplied sources.
@@ -146,11 +143,7 @@ SkISize ImageSrc::size() const {
if (!codec) {
return SkISize::Make(0,0);
}
- SkImageInfo info;
- if (!codec->getInfo(&info)) {
- return SkISize::Make(0,0);
- }
- return info.dimensions();
+ return codec->getInfo().dimensions();
} else {
SkBitmap bitmap;
if (!encoded || !SkImageDecoder::DecodeMemory(encoded->data(),
« no previous file with comments | « no previous file | gyp/skia_for_android_framework_defines.gypi » ('j') | gyp/skia_for_android_framework_defines.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698