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

2012-12-18 Thread Kevin Gadd
Is it possible to expose the width/height of an ImageBitmap, or even expose all the rectangle coordinates? Exposing width/height would be nice for parity with Image and Canvas when writing functions that accept any drawable image source. Thanks for the prompt action here, this looks like a

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

2012-12-18 Thread Kevin Gadd
thread in the first place. -kg On Tue, Dec 18, 2012 at 7:12 AM, Kevin Gadd kevin.g...@gmail.com wrote: Is it possible to expose the width/height of an ImageBitmap, or even expose all the rectangle coordinates? Exposing width/height would be nice for parity with Image and Canvas when writing

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

2012-12-18 Thread Kevin Gadd
Novosad ju...@chromium.org wrote: On Tue, Dec 18, 2012 at 10:17 AM, Kevin Gadd kevin.g...@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

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

2012-12-17 Thread Kevin Gadd
A simple way to create an Image that represents a subregion of another Image or Canvas would be a nice solution here, since for implementations that need a temporary image anyway this lets them ensure it's only created once, and it lets you avoid the costs associated with temporary canvases. A few

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

2012-12-17 Thread Kevin Gadd
On Mon, Dec 17, 2012 at 1:23 PM, Rik Cabanier caban...@gmail.com wrote: On Mon, Dec 17, 2012 at 11:49 AM, Justin Novosad ju...@chromium.org wrote: 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

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

2012-12-10 Thread Kevin Gadd
(Sorry if you get this twice. For some reason my first reply was bounced by the listserv?) On Mon, Dec 10, 2012 at 10:24 AM, Ian Hickson i...@hixie.ch wrote: There's two ways to do scaled sprites with drawImage(): have a border of transparent black around each sprite, or copy the data out of

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

2012-12-10 Thread Kevin Gadd
I can't speak for the most common approach in HTML5 games, but using a temporary surface for drawing sprites is definitely not a common approach in non-canvas games. I've never seen it proposed before this thread for canvas dev, either, but I'm not an expert there. This is at least an area where

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

2012-08-20 Thread Kevin Gadd
Hi, I've been digging into an inconsistency between various browsers' Canvas implementations and I think the spec might be allowing undesirable behavior here. The current version of the spec says