Compensate for source scaling in hidpi mode

In crrev.com/379801 scaling of hidpi nine piece image grids was
changed from using the real image size to using the "layout'ed" image
size (i.e. image size compensated by image scale factor) since that is
what Image::imageSize() returns. Instead the computed source rect was
scaled afterwards, right before drawing.

If GraphicsContext.drawTiledImage() is called with (stretch, stretch)
as tile rules, it ignores the passed scale factor and computes the
scale factor between source and destination itself. However, if one
rule is stretch and the other one repeat, or if both are repeat, the
tile scale factor is used when drawing and the relation between the
sizes of source and dest ignored.

What was missing from crrev.com/379801 was to compensate for the image
scale factor by adjusting tileScale. That meant that the (stretch,
stretch) worked fine but as soon as one repeat was specified, the
scale factor was wrong.

BUG=601544

Review URL: https://codereview.chromium.org/1901103002

Cr-Commit-Position: refs/heads/master@{#388451}
8 files changed