My first cut at plumbing in imagefilters 1. only invoked during saveLayer/restore right now. I ...
12 years, 4 months ago
(2011-12-19 19:06:55 UTC)
#1
My first cut at plumbing in imagefilters
1. only invoked during saveLayer/restore right now. I think I can detect it for
all draw calls, and just fake an internal saveLayer for those cases, so that we
always fall into this restore->drawDevice handling code.
2. need to widen the clip at the time of saveLayer, since the filter can
displace the src and/or needs to read some of the src that would be offscreen in
order to correctly compute its result.
3. this signature (bitmap -> bitmap) does not allow for creating the result on
the gpu, so that will have to change
4. this signature does not allow for reading the dst, which some SVG filters
want, so that will probably have to change (perhaps at the same time as
addressing #3).
5. this signature does not allow the filter to draw directly into the dst, which
can be more efficient than creating a temp bitmap which I then draw (e.g.
SkOffsetImageFilter just wants to draw the src in a different position,
SkMergeImageFilter with friendly xfermodes could draw all of them to the dst w/o
an offscreen). This may be fixed similarly to #3 and #4.
Let's split out these sample filters into a separate patch, and just land the glue ...
12 years, 4 months ago
(2011-12-20 16:26:48 UTC)
#3
Let's split out these sample filters into a separate patch, and just land the
glue which applies them first.
http://codereview.appspot.com/5493082/diff/3001/src/effects/SkTestImageFilter...
File src/effects/SkTestImageFilters.cpp (right):
http://codereview.appspot.com/5493082/diff/3001/src/effects/SkTestImageFilter...
src/effects/SkTestImageFilters.cpp:52: bool
SkOffsetImageFilter::onFilterImage(const SkBitmap& src,
I'm not sure what your plans for this code are, but we don't actually need a
skia implementation of feOffset, feMerge or feComposite for SVG/W3C filters.
Over in WebKit, those nodes are already implemented in terms of
GraphicsContext/ImageBuffer, so they're already using skia under the hood and
thus already have both a software and GPU-accelerated implementation. I don't
see much point in re-implementing them in Skia, but if you want to keep this
code for testing, feel free. It should probably be moved to a gm, though.
I definitely want to keep them, as they seem logical building blocks for other effects, ...
12 years, 4 months ago
(2011-12-20 16:29:09 UTC)
#4
I definitely want to keep them, as they seem logical building blocks for other
effects, and we want this skia feature (imagefilters) to make sense on its own,
and not solely in conjunction with webkit's current svg impl.
Issue 5493082: initial impl for imagefilters (incomplete)
Created 12 years, 4 months ago by reed1
Modified 12 years, 4 months ago
Reviewers: Stephen White
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 1