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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.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/paint/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index cbfc784b6a080149d3e4c73a8f8bbfb774aff3b7..8f8df291a2cfd6ee58aef0aabae09fff9e61139a 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -835,10 +835,18 @@ PaintResult PaintLayerPainter::PaintFragmentByApplyingTransform(
delta.MoveBy(fragment_translation);
TransformationMatrix transform(
paint_layer_.RenderableTransform(painting_info.GetGlobalPaintFlags()));
- IntPoint rounded_delta = RoundedIntPoint(delta);
- transform.PostTranslate(rounded_delta.X(), rounded_delta.Y());
- LayoutSize adjusted_sub_pixel_accumulation =
- painting_info.sub_pixel_accumulation + (delta - rounded_delta);
+ LayoutSize adjusted_sub_pixel_accumulation;
+ if (transform.IsIdentityOrTranslation()) {
+ IntPoint rounded_delta = RoundedIntPoint(delta);
+ transform.PostTranslate(rounded_delta.X(), rounded_delta.Y());
+ adjusted_sub_pixel_accumulation =
+ painting_info.sub_pixel_accumulation + (delta - rounded_delta);
+ } else {
+ // We can't pass subpixel offsets through a non-translation transform.
+ // Bake the offsets into the transform instead.
+ delta += painting_info.sub_pixel_accumulation;
+ transform.PostTranslate(delta.X().ToDouble(), delta.Y().ToDouble());
+ }
// TODO(jbroman): Put the real transform origin here, instead of using a
// matrix with the origin baked in.

Powered by Google App Engine
This is Rietveld 408576698