Bug 1279986 - Make WebGL Uniform*, UniformMatrix* and VertexAttrib* accept SharedArrayBuffer. r=jgilbert
authorEthan Lin <ethlin@mozilla.com>
Tue, 19 Jul 2016 20:00:00 +0200
changeset 331746 6e23273bf3508403aeacdb301d278c281528756c
parent 331745 493c726899561c8214ea70c8a6f699878d82fe2b
child 331747 0d7f83477045aedfd34ba896c17dac918e24cb35
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1279986
milestone50.0a1
Bug 1279986 - Make WebGL Uniform*, UniformMatrix* and VertexAttrib* accept SharedArrayBuffer. r=jgilbert
dom/canvas/WebGLContext.h
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -587,18 +587,18 @@ public:
 protected:
     template<typename elemT, typename arrT>
     struct Arr {
         size_t dataCount;
         const elemT* data;
 
         explicit Arr(const arrT& arr) {
             arr.ComputeLengthAndData();
-            dataCount = arr.Length();
-            data = arr.Data();
+            dataCount = arr.LengthAllowShared();
+            data = arr.DataAllowShared();
         }
 
         explicit Arr(const dom::Sequence<elemT>& arr) {
             dataCount = arr.Length();
             data = arr.Elements();
         }
     };
 
@@ -945,41 +945,41 @@ public:
     void VertexAttrib1f(GLuint index, GLfloat x0);
     void VertexAttrib2f(GLuint index, GLfloat x0, GLfloat x1);
     void VertexAttrib3f(GLuint index, GLfloat x0, GLfloat x1, GLfloat x2);
     void VertexAttrib4f(GLuint index, GLfloat x0, GLfloat x1, GLfloat x2,
                         GLfloat x3);
 
     void VertexAttrib1fv(GLuint idx, const dom::Float32Array& arr) {
         arr.ComputeLengthAndData();
-        VertexAttrib1fv_base(idx, arr.Length(), arr.Data());
+        VertexAttrib1fv_base(idx, arr.LengthAllowShared(), arr.DataAllowShared());
     }
     void VertexAttrib1fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
         VertexAttrib1fv_base(idx, arr.Length(), arr.Elements());
     }
 
     void VertexAttrib2fv(GLuint idx, const dom::Float32Array& arr) {
         arr.ComputeLengthAndData();
-        VertexAttrib2fv_base(idx, arr.Length(), arr.Data());
+        VertexAttrib2fv_base(idx, arr.LengthAllowShared(), arr.DataAllowShared());
     }
     void VertexAttrib2fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
         VertexAttrib2fv_base(idx, arr.Length(), arr.Elements());
     }
 
     void VertexAttrib3fv(GLuint idx, const dom::Float32Array& arr) {
         arr.ComputeLengthAndData();
-        VertexAttrib3fv_base(idx, arr.Length(), arr.Data());
+        VertexAttrib3fv_base(idx, arr.LengthAllowShared(), arr.DataAllowShared());
     }
     void VertexAttrib3fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
         VertexAttrib3fv_base(idx, arr.Length(), arr.Elements());
     }
 
     void VertexAttrib4fv(GLuint idx, const dom::Float32Array& arr) {
         arr.ComputeLengthAndData();
-        VertexAttrib4fv_base(idx, arr.Length(), arr.Data());
+        VertexAttrib4fv_base(idx, arr.LengthAllowShared(), arr.DataAllowShared());
     }
     void VertexAttrib4fv(GLuint idx, const dom::Sequence<GLfloat>& arr) {
         VertexAttrib4fv_base(idx, arr.Length(), arr.Elements());
     }
 
     void VertexAttribPointer(GLuint index, GLint size, GLenum type,
                              WebGLboolean normalized, GLsizei stride,
                              WebGLintptr byteOffset);