DescriptionDrop Image::setContainerSize()
Prior to this patch, the only user of Image::setContainerSize() was
HTMLImageElement::getSourceImageForCanvas().
SVGImage, one the relevant kinds of image that return true for
Image::usesContainerSize(), is a shared resource between all places in
the document pointing to the same SVG image. Each time a SVGImage is
drawn, the container size it is drawn relative to is saved. This may
cause subsequent paints of the same SVGImage to re-use the old
container size unless a new one is provided.
The old code addressed just that. When it detected that there was no
layout object attached, it overwrote the old container size with the
size of the image itself, to avoid reusing an old container size.
The new code uses the SVGImageForContainer wrapper to insert the image
size as container size. This closes the loop for using _any_ container
size at all from the Image element. It seems unreasonable that the
layout'ed size should have anything to do with what's drawn to the
canvas anyway.
GeneratedImage had a setContainerSize() implementation too, which is
removed in this patch. It's suspected that this implementation was
unused since a generated image can't be set on a HTMLImageElement
directly.
BUG=563923
Committed: https://crrev.com/9503d96104a3cb851fc4d4fe28c065edc7e17db3
Cr-Commit-Position: refs/heads/master@{#363437}
Patch Set 1 #
Total comments: 7
Patch Set 2 : Move wrapping to CanvasRenderingContext2D; fix patterns #Patch Set 3 : Back to ps#1 way, with fixed is_expensive test #Dependent Patchsets: Messages
Total messages: 40 (14 generated)
|