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

Issue 6306097: GrSingleTextureEffect (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by TomH
Modified:
12 years, 4 months ago
CC:
senorblanco
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Creates a new base class for any GrCustomStage that needs a texture. Ports all extant stages to use it. Verified that new stages that try to use the old texture pointer & not derive from GrSingleTextureEffect will fail gracefully. A follow-on CL will remove the old texture pointer. Base class has virtual API to support arbitrary numbers of textures, but doesn't provide any storage for them.

Patch Set 1 #

Total comments: 8

Patch Set 2 : Respond to initial review by bsalomon@ #

Patch Set 3 : Per discussion, make numTextures() virtual #

Patch Set 4 : Update to ToT, add Conical2Gradient #

Total comments: 3

Patch Set 5 : Convert new lighting filters #

Total comments: 1

Patch Set 6 : Document immutability requirement, fix isEquals() to call SingleTexture base implementation #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -109 lines) Patch
M gyp/gpu.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M include/gpu/GrCustomStage.h View 1 2 3 4 5 2 chunks +16 lines, -3 lines 1 comment Download
M src/core/SkPaint.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 1 2 3 4 5 17 chunks +35 lines, -28 lines 0 comments Download
M src/gpu/GrContext.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrCustomStage.cpp View 1 2 3 4 5 2 chunks +21 lines, -0 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 4 chunks +16 lines, -13 lines 0 comments Download
M src/gpu/effects/Gr1DKernelEffect.h View 1 2 3 4 4 chunks +7 lines, -5 lines 0 comments Download
M src/gpu/effects/GrConvolutionEffect.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/gpu/effects/GrConvolutionEffect.cpp View 1 2 3 4 5 4 chunks +8 lines, -7 lines 0 comments Download
M src/gpu/effects/GrGradientEffects.h View 1 2 3 4 6 chunks +16 lines, -19 lines 0 comments Download
M src/gpu/effects/GrGradientEffects.cpp View 1 2 3 4 5 12 chunks +18 lines, -14 lines 0 comments Download
M src/gpu/effects/GrMorphologyEffect.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/effects/GrMorphologyEffect.cpp View 1 2 3 4 5 4 chunks +7 lines, -5 lines 1 comment Download
A src/gpu/effects/GrSingleTextureEffect.h View 1 2 3 4 1 chunk +28 lines, -0 lines 0 comments Download
A src/gpu/effects/GrSingleTextureEffect.cpp View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLProgramStage.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M src/gpu/gl/GrGLProgramStage.cpp View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M src/gpu/gl/GrGpuGL.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/gpu/gl/GrGpuGL.cpp View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGpuGL_program.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGpuGL_unittest.cpp View 1 2 3 4 4 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 25
TomH
Prototype. Passes unit tests & GM, but leaks a texture somewhere - perhaps I'm not ...
12 years, 5 months ago (2012-06-18 21:01:20 UTC) #1
bsalomon
Maybe we should run either the existing code or the patched code in gm or ...
12 years, 5 months ago (2012-06-19 12:52:52 UTC) #2
TomH
No idea how I picked up the gyp change? http://codereview.appspot.com/6306097/diff/1/include/gpu/GrCustomStage.h File include/gpu/GrCustomStage.h (right): http://codereview.appspot.com/6306097/diff/1/include/gpu/GrCustomStage.h#newcode67 include/gpu/GrCustomStage.h:67: ...
12 years, 5 months ago (2012-06-19 19:33:14 UTC) #3
TomH
Ready for another look. Steven, Jeff, this will break your custom effects under development (gracefully!) ...
12 years, 4 months ago (2012-07-11 19:52:47 UTC) #4
robertphillips
One question. http://codereview.appspot.com/6306097/diff/12001/src/gpu/effects/GrSingleTextureEffect.h File src/gpu/effects/GrSingleTextureEffect.h (right): http://codereview.appspot.com/6306097/diff/12001/src/gpu/effects/GrSingleTextureEffect.h#newcode16 src/gpu/effects/GrSingleTextureEffect.h:16: GrSingleTextureEffect(GrTexture* texture); I don't think we put ...
12 years, 4 months ago (2012-07-11 20:11:13 UTC) #5
TomH
http://codereview.appspot.com/6306097/diff/12001/src/gpu/effects/GrSingleTextureEffect.h File src/gpu/effects/GrSingleTextureEffect.h (right): http://codereview.appspot.com/6306097/diff/12001/src/gpu/effects/GrSingleTextureEffect.h#newcode16 src/gpu/effects/GrSingleTextureEffect.h:16: GrSingleTextureEffect(GrTexture* texture); On 2012/07/11 20:11:13, robertphillips wrote: > I ...
12 years, 4 months ago (2012-07-11 20:12:09 UTC) #6
robertphillips
Also, I should've said LGTM
12 years, 4 months ago (2012-07-11 20:15:03 UTC) #7
bsalomon
Will the defaultfetch / coord dims stuff eventually move to SingleTextureEffect from Builder? Maybe that ...
12 years, 4 months ago (2012-07-11 20:25:27 UTC) #8
TomH
On 2012/07/11 20:25:27, bsalomon wrote: > Will the defaultfetch / coord dims stuff eventually move ...
12 years, 4 months ago (2012-07-11 20:28:46 UTC) #9
bsalomon
On 2012/07/11 20:28:46, TomH wrote: > On 2012/07/11 20:25:27, bsalomon wrote: > > Will the ...
12 years, 4 months ago (2012-07-11 20:33:22 UTC) #10
Stephen White
On 2012/07/11 20:25:27, bsalomon wrote: > *Should* Jeff inherit from this? His effect seems different ...
12 years, 4 months ago (2012-07-12 14:36:55 UTC) #11
Stephen White
http://codereview.appspot.com/6306097/diff/21001/include/core/SkImageFilter.h File include/core/SkImageFilter.h (right): http://codereview.appspot.com/6306097/diff/21001/include/core/SkImageFilter.h#newcode90 include/core/SkImageFilter.h:90: virtual bool asNewCustomStage(GrCustomStage** stage, GrTexture*) const; Not quite sure ...
12 years, 4 months ago (2012-07-12 14:52:37 UTC) #12
TomH
On 2012/07/12 14:52:37, Stephen White wrote: > http://codereview.appspot.com/6306097/diff/21001/include/core/SkImageFilter.h > File include/core/SkImageFilter.h (right): > > http://codereview.appspot.com/6306097/diff/21001/include/core/SkImageFilter.h#newcode90 ...
12 years, 4 months ago (2012-07-12 15:04:05 UTC) #13
bsalomon
On 2012/07/12 14:36:55, Stephen White wrote: > On 2012/07/11 20:25:27, bsalomon wrote: > > *Should* ...
12 years, 4 months ago (2012-07-12 15:06:20 UTC) #14
bsalomon
On 2012/07/12 15:04:05, TomH wrote: > On 2012/07/12 14:52:37, Stephen White wrote: > > http://codereview.appspot.com/6306097/diff/21001/include/core/SkImageFilter.h ...
12 years, 4 months ago (2012-07-12 15:07:32 UTC) #15
Stephen White
On 2012/07/12 15:04:05, TomH wrote: > On 2012/07/12 14:52:37, Stephen White wrote: > > http://codereview.appspot.com/6306097/diff/21001/include/core/SkImageFilter.h ...
12 years, 4 months ago (2012-07-12 15:10:29 UTC) #16
TomH
Brian & I are talking. Recording notes: - GrCustomStage must not change after it's first ...
12 years, 4 months ago (2012-07-12 15:29:49 UTC) #17
TomH
After much discussion with Brian & Stephen followed by verbal LGTMs, documented immutability, fixed potential ...
12 years, 4 months ago (2012-07-12 17:25:14 UTC) #18
Stephen White
After our discussion I am Enlightened. Since the other parameters are set at construction time ...
12 years, 4 months ago (2012-07-12 17:35:21 UTC) #19
Stephen White
http://codereview.appspot.com/6306097/diff/15003/src/gpu/effects/GrMorphologyEffect.cpp File src/gpu/effects/GrMorphologyEffect.cpp (right): http://codereview.appspot.com/6306097/diff/15003/src/gpu/effects/GrMorphologyEffect.cpp#newcode131 src/gpu/effects/GrMorphologyEffect.cpp:131: *static_cast<GrGLTexture*>(data.texture(0)); Here (and in the other effects) you're getting ...
12 years, 4 months ago (2012-07-12 17:42:14 UTC) #20
TomH
On 2012/07/12 17:42:14, Stephen White wrote: > http://codereview.appspot.com/6306097/diff/15003/src/gpu/effects/GrMorphologyEffect.cpp > File src/gpu/effects/GrMorphologyEffect.cpp (right): > > http://codereview.appspot.com/6306097/diff/15003/src/gpu/effects/GrMorphologyEffect.cpp#newcode131 ...
12 years, 4 months ago (2012-07-12 17:59:29 UTC) #21
twiz1
On 2012/07/11 20:33:22, bsalomon wrote: > On 2012/07/11 20:28:46, TomH wrote: > > On 2012/07/11 ...
12 years, 4 months ago (2012-07-12 18:57:53 UTC) #22
bsalomon
On 2012/07/12 18:57:53, twiz1 wrote: > On 2012/07/11 20:33:22, bsalomon wrote: > > On 2012/07/11 ...
12 years, 4 months ago (2012-07-12 19:37:42 UTC) #23
twiz1
On 2012/07/12 19:37:42, bsalomon wrote: > On 2012/07/12 18:57:53, twiz1 wrote: > > On 2012/07/11 ...
12 years, 4 months ago (2012-07-12 19:45:39 UTC) #24
twiz1
12 years, 4 months ago (2012-07-13 19:50:10 UTC) #25
On 2012/07/12 19:45:39, twiz1 wrote:
> On 2012/07/12 19:37:42, bsalomon wrote:
> > On 2012/07/12 18:57:53, twiz1 wrote:
> > > On 2012/07/11 20:33:22, bsalomon wrote:
> > > > On 2012/07/11 20:28:46, TomH wrote:
> > > > > On 2012/07/11 20:25:27, bsalomon wrote:
> > > > > > Will the defaultfetch / coord dims stuff eventually move to
> > > > > SingleTextureEffect
> > > > > > from Builder? Maybe that depends on also moving matrix to the effect
> > > (along
> > > > > with
> > > > > > the boiler plate texture coordinate stuff that is still in
> GrGLProgram).
> > > > > 
> > > > > Yeah, not a small move.
> > > > 
> > > > 
> > > > Agreed, not arguing for doing it as part of this CL.
> > > > 
> > > > > 
> > > > > > *Should* Jeff inherit from this? His effect seems different than the
> > rest
> > > in
> > > > > > that it only needs the incoming color and no additional coordinates?
> > > > > 
> > > > > I don't know. If that texture pointer is vestigial, then I suppose he
> > > doesn't
> > > > > need to inherit. But the way I read his
GrGLColorTableEffect::emitFS(),
> > he's
> > > > > doing a texture lookup, right?
> > > > 
> > > > Yeah, doing a texture lookup but with different inputs. He doesn't need
a
> > > > matrix, doesn't need texture coords, doesn't need to worry about whether
> the
> > > > texture is alpha-only or rgba. If the boilerplate stuff related to those
> > > > concerns is going to move from GrGLProgram to GrSingleTextureEffect it
> seems
> > > > like he shouldn't inherit from it. I suppose there could be another
> subclass
> > > of
> > > > GrSingleTexturEffect that brings in those elements.
> > > 
> > > I just synced with this change, and it seems that something is going wrong
> > with
> > > my existing CL:  https://codereview.appspot.com/6351081/
> > > 
> > > After the sync, the lut is not making it's way to the shader - I'm getting
> an
> > > empty LUT.  
> > > 
> > > Investigating further right now, and will post an update.
> > > 
> > > Note that I did not modify my CL to inherit from the new classes, as per
> this
> > > discussion.
> > 
> > Hey Jeff, If you'd like, post the merged patch and I can help track it down.
> 
> Patch uploaded as set #4.  (https://codereview.appspot.com/6351081/)
> 
> I think the stage is being skipped entirely, as emitFS is not being invoked.

An update on this conflict.  The regression I've been mentioning is not related
to this change.  After some hand-rolled bisect-builds, I narrowed down the
revision that causes my problem: 
https://code.google.com/p/skia/source/detail?r=4555

Discussion on the problem will continue on the other issue.
(https://codereview.appspot.com/6351081/)

> 
> > 
> > > 
> > > > 
> > > > > 
> > > > > >
> http://codereview.appspot.com/6306097/diff/12001/src/gpu/gl/GrGpuGL.cpp
> > > > > > File src/gpu/gl/GrGpuGL.cpp (right):
> > > > > > 
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://codereview.appspot.com/6306097/diff/12001/src/gpu/gl/GrGpuGL.cpp#newco...
> > > > > > src/gpu/gl/GrGpuGL.cpp:2142: // HACK - if we're using a new
> > > > > SingleTextureEffect,
> > > > > > override
> > > > > > I take it the next step is to make ALL textures go through custom
> effect
> > > and
> > > > > > remove the texture array from GrPaint/GrDrawState?
> > > > > 
> > > > > Yes. We could try to do that as part of this change, although to be
> clean
> > it
> > > > > should also involve default fetch, coord dims, matrix (?), which makes
> the
> > > CL
> > > > > bigger and more complicated.
> > > > 
> > > > I wouldn't do it as part of this change. Just trying to get a feel for
the
> > > > roadmap.
Sign in to reply to this message.

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