[whatwg] Canvas pixel manipulation and performance

On Sun, Nov 29, 2009 at 11:05 AM, Philip Taylor <excors+whatwg at gmail.com> wrote:
> On Sun, Nov 29, 2009 at 6:59 PM, Kenneth Russell <kbr at google.com> wrote:
>> On Sat, Nov 28, 2009 at 9:47 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
>>> Are they even byte stores, necessarily? ?I know in Gecko imagedata is just a
>>> JS array at the moment; it stores each of R,G,B,A as a JS Number (with the
>>> usual "if it's an integer store as an integer" optimization arrays do).
>>> ?That might well change in the future, and I hope it does, but that's the
>>> current code.
>>>
>>> I can't speak to what the behavior is in Webkit, and in particular whether
>>> it's even the same when using V8 vs Nitro.
>>
>> In Chromium (WebKit + V8), CanvasPixelArray property stores write
>> individual bytes to memory. WebGLByteArray and WebGLUnsignedByteArray
>> behave similarly but have simpler clamping semantics.
>
> Would it be helpful (for simplicity or performance or consistency etc)
> to change the specification of CanvasPixelArray to have those "simpler
> clamping semantics"? (I don't expect there would be compatibility
> problems with changing it now, particularly since Firefox doesn't
> implement clamping at all in CPA.)

It would. Vladimir Vukicevic from Mozilla was planning to raise this
issue with the whatwg upon release of the first public draft of the
WebGL spec.

-Ken

Received on Sunday, 29 November 2009 11:21:27 UTC