Re: [whatwg] I believe source rectangles for HTML5 Canvas drawImage are specified incorrectly

> Isn't this the same as what Ian suggested: copy it to a temporary canvas
> and use the temporary canvas scales.
> It seems that you can optimize that case too.
>

Hmm... It would one of those optimizations that only works if you perform
the secret handshake just right.
If I understand correctly, the hypothetical optimization would work
something like this: When a 2d canvas context is created, do not allocate a
backing store immediately. If the first draw operation into the canvas is a
drawImage from an image element and covers the entire canvas, then use a
shallow copy of the bitmap as the backing store. If anything else is drawn
into the canvas, then a proper backing store should be allocated and used.
I guess it could work... but I would fear that this behavior would be
perceived as idiosyncratic.

Received on Monday, 17 December 2012 19:50:01 UTC