DescriptionMake SkImageFilter crop rects relative to the primitive origin, instead of relative to their parent's crop rect. This is required by SVG semantics, and is more sane anyway.
To do this, this patch changes the "offset/loc" parameter in filterImage() / onFilterImage() from an inout-param to an out-param only, so that the calling filter can know how much the input filter wants its result offset (and doesn't include the original primitive position). This offset can then be applied to the current filter's crop rect. (I've renamed the parameter "offset" in all cases to make this clear.) This makes the call sites in SkCanvas/SkGpuDevice responsible for applying the resulting offset to the primitive's position, which is actually a fairly small change.
This change also fixes SkTileImageFilter and SkOffsetImageFilter to correctly handle an input offset, which they weren't before. This required modifying the GM's, since they assumed the broken behaviour.
NOTE: this will require rebaselining the imagefiltersgraph test, since it has a new test case.
NOTE: this will "break" the Blink layout tests css3/filters/effect-reference-subregion-chained-hw.html and css3/filters/effect-reference-subregion-hw.html, but it actually makes them give correct results. It should be suppressed on the skia roll, and I'll rebaseline it.
R=reed@google.com
Committed: https://code.google.com/p/skia/source/detail?r=12895
Patch Set 1 #Patch Set 2 : Apply to remaining filters #Patch Set 3 : fix offset GM; fix tile GM #Patch Set 4 : Since offset is an outparam, use =, not +=. #Patch Set 5 : Add imagefiltersgraph to the ignored list #Patch Set 6 : Remove a useless zero. #
Total comments: 3
Patch Set 7 : Update docs; initialize offset when returning true from a filter. #Patch Set 8 : Initialize more offsets. #Patch Set 9 : Add a unit test. #Patch Set 10 : Tweak includes #Patch Set 11 : Fix errors exposed by unit test #Patch Set 12 : Windows warning fixes #Patch Set 13 : Updated to ToT #
Messages
Total messages: 8 (0 generated)
|