W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2006

[whatwg] proposed canvas 2d API additions

From: Vladimir Vukicevic <vladimirv@gmail.com>
Date: Tue, 16 May 2006 02:49:37 -0700
Message-ID: <9540d010605160249v6eb33bddk600106f8941f63c1@mail.gmail.com>
On 5/16/06, Arve Bersvendsen <arveb at opera.com> wrote:
> Again, and this goes back to what's already been said about the RGBA
> values in ImageData: Using floats for x,y,w,h will for all practical
> purposes exclude canvas from ever being possible to implement in a
> meaningful way on systems without hardware FPUs.
>
> I realise that we can go on forever debating whether having an API that
> "facilitates data loss" is good or bad, but the fact is that it is
> possible for authors to code around this, and get enough performance to
> perform on weaker devices.

Floats are already used throught the rest of the canvas API; this
should be no slower than calling moveTo() or similar. You're
internally rounding the float that's passed in to an integer that
refers to the actual pixel coordinate.  All subsequent implementaiton
operations happen in terms of ints, so there aren't any actual
operations on floating point, no?  Your JS parser/interpreter is
probably free to use fixed point here as well.

   - Vlad
Received on Tuesday, 16 May 2006 02:49:37 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:27 UTC