Chromium Code Reviews| Index: cc/layers/painted_scrollbar_layer.cc |
| diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc |
| index 71a37d48883f8f07d592ff561e288e344917ed65..493e74adb24769f1999e9ffd1e0a536ac839d927 100644 |
| --- a/cc/layers/painted_scrollbar_layer.cc |
| +++ b/cc/layers/painted_scrollbar_layer.cc |
| @@ -244,7 +244,13 @@ UIResourceBitmap PaintedScrollbarLayer::RasterizeScrollbarPart( |
| skbitmap.allocPixels(); |
| SkCanvas skcanvas(skbitmap); |
| - skcanvas.translate(SkFloatToScalar(-rect.x()), SkFloatToScalar(-rect.y())); |
| + |
| + // Skia will round to the nearest pixel on scaling, so we need to take that |
| + // into account when translating back to the origin. |
| + float adjustmentX = round(location_.x() * contents_scale_x()); |
|
danakj
2014/01/31 18:58:43
Using location_ here looks wrong, the input |rect|
bokan
2014/01/31 19:00:40
yikes! You're right, I'll think about this some mo
|
| + float adjustmentY = round(location_.y() * contents_scale_y()); |
| + skcanvas.translate(SkFloatToScalar(-adjustmentX), |
| + SkFloatToScalar(-adjustmentY)); |
| skcanvas.scale(SkFloatToScalar(contents_scale_x()), |
| SkFloatToScalar(contents_scale_y())); |