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

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
« no previous file with comments | « no previous file | include/codec/SkCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 7bbdff73bcb765a31831702db7aa2a9162c8e409..638f6708343ec6c8b24dcb5d35cde124cbfc5452 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -57,12 +57,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
return SkStringPrintf("Couldn't decode %s.", fPath.c_str());
}
- SkImageInfo decodeInfo;
- if (!codec->getInfo(&decodeInfo)) {
- return SkStringPrintf("Couldn't getInfo %s.", fPath.c_str());
- }
-
- decodeInfo = decodeInfo.makeColorType(canvasInfo.colorType());
+ SkImageInfo decodeInfo = codec->getInfo().makeColorType(canvasInfo.colorType());
if (decodeInfo.alphaType() == kUnpremul_SkAlphaType) {
// FIXME: Currently we cannot draw unpremultiplied sources.
decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType);
@@ -93,11 +88,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
SkISize CodecSrc::size() const {
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
- SkImageInfo info;
- if (codec && codec->getInfo(&info)) {
- return info.dimensions();
- }
- return SkISize::Make(0,0);
+ return codec->getInfo().dimensions();
}
Name CodecSrc::name() const {
« no previous file with comments | « no previous file | include/codec/SkCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698