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

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed)

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

Description

store SkAlphaType inside SkBitmap, on road to support unpremul BUG= R=bsalomon@google.com, scroggo@google.com Committed: https://code.google.com/p/skia/source/detail?r=11877

Patch Set 1 #

Total comments: 2

Patch Set 2 : remove occurances of setIsOpaque #

Total comments: 8

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Total comments: 25

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Total comments: 12

Patch Set 14 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -224 lines) Patch
M bench/BitmapBench.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M bench/BitmapRectBench.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M bench/BitmapScaleBench.cpp View 1 1 chunk +4 lines, -4 lines 0 comments Download
M bench/RepeatTileBench.cpp View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M bench/TileBench.cpp View 1 1 chunk +2 lines, -3 lines 0 comments Download
M gm/bleed.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M gm/xfermodes.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M gm/xfermodes2.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M gm/xfermodes3.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M include/core/SkBitmap.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +28 lines, -13 lines 0 comments Download
M samplecode/SampleDitherBitmap.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M samplecode/SampleTinyBitmap.cpp View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M samplecode/SampleXfermodesBlur.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M src/core/SkBitmap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +64 lines, -61 lines 1 comment Download
M src/core/SkBitmapDevice.cpp View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/core/SkBitmapScaler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -3 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -5 lines 0 comments Download
M src/image/SkImagePriv.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -2 lines 0 comments Download
M src/image/SkImagePriv.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -32 lines 0 comments Download
M src/image/SkImage_Raster.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -10 lines 0 comments Download
M src/image/SkSurface_Gpu.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +4 lines, -5 lines 3 comments Download
M src/image/SkSurface_Raster.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -13 lines 0 comments Download
M src/images/SkImageDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -2 lines 0 comments Download
M src/images/SkImageDecoder_libbmp.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/images/SkImageDecoder_libjpeg.cpp View 1 2 3 4 chunks +10 lines, -10 lines 0 comments Download
M src/images/SkImageDecoder_libpng.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +19 lines, -2 lines 0 comments Download
M src/images/SkImageDecoder_libwebp.cpp View 1 2 3 1 chunk +2 lines, -5 lines 0 comments Download
M src/images/SkImageDecoder_wbmp.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/images/SkImageRef.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/lazy/SkBitmapFactory.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -5 lines 0 comments Download
M src/lazy/SkLazyPixelRef.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -5 lines 0 comments Download
M src/ports/SkImageDecoder_CG.cpp View 1 2 chunks +5 lines, -2 lines 0 comments Download
M src/ports/SkImageDecoder_WIC.cpp View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M src/views/SkWindow.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M tests/ARGBImageEncoderTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/BitmapCopyTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +4 lines, -8 lines 0 comments Download
M tests/BitmapHasherTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/DeferredCanvasTest.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M tests/ShaderOpacityTest.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
reed1
7 years, 2 months ago (2013-09-30 18:52:53 UTC) #1
scroggo
https://codereview.chromium.org/25275004/diff/1/include/core/SkBitmap.h File include/core/SkBitmap.h (right): https://codereview.chromium.org/25275004/diff/1/include/core/SkBitmap.h#newcode685 include/core/SkBitmap.h:685: uint8_t fAlphaType; This should be serialized, and we should ...
7 years, 2 months ago (2013-09-30 19:01:27 UTC) #2
bsalomon
lgtm other than cerealizing.
7 years, 2 months ago (2013-09-30 19:15:08 UTC) #3
reed1
Chrome still has occurances of setIsOpaque... I think most are harmless, but not quite sure ...
7 years, 2 months ago (2013-09-30 20:49:52 UTC) #4
scroggo
> Chrome still has occurances of setIsOpaque... I think most are harmless, but not > ...
7 years, 2 months ago (2013-09-30 22:20:04 UTC) #5
scroggo
https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp File src/images/SkImageDecoder_libpng.cpp (right): https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp#newcode440 src/images/SkImageDecoder_libpng.cpp:440: decodedBitmap->setAlphaType(reallyHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType); In addition to checking ...
7 years, 2 months ago (2013-10-02 18:49:58 UTC) #6
reed1
https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp File src/images/SkImageDecoder_libpng.cpp (right): https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp#newcode440 src/images/SkImageDecoder_libpng.cpp:440: decodedBitmap->setAlphaType(reallyHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType); On 2013/10/02 18:49:58, scroggo ...
7 years, 2 months ago (2013-10-03 08:22:53 UTC) #7
scroggo
https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp File src/images/SkImageDecoder_libpng.cpp (right): https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp#newcode440 src/images/SkImageDecoder_libpng.cpp:440: decodedBitmap->setAlphaType(reallyHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType); On 2013/10/03 08:22:54, reed1 ...
7 years, 2 months ago (2013-10-03 14:05:19 UTC) #8
reed1
https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp File src/images/SkImageDecoder_libpng.cpp (right): https://codereview.chromium.org/25275004/diff/40001/src/images/SkImageDecoder_libpng.cpp#newcode440 src/images/SkImageDecoder_libpng.cpp:440: decodedBitmap->setAlphaType(reallyHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType); On 2013/10/03 14:05:19, scroggo ...
7 years, 2 months ago (2013-10-18 15:27:05 UTC) #9
scroggo
https://codereview.chromium.org/25275004/diff/170001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.chromium.org/25275004/diff/170001/src/core/SkBitmap.cpp#newcode283 src/core/SkBitmap.cpp:283: switch (config) { Should this call setAlphaType so we ...
7 years, 2 months ago (2013-10-18 19:32:40 UTC) #10
scroggo
https://codereview.chromium.org/25275004/diff/170001/src/gpu/SkGpuDevice.cpp File src/gpu/SkGpuDevice.cpp (right): https://codereview.chromium.org/25275004/diff/170001/src/gpu/SkGpuDevice.cpp#newcode142 src/gpu/SkGpuDevice.cpp:142: SkBitmap::Config config = grConfig2skConfig(renderTarget->config(), &isOpaque); On 2013/10/18 19:32:40, scroggo ...
7 years, 2 months ago (2013-10-18 20:04:33 UTC) #11
reed1
https://codereview.chromium.org/25275004/diff/170001/src/gpu/SkGpuDevice.cpp File src/gpu/SkGpuDevice.cpp (right): https://codereview.chromium.org/25275004/diff/170001/src/gpu/SkGpuDevice.cpp#newcode142 src/gpu/SkGpuDevice.cpp:142: SkBitmap::Config config = grConfig2skConfig(renderTarget->config(), &isOpaque); On 2013/10/18 20:04:34, scroggo ...
7 years, 2 months ago (2013-10-18 21:37:34 UTC) #12
scroggo
lgtm https://codereview.chromium.org/25275004/diff/420001/src/image/SkSurface_Gpu.cpp File src/image/SkSurface_Gpu.cpp (right): https://codereview.chromium.org/25275004/diff/420001/src/image/SkSurface_Gpu.cpp#newcode46 src/image/SkSurface_Gpu.cpp:46: fDevice->clear(0x0); Not needed for this CL, obviously, but ...
7 years, 2 months ago (2013-10-18 21:52:40 UTC) #13
reed1
https://codereview.chromium.org/25275004/diff/420001/src/image/SkSurface_Gpu.cpp File src/image/SkSurface_Gpu.cpp (right): https://codereview.chromium.org/25275004/diff/420001/src/image/SkSurface_Gpu.cpp#newcode46 src/image/SkSurface_Gpu.cpp:46: fDevice->clear(0x0); On 2013/10/18 21:52:41, scroggo wrote: > Not needed ...
7 years, 2 months ago (2013-10-21 12:24:24 UTC) #14
bsalomon
https://codereview.chromium.org/25275004/diff/420001/src/image/SkSurface_Gpu.cpp File src/image/SkSurface_Gpu.cpp (right): https://codereview.chromium.org/25275004/diff/420001/src/image/SkSurface_Gpu.cpp#newcode46 src/image/SkSurface_Gpu.cpp:46: fDevice->clear(0x0); On 2013/10/21 12:24:25, reed1 wrote: > On 2013/10/18 ...
7 years, 2 months ago (2013-10-21 13:18:03 UTC) #15
reed1
Committed patchset #14 manually as r11877 (presubmit successful).
7 years, 2 months ago (2013-10-21 14:00:22 UTC) #16
scroggo
6 years, 6 months ago (2014-06-10 20:12:00 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/25275004/diff/420001/src/core/SkBitmap.cpp
File src/core/SkBitmap.cpp (right):

https://codereview.chromium.org/25275004/diff/420001/src/core/SkBitmap.cpp#ne...
src/core/SkBitmap.cpp:279: alphaType = kPremul_SkAlphaType;
Looking back at this as I write tests for Android. (I know the code has changed
since then, but it's essentially the same with s/Config/ColorType and -A1.)

Why is A8 forced to premul, but only if we asked for unpremul? It appears that
A8 can be any of:

premul
opaque
ignore

A8 is sort of a strange one to have an alphatype, since it is ONLY alpha, but it
seems like it would make sense for it to have one of them all the time.

Powered by Google App Engine
This is Rietveld 408576698