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

Issue 16125008: Implement SkXfermode image filter (Closed)

Created:
7 years, 6 months ago by Stephen White
Modified:
7 years, 6 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Implement SkXfermode image filter. This required changing the signature of SkXfermode::asNewEffectOrCoeffs(), to add an optional background texture. For the raster path, we do a straightforward 2-pass method: draw background, then composite the foreground over it. For the GPU path, if the xfermode can be expressed as an effect, we build an effect with the background texture incorporated, then do a single-pass draw fetching both foreground and background textures, and compositing to the result. If the xfermode is expressed as src/dst coefficients, we do a 2-pass draw as in the raster path and use fixed-function blending. R=bsalomon@google.com, reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=9373

Patch Set 1 #

Patch Set 2 : Fix background texture access; add more test modes; fix raster fg/bg flip; implement regular blend … #

Patch Set 3 : Fix .h filename in .gyp; remove commented-out code #

Total comments: 6

Patch Set 4 : Fix formatting, add comments. #

Total comments: 4

Patch Set 5 : add a test for NULL xfermode; improve comments #

Patch Set 6 : compare mode in onIsEqual; improve comments; embiggen GM result #

Patch Set 7 : Fix GPU side of SkArithmeticMode to handle background input. #

Total comments: 2

Patch Set 8 : Add new case to xfermodeimagefilter GM; revert changes to arithmode GM #

Unified diffs Side-by-side diffs Delta from patch set Stats (+446 lines, -56 lines) Patch
A gm/xfermodeimagefilter.cpp View 1 2 3 4 5 6 7 1 chunk +163 lines, -0 lines 0 comments Download
M gyp/effects.gypi View 1 2 4 chunks +5 lines, -3 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkXfermode.h View 1 2 3 4 3 chunks +9 lines, -3 lines 0 comments Download
A + include/effects/SkXfermodeImageFilter.h View 1 2 3 2 chunks +18 lines, -19 lines 0 comments Download
M src/core/SkXfermode.cpp View 1 2 3 4 5 11 chunks +68 lines, -16 lines 0 comments Download
M src/effects/SkArithmeticMode.cpp View 1 2 3 4 5 6 12 chunks +61 lines, -15 lines 0 comments Download
A src/effects/SkXfermodeImageFilter.cpp View 1 2 3 1 chunk +119 lines, -0 lines 0 comments Download
M src/ports/SkGlobalInitialization_default.cpp View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Stephen White
PTAL. There's a bit of cargo-culting around the GrTextureAccess and GrGLEffectMatrix that I'm not sure ...
7 years, 6 months ago (2013-05-30 16:46:02 UTC) #1
reed1
https://codereview.chromium.org/16125008/diff/5001/include/effects/SkXfermodeImageFilter.h File include/effects/SkXfermodeImageFilter.h (right): https://codereview.chromium.org/16125008/diff/5001/include/effects/SkXfermodeImageFilter.h#newcode16 include/effects/SkXfermodeImageFilter.h:16: class SK_API SkXfermodeImageFilter : public SkImageFilter { /** * ...
7 years, 6 months ago (2013-05-30 16:56:32 UTC) #2
Stephen White
https://codereview.chromium.org/16125008/diff/5001/include/effects/SkXfermodeImageFilter.h File include/effects/SkXfermodeImageFilter.h (right): https://codereview.chromium.org/16125008/diff/5001/include/effects/SkXfermodeImageFilter.h#newcode16 include/effects/SkXfermodeImageFilter.h:16: class SK_API SkXfermodeImageFilter : public SkImageFilter { On 2013/05/30 ...
7 years, 6 months ago (2013-05-30 17:24:19 UTC) #3
bsalomon
Mostly LGTM. Thanks for catching the bug in isequal! https://codereview.chromium.org/16125008/diff/11001/include/core/SkXfermode.h File include/core/SkXfermode.h (right): https://codereview.chromium.org/16125008/diff/11001/include/core/SkXfermode.h#newcode201 include/core/SkXfermode.h:201: ...
7 years, 6 months ago (2013-05-30 18:00:00 UTC) #4
Stephen White
https://codereview.chromium.org/16125008/diff/11001/include/core/SkXfermode.h File include/core/SkXfermode.h (right): https://codereview.chromium.org/16125008/diff/11001/include/core/SkXfermode.h#newcode201 include/core/SkXfermode.h:201: ignored. On 2013/05/30 18:00:00, bsalomon wrote: > Can we ...
7 years, 6 months ago (2013-05-30 18:45:49 UTC) #5
bsalomon
On 2013/05/30 18:45:49, Stephen White wrote: > https://codereview.chromium.org/16125008/diff/11001/include/core/SkXfermode.h > File include/core/SkXfermode.h (right): > > https://codereview.chromium.org/16125008/diff/11001/include/core/SkXfermode.h#newcode201 ...
7 years, 6 months ago (2013-05-30 18:48:35 UTC) #6
reed1
lgtm
7 years, 6 months ago (2013-05-30 18:59:44 UTC) #7
Stephen White
Of course, I forgot to test the SkArithmeticMode as an SkXfermodeImageFilter, which was the whole ...
7 years, 6 months ago (2013-05-30 20:05:09 UTC) #8
bsalomon
On 2013/05/30 20:05:09, Stephen White wrote: > Of course, I forgot to test the SkArithmeticMode ...
7 years, 6 months ago (2013-05-30 20:39:44 UTC) #9
reed1
I don't really understand the concern about rebaselining and gms. 1. is there a fix ...
7 years, 6 months ago (2013-05-30 20:42:44 UTC) #10
reed1
to be clearer, I'm fine if we land a new GM (exercising xfermodeimagefilter well) in ...
7 years, 6 months ago (2013-05-30 20:46:17 UTC) #11
Stephen White
https://codereview.chromium.org/16125008/diff/2003/gm/arithmode.cpp File gm/arithmode.cpp (right): https://codereview.chromium.org/16125008/diff/2003/gm/arithmode.cpp#newcode121 gm/arithmode.cpp:121: SkXfermode* xfer = SkArithmeticMode::Create(0, one, one, 0); On 2013/05/30 ...
7 years, 6 months ago (2013-05-30 20:50:26 UTC) #12
Stephen White
On 2013/05/30 20:42:44, reed1 wrote: > I don't really understand the concern about rebaselining and ...
7 years, 6 months ago (2013-05-30 20:52:22 UTC) #13
Stephen White
7 years, 6 months ago (2013-05-31 17:49:19 UTC) #14
Message was sent while issue was closed.
Committed patchset #8 manually as r9373 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698