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

Unified Diff: dm/DMSrcSink.cpp

Issue 1294613002: Revert of SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « dm/DM.cpp ('k') | gyp/codec.gyp » ('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 9826f978224d74dfc5f543164fc84bb0121f7a02..f555b9fcbdba78f485e47b9baf4be67d2fa1d83c 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -27,7 +27,6 @@
#include "SkScanlineDecoder.h"
#include "SkStream.h"
#include "SkXMLWriter.h"
-#include "SkScaledCodec.h"
DEFINE_bool(multiPage, false, "For document-type backends, render the source"
" into multiple pages");
@@ -85,13 +84,9 @@
if (!encoded) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTDelete<SkCodec> codec(SkScaledCodec::NewFromData(encoded));
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
if (NULL == codec.get()) {
- // scaledCodec not supported, try normal codec
- codec.reset(SkCodec::NewFromData(encoded));
- if (NULL == codec.get()) {
- return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
- }
+ return SkStringPrintf("Couldn't create codec for %s.", fPath.c_str());
}
// Choose the color type to decode to
@@ -451,16 +446,13 @@
SkISize CodecSrc::size() const {
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str()));
- SkAutoTDelete<SkCodec> codec(SkScaledCodec::NewFromData(encoded));
- if (NULL == codec) {
- // scaledCodec not supported, try regular codec
- codec.reset(SkCodec::NewFromData(encoded));
- if (NULL == codec) {
- return SkISize::Make(0, 0);
- }
- }
- SkISize size = codec->getScaledDimensions(fScale);
- return size;
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ if (NULL != codec) {
+ SkISize size = codec->getScaledDimensions(fScale);
+ return size;
+ } else {
+ return SkISize::Make(0, 0);
+ }
}
Name CodecSrc::name() const {
« no previous file with comments | « dm/DM.cpp ('k') | gyp/codec.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698