Chromium Code Reviews| 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 @@ |
| 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; |
|
chrishtr
2017/05/04 18:39:02
Perhaps the bug here that caused issue 716163 is t
|
| + 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. |