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

Unified Diff: dm/DMSrcSink.cpp

Issue 1373253004: Fix bug testing SkCodec for ICO (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 | « no previous file | no next file » | 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 2e2255633538b4b4c9317fa76459c48891f5c834..d98a9cab7ae81b0f84c8a4b37fdd87ff82624e07 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -641,16 +641,18 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
SkISize CodecSrc::size() const {
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkScaledCodec::NewFromData(encoded));
- if (nullptr == codec) {
- // scaledCodec not supported, try regular codec
+ SkAutoTDelete<SkCodec> codec(nullptr);
+
+ if (kScaledCodec_Mode == fMode) {
+ codec.reset(SkScaledCodec::NewFromData(encoded));
+ } else {
codec.reset(SkCodec::NewFromData(encoded));
- if (nullptr == codec) {
- return SkISize::Make(0, 0);
- }
}
- SkISize size = codec->getScaledDimensions(fScale);
- return size;
+
+ if (nullptr == codec) {
+ return SkISize::Make(0, 0);
+ }
+ return codec->getScaledDimensions(fScale);
}
Name CodecSrc::name() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698