aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-03-19 08:31:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-19 08:31:14 -0700
commit3ef71e343bf075888fb50892350390b4dd47de24 (patch)
treed4765ef144928600322cf21bdb41b37f05a55697 /dm
parent647211f1243f2dc925588e75038be49cad7b5431 (diff)
guarded change to SkImageGenerator to make getInfo() const
Diffstat (limited to 'dm')
-rw-r--r--dm/DMSrcSink.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 7bbdff73bc..638f670834 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 {