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..ae8efd00bdbbf11c9b77b92ad73a794bd1b02b31 100644 |
| --- a/cc/layers/painted_scrollbar_layer.cc |
| +++ b/cc/layers/painted_scrollbar_layer.cc |
| @@ -169,7 +169,7 @@ gfx::Rect PaintedScrollbarLayer::ScrollbarLayerRectToContentRect( |
| const gfx::Rect& layer_rect) const { |
| // Don't intersect with the bounds as in LayerRectToContentRect() because |
| // layer_rect here might be in coordinates of the containing layer. |
| - gfx::Rect expanded_rect = gfx::ScaleToEnclosingRect( |
| + gfx::Rect expanded_rect = gfx::ScaleToEnclosedRect( |
|
danakj
2014/02/10 19:17:28
I don't believe this is correct.
Say you have a s
|
| layer_rect, contents_scale_y(), contents_scale_y()); |
| // We should never return a rect bigger than the content_bounds(). |
| gfx::Size clamped_size = expanded_rect.size(); |
| @@ -248,6 +248,8 @@ UIResourceBitmap PaintedScrollbarLayer::RasterizeScrollbarPart( |
| skcanvas.scale(SkFloatToScalar(contents_scale_x()), |
| SkFloatToScalar(contents_scale_y())); |
| + // Since rect is an enclosed rect around the scaled layer_rect, we must take |
| + // the enclosing rect when unscaling so we don't lose a pixel in truncation. |
| gfx::Rect layer_rect = gfx::ScaleToEnclosingRect( |
|
danakj
2014/02/10 19:17:28
It seems like this one is the one we should switch
danakj
2014/02/10 19:19:37
A possible nice change would be to pass in the lay
bokan
2014/02/11 00:01:53
If the one above is enclosed then it can be clippe
|
| rect, 1.f / contents_scale_x(), 1.f / contents_scale_y()); |
| SkRect layer_skrect = RectToSkRect(layer_rect); |