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

Issue 1372973002: Move all knowledge of X sampling into SkScaledCodec (Closed)

Created:
5 years, 2 months ago by scroggo
Modified:
5 years, 2 months ago
Reviewers:
msarett, djsollen
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@codecSDmerge
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

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 Committed: https://skia.googlesource.com/skia/+/e7fc14b55bb8c41ba054abf0bfa09cdd6ec84671

Patch Set 1 #

Patch Set 2 : Appears to fix bugs. Need to clean up and rebase. #

Patch Set 3 : Cleanups #

Patch Set 4 : Rebase onto master #

Patch Set 5 : Fix ico, sampling #

Total comments: 35

Patch Set 6 : Remove redundant dimensions check in wbmp #

Patch Set 7 : Respond to Matt's comments in patch set 5 #

Patch Set 8 : Attempted fix for BmpRLE; use the return value from setSampleX #

Patch Set 9 : Fix BmpRLE #

Patch Set 10 : Fix warnings #

Patch Set 11 : Fix final BMP subclass #

Patch Set 12 : Attempt to fix RLE overflow #

Unified diffs Side-by-side diffs Delta from patch set Stats (+363 lines, -248 lines) Patch
M include/codec/SkCodec.h View 1 2 3 4 chunks +35 lines, -0 lines 0 comments Download
M include/codec/SkScaledCodec.h View 1 2 2 chunks +2 lines, -17 lines 0 comments Download
M src/codec/SkBmpCodec.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M src/codec/SkBmpCodec.cpp View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M src/codec/SkBmpMaskCodec.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/codec/SkBmpRLECodec.h View 1 2 3 4 5 6 7 4 chunks +6 lines, -0 lines 0 comments Download
M src/codec/SkBmpRLECodec.cpp View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +38 lines, -8 lines 0 comments Download
M src/codec/SkBmpStandardCodec.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M src/codec/SkBmpStandardCodec.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkCodec.cpp View 1 2 3 4 5 6 3 chunks +28 lines, -2 lines 0 comments Download
M src/codec/SkCodec_libgif.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/codec/SkCodec_libgif.cpp View 1 2 3 3 chunks +2 lines, -14 lines 0 comments Download
M src/codec/SkCodec_libico.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M src/codec/SkCodec_libico.cpp View 1 2 3 4 5 6 3 chunks +14 lines, -4 lines 0 comments Download
M src/codec/SkCodec_libpng.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/codec/SkCodec_libpng.cpp View 1 2 3 4 chunks +4 lines, -21 lines 0 comments Download
M src/codec/SkCodec_wbmp.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/codec/SkCodec_wbmp.cpp View 1 2 3 4 5 5 chunks +3 lines, -12 lines 0 comments Download
M src/codec/SkJpegCodec.h View 1 2 3 2 chunks +3 lines, -7 lines 0 comments Download
M src/codec/SkJpegCodec.cpp View 1 2 3 4 5 6 7 8 9 7 chunks +60 lines, -49 lines 0 comments Download
M src/codec/SkMaskSwizzler.h View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -10 lines 0 comments Download
M src/codec/SkMaskSwizzler.cpp View 1 3 chunks +21 lines, -12 lines 0 comments Download
A src/codec/SkSampler.h View 1 chunk +27 lines, -0 lines 0 comments Download
M src/codec/SkScaledCodec.cpp View 1 2 3 4 5 6 7 3 chunks +53 lines, -53 lines 0 comments Download
M src/codec/SkSwizzler.h View 3 chunks +15 lines, -18 lines 0 comments Download
M src/codec/SkSwizzler.cpp View 2 chunks +19 lines, -14 lines 0 comments Download
M src/codec/SkWebpCodec.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/codec/SkWebpCodec.cpp View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (11 generated)
scroggo
https://codereview.chromium.org/1372973002/diff/80001/src/codec/SkCodec.cpp File src/codec/SkCodec.cpp (right): https://codereview.chromium.org/1372973002/diff/80001/src/codec/SkCodec.cpp#newcode244 src/codec/SkCodec.cpp:244: // FIXME: This check breaks down when we sample ...
5 years, 2 months ago (2015-10-01 15:33:14 UTC) #2
msarett
I think this is another really good change. It'll be interesting to integrate this with ...
5 years, 2 months ago (2015-10-01 19:34:34 UTC) #3
scroggo
https://codereview.chromium.org/1372973002/diff/80001/include/codec/SkScaledCodec.h File include/codec/SkScaledCodec.h (right): https://codereview.chromium.org/1372973002/diff/80001/include/codec/SkScaledCodec.h#newcode25 include/codec/SkScaledCodec.h:25: static void ComputeSampleSize(const SkISize& dstDim, const SkISize& srcDim, On ...
5 years, 2 months ago (2015-10-01 21:16:58 UTC) #4
msarett
lgtm https://codereview.chromium.org/1372973002/diff/80001/src/codec/SkBmpRLECodec.cpp File src/codec/SkBmpRLECodec.cpp (right): https://codereview.chromium.org/1372973002/diff/80001/src/codec/SkBmpRLECodec.cpp#newcode47 src/codec/SkBmpRLECodec.cpp:47: // scaling could be supported? On 2015/10/01 21:16:57, ...
5 years, 2 months ago (2015-10-01 22:53:07 UTC) #5
scroggo
The latest patch set (8) attempts to fix SkBmpRLECodec. It does not address sampling without ...
5 years, 2 months ago (2015-10-02 15:11:52 UTC) #6
scroggo
RLE is fixed (thanks, Matt!). Derek, can you take a look at the API?
5 years, 2 months ago (2015-10-02 15:30:22 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1372973002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1372973002/160001
5 years, 2 months ago (2015-10-02 15:50:54 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/3522) Build-Win-MSVC-x86_64-Debug-Trybot on ...
5 years, 2 months ago (2015-10-02 15:52:48 UTC) #12
djsollen
api lgtm
5 years, 2 months ago (2015-10-02 17:55:25 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1372973002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1372973002/200001
5 years, 2 months ago (2015-10-02 18:54:16 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1372973002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1372973002/200001
5 years, 2 months ago (2015-10-02 18:54:41 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1372973002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1372973002/220001
5 years, 2 months ago (2015-10-02 20:07:53 UTC) #23
commit-bot: I haz the power
5 years, 2 months ago (2015-10-02 20:14:53 UTC) #24
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://skia.googlesource.com/skia/+/e7fc14b55bb8c41ba054abf0bfa09cdd6ec84671

Powered by Google App Engine
This is Rietveld 408576698