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

Issue 2232013002: CSS filters: fix filtered parent with animated transform child.

Created:
4 years, 4 months ago by Stephen White
Modified:
4 years, 4 months ago
Reviewers:
chrishtr
CC:
darktears, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, chromium-reviews, dshwang, eae+blinkwatch, Eric Willigers, fs, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, rjwright, shans, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@filter-bounds-transformed-composited-child
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CSS filters: fix filtered parent with animated transform child. When an element with a reference filter has a child element with an animated transform, we need to invalidate the reference filter on each animation frame. This is because the changing child position can change the reference box used for filter region computations. This requires disabling compositor animations for all nodes with reference filter parents, since we need to them to run blink-side to trigger the invalidation. It also means we must traverse up the hierarchy to discover such filters and invalidate them. BUG=620394 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Patch Set 1 #

Total comments: 2

Patch Set 2 : Update to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -8 lines) Patch
A + third_party/WebKit/LayoutTests/css3/filters/filter-region-animated-child.html View 1 2 chunks +23 lines, -4 lines 0 comments Download
A + third_party/WebKit/LayoutTests/css3/filters/filter-region-animated-child-expected.html View 1 2 chunks +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/animation/CompositorAnimations.cpp View 1 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp View 1 1 chunk +5 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 8 (3 generated)
Stephen White
chrishtr@: PTAL. This is a followup patch to https://codereview.chromium.org/2230593002/ which handles the animated case. Let ...
4 years, 4 months ago (2016-08-10 20:19:54 UTC) #3
chrishtr
This patch addresses what looks like two bugs: 1. can't run reference filters on the ...
4 years, 4 months ago (2016-08-11 01:23:59 UTC) #4
chrishtr
On 2016/08/11 at 01:23:59, chrishtr wrote: > This patch addresses what looks like two bugs: ...
4 years, 4 months ago (2016-08-11 02:54:27 UTC) #5
Stephen White
https://codereview.chromium.org/2232013002/diff/1/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp File third_party/WebKit/Source/core/animation/CompositorAnimations.cpp (right): https://codereview.chromium.org/2232013002/diff/1/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp#newcode248 third_party/WebKit/Source/core/animation/CompositorAnimations.cpp:248: if (layoutObject->styleRef().filter().hasReferenceFilter()) { On 2016/08/11 01:23:59, chrishtr wrote: > ...
4 years, 4 months ago (2016-08-11 15:17:12 UTC) #6
Stephen White
4 years, 4 months ago (2016-08-11 15:20:54 UTC) #7
On 2016/08/11 01:23:59, chrishtr wrote:
> This patch addresses what looks like two bugs:
> 
> 1. can't run reference filters on the compositor thread because they may
involve
> computing
> size of transformed children and storing them in the filter graph.
> 
> 2. Need to update reference filters whenever geometry of the subtree changes.
> 
> #1 is solved I think via the CompositorAnimations change.

Correct.

> Marking for compositing is probably already taken care of by existing
triggers.
> 
> How does your cl fix #2 for paint? In particular, how does it mark objects
which
> contain one that changes style as needing paint when the object's bounds
change?

That's the CompositedLayerMapping change: it rebuilds the filter graphs of all
parent elements when a child transform changes.

> 
> ...
> 
> This whole thing could avoided if was not required to compute the bounds of
the
> reference box for filters. can Skia be taught how to do that at raster time?
cc
> could do something similar at draw time.

Skia currently expresses its crop rect (the equivalent of filter region) in
terms 
of (essentially) CSS pixels.

As noted above, the filter region (on the <filter> node, and also used to
compute
the filter primitive subregion for each filter primitive) is expressed as a
fraction 
of the bounding box of the filtered element.

The only ways I can see to make this work are:

1) Convert those fractions (and other SVG units) to CSS pixels at paint time
relative to the computed total bounds of the filtered element, which is what I'm

doing here.

2) Teach Skia how to apply a fractional crop rect, and then apply those
fractions to the layer size received in cc. This assumes that the layer size
by the time we get to cc is exactly the correct bounding box.

Powered by Google App Engine
This is Rietveld 408576698