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

Issue 1013743003: Adding premul and 565 swizzles for bmp: (Closed)

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

Description

Adding swizzles for bmp: We now support kN32 and kRGB_565 color types. Additionally, we support premul, unpremul, and opaque alpha types. Unpremul is currently untested as we cannot currently draw to unpremul. BUG=skia: Committed: https://skia.googlesource.com/skia/+/eed039b5ffbdff958053ac80b09451ad6caa1787

Patch Set 1 #

Patch Set 2 : Rebasing on master #

Patch Set 3 : Rebasing to master again #

Patch Set 4 : Clean up before public code review #

Total comments: 33

Patch Set 5 : Moved color table checks to onGetPixels, Disabled swizzles non-opaque swizzles to 565 #

Total comments: 13

Patch Set 6 : Removed bytesRead param, build color table on stack #

Total comments: 6

Patch Set 7 : Added profile type check #

Total comments: 16

Patch Set 8 : Made MaskSwizzler::next consistent with Swizzler #

Total comments: 1

Patch Set 9 : Trybot fixes #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+577 lines, -225 lines) Patch
M src/codec/SkCodecPriv.h View 1 2 3 4 5 1 chunk +0 lines, -9 lines 0 comments Download
M src/codec/SkCodec_libbmp.h View 1 2 3 4 5 6 7 5 chunks +32 lines, -10 lines 0 comments Download
M src/codec/SkCodec_libbmp.cpp View 1 2 3 4 5 6 7 8 18 chunks +240 lines, -135 lines 1 comment Download
M src/codec/SkCodec_libpng.cpp View 1 2 3 4 5 1 chunk +6 lines, -6 lines 0 comments Download
M src/codec/SkMaskSwizzler.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -5 lines 0 comments Download
M src/codec/SkMaskSwizzler.cpp View 1 2 3 4 5 6 7 8 chunks +206 lines, -58 lines 0 comments Download
M src/codec/SkSwizzler.cpp View 1 2 3 4 8 chunks +84 lines, -2 lines 0 comments Download

Messages

Total messages: 28 (6 generated)
msarett
Adding swizzles for bmp: We now support kN32 and kRGB_565 color types. Additionally, we support ...
5 years, 9 months ago (2015-03-16 20:21:55 UTC) #1
msarett
Adding swizzles for bmp: We now support kN32 and kRGB_565 color types. Additionally, we support ...
5 years, 9 months ago (2015-03-16 20:22:28 UTC) #3
scroggo
https://codereview.chromium.org/1013743003/diff/60001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/60001/src/codec/SkCodec_libbmp.cpp#newcode397 src/codec/SkCodec_libbmp.cpp:397: const uint32_t maxColors = 1 << bitsPerPixel; Could you ...
5 years, 9 months ago (2015-03-17 13:27:23 UTC) #4
msarett
Once again, thanks for your review. I moved all of the color table code to ...
5 years, 9 months ago (2015-03-17 16:54:06 UTC) #5
scroggo
https://codereview.chromium.org/1013743003/diff/60001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/60001/src/codec/SkCodec_libbmp.cpp#newcode397 src/codec/SkCodec_libbmp.cpp:397: const uint32_t maxColors = 1 << bitsPerPixel; On 2015/03/17 ...
5 years, 9 months ago (2015-03-17 20:02:58 UTC) #6
msarett
Removed bytesRead parameter Created color table on stack before copying into SkColorTable https://codereview.chromium.org/1013743003/diff/60001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp ...
5 years, 9 months ago (2015-03-18 13:02:52 UTC) #7
scroggo
https://codereview.chromium.org/1013743003/diff/80001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/80001/src/codec/SkCodec_libbmp.cpp#newcode670 src/codec/SkCodec_libbmp.cpp:670: dstRow[x] = fColorTable.get()[0][index]; On 2015/03/18 13:02:52, msarett wrote: > ...
5 years, 9 months ago (2015-03-18 13:33:20 UTC) #8
msarett
Minor fixes https://codereview.chromium.org/1013743003/diff/100001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/100001/src/codec/SkCodec_libbmp.cpp#newcode498 src/codec/SkCodec_libbmp.cpp:498: SkPMColor colorTable[maxColors]; On 2015/03/18 13:33:20, scroggo wrote: ...
5 years, 9 months ago (2015-03-18 14:09:12 UTC) #9
msarett
https://codereview.chromium.org/1013743003/diff/100001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/100001/src/codec/SkCodec_libbmp.cpp#newcode498 src/codec/SkCodec_libbmp.cpp:498: SkPMColor colorTable[maxColors]; On 2015/03/18 14:09:12, msarett wrote: > On ...
5 years, 9 months ago (2015-03-18 14:14:24 UTC) #10
scroggo
https://codereview.chromium.org/1013743003/diff/100001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/100001/src/codec/SkCodec_libbmp.cpp#newcode498 src/codec/SkCodec_libbmp.cpp:498: SkPMColor colorTable[maxColors]; On 2015/03/18 14:09:12, msarett wrote: > On ...
5 years, 9 months ago (2015-03-18 14:59:32 UTC) #11
msarett
Made MaskSwizzler::next consistent with Swizzler https://codereview.chromium.org/1013743003/diff/120001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/120001/src/codec/SkCodec_libbmp.cpp#newcode416 src/codec/SkCodec_libbmp.cpp:416: // set color type ...
5 years, 9 months ago (2015-03-18 15:57:01 UTC) #12
scroggo
https://codereview.chromium.org/1013743003/diff/120001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/120001/src/codec/SkCodec_libbmp.cpp#newcode619 src/codec/SkCodec_libbmp.cpp:619: SkSwizzler::ResultAlpha r = maskSwizzler->next(dstRow, srcRow); On 2015/03/18 14:59:32, scroggo ...
5 years, 9 months ago (2015-03-18 16:02:06 UTC) #13
msarett
(src, y) are the current parameters to next. Happy to put off the possibility of ...
5 years, 9 months ago (2015-03-18 16:08:17 UTC) #14
scroggo
lgtm
5 years, 9 months ago (2015-03-18 16:51:21 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1013743003/140001
5 years, 9 months ago (2015-03-18 17:47:33 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu13.10-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-Clang-x86_64-Debug-Trybot/builds/2586)
5 years, 9 months ago (2015-03-18 17:49:03 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1013743003/160001
5 years, 9 months ago (2015-03-18 17:57:23 UTC) #22
scroggo
https://codereview.chromium.org/1013743003/diff/140001/src/codec/SkCodec_libbmp.cpp File src/codec/SkCodec_libbmp.cpp (right): https://codereview.chromium.org/1013743003/diff/140001/src/codec/SkCodec_libbmp.cpp#newcode501 src/codec/SkCodec_libbmp.cpp:501: SkPMColor colorTable[maxColors]; I thought this wasn't allowed, but it ...
5 years, 9 months ago (2015-03-18 18:05:15 UTC) #23
commit-bot: I haz the power
Committed patchset #9 (id:160001) as https://skia.googlesource.com/skia/+/eed039b5ffbdff958053ac80b09451ad6caa1787
5 years, 9 months ago (2015-03-18 18:11:23 UTC) #24
msarett
Yeah I was pleasantly surprised when that compiled for me, but I guess it wasn't ...
5 years, 9 months ago (2015-03-18 18:21:27 UTC) #25
scroggo
On 2015/03/18 18:21:27, msarett wrote: > Yeah I was pleasantly surprised when that compiled for ...
5 years, 9 months ago (2015-03-18 18:42:21 UTC) #26
scroggo
5 years, 9 months ago (2015-03-18 19:27:19 UTC) #28
Message was sent while issue was closed.
One last after the fact comment:

Mike pointed out that we should not do any conversion down to 565, since we'll
lose color information. Rather than perform dithering for the client, we can let
them do it after the fact if they want to.

If an image is encoded as 565 (or perhaps as 555, as in the BMP case), we can
decode to 565.

Powered by Google App Engine
This is Rietveld 408576698