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

Issue 16410009: Add an option to create unpremultiplied bitmaps. (Closed)

Created:
7 years, 6 months ago by scroggo
Modified:
7 years, 6 months ago
Reviewers:
djsollen, bsalomon, reed1
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Add an option to create unpremultiplied bitmaps. Currently they cannot be used directly by Skia, but the pixels can be used elsewhere. SkImageDecoder: Add functions to require unpremultiplied output and query the presence of the requirement SkImageDecoder_libpng: SkImageDecoder_libwebp: SkImageDecoder_WIC: Respect the requirement for unpremultiplied output. TODO: Fix SkImageDecoder_CG. SkScaledBitmapSampler: Add procs to skip premultiplication and a boolean parameter to use those procs. ImageDecodingTest: Test unpremultiplied bitmap decoding. SampleUnpremul: Add a sample which allows visually comparing between the unpremultiplied version (copied into a premultiplied bitmap, since drawing unpremultiplied is not currently supported) and a premultiplied version of image files. gm.h: Add a getter for the resource path, so Samples can use it. As of patch set 13, https://codereview.chromium.org/16816016/ and https://codereview.chromium.org/16983004/, which were approved separately. R=reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=9612

Patch Set 1 #

Patch Set 2 : Continued work in progress. #

Patch Set 3 : In progress... #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 4

Patch Set 7 : Respond to comments #

Total comments: 5

Patch Set 8 : Add a benchmark #

Patch Set 9 : ImageDecodeBench does no rendering. #

Total comments: 3

Patch Set 10 : Respond to comments. #

Patch Set 11 : rebase #

Patch Set 12 : Merge in issue 16983004 #

Patch Set 13 : Merge in issue 16816016 #

Patch Set 14 : Fix for andriod only code. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+627 lines, -52 lines) Patch
A bench/ImageDecodeBench.cpp View 1 2 3 4 5 6 7 8 1 chunk +91 lines, -0 lines 0 comments Download
M gm/gm.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M gyp/SampleApp.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M gyp/bench.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M gyp/tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkImageDecoder.h View 1 2 3 4 5 6 2 chunks +16 lines, -0 lines 0 comments Download
M samplecode/SampleColorFilter.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
A samplecode/SampleUnpremul.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +204 lines, -0 lines 0 comments Download
M src/images/SkImageDecoder.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M src/images/SkImageDecoder_libpng.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +38 lines, -9 lines 0 comments Download
M src/images/SkImageDecoder_libwebp.cpp View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +22 lines, -13 lines 0 comments Download
M src/images/SkScaledBitmapSampler.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/images/SkScaledBitmapSampler.cpp View 1 2 3 4 5 6 5 chunks +79 lines, -26 lines 0 comments Download
M src/ports/SkImageDecoder_WIC.cpp View 1 2 3 4 5 6 1 chunk +8 lines, -1 line 0 comments Download
A tests/ImageDecodingTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +157 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
scroggo
Unpremultiplied bitmaps for Android, ready for review at patch set 6.
7 years, 6 months ago (2013-06-12 17:12:01 UTC) #1
djsollen
I figure there has already been discussion on this but I have to ask. :) ...
7 years, 6 months ago (2013-06-12 17:59:21 UTC) #2
scroggo
https://codereview.chromium.org/16410009/diff/18001/include/core/SkBitmap.h File include/core/SkBitmap.h (right): https://codereview.chromium.org/16410009/diff/18001/include/core/SkBitmap.h#newcode266 include/core/SkBitmap.h:266: bool premul = true); On 2013/06/12 17:59:21, djsollen wrote: ...
7 years, 6 months ago (2013-06-12 18:24:42 UTC) #3
reed1
can we only checkin the codec-related changes for now, and just park the others changes ...
7 years, 6 months ago (2013-06-12 20:20:00 UTC) #4
scroggo
Latest patch removes the changes to SkBitmap. Now SkImageDecoder returns an unpremultiplied bitmap or fails. ...
7 years, 6 months ago (2013-06-12 22:08:28 UTC) #5
bsalomon
not really versed in the image code, so skimmed most of this. https://codereview.chromium.org/16410009/diff/26001/src/core/SkColor.cpp File src/core/SkColor.cpp ...
7 years, 6 months ago (2013-06-13 12:24:59 UTC) #6
reed1
I had asked to contract the earlier CL to just the minimum need to support ...
7 years, 6 months ago (2013-06-13 13:51:39 UTC) #7
scroggo
https://codereview.chromium.org/16410009/diff/26001/src/core/SkColor.cpp File src/core/SkColor.cpp (right): https://codereview.chromium.org/16410009/diff/26001/src/core/SkColor.cpp#newcode26 src/core/SkColor.cpp:26: SkPMColor SkPreMultiplyUnPMColor(SkPMColor c) { On 2013/06/13 13:51:39, reed1 wrote: ...
7 years, 6 months ago (2013-06-13 19:04:49 UTC) #8
scroggo
https://codereview.chromium.org/16410009/diff/36001/bench/ImageDecodeBench.cpp File bench/ImageDecodeBench.cpp (right): https://codereview.chromium.org/16410009/diff/36001/bench/ImageDecodeBench.cpp#newcode90 bench/ImageDecodeBench.cpp:90: //DEF_BENCH( return SkNEW_ARGS(ImageDecodeBench, (p, "/usr/local/google/home/scroggo/Downloads/images/hal_163x90.png")); ) I commented these ...
7 years, 6 months ago (2013-06-13 19:06:49 UTC) #9
reed1
lgtm w/ one last parting shot on the secret color function https://codereview.chromium.org/16410009/diff/36001/src/core/SkColor.cpp File src/core/SkColor.cpp (right): ...
7 years, 6 months ago (2013-06-13 19:33:07 UTC) #10
scroggo
https://codereview.chromium.org/16410009/diff/36001/src/core/SkColor.cpp File src/core/SkColor.cpp (right): https://codereview.chromium.org/16410009/diff/36001/src/core/SkColor.cpp#newcode26 src/core/SkColor.cpp:26: SkPMColor SkPreMultiplyUnPMColor(SkPMColor c) { On 2013/06/13 19:33:07, reed1 wrote: ...
7 years, 6 months ago (2013-06-13 20:10:39 UTC) #11
scroggo
7 years, 6 months ago (2013-06-14 15:33:32 UTC) #12
Message was sent while issue was closed.
Committed patchset #14 manually as r9612 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698