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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2868933002: Don't pass subpixel offsets through non-translation transforms (composited case) (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
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 2d2167ead07fe3179ddd06a2d1ff2c1169700c52..ca181cfe9f1aa74df2c787577f55ffbc745a4bf0 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -892,8 +892,14 @@ void CompositedLayerMapping::ComputeBoundsOfOwningLayer(
IntPoint(offset_from_composited_ancestor.X().Round(),
offset_from_composited_ancestor.Y().Round());
- LayoutSize subpixel_accumulation =
- offset_from_composited_ancestor - snapped_offset_from_composited_ancestor;
+ LayoutSize subpixel_accumulation;
+ if (!owning_layer_.Transform() ||
+ owning_layer_.Transform()->IsIdentityOrTranslation()) {
+ subpixel_accumulation = offset_from_composited_ancestor -
+ snapped_offset_from_composited_ancestor;
+ }
+ // Otherwise discard the sub-pixel remainder because paint offset can't be
+ // transformed by a non-translation transform.
owning_layer_.SetSubpixelAccumulation(subpixel_accumulation);
// Move the bounds by the subpixel accumulation so that it pixel-snaps
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698