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

Issue 5656067: Implement morphology (erode and dilate) effects (Closed)

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

Description

Erode and dilate effects, CPU and GPU implementations. The GPU implementation behaves like a filtering mode, and re-uses the kernelWidth parameter from the convolution shader. The convolution was also refactored to remove imageIncrement from GrContext, replace it with a FilterDirection (also used by the morphology), and push imageIncrement computation down to GrGpuGLShaders. On the CPU side, SkMorphologyImageFilter is an abstract base class, with SkErodeImageFilter and SkDilateImageFilter derived from it. The software implementation is fairly straightforward, with a two-pass separable process like the GPU side.

Patch Set 1 #

Patch Set 2 : New draft #

Total comments: 4

Patch Set 3 : fixed indents, refactored software impl #

Patch Set 4 : clamp radius to src width #

Unified diffs Side-by-side diffs Delta from patch set Stats (+671 lines, -74 lines) Patch
A gm/morphology.cpp View 1 1 chunk +95 lines, -0 lines 0 comments Download
M gyp/effects.gyp View 1 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/gmslides.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkImageFilter.h View 1 1 chunk +16 lines, -0 lines 0 comments Download
A include/effects/SkMorphologyImageFilter.h View 1 1 chunk +65 lines, -0 lines 0 comments Download
M include/gpu/GrContext.h View 1 2 chunks +16 lines, -19 lines 0 comments Download
M include/gpu/GrSamplerState.h View 1 2 7 chunks +48 lines, -23 lines 0 comments Download
M src/core/SkPaint.cpp View 1 1 chunk +8 lines, -0 lines 0 comments Download
A src/effects/SkMorphologyImageFilter.cpp View 1 2 3 1 chunk +221 lines, -0 lines 0 comments Download
M src/gpu/GrContext.cpp View 1 2 chunks +28 lines, -25 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 6 chunks +59 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGLProgram.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGLProgram.cpp View 1 4 chunks +79 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGpuGL.cpp View 1 2 chunks +3 lines, -1 line 0 comments Download
M src/gpu/gl/GrGpuGLShaders.cpp View 1 5 chunks +28 lines, -3 lines 0 comments Download

Messages

Total messages: 14
Stephen White
12 years, 9 months ago (2012-02-15 20:29:16 UTC) #1
reed1
raster side seems fine, deferring to brian for GPU aspects
12 years, 9 months ago (2012-02-15 21:02:55 UTC) #2
bsalomon
High level comments: 1) I think we should push the logic of how to apply ...
12 years, 9 months ago (2012-02-16 15:57:13 UTC) #3
Stephen White
On 2012/02/16 15:57:13, bsalomon wrote: > High level comments: All good points! > > 1) ...
12 years, 9 months ago (2012-03-01 22:37:14 UTC) #4
Stephen White
So in this version, I've removed the imageIncrement from GrSamplerState, and added a FilterDirection instead. ...
12 years, 9 months ago (2012-03-01 22:45:06 UTC) #5
reed1
http://codereview.appspot.com/5656067/diff/6001/src/effects/SkMorphologyImageFilter.cpp File src/effects/SkMorphologyImageFilter.cpp (right): http://codereview.appspot.com/5656067/diff/6001/src/effects/SkMorphologyImageFilter.cpp#newcode85 src/effects/SkMorphologyImageFilter.cpp:85: can we combine these two, by just passing in ...
12 years, 9 months ago (2012-03-02 13:18:06 UTC) #6
bsalomon
I like this version. On 2012/03/01 22:45:06, Stephen White wrote: > So in this version, ...
12 years, 9 months ago (2012-03-02 14:15:24 UTC) #7
bsalomon
http://codereview.appspot.com/5656067/diff/6001/include/gpu/GrSamplerState.h File include/gpu/GrSamplerState.h (right): http://codereview.appspot.com/5656067/diff/6001/include/gpu/GrSamplerState.h#newcode242 include/gpu/GrSamplerState.h:242: FilterDirection fFilterDirection : 8; ubernit: can we tab out ...
12 years, 9 months ago (2012-03-02 14:15:30 UTC) #8
Stephen White
http://codereview.appspot.com/5656067/diff/6001/include/gpu/GrSamplerState.h File include/gpu/GrSamplerState.h (right): http://codereview.appspot.com/5656067/diff/6001/include/gpu/GrSamplerState.h#newcode242 include/gpu/GrSamplerState.h:242: FilterDirection fFilterDirection : 8; On 2012/03/02 14:15:30, bsalomon wrote: ...
12 years, 9 months ago (2012-03-02 17:34:23 UTC) #9
reed1
nice code sharing. Perhaps we could make the '<' or '>' (the only diff between ...
12 years, 9 months ago (2012-03-02 20:21:10 UTC) #10
Stephen White
On 2012/03/02 20:21:10, reed1 wrote: > nice code sharing. > > Perhaps we could make ...
12 years, 9 months ago (2012-03-02 20:26:46 UTC) #11
reed1
We have a lot of attempted code sharing (e.g. bitmapshaderproc), but in that case, we ...
12 years, 9 months ago (2012-03-02 20:33:51 UTC) #12
Stephen White
Landed as r3310. Closing.
12 years, 9 months ago (2012-03-02 22:28:23 UTC) #13
Stephen White
12 years, 9 months ago (2012-03-02 22:28:23 UTC) #14
Landed as r3310.  Closing.
Sign in to reply to this message.

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