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

Rik Cabanier cabanier at gmail.com
Tue Dec 18 20:39:11 PST 2012


On Tue, Dec 18, 2012 at 1:14 PM, Robert O'Callahan <robert at ocallahan.org>wrote:

> On Wed, Dec 19, 2012 at 4:17 AM, Kevin Gadd <kevin.gadd at gmail.com> wrote:
>
>> Sorry, upon reading over the ImageBitmap part of the spec again I'm
>> confused: Why is constructing an ImageBitmap asynchronous? I thought
>> any decoding isn't supposed to happen until drawImage, so I don't
>> really understand why this operation involves a callback and a delay.
>> Making ImageBitmap creation async means that you *cannot* use this as
>> a replacement for drawImage source rectangles unless you know all
>> possible source rectangles in advance. This is not possible for many,
>> many use cases (scrolling through a bitmap would be one trivial
>> example).
>>
>
> I think this is a real problem.
>
> It seems to me a synchronous constructor that creates an ImageBitmap for a
> subimage of another ImageBitmap (but not other kind of source!) will be
> needed.
>
>
Did you mean to say a synchronous constructor?
Reading the new spec (
http://www.whatwg.org/specs/web-apps/current-work/#imagebitmap), I still
fail to see how this is better than a drawimage with dx=dy=0 and
dw/dy=canvas width/height



More information about the whatwg mailing list