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

Issue 16064002: Provide a GPU implementation of SkArithmeticMode (Closed)

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

Description

Provide a GPU implementation of SkArithmeticMode, using a custom GrEffect exposed via asNewEffectOrCoeff(). Doing it this way required modifying the arithmode GM to use saveLayer()/restore() rather than creating an offscreen SkBitmap, since otherwise the compositing is always done in raster mode. Fixing that in turn exposed that SkArithmeticMode did not work in Picture mode, since it wasn't flattenable. Made it so. Note: this will require rebaselining the arithmode GM (again). R=bsalomon@google.com, reed@google.com Originally committed: https://code.google.com/p/skia/source/detail?r=9324 Reverted: https://code.google.com/p/skia/source/detail?r=9325 Committed: https://code.google.com/p/skia/source/detail?r=9330

Patch Set 1 #

Patch Set 2 : Fix spacing #

Total comments: 4

Patch Set 3 : Changed k's to a vec4 in the shader. #

Total comments: 1

Patch Set 4 : Add comment, as per review #

Patch Set 5 : Convert to effect on SkArithmeticMode (forget image filter for now) #

Patch Set 6 : Fix flattening for out-of-process pictures. #

Patch Set 7 : Fix a typo. #

Patch Set 8 : Don't attempt to write to inputColor. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+209 lines, -15 lines) Patch
M gm/arithmode.cpp View 1 2 3 4 2 chunks +8 lines, -14 lines 0 comments Download
M include/effects/SkArithmeticMode.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M src/effects/SkArithmeticMode.cpp View 1 2 3 4 5 6 7 3 chunks +197 lines, -1 line 0 comments Download
M src/ports/SkGlobalInitialization_default.cpp View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
Stephen White
PTAL. Thanks!
7 years, 6 months ago (2013-05-28 13:58:15 UTC) #1
bsalomon
The GPU code mostly looks good to me. A couple of questions inline. https://codereview.chromium.org/16064002/diff/2001/src/effects/SkArithmeticImageFilter.cpp File ...
7 years, 6 months ago (2013-05-28 14:21:20 UTC) #2
Stephen White
https://codereview.chromium.org/16064002/diff/2001/src/effects/SkArithmeticImageFilter.cpp File src/effects/SkArithmeticImageFilter.cpp (right): https://codereview.chromium.org/16064002/diff/2001/src/effects/SkArithmeticImageFilter.cpp#newcode238 src/effects/SkArithmeticImageFilter.cpp:238: fK1Uni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, On 2013/05/28 14:21:20, bsalomon wrote: > ...
7 years, 6 months ago (2013-05-28 15:08:33 UTC) #3
Stephen White
Changed the shader as requested. PTAnotherL. :)
7 years, 6 months ago (2013-05-28 15:35:27 UTC) #4
bsalomon
On 2013/05/28 15:35:27, Stephen White wrote: > Changed the shader as requested. PTAnotherL. :) gpu ...
7 years, 6 months ago (2013-05-28 15:40:54 UTC) #5
reed1
SkArithmeticMode.cpp -- might want to land this on its own. https://codereview.chromium.org/16064002/diff/7001/include/effects/SkArithmeticImageFilter.h File include/effects/SkArithmeticImageFilter.h (right): https://codereview.chromium.org/16064002/diff/7001/include/effects/SkArithmeticImageFilter.h#newcode16 ...
7 years, 6 months ago (2013-05-28 16:22:02 UTC) #6
reed1
Do we already have an imagefilter that just applies an arbitrary xfermode between two other ...
7 years, 6 months ago (2013-05-28 16:25:37 UTC) #7
Stephen White
On 2013/05/28 16:25:37, reed1 wrote: > Do we already have an imagefilter that just applies ...
7 years, 6 months ago (2013-05-28 16:40:06 UTC) #8
reed1
Hmmm, sounds like we want a way for the xfermode to emit some effect snippet ...
7 years, 6 months ago (2013-05-28 16:41:08 UTC) #9
reed1
7 years, 6 months ago (2013-05-28 16:44:06 UTC) #10
robertphillips
Why can't we just add a asNewEffectOrCoeff method to SkArithmeticMode and use that?
7 years, 6 months ago (2013-05-28 16:49:56 UTC) #11
bsalomon
On 2013/05/28 16:49:56, robertphillips wrote: > Why can't we just add a asNewEffectOrCoeff method to ...
7 years, 6 months ago (2013-05-28 16:59:14 UTC) #12
Stephen White
On 2013/05/28 16:49:56, robertphillips wrote: > Why can't we just add a asNewEffectOrCoeff method to ...
7 years, 6 months ago (2013-05-28 17:11:00 UTC) #13
Stephen White
On 2013/05/28 16:59:14, bsalomon wrote: > On 2013/05/28 16:49:56, robertphillips wrote: > > Why can't ...
7 years, 6 months ago (2013-05-28 17:14:37 UTC) #14
Stephen White
On 2013/05/28 17:11:00, Stephen White wrote: > On 2013/05/28 16:49:56, robertphillips wrote: > > Why ...
7 years, 6 months ago (2013-05-28 17:21:00 UTC) #15
bsalomon
On 2013/05/28 17:21:00, Stephen White wrote: > On 2013/05/28 17:11:00, Stephen White wrote: > > ...
7 years, 6 months ago (2013-05-28 17:40:39 UTC) #16
reed1
I'm fine for me to change the raster virtual for xfermodes to take the dst ...
7 years, 6 months ago (2013-05-28 18:14:52 UTC) #17
bsalomon
On 2013/05/28 18:14:52, reed1 wrote: > I'm fine for me to change the raster virtual ...
7 years, 6 months ago (2013-05-28 18:38:44 UTC) #18
Stephen White
On 2013/05/28 18:38:44, bsalomon wrote: > On 2013/05/28 18:14:52, reed1 wrote: > > I'm fine ...
7 years, 6 months ago (2013-05-28 18:47:13 UTC) #19
reed1
Brian thought he could update the gpu signature to allow for SkXfermodeImageFilter to take its ...
7 years, 6 months ago (2013-05-28 18:52:26 UTC) #20
Stephen White
On 2013/05/28 18:52:26, reed1 wrote: > Brian thought he could update the gpu signature to ...
7 years, 6 months ago (2013-05-28 18:55:21 UTC) #21
bsalomon
On 2013/05/28 18:55:21, Stephen White wrote: > On 2013/05/28 18:52:26, reed1 wrote: > > Brian ...
7 years, 6 months ago (2013-05-28 18:58:47 UTC) #22
Stephen White
This patch moves the arithmetic effect to SkArithmeticMode's GPU path, using a custom GrEffect exposed ...
7 years, 6 months ago (2013-05-29 18:07:24 UTC) #23
reed1
Thanks for the flattening catch/fix. Will need to add this mode to SkGlobalInitialization_default.cpp. raster change ...
7 years, 6 months ago (2013-05-29 18:15:24 UTC) #24
bsalomon
On 2013/05/29 18:15:24, reed1 wrote: > Thanks for the flattening catch/fix. Will need to add ...
7 years, 6 months ago (2013-05-29 18:23:17 UTC) #25
Stephen White
On 2013/05/29 18:15:24, reed1 wrote: > Thanks for the flattening catch/fix. Will need to add ...
7 years, 6 months ago (2013-05-29 18:45:23 UTC) #26
reed1
lgtm
7 years, 6 months ago (2013-05-29 18:49:25 UTC) #27
Stephen White
Committed patchset #7 manually as r9324 (presubmit successful).
7 years, 6 months ago (2013-05-29 18:51:01 UTC) #28
Stephen White
Brian: PTAL. I was assuming I could write to the inputColor variable, which isn't always ...
7 years, 6 months ago (2013-05-29 19:33:12 UTC) #29
bsalomon
On 2013/05/29 19:33:12, Stephen White wrote: > Brian: PTAL. I was assuming I could write ...
7 years, 6 months ago (2013-05-29 20:48:48 UTC) #30
bsalomon
On 2013/05/29 20:48:48, bsalomon wrote: > On 2013/05/29 19:33:12, Stephen White wrote: > > Brian: ...
7 years, 6 months ago (2013-05-29 20:48:55 UTC) #31
Stephen White
7 years, 6 months ago (2013-05-29 20:55:16 UTC) #32
Message was sent while issue was closed.
Committed patchset #8 manually as r9330 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698