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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2847873002: Don't pass subpixel offsets through non-translation transforms (Closed)
Patch Set: rebaseline-cl Created 3 years, 8 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/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 548907dd20a6eab1e2352cd7e13ca31bc82a21bd..45c06950406da7521b285891732b401c253e2b31 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1200,8 +1200,8 @@ bool LayoutBox::MapVisualRectToContainer(
// 2. Container offset.
// 3. Container scroll offset.
// 4. Perspective applied by container.
- // 5. Transform flattening.
- // 6. Expansion for pixel snapping.
+ // 5. Expansion for pixel snapping.
+ // 6. Transform flattening.
chrishtr 2017/05/01 20:22:28 Not an issue you created, but could you make this
Xianzhu 2017/05/01 22:03:32 The steps 1 to 4 are actually generate the transfo
// 7. Container clip.
// 1. Transform.
@@ -1237,11 +1237,8 @@ bool LayoutBox::MapVisualRectToContainer(
transform = perspective_matrix * transform;
}
- // 5. Transform flattening.
- transform_state.ApplyTransform(transform, accumulation);
-
- // 6. Expansion for pixel snapping.
- // Use enclosingBoundingBox because we cannot properly compute pixel
+ // 5. Expansion for pixel snapping.
+ // Use EnclosingBoundingBox because we cannot properly compute pixel
chrishtr 2017/04/28 23:26:44 Why does this have to be first now? Don't see it y
Xianzhu 2017/05/01 18:13:42 This is to fix the MapToVisualRectInAncestorSpace(
chrishtr 2017/05/01 20:22:28 Oh I see. Yes I did make this change in 2727093002
// snapping for painted elements within the transform since we don't know
// the desired subpixel accumulation at this point, and the transform may
// include a scale.
chrishtr 2017/05/01 20:22:28 Please add a comment saying that pixel-snapping li
Xianzhu 2017/05/01 22:03:32 Done.
@@ -1251,6 +1248,13 @@ bool LayoutBox::MapVisualRectToContainer(
FloatQuad(transform_state.LastPlanarQuad().EnclosingBoundingBox()));
}
+ // 6. Transform flattening.
+ transform_state.ApplyTransform(transform, accumulation);
+ if (!preserve3D) {
+ transform_state.Flatten();
+ transform_state.SetQuad(FloatQuad(transform_state.LastPlanarQuad()));
+ }
+
// 7. Container clip.
if (container_object->IsBox() && container_object != ancestor &&
container_object->HasClipRelatedProperty()) {

Powered by Google App Engine
This is Rietveld 408576698