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

Issue 6443119: Generalize DAG connectivity for SkImageFilter (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by Stephen White
Modified:
11 years, 8 months ago
Reviewers:
Leon, bsalomon, reed1
CC:
DerekS, skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

This patch implements generalized DAG connectivity for SkImageFilter. SkImageFilter maintains a list of inputs, which can be constructed either from a SkImageFilter** or zero or more SkImageFilter* arguments (varargs). Existing filters which maintained their own filter connectivity were refactored to use the new constructors and flattening/unflattening code. Modifying the remaining filters which are not yet DAG-friendly is left for future work; they are considered to have zero inputs for now. Committed: https://code.google.com/p/skia/source/detail?r=5891

Patch Set 1 #

Patch Set 2 : add missing files #

Patch Set 3 : update to ToT; fix errors #

Total comments: 1

Patch Set 4 : updated to ToT; absorbed SkLightingImageFilter changes #

Patch Set 5 : use SkRefCnt_SafeAssign #

Patch Set 6 : varargs & array constructors for SkImageFilter #

Patch Set 7 : make destructor virtual; don't ref newly-unflattened filters #

Patch Set 8 : remove spurious whitespace change #

Total comments: 4

Patch Set 9 : add comments, whitespace, convenience fns #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -157 lines) Patch
M gm/imagefiltersbase.cpp View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M include/core/SkImageFilter.h View 1 2 3 4 5 6 7 8 2 chunks +21 lines, -2 lines 0 comments Download
M include/effects/SkBlendImageFilter.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M include/effects/SkSingleInputImageFilter.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M include/effects/SkTestImageFilters.h View 1 2 3 4 5 6 7 5 chunks +5 lines, -15 lines 0 comments Download
M src/core/SkImageFilter.cpp View 1 2 3 4 5 6 1 chunk +66 lines, -0 lines 0 comments Download
M src/effects/SkBitmapSource.cpp View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M src/effects/SkBlendImageFilter.cpp View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -22 lines 0 comments Download
M src/effects/SkMagnifierImageFilter.cpp View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M src/effects/SkSingleInputImageFilter.cpp View 1 2 3 4 5 1 chunk +11 lines, -23 lines 0 comments Download
M src/effects/SkTestImageFilters.cpp View 1 2 3 4 5 5 chunks +53 lines, -87 lines 0 comments Download

Messages

Total messages: 8
Stephen White
11 years, 10 months ago (2012-08-13 21:28:41 UTC) #1
reed1
I think the question of how/when to specify other parameters (inputs) is a healthy one. ...
11 years, 8 months ago (2012-10-04 15:41:34 UTC) #2
Leon
+1 for the effort of moving common functionality into the base class. I have not ...
11 years, 8 months ago (2012-10-04 17:54:58 UTC) #3
Stephen White
Thanks for your comments. Just for background, here was my original comment to Mike: > ...
11 years, 8 months ago (2012-10-04 18:12:55 UTC) #4
bsalomon
On 2012/10/04 18:12:55, Stephen White wrote: > Thanks for your comments. Just for background, here ...
11 years, 8 months ago (2012-10-04 18:18:00 UTC) #5
Stephen White
On 2012/10/04 18:18:00, bsalomon wrote: > On 2012/10/04 18:12:55, Stephen White wrote: > > It's ...
11 years, 8 months ago (2012-10-09 17:02:41 UTC) #6
reed1
I like the simplification of requiring all inputs up front. LGTM w/ request for some ...
11 years, 8 months ago (2012-10-10 15:29:41 UTC) #7
Stephen White
11 years, 8 months ago (2012-10-10 19:11:54 UTC) #8
https://codereview.appspot.com/6443119/diff/33012/include/core/SkImageFilter.h
File include/core/SkImageFilter.h (right):

https://codereview.appspot.com/6443119/diff/33012/include/core/SkImageFilter....
include/core/SkImageFilter.h:112: SkImageFilter(int numInputs, SkImageFilter**
inputs);
On 2012/10/10 15:29:41, reed1 wrote:
> // the ... represents numInputs SkImageFilter pointers, upon which this
> // constructor will call SkSafeRef(). This is the same behavior as the
> // SkImageFilter(int, SkImageFilter**) constructor.

Done.

https://codereview.appspot.com/6443119/diff/33012/src/effects/SkBlendImageFil...
File src/effects/SkBlendImageFilter.cpp (right):

https://codereview.appspot.com/6443119/diff/33012/src/effects/SkBlendImageFil...
src/effects/SkBlendImageFilter.cpp:78: SkBitmap background, foreground = src;
On 2012/10/10 15:29:41, reed1 wrote:
> Might want to consider helper getters or a private enum to document in a
single
> place which input is background and which is foreground. Not sure if this
would
> help other subclasses as well or not.

Done.
Sign in to reply to this message.

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