DescriptionLimit size of scaled layer rects in ScrollbarLayer to content_bounds().
ScrollbarLayer allocates textures for the back-/fore-tracks that are sized to
the content_bounds.
When a non-integer contents_scale is applied to a ScrollbarLayer at present, it
may paint bitmaps that are larger than the texture size. This can happen when
the following conditions are true:
1) The scrollbar location is non-zero, and
2) the contents scale is non-integer.
In this case, the bitmap is painted to a rect that is created from both a scaled
location and the content_bounds(), and then enlarged using ToEnclosingRect().
The enlarging operation can result in a paint rect that is larger-by-one than
the content_bounds() in one or two dimensions, leading to an error when
attempting to upload the bitmap to the texture.
Non-integer content_bounds() can occur either through non-integer page scales
encountered during pinch-zoom, or non-integer device scale factors (1.4 and
1.8 are common on Windows), or a combination of both.
This CL clamps the scaled layer rects produced internally in ScrollbarLayer so
they do not exceed the content_bounds().
BUG=229614
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=201392
Patch Set 1 #Patch Set 2 : Rebased to fix merge conflict. #
Messages
Total messages: 11 (0 generated)
|