Commit 8b3bc88c authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Invalidate painting layer when transform invertibility changes

PaintLayerPainter::PaintLayerWithAdjustedRoot skips painting of a layer
whose transform is not invertible, so we need to repaint the layer when
invertible status changes.

Bug: 853047
Change-Id: Ie24af4de933336e888065e993e473ab8ed4711a4
Reviewed-on: https://chromium-review.googlesource.com/1105298Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568269}
parent bfcc445d
<!DOCTYPE html>
<div id="target" style="width: 200px; height: 200px; background: blue"></div>
<!DOCTYPE html>
<div id="target" style="width: 100px; height: 100px; background: blue; transform: scale(0); transform-origin: 0 0"></div>
<script src="../../../resources/run-after-layout-and-paint.js"></script>
<script>
runAfterLayoutAndPaint(function() {
target.style.transform = "scale(2)";
}, true);
</script>
......@@ -431,11 +431,30 @@ void LayoutBoxModelObject::StyleDidChange(StyleDifference diff,
}
if (old_style && RuntimeEnabledFeatures::SlimmingPaintV175Enabled() &&
old_style->BackfaceVisibility() != StyleRef().BackfaceVisibility() &&
HasLayer()) {
// We need to repaint the layer to update the backface visibility value of
// the paint chunk.
Layer()->SetNeedsRepaint();
HasLayer() && !Layer()->NeedsRepaint()) {
if (old_style->BackfaceVisibility() != StyleRef().BackfaceVisibility()) {
// We need to repaint the layer to update the backface visibility value of
// the paint chunk.
Layer()->SetNeedsRepaint();
} else if (diff.TransformChanged() &&
(RuntimeEnabledFeatures::SlimmingPaintV2Enabled() ||
!Layer()->HasStyleDeterminedDirectCompositingReasons())) {
// PaintLayerPainter::PaintLayerWithAdjustedRoot skips painting of a layer
// whose transform is not invertible, so we need to repaint the layer when
// invertible status changes.
TransformationMatrix old_transform;
TransformationMatrix new_transform;
old_style->ApplyTransform(
old_transform, LayoutSize(), ComputedStyle::kExcludeTransformOrigin,
ComputedStyle::kExcludeMotionPath,
ComputedStyle::kIncludeIndependentTransformProperties);
StyleRef().ApplyTransform(
new_transform, LayoutSize(), ComputedStyle::kExcludeTransformOrigin,
ComputedStyle::kExcludeMotionPath,
ComputedStyle::kIncludeIndependentTransformProperties);
if (old_transform.IsInvertible() != new_transform.IsInvertible())
Layer()->SetNeedsRepaint();
}
}
}
......
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