Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2190)

Issue 5451102: Adding opacity test for shaders, used for deferred drawing optimization (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by junov1
Modified:
12 years, 4 months ago
Reviewers:
bsalomon, reed1
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Adding a virtual interface for querying whether a shader returns opaque colors. This is necessary because getFlags (which has a flag for opacity) only returns correct flags after setContext is called, which is not convenient for deferred drawing.

Patch Set 1 #

Patch Set 2 : patch 2 #

Total comments: 2

Patch Set 3 : response to comments, added SkPaint::isOpaque #

Total comments: 5

Patch Set 4 : response to comments #

Total comments: 3

Patch Set 5 : Corrections to SkGradientShader.cpp #

Total comments: 1

Patch Set 6 : Removed SkPaint::isOpaque, added test #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -14 lines) Patch
M gyp/tests.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkColorShader.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkShader.h View 1 2 1 chunk +10 lines, -0 lines 1 comment Download
M src/core/SkBitmapProcShader.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M src/core/SkShader.cpp View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/effects/SkGradientShader.cpp View 1 2 3 4 5 8 chunks +21 lines, -14 lines 0 comments Download
A tests/ShaderOpacityTest.cpp View 1 2 3 4 5 1 chunk +119 lines, -0 lines 0 comments Download

Messages

Total messages: 22
junov1
PTAL
12 years, 6 months ago (2011-12-06 14:20:00 UTC) #1
reed1
1. Lets have the default return value be false, not true, to be conservative. 2. ...
12 years, 6 months ago (2011-12-06 14:43:17 UTC) #2
junov1
On 2011/12/06 14:43:17, reed1 wrote: > 2. Can we simplify it by not bother to ...
12 years, 6 months ago (2011-12-06 15:06:24 UTC) #3
junov1
http://codereview.appspot.com/5451102/diff/2001/include/core/SkShader.h File include/core/SkShader.h (right): http://codereview.appspot.com/5451102/diff/2001/include/core/SkShader.h#newcode107 include/core/SkShader.h:107: virtual bool isOpaque(const SkPaint& paint) const { return false; ...
12 years, 6 months ago (2011-12-06 15:06:47 UTC) #4
reed1
Shaders are defined such that they must modulate their alpha by the paint's alpha. Thus ...
12 years, 6 months ago (2011-12-06 15:09:45 UTC) #5
reed1
http://codereview.appspot.com/5451102/diff/2001/include/core/SkShader.h File include/core/SkShader.h (right): http://codereview.appspot.com/5451102/diff/2001/include/core/SkShader.h#newcode107 include/core/SkShader.h:107: virtual bool isOpaque(const SkPaint& paint) const { return false; ...
12 years, 6 months ago (2011-12-06 15:09:53 UTC) #6
bsalomon
The current tests don't seem conservative since we aren't looking at the colorfilter, maskfilter, or ...
12 years, 6 months ago (2011-12-06 15:11:35 UTC) #7
junov1
On 2011/12/06 15:11:35, bsalomon wrote: Brian, what you are suggesting is exactly what I have ...
12 years, 6 months ago (2011-12-06 16:13:23 UTC) #8
junov1
Forgot to mention: I agree with the comment, I will remove the paint argument to ...
12 years, 6 months ago (2011-12-06 16:17:46 UTC) #9
bsalomon
On 2011/12/06 16:13:23, junov1 wrote: > On 2011/12/06 15:11:35, bsalomon wrote: > > Brian, what ...
12 years, 6 months ago (2011-12-06 17:26:48 UTC) #10
junov1
> It seems like this should be somewhere reusable. What about something like > bool ...
12 years, 6 months ago (2011-12-07 18:34:18 UTC) #11
reed1
The xfermode switch statement needs more { } around ifs I think http://codereview.appspot.com/5451102/diff/5003/src/core/SkPaint.cpp File src/core/SkPaint.cpp ...
12 years, 6 months ago (2011-12-07 18:49:54 UTC) #12
bsalomon
It seems like there are two questions that need to be asked to determine if ...
12 years, 6 months ago (2011-12-07 19:25:25 UTC) #13
junov1
On 2011/12/07 18:49:54, reed1 wrote: > The xfermode switch statement needs more { } around ...
12 years, 6 months ago (2011-12-07 19:25:48 UTC) #14
junov1
On 2011/12/07 19:25:25, bsalomon wrote: > It seems like SkPaint should answer question 2 but ...
12 years, 6 months ago (2011-12-07 19:32:22 UTC) #15
junov1
Done.
12 years, 5 months ago (2011-12-08 15:56:06 UTC) #16
bsalomon
Overall looks good, minor inline comments http://codereview.appspot.com/5451102/diff/8001/src/effects/SkGradientShader.cpp File src/effects/SkGradientShader.cpp (right): http://codereview.appspot.com/5451102/diff/8001/src/effects/SkGradientShader.cpp#newcode308 src/effects/SkGradientShader.cpp:308: initCommon(); this->initCommond http://codereview.appspot.com/5451102/diff/8001/src/effects/SkGradientShader.cpp#newcode342 ...
12 years, 5 months ago (2011-12-08 16:42:02 UTC) #17
reed1
I'm good with all of the changes related to shaders. Find if we land those ...
12 years, 5 months ago (2011-12-08 20:28:47 UTC) #18
reed1
Should be quick to add a unittest for the new API...
12 years, 5 months ago (2011-12-08 20:32:46 UTC) #19
junov1
On 2011/12/08 20:32:46, reed1 wrote: > Should be quick to add a unittest for the ...
12 years, 5 months ago (2011-12-08 22:53:20 UTC) #20
reed1
LGTM w/ comment fix http://codereview.appspot.com/5451102/diff/15001/include/core/SkShader.h File include/core/SkShader.h (right): http://codereview.appspot.com/5451102/diff/15001/include/core/SkShader.h#newcode104 include/core/SkShader.h:104: * which only works properly ...
12 years, 5 months ago (2011-12-09 13:04:38 UTC) #21
bsalomon
12 years, 5 months ago (2011-12-09 13:43:21 UTC) #22
On 2011/12/09 13:04:38, reed1 wrote:
> LGTM w/ comment fix
> 
> http://codereview.appspot.com/5451102/diff/15001/include/core/SkShader.h
> File include/core/SkShader.h (right):
> 
>
http://codereview.appspot.com/5451102/diff/15001/include/core/SkShader.h#newc...
> include/core/SkShader.h:104: *  which only works properly when the context is
> set.
> remove @param comment, since there's no paint parameter

LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b