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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2862053002: Reland of Don't pass subpixel offsets through non-translation transforms (Closed)
Patch Set: - Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index 5fabc8b6b331dd680bc71dcfeb766323e5534803..30aaab954e478d9f82adc597e6c996741d6e8c78 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -269,6 +269,17 @@ void PaintPropertyTreeBuilder::UpdatePaintOffsetTranslation(
RoundedIntPoint(context.current.paint_offset);
LayoutPoint fractional_paint_offset =
LayoutPoint(context.current.paint_offset - rounded_paint_offset);
+ if (fractional_paint_offset != LayoutPoint()) {
+ // If the object has a non-translation transform, discard the fractional
+ // paint offset which can't be transformed by the transform.
+ TransformationMatrix matrix;
+ object.StyleRef().ApplyTransform(
+ matrix, LayoutSize(), ComputedStyle::kExcludeTransformOrigin,
+ ComputedStyle::kIncludeMotionPath,
+ ComputedStyle::kIncludeIndependentTransformProperties);
+ if (!matrix.IsIdentityOrTranslation())
+ fractional_paint_offset = LayoutPoint();
+ }
force_subtree_update |= properties.UpdatePaintOffsetTranslation(
context.current.transform,
@@ -283,8 +294,8 @@ void PaintPropertyTreeBuilder::UpdatePaintOffsetTranslation(
object.IsLayoutView()) {
context.absolute_position.transform = properties.PaintOffsetTranslation();
context.fixed_position.transform = properties.PaintOffsetTranslation();
- context.absolute_position.paint_offset = LayoutPoint();
- context.fixed_position.paint_offset = LayoutPoint();
+ context.absolute_position.paint_offset = fractional_paint_offset;
+ context.fixed_position.paint_offset = fractional_paint_offset;
}
} else {
if (auto* properties = object.GetMutableForPainting().PaintProperties())

Powered by Google App Engine
This is Rietveld 408576698