| Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| index a3da846049bfe5db49feaba7ced2aecc5124e88d..6e236c0239d5e1265d45ea6549b362dff1cffa74 100644
|
| --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| @@ -2876,7 +2876,7 @@ void WebGL2RenderingContextBase::uniformMatrix4fv(
|
| void WebGL2RenderingContextBase::uniformMatrix2x3fv(
|
| const WebGLUniformLocation* location,
|
| GLboolean transpose,
|
| - DOMFloat32Array* value,
|
| + const MaybeShared<DOMFloat32Array>& value,
|
| GLuint srcOffset,
|
| GLuint srcLength) {
|
| if (isContextLost() ||
|
| @@ -2886,8 +2886,9 @@ void WebGL2RenderingContextBase::uniformMatrix2x3fv(
|
| return;
|
| contextGL()->UniformMatrix2x3fv(
|
| location->location(),
|
| - (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose,
|
| - value->data() + srcOffset);
|
| + (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) /
|
| + 6,
|
| + transpose, value.viewNotShared()->data() + srcOffset);
|
| }
|
|
|
| void WebGL2RenderingContextBase::uniformMatrix2x3fv(
|
| @@ -2910,7 +2911,7 @@ void WebGL2RenderingContextBase::uniformMatrix2x3fv(
|
| void WebGL2RenderingContextBase::uniformMatrix3x2fv(
|
| const WebGLUniformLocation* location,
|
| GLboolean transpose,
|
| - DOMFloat32Array* value,
|
| + const MaybeShared<DOMFloat32Array>& value,
|
| GLuint srcOffset,
|
| GLuint srcLength) {
|
| if (isContextLost() ||
|
| @@ -2920,8 +2921,9 @@ void WebGL2RenderingContextBase::uniformMatrix3x2fv(
|
| return;
|
| contextGL()->UniformMatrix3x2fv(
|
| location->location(),
|
| - (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose,
|
| - value->data() + srcOffset);
|
| + (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) /
|
| + 6,
|
| + transpose, value.viewNotShared()->data() + srcOffset);
|
| }
|
|
|
| void WebGL2RenderingContextBase::uniformMatrix3x2fv(
|
| @@ -2944,7 +2946,7 @@ void WebGL2RenderingContextBase::uniformMatrix3x2fv(
|
| void WebGL2RenderingContextBase::uniformMatrix2x4fv(
|
| const WebGLUniformLocation* location,
|
| GLboolean transpose,
|
| - DOMFloat32Array* value,
|
| + const MaybeShared<DOMFloat32Array>& value,
|
| GLuint srcOffset,
|
| GLuint srcLength) {
|
| if (isContextLost() ||
|
| @@ -2954,8 +2956,9 @@ void WebGL2RenderingContextBase::uniformMatrix2x4fv(
|
| return;
|
| contextGL()->UniformMatrix2x4fv(
|
| location->location(),
|
| - (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose,
|
| - value->data() + srcOffset);
|
| + (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) >>
|
| + 3,
|
| + transpose, value.viewNotShared()->data() + srcOffset);
|
| }
|
|
|
| void WebGL2RenderingContextBase::uniformMatrix2x4fv(
|
| @@ -2978,7 +2981,7 @@ void WebGL2RenderingContextBase::uniformMatrix2x4fv(
|
| void WebGL2RenderingContextBase::uniformMatrix4x2fv(
|
| const WebGLUniformLocation* location,
|
| GLboolean transpose,
|
| - DOMFloat32Array* value,
|
| + const MaybeShared<DOMFloat32Array>& value,
|
| GLuint srcOffset,
|
| GLuint srcLength) {
|
| if (isContextLost() ||
|
| @@ -2988,8 +2991,9 @@ void WebGL2RenderingContextBase::uniformMatrix4x2fv(
|
| return;
|
| contextGL()->UniformMatrix4x2fv(
|
| location->location(),
|
| - (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose,
|
| - value->data() + srcOffset);
|
| + (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) >>
|
| + 3,
|
| + transpose, value.viewNotShared()->data() + srcOffset);
|
| }
|
|
|
| void WebGL2RenderingContextBase::uniformMatrix4x2fv(
|
| @@ -3012,7 +3016,7 @@ void WebGL2RenderingContextBase::uniformMatrix4x2fv(
|
| void WebGL2RenderingContextBase::uniformMatrix3x4fv(
|
| const WebGLUniformLocation* location,
|
| GLboolean transpose,
|
| - DOMFloat32Array* value,
|
| + const MaybeShared<DOMFloat32Array>& value,
|
| GLuint srcOffset,
|
| GLuint srcLength) {
|
| if (isContextLost() ||
|
| @@ -3022,8 +3026,9 @@ void WebGL2RenderingContextBase::uniformMatrix3x4fv(
|
| return;
|
| contextGL()->UniformMatrix3x4fv(
|
| location->location(),
|
| - (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose,
|
| - value->data() + srcOffset);
|
| + (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) /
|
| + 12,
|
| + transpose, value.viewNotShared()->data() + srcOffset);
|
| }
|
|
|
| void WebGL2RenderingContextBase::uniformMatrix3x4fv(
|
| @@ -3046,7 +3051,7 @@ void WebGL2RenderingContextBase::uniformMatrix3x4fv(
|
| void WebGL2RenderingContextBase::uniformMatrix4x3fv(
|
| const WebGLUniformLocation* location,
|
| GLboolean transpose,
|
| - DOMFloat32Array* value,
|
| + const MaybeShared<DOMFloat32Array>& value,
|
| GLuint srcOffset,
|
| GLuint srcLength) {
|
| if (isContextLost() ||
|
| @@ -3056,8 +3061,9 @@ void WebGL2RenderingContextBase::uniformMatrix4x3fv(
|
| return;
|
| contextGL()->UniformMatrix4x3fv(
|
| location->location(),
|
| - (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose,
|
| - value->data() + srcOffset);
|
| + (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) /
|
| + 12,
|
| + transpose, value.viewNotShared()->data() + srcOffset);
|
| }
|
|
|
| void WebGL2RenderingContextBase::uniformMatrix4x3fv(
|
| @@ -3226,15 +3232,16 @@ void WebGL2RenderingContextBase::vertexAttribI4i(GLuint index,
|
| setVertexAttribType(index, Int32ArrayType);
|
| }
|
|
|
| -void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index,
|
| - const DOMInt32Array* v) {
|
| - if (isContextLost())
|
| +void WebGL2RenderingContextBase::vertexAttribI4iv(
|
| + GLuint index,
|
| + const MaybeShared<const DOMInt32Array>& v) {
|
| + if (isContextLost() || !validateNotSharedArrayBuffer("vertexAttribI4iv", v))
|
| return;
|
| - if (!v || v->length() < 4) {
|
| + if (!v || v.viewNotShared()->length() < 4) {
|
| synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array");
|
| return;
|
| }
|
| - contextGL()->VertexAttribI4iv(index, v->data());
|
| + contextGL()->VertexAttribI4iv(index, v.viewNotShared()->data());
|
| setVertexAttribType(index, Int32ArrayType);
|
| }
|
|
|
| @@ -3261,15 +3268,16 @@ void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index,
|
| setVertexAttribType(index, Uint32ArrayType);
|
| }
|
|
|
| -void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index,
|
| - const DOMUint32Array* v) {
|
| - if (isContextLost())
|
| +void WebGL2RenderingContextBase::vertexAttribI4uiv(
|
| + GLuint index,
|
| + const MaybeShared<const DOMUint32Array>& v) {
|
| + if (isContextLost() || !validateNotSharedArrayBuffer("vertexAttribI4uiv", v))
|
| return;
|
| - if (!v || v->length() < 4) {
|
| + if (!v || v.viewNotShared()->length() < 4) {
|
| synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array");
|
| return;
|
| }
|
| - contextGL()->VertexAttribI4uiv(index, v->data());
|
| + contextGL()->VertexAttribI4uiv(index, v.viewNotShared()->data());
|
| setVertexAttribType(index, Uint32ArrayType);
|
| }
|
|
|
| @@ -3482,14 +3490,17 @@ WebGLTexture* WebGL2RenderingContextBase::validateTexImageBinding(
|
| return validateTexture2DBinding(funcName, target);
|
| }
|
|
|
| -void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer,
|
| - GLint drawbuffer,
|
| - DOMInt32Array* value) {
|
| +void WebGL2RenderingContextBase::clearBufferiv(
|
| + GLenum buffer,
|
| + GLint drawbuffer,
|
| + const MaybeShared<DOMInt32Array>& value) {
|
| if (isContextLost() ||
|
| - !validateClearBuffer("clearBufferiv", buffer, value->length()))
|
| + !validateNotSharedArrayBuffer("clearBufferiv", value) ||
|
| + !validateClearBuffer("clearBufferiv", buffer,
|
| + value.viewNotShared()->length()))
|
| return;
|
|
|
| - contextGL()->ClearBufferiv(buffer, drawbuffer, value->data());
|
| + contextGL()->ClearBufferiv(buffer, drawbuffer, value.viewNotShared()->data());
|
| }
|
|
|
| void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer,
|
| @@ -3502,14 +3513,18 @@ void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer,
|
| contextGL()->ClearBufferiv(buffer, drawbuffer, value.data());
|
| }
|
|
|
| -void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer,
|
| - GLint drawbuffer,
|
| - DOMUint32Array* value) {
|
| +void WebGL2RenderingContextBase::clearBufferuiv(
|
| + GLenum buffer,
|
| + GLint drawbuffer,
|
| + const MaybeShared<DOMUint32Array>& value) {
|
| if (isContextLost() ||
|
| - !validateClearBuffer("clearBufferuiv", buffer, value->length()))
|
| + !validateNotSharedArrayBuffer("clearBufferuiv", value) ||
|
| + !validateClearBuffer("clearBufferuiv", buffer,
|
| + value.viewNotShared()->length()))
|
| return;
|
|
|
| - contextGL()->ClearBufferuiv(buffer, drawbuffer, value->data());
|
| + contextGL()->ClearBufferuiv(buffer, drawbuffer,
|
| + value.viewNotShared()->data());
|
| }
|
|
|
| void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer,
|
| @@ -3522,14 +3537,17 @@ void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer,
|
| contextGL()->ClearBufferuiv(buffer, drawbuffer, value.data());
|
| }
|
|
|
| -void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer,
|
| - GLint drawbuffer,
|
| - DOMFloat32Array* value) {
|
| +void WebGL2RenderingContextBase::clearBufferfv(
|
| + GLenum buffer,
|
| + GLint drawbuffer,
|
| + const MaybeShared<DOMFloat32Array>& value) {
|
| if (isContextLost() ||
|
| - !validateClearBuffer("clearBufferfv", buffer, value->length()))
|
| + !validateNotSharedArrayBuffer("clearBufferfv", value) ||
|
| + !validateClearBuffer("clearBufferfv", buffer,
|
| + value.viewNotShared()->length()))
|
| return;
|
|
|
| - contextGL()->ClearBufferfv(buffer, drawbuffer, value->data());
|
| + contextGL()->ClearBufferfv(buffer, drawbuffer, value.viewNotShared()->data());
|
| }
|
|
|
| void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer,
|
|
|