Bug 39100 - Implement TypedArray BYTES_PER_ELEMENT
Summary: Implement TypedArray BYTES_PER_ELEMENT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-13 18:20 PDT by Kenneth Russell
Modified: 2010-06-10 11:53 PDT (History)
5 users (show)

See Also:


Attachments
Patch (31.56 KB, patch)
2010-06-09 16:52 PDT, Kenneth Russell
dglazkov: review+
kbr: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2010-05-13 18:20:01 PDT
The constant value BYTES_PER_ELEMENT needs to be added to the various TypedArray interfaces.
Comment 1 Kenneth Russell 2010-06-09 16:52:28 PDT
Created attachment 58308 [details]
Patch

From the ChangeLog:

Implemented BYTES_PER_ELEMENT on all ArrayBufferView subclasses. Required bug fixes to JSC bindings' custom constructors. Updated fast/canvas/webgl/array-unit-tests.html to verify. Ran all WebGL layout tests in Safari and Chromium.
Comment 2 Kenneth Russell 2010-06-10 10:43:23 PDT
Note: the modifications to the JSC custom bindings came from looking at the autogenerated JSCSSValue.{cpp.h}, which has values like CSS_INHERIT attached to its prototype. From experimentation these are the minimal changes to the custom constructors which allow the BYTES_PER_ELEMENT lookup to succeed on the constructor functions (i.e., "Float32Array.BYTES_PER_ELEMENT") while also not perturbing the functionality in any way.
Comment 3 Dimitri Glazkov (Google) 2010-06-10 10:46:20 PDT
Comment on attachment 58308 [details]
Patch

ok. Can we not make the constructors non-custom with the new overloading goodness that Yaar had built?
Comment 4 Kenneth Russell 2010-06-10 10:55:34 PDT
(In reply to comment #3)
> (From update of attachment 58308 [details])
> ok. Can we not make the constructors non-custom with the new overloading goodness that Yaar had built?

It may be possible; I'll ask Yaar. I don't know how the IDL and code generator handle autogenerated constructors and/or overloaded constructors.
Comment 5 Kenneth Russell 2010-06-10 11:53:39 PDT
Committed r60967: <http://trac.webkit.org/changeset/60967>