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

Issue 1641273003: Support decoding opaque to *premul (Closed)

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

Description

Support decoding opaque to *premul If a client requests unpremul or premul from an opaque SkCodec, support it. The opaque image can be treated as any of them, though it will be less efficient to draw than if the client had used opaque. Change the filling code (i.e. for incomplete images) to base its color on the source alpha type. Prior to adding the support to decode opaque to any, it was fine to use either source or dest (which would have yielded the same result). If the client requests non-opaque, we do not want this to switch the fill value from black to transparent. This also allows simplifying the signatures for getFillValue and onGetFillValue. In CodexTest, expect the same result when decoding opaque to *premul, and compare to the opaque version. BUG=skia:4616 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1641273003 Committed: https://skia.googlesource.com/skia/+/c5560bef14149f4c945a4536988aeba1a16adedc

Patch Set 1 #

Patch Set 2 : Remove unnecessary change. #

Patch Set 3 : Make the fill value consistent #

Patch Set 4 : No need for alphaType parameter #

Total comments: 7

Patch Set 5 : Fix bug in BMP #

Patch Set 6 : Test opaque to premul in dm #

Total comments: 4

Patch Set 7 : Add warning, and suffix for unpremul #

Patch Set 8 : Rewrite warning; add warning to SkJpegCodec #

Patch Set 9 : Rebase, just in case #

Patch Set 10 : Update SkMaskSwizzler to support opaque to premul #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -89 lines) Patch
M dm/DM.cpp View 1 2 3 4 5 6 7 8 6 chunks +48 lines, -11 lines 0 comments Download
M dm/DMSrcSink.h View 1 2 3 4 5 4 chunks +4 lines, -2 lines 0 comments Download
M dm/DMSrcSink.cpp View 1 2 3 4 5 5 chunks +14 lines, -17 lines 0 comments Download
M include/codec/SkCodec.h View 1 2 3 2 chunks +5 lines, -6 lines 0 comments Download
M src/codec/SkBmpStandardCodec.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkBmpStandardCodec.cpp View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M src/codec/SkCodec.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkCodecPriv.h View 1 2 3 4 5 6 7 4 chunks +16 lines, -10 lines 0 comments Download
M src/codec/SkGifCodec.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkGifCodec.cpp View 1 2 3 3 chunks +3 lines, -5 lines 0 comments Download
M src/codec/SkJpegCodec.cpp View 1 2 3 4 5 6 7 1 chunk +6 lines, -2 lines 0 comments Download
M src/codec/SkMaskSwizzler.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -21 lines 2 comments Download
M src/codec/SkPngCodec.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkPngCodec.cpp View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M src/codec/SkSampledCodec.cpp View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M tests/CodexTest.cpp View 1 2 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 28 (14 generated)
scroggo
Something that came up in tests is that if we decode an opaque image to ...
4 years, 10 months ago (2016-01-29 14:15:17 UTC) #5
msarett
On 2016/01/29 14:15:17, scroggo wrote: > Something that came up in tests is that if ...
4 years, 10 months ago (2016-01-29 14:23:05 UTC) #6
msarett
I still have the same concerns I mentioned in skbug.com/4616, but if the rest of ...
4 years, 10 months ago (2016-01-29 14:50:38 UTC) #7
scroggo
https://codereview.chromium.org/1641273003/diff/60001/src/codec/SkBmpStandardCodec.cpp File src/codec/SkBmpStandardCodec.cpp (right): https://codereview.chromium.org/1641273003/diff/60001/src/codec/SkBmpStandardCodec.cpp#newcode185 src/codec/SkBmpStandardCodec.cpp:185: if (kOpaque_SkAlphaType == dstInfo.alphaType()) { On 2016/01/29 14:50:38, msarett ...
4 years, 10 months ago (2016-01-29 17:19:54 UTC) #8
msarett
LGTM https://codereview.chromium.org/1641273003/diff/60001/src/codec/SkCodecPriv.h File src/codec/SkCodecPriv.h (right): https://codereview.chromium.org/1641273003/diff/60001/src/codec/SkCodecPriv.h#newcode84 src/codec/SkCodecPriv.h:84: // If the source is opaque, we can ...
4 years, 10 months ago (2016-01-29 19:17:05 UTC) #9
scroggo
Mike, can you review the API change (this is a protected method, so the public ...
4 years, 10 months ago (2016-01-29 19:31:22 UTC) #10
reed1
lgtm
4 years, 10 months ago (2016-01-29 19:49:12 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1641273003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1641273003/120001
4 years, 10 months ago (2016-01-29 19:51:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1641273003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1641273003/160001
4 years, 10 months ago (2016-01-29 19:57:17 UTC) #19
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/5671)
4 years, 10 months ago (2016-01-29 20:03:06 UTC) #21
scroggo
https://codereview.chromium.org/1641273003/diff/60001/src/codec/SkBmpStandardCodec.cpp File src/codec/SkBmpStandardCodec.cpp (right): https://codereview.chromium.org/1641273003/diff/60001/src/codec/SkBmpStandardCodec.cpp#newcode185 src/codec/SkBmpStandardCodec.cpp:185: if (kOpaque_SkAlphaType == dstInfo.alphaType()) { On 2016/01/29 14:50:38, msarett ...
4 years, 10 months ago (2016-02-03 14:58:45 UTC) #22
msarett
lgtm https://codereview.chromium.org/1641273003/diff/200001/src/codec/SkMaskSwizzler.cpp File src/codec/SkMaskSwizzler.cpp (right): https://codereview.chromium.org/1641273003/diff/200001/src/codec/SkMaskSwizzler.cpp#newcode253 src/codec/SkMaskSwizzler.cpp:253: proc = &swizzle_mask16_to_565; On 2016/02/03 14:58:45, scroggo wrote: ...
4 years, 10 months ago (2016-02-03 15:03:07 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1641273003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1641273003/200001
4 years, 10 months ago (2016-02-03 16:21:42 UTC) #26
commit-bot: I haz the power
4 years, 10 months ago (2016-02-03 17:42:47 UTC) #28
Message was sent while issue was closed.
Committed patchset #10 (id:200001) as
https://skia.googlesource.com/skia/+/c5560bef14149f4c945a4536988aeba1a16adedc

Powered by Google App Engine
This is Rietveld 408576698