diff options
author | 2015-10-02 13:14:46 -0700 | |
---|---|---|
committer | 2015-10-02 13:14:46 -0700 | |
commit | e7fc14b55bb8c41ba054abf0bfa09cdd6ec84671 (patch) | |
tree | 81525743c2c436a60f4127cf04f0f96d5dc3bed5 /src/codec/SkJpegCodec.h | |
parent | 65f7c9fa7ed028159a4a2c792ccc1dcdf718eed2 (diff) |
Move all knowledge of X sampling into SkScaledCodec
Prior to this CL, each SkCodec subclass that allows sampling does an
extra check in onStartScanlineDecode to determine whether the X dimension
is supported for sampling. Remove this check, and provide a way for
SkScaledCodec to directly access the SkSwizzler, and update it to do
sampling. This way, the SkCodec knows nothing of sampling, but we can
still save the extra step of sampling afterwards.
FIXME: SkBmpRLECodec still calls SkScaledCodec::DimensionsSupported. It
seems like it could directly support sampling, rather than dealing with
SkScaledCodec (partially).
Add a new base class for SkSwizzler. It allows updating the swizzler
after it was created, which is done by SkScaledCodec. Modify SkSwizzler's
constructor/factory function to stop taking any info about sampling,
assume the sample size is one, and move modifying that into a virtual
function overridden from the base class.
BUG=skia:4284
Review URL: https://codereview.chromium.org/1372973002
Diffstat (limited to 'src/codec/SkJpegCodec.h')
-rw-r--r-- | src/codec/SkJpegCodec.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/codec/SkJpegCodec.h b/src/codec/SkJpegCodec.h index b86396317b..24594c1226 100644 --- a/src/codec/SkJpegCodec.h +++ b/src/codec/SkJpegCodec.h @@ -58,6 +58,8 @@ protected: bool onRewind() override; + bool onDimensionsSupported(const SkISize&) override; + private: /* @@ -102,14 +104,8 @@ private: */ bool setOutputColorSpace(const SkImageInfo& dst); - /* - * Checks if we can natively scale to the requested dimensions and natively scales the - * dimensions if possible - */ - bool nativelyScaleToDimensions(uint32_t width, uint32_t height); - // scanline decoding - Result initializeSwizzler(const SkImageInfo&, const SkCodec::Options&); + SkSampler* getSampler() override; Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options, SkPMColor ctable[], int* ctableCount) override; Result onGetScanlines(void* dst, int count, size_t rowBytes) override; |