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

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed)

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

Description

Fill incomplete images in SkCodec parent class Rather than implementing some sort of "fill" in every SkCodec subclass for incomplete images, let's make the parent class handle this situation. This includes an API change to SkCodec.h SkCodec::getScanlines() now returns the number of lines it read successfully, rather than an SkCodec::Result enum. getScanlines() most often fails on an incomplete input, in which case it is useful to know how many lines were successfully decoded - this provides more information than kIncomplete vs kSuccess. We do lose information when the API is used improperly, as we are no longer able to return kInvalidParameter or kScanlineNotStarted. Known Issues: Does not work for incomplete fFrameIsSubset gifs. Does not work for incomplete icos. BUG=skia: Committed: https://skia.googlesource.com/skia/+/e6dd004c1b8a81dc37a370570877b8b7d6dbe308

Patch Set 1 : #

Total comments: 49

Patch Set 2 : Rebase #

Patch Set 3 : Response to comments #

Total comments: 24

Patch Set 4 : Response to comments on Patch Set 3 #

Patch Set 5 : Rebase on merged SkCodec and SkScanlineDecoder #

Total comments: 55

Patch Set 6 : Response to comments in Patch Set 5 #

Total comments: 19

Patch Set 7 : Response to comments in Patch Set 6 #

Total comments: 4

Patch Set 8 : Rebase #

Patch Set 9 : Make fill() a function on SkSampler, so we know the scaledWidth #

Patch Set 10 : Forgot to add SkSampler.cpp #

Total comments: 10

Patch Set 11 : Response to comments in 8 and 11 #

Total comments: 16

Patch Set 12 : Response to Patch Set 11 #

Total comments: 24

Patch Set 13 : Response to Patch Set 12 #

Patch Set 14 : Rebase on subset benchmarks change #

Patch Set 15 : Missing return value #

Patch Set 16 : Don't test incomplete gifs #

Patch Set 17 : Fix leaks #

Patch Set 18 : Fix windows warnings #

Patch Set 19 : Disable incomplete pngs #

Patch Set 20 : Use aligned memory in swizzler test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1685 lines, -701 lines) Patch
M bench/subset/SubsetSingleBench.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +6 lines, -6 lines 0 comments Download
M bench/subset/SubsetTranslateBench.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +6 lines, -6 lines 0 comments Download
M bench/subset/SubsetZoomBench.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -6 lines 0 comments Download
M dm/DMSrcSink.cpp View 1 2 3 4 5 6 7 8 6 chunks +30 lines, -82 lines 0 comments Download
M gyp/codec.gyp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M gyp/tools.gyp View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M include/codec/SkCodec.h View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +90 lines, -26 lines 0 comments Download
M include/codec/SkScaledCodec.h View 1 2 3 4 5 6 7 9 10 2 chunks +5 lines, -1 line 0 comments Download
M src/codec/SkBmpCodec.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -13 lines 0 comments Download
M src/codec/SkBmpCodec.cpp View 1 2 3 4 5 6 7 2 chunks +1 line, -17 lines 0 comments Download
M src/codec/SkBmpMaskCodec.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -4 lines 0 comments Download
M src/codec/SkBmpMaskCodec.cpp View 1 2 3 4 5 6 5 chunks +11 lines, -10 lines 0 comments Download
M src/codec/SkBmpRLECodec.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -4 lines 0 comments Download
M src/codec/SkBmpRLECodec.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 12 chunks +32 lines, -21 lines 0 comments Download
M src/codec/SkBmpStandardCodec.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -4 lines 0 comments Download
M src/codec/SkBmpStandardCodec.cpp View 1 2 3 4 5 6 7 6 chunks +17 lines, -13 lines 0 comments Download
M src/codec/SkCodec.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +93 lines, -13 lines 0 comments Download
M src/codec/SkCodecPriv.h View 1 2 3 4 5 6 7 8 9 10 11 12 12 chunks +34 lines, -31 lines 0 comments Download
M src/codec/SkCodec_libgif.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +12 lines, -8 lines 0 comments Download
M src/codec/SkCodec_libgif.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +49 lines, -72 lines 0 comments Download
M src/codec/SkCodec_libico.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
M src/codec/SkCodec_libico.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +8 lines, -4 lines 0 comments Download
M src/codec/SkCodec_libpng.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -2 lines 0 comments Download
M src/codec/SkCodec_libpng.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 chunks +53 lines, -22 lines 0 comments Download
M src/codec/SkCodec_wbmp.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -6 lines 0 comments Download
M src/codec/SkCodec_wbmp.cpp View 1 2 3 4 5 6 7 9 10 5 chunks +11 lines, -15 lines 0 comments Download
M src/codec/SkJpegCodec.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -4 lines 0 comments Download
M src/codec/SkJpegCodec.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +14 lines, -27 lines 0 comments Download
M src/codec/SkMaskSwizzler.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -0 lines 0 comments Download
M src/codec/SkSampler.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +35 lines, -0 lines 0 comments Download
A src/codec/SkSampler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +102 lines, -0 lines 0 comments Download
M src/codec/SkScaledCodec.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +65 lines, -25 lines 0 comments Download
M src/codec/SkSwizzler.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +10 lines, -38 lines 0 comments Download
M src/codec/SkSwizzler.cpp View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -79 lines 0 comments Download
M src/codec/SkWebpCodec.h View 1 2 3 4 5 6 7 9 10 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkWebpCodec.cpp View 1 2 3 4 5 6 7 9 10 2 chunks +4 lines, -5 lines 0 comments Download
M tests/CodexTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 15 chunks +94 lines, -57 lines 0 comments Download
M tests/SwizzlerTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 6 chunks +29 lines, -37 lines 0 comments Download
M tools/SkBitmapRegionCanvas.cpp View 1 2 3 4 1 chunk +2 lines, -11 lines 0 comments Download
M tools/SkBitmapRegionDecoderInterface.cpp View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M tools/dm_flags.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +783 lines, -23 lines 0 comments Download
M tools/dm_flags.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +21 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 67 (25 generated)
msarett
This CL is very much a work in progress. I normally wouldn't upload this early, ...
5 years, 3 months ago (2015-09-11 15:34:53 UTC) #5
msarett
Just want to make sure that, at this stage, you don't spend time reviewing this. ...
5 years, 3 months ago (2015-09-16 14:25:13 UTC) #6
msarett
This is ready for a review. No rush on this, I know you've been swamped ...
5 years, 3 months ago (2015-09-16 22:24:44 UTC) #9
scroggo
https://codereview.chromium.org/1332053002/diff/100001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/1332053002/diff/100001/dm/DMSrcSink.cpp#newcode355 dm/DMSrcSink.cpp:355: uint32_t lines = 0; Maybe this should be linesDecoded? ...
5 years, 3 months ago (2015-09-22 18:02:48 UTC) #10
msarett
https://codereview.chromium.org/1332053002/diff/100001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/1332053002/diff/100001/dm/DMSrcSink.cpp#newcode355 dm/DMSrcSink.cpp:355: uint32_t lines = 0; On 2015/09/22 18:02:48, scroggo wrote: ...
5 years, 3 months ago (2015-09-23 13:22:40 UTC) #11
scroggo
Overall, I this is moving in the right direction, though not quite ready to submit. ...
5 years, 2 months ago (2015-09-25 15:55:06 UTC) #12
msarett
IMO, this is much cleaner after the rebase! https://codereview.chromium.org/1332053002/diff/100001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/1332053002/diff/100001/dm/DMSrcSink.cpp#newcode456 dm/DMSrcSink.cpp:456: return ...
5 years, 2 months ago (2015-10-01 12:44:52 UTC) #14
scroggo
> This CL also makes an API change to SkScanlineDecoder.h > > SkScanlineDecoder::getScanlines() now returns ...
5 years, 2 months ago (2015-10-01 14:48:32 UTC) #15
msarett
https://codereview.chromium.org/1332053002/diff/100001/include/codec/SkScanlineDecoder.h File include/codec/SkScanlineDecoder.h (right): https://codereview.chromium.org/1332053002/diff/100001/include/codec/SkScanlineDecoder.h#newcode126 include/codec/SkScanlineDecoder.h:126: * @return the number of lines successfully skipped On ...
5 years, 2 months ago (2015-10-01 18:14:14 UTC) #16
scroggo
https://codereview.chromium.org/1332053002/diff/200001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/1332053002/diff/200001/dm/DMSrcSink.cpp#newcode358 dm/DMSrcSink.cpp:358: codec->getScanlines(dstPtr, 1, bitmap.rowBytes()); On 2015/10/01 18:14:13, msarett wrote: > ...
5 years, 2 months ago (2015-10-01 20:48:58 UTC) #17
msarett
I think this is getting closer. The major remaining question is on the getScanlines() API. ...
5 years, 2 months ago (2015-10-01 22:34:52 UTC) #18
scroggo
On 2015/10/01 22:34:52, msarett wrote: > I think this is getting closer. The major remaining ...
5 years, 2 months ago (2015-10-02 19:00:54 UTC) #19
msarett
Derek, could you take a look at the API? "Do you mean how you ignore ...
5 years, 2 months ago (2015-10-02 20:52:42 UTC) #20
scroggo
On 2015/10/02 20:52:42, msarett wrote: > Derek, could you take a look at the API? ...
5 years, 2 months ago (2015-10-02 20:57:09 UTC) #22
scroggo
Also, lgtm
5 years, 2 months ago (2015-10-02 20:57:34 UTC) #23
djsollen
https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h#newcode283 include/codec/SkCodec.h:283: int getScanlines(void* dst, int countLines, size_t rowBytes); what do ...
5 years, 2 months ago (2015-10-05 12:15:39 UTC) #24
scroggo
https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h#newcode283 include/codec/SkCodec.h:283: int getScanlines(void* dst, int countLines, size_t rowBytes); On 2015/10/05 ...
5 years, 2 months ago (2015-10-05 13:12:24 UTC) #25
msarett
This change originated as something we "needed" to do: When SkCodec and SkScanlineDecoder were separate, ...
5 years, 2 months ago (2015-10-05 13:41:09 UTC) #26
msarett
Mike, can you take a look at the API?
5 years, 2 months ago (2015-10-06 18:34:25 UTC) #28
reed1
https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h#newcode283 include/codec/SkCodec.h:283: int getScanlines(void* dst, int countLines, size_t rowBytes); What is ...
5 years, 2 months ago (2015-10-06 18:40:02 UTC) #29
msarett
https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/240001/include/codec/SkCodec.h#newcode283 include/codec/SkCodec.h:283: int getScanlines(void* dst, int countLines, size_t rowBytes); On 2015/10/06 ...
5 years, 2 months ago (2015-10-06 18:47:41 UTC) #30
msarett
I plan to take another look at this, but I thought I'd go ahead and ...
5 years, 2 months ago (2015-10-06 21:45:40 UTC) #32
msarett
This is ready for review! Mike, can you take a look at the API? Leon, ...
5 years, 2 months ago (2015-10-07 14:10:13 UTC) #34
scroggo
High level thoughts: A goal of crrev.com/1372973002 was to make it so that each SkCodec ...
5 years, 2 months ago (2015-10-07 16:04:25 UTC) #35
msarett
So I accidentally deleted Patch Set 11...ugh sorry. I've made the fixes and will respond ...
5 years, 2 months ago (2015-10-07 17:40:31 UTC) #39
msarett
https://codereview.chromium.org/1332053002/diff/320001/src/codec/SkCodec_libgif.cpp File src/codec/SkCodec_libgif.cpp (right): https://codereview.chromium.org/1332053002/diff/320001/src/codec/SkCodec_libgif.cpp#newcode468 src/codec/SkCodec_libgif.cpp:468: fSwizzler->fill(dst, dstInfo.colorType(), dstInfo.height(), dstRowBytes, On 2015/10/07 16:04:24, scroggo wrote: ...
5 years, 2 months ago (2015-10-07 17:40:41 UTC) #40
scroggo
https://codereview.chromium.org/1332053002/diff/420001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/420001/include/codec/SkCodec.h#newcode461 include/codec/SkCodec.h:461: * type specified in dstInfo. nit: dstInfo is no ...
5 years, 2 months ago (2015-10-07 18:46:39 UTC) #41
msarett
https://codereview.chromium.org/1332053002/diff/420001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/420001/include/codec/SkCodec.h#newcode461 include/codec/SkCodec.h:461: * type specified in dstInfo. On 2015/10/07 18:46:39, scroggo ...
5 years, 2 months ago (2015-10-07 20:53:23 UTC) #42
scroggo
I want to take another look at this tomorrow, but it looks like the right ...
5 years, 2 months ago (2015-10-07 21:56:06 UTC) #43
msarett
https://codereview.chromium.org/1332053002/diff/440001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/440001/include/codec/SkCodec.h#newcode556 include/codec/SkCodec.h:556: * @param dstInfo Contains the destination color type On ...
5 years, 2 months ago (2015-10-07 22:04:22 UTC) #44
scroggo
https://codereview.chromium.org/1332053002/diff/440001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1332053002/diff/440001/include/codec/SkCodec.h#newcode556 include/codec/SkCodec.h:556: * @param dstInfo Contains the destination color type On ...
5 years, 2 months ago (2015-10-08 13:50:30 UTC) #45
msarett
Mike, can I get an API review? Leon, I have responded to your latest comments. ...
5 years, 2 months ago (2015-10-08 15:33:26 UTC) #46
scroggo
On 2015/10/08 15:33:26, msarett wrote: > Mike, can I get an API review? > > ...
5 years, 2 months ago (2015-10-08 16:42:57 UTC) #47
reed1
api lgtm Still not comfortable w/ not controlling what the "fill-in" color is for non-index-8, ...
5 years, 2 months ago (2015-10-08 20:26:20 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332053002/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332053002/460001
5 years, 2 months ago (2015-10-08 20:27:24 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/builds/3533) Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot on client.skia.compile (JOB_FAILED, ...
5 years, 2 months ago (2015-10-08 20:28:26 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332053002/550001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332053002/550001
5 years, 2 months ago (2015-10-09 12:43:24 UTC) #56
commit-bot: I haz the power
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/3606) Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, ...
5 years, 2 months ago (2015-10-09 12:45:55 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332053002/570001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332053002/570001
5 years, 2 months ago (2015-10-09 13:06:22 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Shared-Trybot/builds/3548)
5 years, 2 months ago (2015-10-09 13:09:07 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332053002/610001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332053002/610001
5 years, 2 months ago (2015-10-09 17:57:04 UTC) #66
commit-bot: I haz the power
5 years, 2 months ago (2015-10-09 18:07:40 UTC) #67
Message was sent while issue was closed.
Committed patchset #20 (id:610001) as
https://skia.googlesource.com/skia/+/e6dd004c1b8a81dc37a370570877b8b7d6dbe308

Powered by Google App Engine
This is Rietveld 408576698