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

Issue 6351113: Added asNewCustomStage to SkShader and implemented it for all the gradient shaders. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by rileya
Modified:
12 years, 3 months ago
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Added asNewCustomStage to SkShader and implemented it for all the gradient shaders. Not actually hooked up yet, but it should be ready to replace asABitmap for a future CL. Committed: https://code.google.com/p/skia/source/detail?r=4702

Patch Set 1 #

Total comments: 6

Patch Set 2 : Change from passing by non-const references to pointers. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -22 lines) Patch
M include/core/SkShader.h View 1 2 chunks +13 lines, -0 lines 0 comments Download
M src/core/SkShader.cpp View 1 1 chunk +5 lines, -0 lines 0 comments Download
M src/effects/SkGradientShader.cpp View 1 8 chunks +72 lines, -0 lines 0 comments Download
M src/gpu/effects/GrGradientEffects.h View 1 7 chunks +7 lines, -6 lines 0 comments Download
M src/gpu/effects/GrGradientEffects.cpp View 1 9 chunks +66 lines, -16 lines 0 comments Download

Messages

Total messages: 7
rileya
12 years, 3 months ago (2012-07-20 17:15:58 UTC) #1
reed1
Just a thought. Given the huge size of SkGradientShader.cpp already, should we move the Gpu ...
12 years, 3 months ago (2012-07-20 17:28:26 UTC) #2
TomH
Mike said: > Just a thought. Given the huge size of SkGradientShader.cpp already, should we ...
12 years, 3 months ago (2012-07-20 17:35:29 UTC) #3
bsalomon
Mostly LGTM. Should we move the gradient gpu files to src/effects to be next to ...
12 years, 3 months ago (2012-07-20 17:36:38 UTC) #4
reed1
On 2012/07/20 17:35:29, TomH wrote: > Mike said: > > Just a thought. Given the ...
12 years, 3 months ago (2012-07-20 17:47:56 UTC) #5
rileya
> I see Gr code in the main file. Can that be moved out? The ...
12 years, 3 months ago (2012-07-20 19:34:59 UTC) #6
bsalomon
12 years, 3 months ago (2012-07-20 19:50:07 UTC) #7
On 2012/07/20 19:34:59, rileya wrote:
> > I see Gr code in the main file. Can that be moved out?
> 
> The Gr code in SkGradientShader.cpp is limited to setting up the sampler state
> parameters (matrix, tilemode, and filtering) in asNewCustomStage, it sounds
like
> all of that is going to eventually be moved into GrCustomStage, so I think
that
> can cleanly get pulled out once that is done, until then I don't see a way of
> pulling that out that doesn't involve making asNewCustomStage return
> tilemode/matrix/etc and making the caller apply those to the sampler (which is
> what currently happens with asABitmap in SkGpuDevice).

Once all that junk is setup by custom effect it seems like all the
asANewCustomStage funcs will be one-liners. Given that they represent a pretty
small fraction of the overall file length already, it seems overkill to pull
those defs into another file. If we did pull the custom effect definitions into
a cpp in src/effects/ then these virtuals could be defined in those cpps.
However, ...


> 
> >Should we move the gradient gpu files to src/effects to be next to their CPU
> >cousins?
> 
> Sounds good, how would this work naming-wise? I think you mentioned something
> like: GrGradientEffects.cpp/h -> SkGradientEffectsGpu.cpp/h? Would the
contents
> of those files keep their Gr/GrGL prefixes?

... I'm not sure. Let's have a quick discussion about this on Monday when
everyone is back in the office. We'll need a consistent policy on this going
forward.

> 
> https://codereview.appspot.com/6351113/diff/1/include/core/SkShader.h
> File include/core/SkShader.h (right):
> 
>
https://codereview.appspot.com/6351113/diff/1/include/core/SkShader.h#newcode311
> include/core/SkShader.h:311: */
> On 2012/07/20 17:28:26, reed1 wrote:
> > Skia likes to pass const Foo& for const parameters, and Foo* for
non-const...
> 
> Fixed.
> 
>
https://codereview.appspot.com/6351113/diff/1/include/core/SkShader.h#newcode313
> include/core/SkShader.h:313: GrSamplerState& sampler) const;
> On 2012/07/20 17:36:38, bsalomon wrote:
> > Skia convention is to pass T* rather than T& for non-const params.
> 
> Fixed.
> 
>
https://codereview.appspot.com/6351113/diff/1/src/gpu/effects/GrGradientEffec...
> File src/gpu/effects/GrGradientEffects.cpp (right):
> 
>
https://codereview.appspot.com/6351113/diff/1/src/gpu/effects/GrGradientEffec...
> src/gpu/effects/GrGradientEffects.cpp:62: // retrieve the gradient bitmap
> On 2012/07/20 17:35:29, TomH wrote:
> > Nit: this comment isn't useful?
> 
> Removed.
Sign in to reply to this message.

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