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

Issue 947283002: Bmp Image Decoding (Closed)

Created:
5 years, 10 months ago by msarett
Modified:
5 years, 9 months ago
Reviewers:
scroggo, djsollen
Base URL:
https://skia.googlesource.com/skia.git@decode-leon-3
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Implementation of image decoding for bmp files, in accordance with the new API. Currently decodes to opaque and unpremul. Tested on local test suite. BUG=skia:3257 Committed: https://skia.googlesource.com/skia/+/3675874468de7228944ce21922e6ec863f5f2310

Patch Set 1 #

Patch Set 2 : Tested bmp and swizzler design #

Total comments: 45

Patch Set 3 : Fixing merge issues hopefully #

Total comments: 1

Patch Set 4 : Fixes from last iteration and RLE #

Total comments: 34

Patch Set 5 : Minor fixes #

Total comments: 5

Patch Set 6 : Fixed latest comments and tested further #

Total comments: 8

Patch Set 7 : Minor dm testing changes #

Patch Set 8 : Improved clarity of swizzler with regard to weird alpha #

Total comments: 34

Patch Set 9 : Moved bmp specific code out of the swizzler #

Total comments: 33

Patch Set 10 : separate swizzler for masks #

Total comments: 22

Patch Set 11 : Rebase #

Patch Set 12 : Minor fixes #

Patch Set 13 : Creation of SkMasks #

Total comments: 13

Patch Set 14 : clarified ownership of SkMasks* #

Total comments: 28

Patch Set 15 : Various fixes from Leon's comments #

Total comments: 22

Patch Set 16 : Improved efficiency of ResultAlpha and code sharing #

Total comments: 8

Patch Set 17 : More code sharing #

Total comments: 8

Patch Set 18 : Commented out the rare case until we demonstrate that we need it #

Total comments: 4

Patch Set 19 : Keep the correction step for decodeMask, it is used #

Patch Set 20 : Premul marked as unsupported #

Total comments: 1

Patch Set 21 : Fixed include #

Patch Set 22 : Fixed relase mode failure - inline function not defined #

Patch Set 23 : Removed implicit conversions between size_t and uint32_t #

Patch Set 24 : One more casting error #

Patch Set 25 : Build bot failure on for loop syntax #

Patch Set 26 : Bmp Decoder - Undoing the reverts #

Patch Set 27 : Original change plus fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2035 lines, -109 lines) Patch
M dm/DMSrcSink.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +20 lines, -8 lines 0 comments Download
M gyp/codec.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M include/codec/SkCodec.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +9 lines, -0 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 18 19 20 21 22 23 24 25 26 1 chunk +20 lines, -10 lines 0 comments Download
A src/codec/SkCodecPriv.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +117 lines, -0 lines 0 comments Download
A src/codec/SkCodec_libbmp.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +142 lines, -0 lines 0 comments Download
A src/codec/SkCodec_libbmp.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +903 lines, -0 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 4 chunks +3 lines, -6 lines 0 comments Download
A src/codec/SkMaskSwizzler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +60 lines, -0 lines 0 comments Download
A src/codec/SkMaskSwizzler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +205 lines, -0 lines 0 comments Download
A src/codec/SkMasks.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +81 lines, -0 lines 0 comments Download
A src/codec/SkMasks.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +160 lines, -0 lines 0 comments Download
M src/codec/SkSwizzler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +123 lines, -24 lines 0 comments Download
M src/codec/SkSwizzler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +189 lines, -61 lines 0 comments Download

Messages

Total messages: 65 (15 generated)
msarett
Overall, I am pretty excited about this set of changes. Moving complexity to the swizzler ...
5 years, 10 months ago (2015-02-24 21:56:07 UTC) #1
scroggo
https://codereview.chromium.org/947283002/diff/20001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/947283002/diff/20001/include/codec/SkCodec.h#newcode72 include/codec/SkCodec.h:72: SkAutoTDelete<SkStream> fStream; On 2015/02/24 21:56:06, msarett wrote: > I ...
5 years, 10 months ago (2015-02-25 17:22:43 UTC) #3
scroggo
https://codereview.chromium.org/947283002/diff/40001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/40001/src/codec/SkCodec_libbmp.cpp#newcode367 src/codec/SkCodec_libbmp.cpp:367: // Use of image info for input format does ...
5 years, 10 months ago (2015-02-25 22:26:35 UTC) #4
msarett
I've added RLE and I think it's a lot better this time. I still the ...
5 years, 10 months ago (2015-02-26 23:58:18 UTC) #5
msarett
Minor fixes
5 years, 9 months ago (2015-02-27 16:01:00 UTC) #6
scroggo
https://codereview.chromium.org/947283002/diff/20001/src/codec/SkSwizzler.cpp File src/codec/SkSwizzler.cpp (right): https://codereview.chromium.org/947283002/diff/20001/src/codec/SkSwizzler.cpp#newcode186 src/codec/SkSwizzler.cpp:186: switch (deltaSrc) { On 2015/02/26 23:58:18, msarett wrote: > ...
5 years, 9 months ago (2015-02-27 17:04:04 UTC) #7
msarett
Testing Comments: Tried to test on file with no extension: DmSrcSink won't read it. On ...
5 years, 9 months ago (2015-02-27 21:17:29 UTC) #8
scroggo
On 2015/02/27 21:17:29, msarett wrote: > Testing Comments: > > Tried to test on file ...
5 years, 9 months ago (2015-02-28 00:25:13 UTC) #9
msarett
Minor dm testing changes https://codereview.chromium.org/947283002/diff/100001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/100001/src/codec/SkCodec_libbmp.cpp#newcode233 src/codec/SkCodec_libbmp.cpp:233: if (infoBytesRemaining >= 16) { ...
5 years, 9 months ago (2015-03-02 15:00:13 UTC) #10
msarett
Improved clarity of swizzler with regard to weird alpha. We could possibly improve performance if ...
5 years, 9 months ago (2015-03-02 17:03:07 UTC) #11
scroggo
https://codereview.chromium.org/947283002/diff/140001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/947283002/diff/140001/dm/DMSrcSink.cpp#newcode70 dm/DMSrcSink.cpp:70: if (result == SkImageGenerator::kIncompleteInput) { I think this would ...
5 years, 9 months ago (2015-03-04 17:10:31 UTC) #12
scroggo
Oh, and one meta comment: NewFromStream is 400 lines decodeRLE is around 200 lines Would ...
5 years, 9 months ago (2015-03-04 17:15:27 UTC) #13
msarett
I think this iteration is a better balance between SkBmpCodec and the Swizzler. https://codereview.chromium.org/947283002/diff/140001/dm/DMSrcSink.cpp File ...
5 years, 9 months ago (2015-03-05 23:13:17 UTC) #14
scroggo
https://codereview.chromium.org/947283002/diff/160001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/160001/src/codec/SkCodec_libbmp.cpp#newcode361 src/codec/SkCodec_libbmp.cpp:361: SkCodec* SkBmpCodec::NewFromStream(SkStream* stream) { On 2015/03/05 23:13:17, msarett wrote: ...
5 years, 9 months ago (2015-03-05 23:32:35 UTC) #15
scroggo
On 2015/03/05 23:13:17, msarett wrote: > I think this iteration is a better balance between ...
5 years, 9 months ago (2015-03-06 18:56:14 UTC) #16
msarett
I think this version is looking pretty good. No worries if you can't get to ...
5 years, 9 months ago (2015-03-07 00:19:50 UTC) #17
msarett
Adding Derek
5 years, 9 months ago (2015-03-11 13:43:12 UTC) #19
scroggo
High level comment: When you've made a change in response to one of my comments ...
5 years, 9 months ago (2015-03-11 14:23:10 UTC) #20
msarett
Thanks for the feedback! I just rebased everything and it caused a huge mess. I'm ...
5 years, 9 months ago (2015-03-11 14:27:39 UTC) #21
msarett
Here is the new, improved, and rebased version! Sorry about not responding to comments in ...
5 years, 9 months ago (2015-03-11 18:53:05 UTC) #22
scroggo
Agreed that this is the right direction. I have a few more comments, and then ...
5 years, 9 months ago (2015-03-11 19:22:45 UTC) #23
msarett
I added fixes from your latest comments. Hopefully I'm getting better at using AutoTDelete and ...
5 years, 9 months ago (2015-03-11 20:03:11 UTC) #24
scroggo
I still need to look over SkSwizzler one last time in its entirety, but the ...
5 years, 9 months ago (2015-03-11 21:14:26 UTC) #25
msarett
Biggest Changes: Added shared code to SkCodec.h Added methods to SkSwizzler.h to help callers interpret ...
5 years, 9 months ago (2015-03-12 14:06:47 UTC) #26
scroggo
https://codereview.chromium.org/947283002/diff/260001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/260001/src/codec/SkCodec_libbmp.cpp#newcode357 src/codec/SkCodec_libbmp.cpp:357: // is V2+, we are guaranteed to be able ...
5 years, 9 months ago (2015-03-12 15:19:58 UTC) #27
msarett
Improved efficiency of ResultAlpha and code sharing https://codereview.chromium.org/947283002/diff/280001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/947283002/diff/280001/include/codec/SkCodec.h#newcode57 include/codec/SkCodec.h:57: static bool ...
5 years, 9 months ago (2015-03-12 18:37:47 UTC) #28
scroggo
https://codereview.chromium.org/947283002/diff/280001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/280001/src/codec/SkCodec_libbmp.cpp#newcode912 src/codec/SkCodec_libbmp.cpp:912: // Modifying alpha is safe because colors are stored ...
5 years, 9 months ago (2015-03-12 19:58:40 UTC) #29
msarett
So here are my thoughts on bmp alpha corrections: Of my bmp test suite of ...
5 years, 9 months ago (2015-03-12 21:59:41 UTC) #30
scroggo
On 2015/03/12 21:59:41, msarett wrote: > So here are my thoughts on bmp alpha corrections: ...
5 years, 9 months ago (2015-03-13 14:06:59 UTC) #31
msarett
Commented out the rare case until we demonstrate that we need it https://codereview.chromium.org/947283002/diff/320001/src/codec/SkCodec_libbmp.h File src/codec/SkCodec_libbmp.h ...
5 years, 9 months ago (2015-03-13 14:57:07 UTC) #32
scroggo
https://codereview.chromium.org/947283002/diff/340001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/340001/src/codec/SkCodec_libbmp.cpp#newcode577 src/codec/SkCodec_libbmp.cpp:577: // FIXME: transparent &= SkSwizzler::IsTransparent(r); Are we still using ...
5 years, 9 months ago (2015-03-13 15:04:46 UTC) #33
msarett
Keep the correction step for decodeMask, it is used https://codereview.chromium.org/947283002/diff/340001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/947283002/diff/340001/src/codec/SkCodec_libbmp.cpp#newcode577 src/codec/SkCodec_libbmp.cpp:577: ...
5 years, 9 months ago (2015-03-13 15:21:16 UTC) #34
msarett
Premul marked as unsupported
5 years, 9 months ago (2015-03-13 19:48:07 UTC) #35
scroggo
lgtm nit: Can you update the description to be more informative about the changes here? ...
5 years, 9 months ago (2015-03-16 13:49:40 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/947283002/380001
5 years, 9 months ago (2015-03-16 14:03:25 UTC) #38
commit-bot: I haz the power
Presubmit check for 947283002-380001 failed and returned exit status 1. Running presubmit commit checks ...
5 years, 9 months ago (2015-03-16 14:03:34 UTC) #40
djsollen
https://codereview.chromium.org/947283002/diff/380001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/947283002/diff/380001/include/codec/SkCodec.h#newcode11 include/codec/SkCodec.h:11: #include "SkEndian.h" drop this include.
5 years, 9 months ago (2015-03-16 14:30:57 UTC) #41
djsollen
API lgtm when the include is dropped.
5 years, 9 months ago (2015-03-16 14:31:28 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/947283002/400001
5 years, 9 months ago (2015-03-16 14:36:22 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-Shared-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-Shared-Trybot/builds/2563)
5 years, 9 months ago (2015-03-16 14:37:50 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/947283002/420001
5 years, 9 months ago (2015-03-16 14:47:39 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: Build-Win-VS2013-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-VS2013-x86-Debug-Trybot/builds/2954)
5 years, 9 months ago (2015-03-16 14:58:44 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/947283002/440001
5 years, 9 months ago (2015-03-16 15:15:35 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: Build-Win-VS2013-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-VS2013-x86_64-Debug-Trybot/builds/211)
5 years, 9 months ago (2015-03-16 15:19:56 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/947283002/460001
5 years, 9 months ago (2015-03-16 15:21:25 UTC) #60
commit-bot: I haz the power
Committed patchset #24 (id:460001) as https://skia.googlesource.com/skia/+/3675874468de7228944ce21922e6ec863f5f2310
5 years, 9 months ago (2015-03-16 15:27:57 UTC) #61
egdaniel
A revert of this CL (patchset #25 id:480001) has been created in https://codereview.chromium.org/1010813003/ by egdaniel@google.com. ...
5 years, 9 months ago (2015-03-16 17:51:30 UTC) #62
Justin Novosad
On 2015/03/16 15:27:57, I haz the power (commit-bot) wrote: > Committed patchset #24 (id:460001) as ...
5 years, 9 months ago (2015-03-16 17:54:48 UTC) #63
Justin Novosad
Thanks Greg.
5 years, 9 months ago (2015-03-16 17:55:33 UTC) #64
scroggo
5 years, 9 months ago (2015-03-16 18:19:06 UTC) #65
Message was sent while issue was closed.
On 2015/03/16 17:54:48, junov wrote:
> On 2015/03/16 15:27:57, I haz the power (commit-bot) wrote:
> > Committed patchset #24 (id:460001) as
> >
https://skia.googlesource.com/skia/+/3675874468de7228944ce21922e6ec863f5f2310
> 
> Test crashes have appeared in Blink unit tests. This change may be to blame.
> DeferredImageDecoder tests are crashing on all platform. For example:
>
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7/builds/27...

I don't understand how this change could be responsible for that. All these
changes apply to SkCodec, which is not used by Chromium/Blink. (There's also a
change to DM, which I believe is also not used by the tests.)

That said, none of the other CLs in the Skia roll look like they could be
responsible either: https://chromium.googlesource.com/skia/+log/1e23738..3675874

Since these are mostly related to deferred decoding, I'd guess the problem is in
https://codereview.chromium.org/1004043002

Powered by Google App Engine
This is Rietveld 408576698