Commit 56f9d347 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Fixing overlap checking for layers with pixel-moving backdrop-filters

Previous to this CL, overlap checking was incorrect for layers
that had a pixel-moving backdrop-filter applied. The WPT test
external/wpt/css/filter-effects/backdrop-filter-paint-order.html
was the best indicator of this bug - a backdrop-filter painted
*after* adjoining but not overlapping content would be improperly
merged, and blurred content would be observed. This is now fixed.

Bug: 622128
Change-Id: I07539f5fbdc9c6e9cfaf6d4116b8de3dd62d1e94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1607101
Commit-Queue: Philip Rogers <pdr@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659494}
parent 6b954f12
......@@ -2615,10 +2615,18 @@ LayoutRect PaintLayer::BoundingBoxForCompositingOverlapTest() const {
// TODO(trchen): Layer fragmentation is inhibited across compositing boundary.
// Should we return the unfragmented bounds for overlap testing? Or perhaps
// assume fragmented layers always overlap?
return OverlapBoundsIncludeChildren()
? BoundingBoxForCompositingInternal(
*this, nullptr, kNeverIncludeTransformForAncestorLayer)
: FragmentsBoundingBox(this);
LayoutRect bounding_box =
OverlapBoundsIncludeChildren()
? BoundingBoxForCompositingInternal(
*this, nullptr, kNeverIncludeTransformForAncestorLayer)
: FragmentsBoundingBox(this);
const ComputedStyle& style = GetLayoutObject().StyleRef();
if (style.HasBackdropFilter() &&
style.BackdropFilter().HasFilterThatMovesPixels()) {
bounding_box = EnclosingLayoutRect(
style.BackdropFilter().MapRect(FloatRect(bounding_box)));
}
return bounding_box;
}
bool PaintLayer::OverlapBoundsIncludeChildren() const {
......
......@@ -1617,7 +1617,6 @@ crbug.com/538697 [ Win ] printing/webgl-oversized-printing.html [ Failure Crash
crbug.com/497522 css3/filters/backdrop-filter-boundary.html [ Failure ]
crbug.com/497522 css3/filters/backdrop-filter-bleeding.html [ Failure ]
crbug.com/497522 css3/filters/backdrop-filter-svg.html [ Failure ]
crbug.com/497522 external/wpt/css/filter-effects/backdrop-filter-paint-order.html [ Failure ]
# ====== Backdrop-filter related tests END ======
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment