Use Image::SizeAsFloat() and unsnapped rectangle in ImagePainter
The pixel-snapping of the destination rectangle can end up distorting the geometry use for painting an SVG image preserveAspectRatio is used - the larger the aspect ratio, the larger the error. By passing the unsnapped rectangle to LayoutImageResource::GetImage, and using Image::SizeAsFloat() to compute the source rectangle of the image, e can minimize the error and allow the Image in question (an SVGImage) to perform compensation for the difference in aspect ratio between the snapped and unsnapped rectangles. This means that the painted result will better approximate the intended rendering. Also clean up accesses to the LayoutImageResource and ImageResourceContent by adding and using local variables for them. Bug: 812239 Change-Id: I0778648e7dd6fcca778a95123509f15b3519564c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1969831Reviewed-by:Stephen Chenney <schenney@chromium.org> Commit-Queue: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#726375}
Showing



