From b0a32cc38fcd8f37a23dfa19e928aeca529eaf14 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Fri, 14 Aug 2015 06:37:37 -0700 Subject: 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 --- dm/DMSrcSink.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'dm/DMSrcSink.cpp') 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 codec(SkScaledCodec::NewFromData(encoded)); + SkAutoTDelete 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 encoded(SkData::NewFromFileName(fPath.c_str())); - SkAutoTDelete 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 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 { -- cgit v1.2.3