Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Issue 14652016: Implement filter primitive subregion for reference CSS filters. This required refactoring determin… (Closed)

Created:
7 years, 7 months ago by Stephen White
Modified:
7 years, 7 months ago
CC:
blink-reviews, jamesr, danakj, f(malita), jchaffraix+rendering, pdr, Stephen Chennney, jeez
Visibility:
Public.

Description

Implement filter primitive subregion for reference CSS filters. This required copying determineFilterPrimitiveSubregion() from RenderSVGResourceFilter out into FilterEffect, and modifying it slightly (to accommodate CSS's inflatable result rects; see below). This also required refactoring m_filterRegion and m_absoluteFilterRegion into the Filter base class, and giving its accessors sane names. There was also a call to setClipsToBounds(false) for the FilterOperations nodes converted to FilterEffects. However, this is not correct for reference filters -- they should clip to their filter primitive subregion. (In fact, it was only being called on the final node in a reference effect chain, just to be super-confusing.) This was fixed by calling setEffectBoundaries() while building the reference filter, and skipping the call to setClipsToBounds(false). The filter outsets for reference filters are now computed by recursively traversing the DAG, so the graphics layers will be created at the appropriately-inflated size, as is done for shorthand filters. The actual per-FilterEffect-subclass computation (mapRect) was refactored from the existing code to compute absolutePaintRects, and made bidirectional. It's used for computing outsets in the forward direction, and source rects in the reverse direction. We now no longer call setMaxEffectsRects() directly, but instead call determineFilterPrimitiveSubregion() recursively on the output node. This will set the maxEffectRect as well as the absolutePaintRect, inflating and clipping as necessary. This uses the filter primitive subregion (if set, as in the reference filter case), or the source rect (if not). Note that this patch only supports filter primitive subregion, not filter effect region, which still defaults to 100% of the filterBoxRect. Finally, I noticed that the colorspace for reference filters was not being correctly set either (same place as the setClipsToBounds() call). That will require a bunch of rebaselines, however, so it'll be fixed in a separate patch. BUG=237518 R=schenney@chromium.org First committed: https://src.chromium.org/viewvc/blink?view=rev&revision=150342 Reverted: http://src.chromium.org/viewvc/blink?view=rev&rev=150369 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=150433

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix expectations, update to ToT #

Patch Set 3 : WIP: added toSVGFilterElement; fixed correctness; still needs tests #

Patch Set 4 : Rebased to ToT #

Patch Set 5 : WIP: Refactor m_filterRegion and m_absoluteFilterRegion into the Filter base class, and give the a… #

Patch Set 6 : WIP: move filter rect adjustment to computeSourceImageRectEtc; remove m_paintOffset (redundant), fi… #

Patch Set 7 : WIP: refactor determineFilterPrimitiveSubregion() #

Patch Set 8 : Rebased to ToT #

Patch Set 9 : WIP: extend outset computation into FilterEffect, so we get auto-margins. #

Patch Set 10 : Remove stale comments #

Patch Set 11 : Reworked to better handle nested subregions. #

Patch Set 12 : Change the subregion tests a bit. Remove some commented-out code. Restore the m_repaintRect optimiz… #

Patch Set 13 : Rearrange the whitespace in the repaint tests, to make them cross-platform #

Patch Set 14 : New test results for repaint tests #

Patch Set 15 : New test results for realz #

Patch Set 16 : Rebased to ToT #

Patch Set 17 : Don't use negative outsets for reference filters. Fixes effect-reference-hw (feOffset test). #

Patch Set 18 : Rebased to ToT #

Total comments: 2

Patch Set 19 : add OVERRIDE FINAL to all mapRect overrides; fix Debug build #

Patch Set 20 : Fix test failures: ReferenceFilterOperation should ref the Filter which owns its FilterEffects #

Unified diffs Side-by-side diffs Delta from patch set Stats (+690 lines, -83 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-gaussianblur.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-gaussianblur-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-gaussianblur-xonly.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-gaussianblur-xonly-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-gaussianblur-yonly.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-gaussianblur-yonly-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-merge.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +51 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-merge-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-morphology.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-morphology-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-morphology-xonly.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-morphology-xonly-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-morphology-yonly.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-morphology-yonly-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-offset.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +41 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-repaint-offset-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-subregion.html View 1 2 3 4 5 6 7 8 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/css3/filters/effect-reference-subregion-nested.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +31 lines, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FEDropShadow.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FEDropShadow.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +24 lines, -12 lines 0 comments Download
M Source/core/platform/graphics/filters/FEGaussianBlur.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FEGaussianBlur.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -9 lines 0 comments Download
M Source/core/platform/graphics/filters/FEMorphology.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FEMorphology.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -4 lines 0 comments Download
M Source/core/platform/graphics/filters/FEOffset.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FEOffset.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FETile.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/graphics/filters/Filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +10 lines, -3 lines 0 comments Download
M Source/core/platform/graphics/filters/FilterEffect.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +15 lines, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FilterEffect.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +78 lines, -0 lines 0 comments Download
M Source/core/platform/graphics/filters/FilterOperation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +3 lines, -1 line 0 comments Download
M Source/core/platform/graphics/filters/FilterOperations.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +16 lines, -1 line 0 comments Download
M Source/core/rendering/FilterEffectRenderer.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -17 lines 0 comments Download
M Source/core/rendering/FilterEffectRenderer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 13 chunks +31 lines, -23 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp View 1 2 3 4 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/svg/SVGFilterElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +7 lines, -0 lines 0 comments Download
M Source/core/svg/graphics/filters/SVGFilter.h View 1 2 3 4 2 chunks +0 lines, -5 lines 0 comments Download
M Source/core/svg/graphics/filters/SVGFilter.cpp View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Stephen White
schenney@: PTAL. Thanks!
7 years, 7 months ago (2013-05-02 16:24:05 UTC) #1
Stephen Chennney
I mostly wondering about testing, plus our desire to avoid all static_cast for security reasons. ...
7 years, 7 months ago (2013-05-02 16:53:55 UTC) #2
Stephen White
On 2013/05/02 16:53:55, Stephen Chenney wrote: > I mostly wondering about testing, plus our desire ...
7 years, 7 months ago (2013-05-02 18:00:20 UTC) #3
Stephen White
PTAL. I've reworked the code significantly, and added more tests. I think it should be ...
7 years, 7 months ago (2013-05-10 20:41:54 UTC) #4
krit
On 2013/05/10 20:41:54, Stephen White wrote: > PTAL. I've reworked the code significantly, and added ...
7 years, 7 months ago (2013-05-10 20:50:58 UTC) #5
Stephen White
On 2013/05/10 20:50:58, krit wrote: > I'll take a look on Monday. Won't work today ...
7 years, 7 months ago (2013-05-13 18:12:03 UTC) #6
Stephen White
Stephen, would you mind taking another look?
7 years, 7 months ago (2013-05-13 21:54:26 UTC) #7
Stephen Chennney
Good tests, good refactor. Please add OVERRIDE FINAL on all the mapRect() implementations and then ...
7 years, 7 months ago (2013-05-14 17:07:13 UTC) #8
Stephen White
Thanks for your review. This also fixes the Debug build, which I broke a few ...
7 years, 7 months ago (2013-05-14 17:41:00 UTC) #9
Stephen Chennney
lgtm
7 years, 7 months ago (2013-05-14 18:02:28 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/senorblanco@chromium.org/14652016/97040
7 years, 7 months ago (2013-05-14 18:31:50 UTC) #11
Stephen White
Committed patchset #19 manually as r150342 (presubmit successful).
7 years, 7 months ago (2013-05-14 20:07:44 UTC) #12
eseidel
This may have caused 2 crashes: css3/filters/effect-reference-ordering-hw.html css3/filters/effect-reference-composite.html
7 years, 7 months ago (2013-05-14 21:46:40 UTC) #13
Stephen White
On 2013/05/14 21:46:40, eseidel wrote: > This may have caused 2 crashes: > css3/filters/effect-reference-ordering-hw.html > ...
7 years, 7 months ago (2013-05-15 01:22:28 UTC) #14
Stephen Chennney
LGTM. My primary concern is that we'll create circular references, and it seems there are ...
7 years, 7 months ago (2013-05-15 13:50:56 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/senorblanco@chromium.org/14652016/120001
7 years, 7 months ago (2013-05-15 13:55:43 UTC) #16
commit-bot: I haz the power
7 years, 7 months ago (2013-05-15 14:55:25 UTC) #17
Message was sent while issue was closed.
Change committed as 150433

Powered by Google App Engine
This is Rietveld 408576698