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

Issue 6462071: Implement DAG connectivity for single-input image filters (Closed)

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

Description

This patch is another approach to DAG connectivity, as contrasted with the generalized DAG connectivity implemented in http://codereview.appspot.com/6443119/. In this version we introduce a new class, SkSingleInputImageFilter, to handle (not surprisingly) filters with a single image input. This provides functionality to store, flatten and unflatten a single SkImageFilter input, as well as to recursively evaluate it on the CPU or GPU. The advantage of this approach is that is the functionality is opt-in (although if a single-input filter does not use it, it will not have connectivity). Another advantage is that optimizations such as the matrix-collapsing can be more clearly expressed, since they will be performed before retrieving the inputs. The disadvantage is that code to recurse on the inputs must be added to both the CPU and GPU paths. Since it does not generalize connectivity, when we add future traversals later (e.g., for invalidating intermediate results), this will require custom code in each of the classes which maintain input references. Another thing which this version handles is recursive GPU processing, which it turns out the generalized version does not, since not all paths go through SkImageFilter::filterImage()). There are three cases. One, the input filter can be processed on the GPU, in which case we recurse via onFilterImageGPU(). Two, the input filter has only onFilterImage(), but only uses generic skia primitives, so actually does work on the GPU (e.g., SkMergeImageFilter), so we just call getTexture() and return it. Three, the input filter results in a software bitmap (e.g., SkBitmapSource), in which case we load it to the texture cache and return it. Instead of the general setInput() call, single-input image filters add a new parameter to their constructor, which represents the input filter (default NULL). There should be no change in functionality to existing code in WebKit, since all filter inputs will be NULL and filters will be processed individually as before.

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix morphology calls, this-> changes, SK_SUPPORT_GPU #

Patch Set 3 : Fix refcounting on unlocked cache textures #

Unified diffs Side-by-side diffs Delta from patch set Stats (+313 lines, -32 lines) Patch
A gm/imagefiltersgraph.cpp View 1 1 chunk +76 lines, -0 lines 0 comments Download
M gyp/effects.gyp View 4 chunks +4 lines, -0 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A include/effects/SkBitmapSource.h View 1 1 chunk +33 lines, -0 lines 0 comments Download
M include/effects/SkBlurImageFilter.h View 2 chunks +4 lines, -4 lines 0 comments Download
M include/effects/SkMorphologyImageFilter.h View 3 chunks +8 lines, -6 lines 0 comments Download
A include/effects/SkSingleInputImageFilter.h View 1 1 chunk +44 lines, -0 lines 0 comments Download
M include/effects/SkTestImageFilters.h View 3 chunks +4 lines, -3 lines 0 comments Download
M src/core/SkPaint.cpp View 1 chunk +1 line, -2 lines 0 comments Download
A src/effects/SkBitmapSource.cpp View 1 1 chunk +29 lines, -0 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 3 chunks +8 lines, -6 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 1 5 chunks +14 lines, -10 lines 0 comments Download
A src/effects/SkSingleInputImageFilter.cpp View 1 2 1 chunk +85 lines, -0 lines 0 comments Download
M src/effects/SkTestImageFilters.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7
Stephen White
11 years, 9 months ago (2012-08-16 19:22:14 UTC) #1
bsalomon
Would it be possible to structure it so that the derived classes don't have to ...
11 years, 9 months ago (2012-08-17 12:53:09 UTC) #2
Stephen White
On 2012/08/17 12:53:09, bsalomon wrote: > Would it be possible to structure it so that ...
11 years, 9 months ago (2012-08-17 13:10:19 UTC) #3
bsalomon
On 2012/08/17 13:10:19, Stephen White wrote: > On 2012/08/17 12:53:09, bsalomon wrote: > > Would ...
11 years, 9 months ago (2012-08-17 13:16:04 UTC) #4
bsalomon
On 2012/08/17 13:16:04, bsalomon wrote: > On 2012/08/17 13:10:19, Stephen White wrote: > > On ...
11 years, 9 months ago (2012-08-17 18:33:02 UTC) #5
reed1
1. I don't understand all of it, but something this big/new will just take time ...
11 years, 9 months ago (2012-08-17 18:37:14 UTC) #6
Stephen White
11 years, 9 months ago (2012-08-20 15:19:20 UTC) #7
Landed as r5170.  Closing.
Sign in to reply to this message.

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