aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMSrcSink.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-08-14 06:37:37 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-14 06:37:37 -0700
commitb0a32cc38fcd8f37a23dfa19e928aeca529eaf14 (patch)
tree27b24eee017e5e6d621789df6e4bc55db7ce695c /dm/DMSrcSink.cpp
parent2ba70995f8a69285dd35968aa3a3e19d5429bdd0 (diff)
Revert of SkScaledCodec class (patchset #35 id:680001 of https://codereview.chromium.org/1260673002/ )
Reason for revert: breaking ubuntu bots Original issue's description: > SkScaledCodec class > > This class does scaling by using a scanlineDecoder. > getScanlines and skipScanlines are used for y sampling, > the swizzler is used for x sampling > > this class is currently only working for png and jpeg images > I will update other Codec types to work soon > > For SkJpegCodec to implement width wise swizzling it now > uses a swizzler. I ran performance tests on this change. > Here are the performance test results: > https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee > > Committed: https://skia.googlesource.com/skia/+/d518ea7927f9f4e0ed5b4134d1b4f48243855a47 > > Committed: https://skia.googlesource.com/skia/+/b157917507d4f7d2651f0aeb566d31603cc02240 TBR=scroggo@google.com,msarett@google.com,djsollen@google.com,mtklein@google.com,emmaleer@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1285173003
Diffstat (limited to 'dm/DMSrcSink.cpp')
-rw-r--r--dm/DMSrcSink.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 9826f97822..f555b9fcbd 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 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
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 @@ 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 (NULL == codec) {
- // scaledCodec not supported, try regular codec
- codec.reset(SkCodec::NewFromData(encoded));
- if (NULL == codec) {
- return SkISize::Make(0, 0);
- }
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded));
+ if (NULL != codec) {
+ SkISize size = codec->getScaledDimensions(fScale);
+ return size;
+ } else {
+ return SkISize::Make(0, 0);
}
- SkISize size = codec->getScaledDimensions(fScale);
- return size;
}
Name CodecSrc::name() const {