| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include <memory> | 28 #include <memory> |
| 29 #include "bindings/core/v8/ExceptionMessages.h" | 29 #include "bindings/core/v8/ExceptionMessages.h" |
| 30 #include "bindings/core/v8/ExceptionState.h" | 30 #include "bindings/core/v8/ExceptionState.h" |
| 31 #include "bindings/core/v8/ScriptWrappableVisitor.h" | 31 #include "bindings/core/v8/ScriptWrappableVisitor.h" |
| 32 #include "bindings/core/v8/V8BindingMacros.h" | 32 #include "bindings/core/v8/V8BindingMacros.h" |
| 33 #include "bindings/modules/v8/HTMLCanvasElementOrOffscreenCanvas.h" | 33 #include "bindings/modules/v8/HTMLCanvasElementOrOffscreenCanvas.h" |
| 34 #include "bindings/modules/v8/WebGLAny.h" | 34 #include "bindings/modules/v8/WebGLAny.h" |
| 35 #include "core/dom/DOMArrayBuffer.h" | 35 #include "core/dom/DOMArrayBuffer.h" |
| 36 #include "core/dom/DOMTypedArray.h" | 36 #include "core/dom/DOMTypedArray.h" |
| 37 #include "core/dom/FlexibleArrayBufferView.h" | 37 #include "core/dom/FlexibleArrayBufferView.h" |
| 38 #include "core/dom/NotShared.h" |
| 38 #include "core/dom/TaskRunnerHelper.h" | 39 #include "core/dom/TaskRunnerHelper.h" |
| 39 #include "core/frame/ImageBitmap.h" | 40 #include "core/frame/ImageBitmap.h" |
| 40 #include "core/frame/LocalFrame.h" | 41 #include "core/frame/LocalFrame.h" |
| 41 #include "core/frame/LocalFrameClient.h" | 42 #include "core/frame/LocalFrameClient.h" |
| 42 #include "core/frame/Settings.h" | 43 #include "core/frame/Settings.h" |
| 43 #include "core/html/HTMLCanvasElement.h" | 44 #include "core/html/HTMLCanvasElement.h" |
| 44 #include "core/html/HTMLImageElement.h" | 45 #include "core/html/HTMLImageElement.h" |
| 45 #include "core/html/HTMLVideoElement.h" | 46 #include "core/html/HTMLVideoElement.h" |
| 46 #include "core/html/ImageData.h" | 47 #include "core/html/ImageData.h" |
| 47 #include "core/inspector/ConsoleMessage.h" | 48 #include "core/inspector/ConsoleMessage.h" |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1896 if (isContextLost()) | 1897 if (isContextLost()) |
| 1897 return; | 1898 return; |
| 1898 if (!data) { | 1899 if (!data) { |
| 1899 SynthesizeGLError(GL_INVALID_VALUE, "bufferData", "no data"); | 1900 SynthesizeGLError(GL_INVALID_VALUE, "bufferData", "no data"); |
| 1900 return; | 1901 return; |
| 1901 } | 1902 } |
| 1902 BufferDataImpl(target, data->ByteLength(), data->Data(), usage); | 1903 BufferDataImpl(target, data->ByteLength(), data->Data(), usage); |
| 1903 } | 1904 } |
| 1904 | 1905 |
| 1905 void WebGLRenderingContextBase::bufferData(GLenum target, | 1906 void WebGLRenderingContextBase::bufferData(GLenum target, |
| 1906 NotShared<DOMArrayBufferView> data, | 1907 MaybeShared<DOMArrayBufferView> data, |
| 1907 GLenum usage) { | 1908 GLenum usage) { |
| 1908 if (isContextLost()) | 1909 if (isContextLost()) |
| 1909 return; | 1910 return; |
| 1910 DCHECK(data); | 1911 DCHECK(data); |
| 1911 BufferDataImpl(target, data.View()->byteLength(), data.View()->BaseAddress(), | 1912 BufferDataImpl(target, data.View()->byteLength(), data.View()->BaseAddress(), |
| 1912 usage); | 1913 usage); |
| 1913 } | 1914 } |
| 1914 | 1915 |
| 1915 void WebGLRenderingContextBase::BufferSubDataImpl(GLenum target, | 1916 void WebGLRenderingContextBase::BufferSubDataImpl(GLenum target, |
| 1916 long long offset, | 1917 long long offset, |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2076 ContextGL()->CompileShader(ObjectOrZero(shader)); | 2077 ContextGL()->CompileShader(ObjectOrZero(shader)); |
| 2077 } | 2078 } |
| 2078 | 2079 |
| 2079 void WebGLRenderingContextBase::compressedTexImage2D( | 2080 void WebGLRenderingContextBase::compressedTexImage2D( |
| 2080 GLenum target, | 2081 GLenum target, |
| 2081 GLint level, | 2082 GLint level, |
| 2082 GLenum internalformat, | 2083 GLenum internalformat, |
| 2083 GLsizei width, | 2084 GLsizei width, |
| 2084 GLsizei height, | 2085 GLsizei height, |
| 2085 GLint border, | 2086 GLint border, |
| 2086 NotShared<DOMArrayBufferView> data) { | 2087 MaybeShared<DOMArrayBufferView> data) { |
| 2087 if (isContextLost()) | 2088 if (isContextLost()) |
| 2088 return; | 2089 return; |
| 2089 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) | 2090 if (!ValidateTexture2DBinding("compressedTexImage2D", target)) |
| 2090 return; | 2091 return; |
| 2091 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) | 2092 if (!ValidateCompressedTexFormat("compressedTexImage2D", internalformat)) |
| 2092 return; | 2093 return; |
| 2093 ContextGL()->CompressedTexImage2D(target, level, internalformat, width, | 2094 ContextGL()->CompressedTexImage2D(target, level, internalformat, width, |
| 2094 height, border, data.View()->byteLength(), | 2095 height, border, data.View()->byteLength(), |
| 2095 data.View()->BaseAddress()); | 2096 data.View()->BaseAddress()); |
| 2096 } | 2097 } |
| 2097 | 2098 |
| 2098 void WebGLRenderingContextBase::compressedTexSubImage2D( | 2099 void WebGLRenderingContextBase::compressedTexSubImage2D( |
| 2099 GLenum target, | 2100 GLenum target, |
| 2100 GLint level, | 2101 GLint level, |
| 2101 GLint xoffset, | 2102 GLint xoffset, |
| 2102 GLint yoffset, | 2103 GLint yoffset, |
| 2103 GLsizei width, | 2104 GLsizei width, |
| 2104 GLsizei height, | 2105 GLsizei height, |
| 2105 GLenum format, | 2106 GLenum format, |
| 2106 NotShared<DOMArrayBufferView> data) { | 2107 MaybeShared<DOMArrayBufferView> data) { |
| 2107 if (isContextLost()) | 2108 if (isContextLost()) |
| 2108 return; | 2109 return; |
| 2109 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) | 2110 if (!ValidateTexture2DBinding("compressedTexSubImage2D", target)) |
| 2110 return; | 2111 return; |
| 2111 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) | 2112 if (!ValidateCompressedTexFormat("compressedTexSubImage2D", format)) |
| 2112 return; | 2113 return; |
| 2113 ContextGL()->CompressedTexSubImage2D( | 2114 ContextGL()->CompressedTexSubImage2D( |
| 2114 target, level, xoffset, yoffset, width, height, format, | 2115 target, level, xoffset, yoffset, width, height, format, |
| 2115 data.View()->byteLength(), data.View()->BaseAddress()); | 2116 data.View()->byteLength(), data.View()->BaseAddress()); |
| 2116 } | 2117 } |
| (...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4108 return true; | 4109 return true; |
| 4109 } | 4110 } |
| 4110 | 4111 |
| 4111 void WebGLRenderingContextBase::readPixels( | 4112 void WebGLRenderingContextBase::readPixels( |
| 4112 GLint x, | 4113 GLint x, |
| 4113 GLint y, | 4114 GLint y, |
| 4114 GLsizei width, | 4115 GLsizei width, |
| 4115 GLsizei height, | 4116 GLsizei height, |
| 4116 GLenum format, | 4117 GLenum format, |
| 4117 GLenum type, | 4118 GLenum type, |
| 4118 NotShared<DOMArrayBufferView> pixels) { | 4119 MaybeShared<DOMArrayBufferView> pixels) { |
| 4119 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); | 4120 ReadPixelsHelper(x, y, width, height, format, type, pixels.View(), 0); |
| 4120 } | 4121 } |
| 4121 | 4122 |
| 4122 void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, | 4123 void WebGLRenderingContextBase::ReadPixelsHelper(GLint x, |
| 4123 GLint y, | 4124 GLint y, |
| 4124 GLsizei width, | 4125 GLsizei width, |
| 4125 GLsizei height, | 4126 GLsizei height, |
| 4126 GLenum format, | 4127 GLenum format, |
| 4127 GLenum type, | 4128 GLenum type, |
| 4128 DOMArrayBufferView* pixels, | 4129 DOMArrayBufferView* pixels, |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4725 | 4726 |
| 4726 void WebGLRenderingContextBase::texImage2D( | 4727 void WebGLRenderingContextBase::texImage2D( |
| 4727 GLenum target, | 4728 GLenum target, |
| 4728 GLint level, | 4729 GLint level, |
| 4729 GLint internalformat, | 4730 GLint internalformat, |
| 4730 GLsizei width, | 4731 GLsizei width, |
| 4731 GLsizei height, | 4732 GLsizei height, |
| 4732 GLint border, | 4733 GLint border, |
| 4733 GLenum format, | 4734 GLenum format, |
| 4734 GLenum type, | 4735 GLenum type, |
| 4735 NotShared<DOMArrayBufferView> pixels) { | 4736 MaybeShared<DOMArrayBufferView> pixels) { |
| 4736 TexImageHelperDOMArrayBufferView(kTexImage2D, target, level, internalformat, | 4737 TexImageHelperDOMArrayBufferView(kTexImage2D, target, level, internalformat, |
| 4737 width, height, 1, border, format, type, 0, 0, | 4738 width, height, 1, border, format, type, 0, 0, |
| 4738 0, pixels.View(), kNullAllowed, 0); | 4739 0, pixels.View(), kNullAllowed, 0); |
| 4739 } | 4740 } |
| 4740 | 4741 |
| 4741 void WebGLRenderingContextBase::TexImageHelperImageData( | 4742 void WebGLRenderingContextBase::TexImageHelperImageData( |
| 4742 TexImageFunctionID function_id, | 4743 TexImageFunctionID function_id, |
| 4743 GLenum target, | 4744 GLenum target, |
| 4744 GLint level, | 4745 GLint level, |
| 4745 GLint internalformat, | 4746 GLint internalformat, |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5560 | 5561 |
| 5561 void WebGLRenderingContextBase::texSubImage2D( | 5562 void WebGLRenderingContextBase::texSubImage2D( |
| 5562 GLenum target, | 5563 GLenum target, |
| 5563 GLint level, | 5564 GLint level, |
| 5564 GLint xoffset, | 5565 GLint xoffset, |
| 5565 GLint yoffset, | 5566 GLint yoffset, |
| 5566 GLsizei width, | 5567 GLsizei width, |
| 5567 GLsizei height, | 5568 GLsizei height, |
| 5568 GLenum format, | 5569 GLenum format, |
| 5569 GLenum type, | 5570 GLenum type, |
| 5570 NotShared<DOMArrayBufferView> pixels) { | 5571 MaybeShared<DOMArrayBufferView> pixels) { |
| 5571 TexImageHelperDOMArrayBufferView(kTexSubImage2D, target, level, 0, width, | 5572 TexImageHelperDOMArrayBufferView(kTexSubImage2D, target, level, 0, width, |
| 5572 height, 1, 0, format, type, xoffset, yoffset, | 5573 height, 1, 0, format, type, xoffset, yoffset, |
| 5573 0, pixels.View(), kNullNotAllowed, 0); | 5574 0, pixels.View(), kNullNotAllowed, 0); |
| 5574 } | 5575 } |
| 5575 | 5576 |
| 5576 void WebGLRenderingContextBase::texSubImage2D(GLenum target, | 5577 void WebGLRenderingContextBase::texSubImage2D(GLenum target, |
| 5577 GLint level, | 5578 GLint level, |
| 5578 GLint xoffset, | 5579 GLint xoffset, |
| 5579 GLint yoffset, | 5580 GLint yoffset, |
| 5580 GLenum format, | 5581 GLenum format, |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5917 !ValidateUniformParameters("uniform4iv", location, v.Data(), v.size(), 4, | 5918 !ValidateUniformParameters("uniform4iv", location, v.Data(), v.size(), 4, |
| 5918 0, v.size())) | 5919 0, v.size())) |
| 5919 return; | 5920 return; |
| 5920 | 5921 |
| 5921 ContextGL()->Uniform4iv(location->Location(), v.size() >> 2, v.Data()); | 5922 ContextGL()->Uniform4iv(location->Location(), v.size() >> 2, v.Data()); |
| 5922 } | 5923 } |
| 5923 | 5924 |
| 5924 void WebGLRenderingContextBase::uniformMatrix2fv( | 5925 void WebGLRenderingContextBase::uniformMatrix2fv( |
| 5925 const WebGLUniformLocation* location, | 5926 const WebGLUniformLocation* location, |
| 5926 GLboolean transpose, | 5927 GLboolean transpose, |
| 5927 NotShared<DOMFloat32Array> v) { | 5928 MaybeShared<DOMFloat32Array> v) { |
| 5928 if (isContextLost() || | 5929 if (isContextLost() || |
| 5929 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 5930 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 5930 v.View(), 4, 0, v.View()->length())) | 5931 v.View(), 4, 0, v.View()->length())) |
| 5931 return; | 5932 return; |
| 5932 ContextGL()->UniformMatrix2fv(location->Location(), v.View()->length() >> 2, | 5933 ContextGL()->UniformMatrix2fv(location->Location(), v.View()->length() >> 2, |
| 5933 transpose, v.View()->Data()); | 5934 transpose, v.View()->Data()); |
| 5934 } | 5935 } |
| 5935 | 5936 |
| 5936 void WebGLRenderingContextBase::uniformMatrix2fv( | 5937 void WebGLRenderingContextBase::uniformMatrix2fv( |
| 5937 const WebGLUniformLocation* location, | 5938 const WebGLUniformLocation* location, |
| 5938 GLboolean transpose, | 5939 GLboolean transpose, |
| 5939 Vector<GLfloat>& v) { | 5940 Vector<GLfloat>& v) { |
| 5940 if (isContextLost() || | 5941 if (isContextLost() || |
| 5941 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, | 5942 !ValidateUniformMatrixParameters("uniformMatrix2fv", location, transpose, |
| 5942 v.Data(), v.size(), 4, 0, v.size())) | 5943 v.Data(), v.size(), 4, 0, v.size())) |
| 5943 return; | 5944 return; |
| 5944 ContextGL()->UniformMatrix2fv(location->Location(), v.size() >> 2, transpose, | 5945 ContextGL()->UniformMatrix2fv(location->Location(), v.size() >> 2, transpose, |
| 5945 v.Data()); | 5946 v.Data()); |
| 5946 } | 5947 } |
| 5947 | 5948 |
| 5948 void WebGLRenderingContextBase::uniformMatrix3fv( | 5949 void WebGLRenderingContextBase::uniformMatrix3fv( |
| 5949 const WebGLUniformLocation* location, | 5950 const WebGLUniformLocation* location, |
| 5950 GLboolean transpose, | 5951 GLboolean transpose, |
| 5951 NotShared<DOMFloat32Array> v) { | 5952 MaybeShared<DOMFloat32Array> v) { |
| 5952 if (isContextLost() || | 5953 if (isContextLost() || |
| 5953 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 5954 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 5954 v.View(), 9, 0, v.View()->length())) | 5955 v.View(), 9, 0, v.View()->length())) |
| 5955 return; | 5956 return; |
| 5956 ContextGL()->UniformMatrix3fv(location->Location(), v.View()->length() / 9, | 5957 ContextGL()->UniformMatrix3fv(location->Location(), v.View()->length() / 9, |
| 5957 transpose, v.View()->Data()); | 5958 transpose, v.View()->Data()); |
| 5958 } | 5959 } |
| 5959 | 5960 |
| 5960 void WebGLRenderingContextBase::uniformMatrix3fv( | 5961 void WebGLRenderingContextBase::uniformMatrix3fv( |
| 5961 const WebGLUniformLocation* location, | 5962 const WebGLUniformLocation* location, |
| 5962 GLboolean transpose, | 5963 GLboolean transpose, |
| 5963 Vector<GLfloat>& v) { | 5964 Vector<GLfloat>& v) { |
| 5964 if (isContextLost() || | 5965 if (isContextLost() || |
| 5965 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, | 5966 !ValidateUniformMatrixParameters("uniformMatrix3fv", location, transpose, |
| 5966 v.Data(), v.size(), 9, 0, v.size())) | 5967 v.Data(), v.size(), 9, 0, v.size())) |
| 5967 return; | 5968 return; |
| 5968 ContextGL()->UniformMatrix3fv(location->Location(), v.size() / 9, transpose, | 5969 ContextGL()->UniformMatrix3fv(location->Location(), v.size() / 9, transpose, |
| 5969 v.Data()); | 5970 v.Data()); |
| 5970 } | 5971 } |
| 5971 | 5972 |
| 5972 void WebGLRenderingContextBase::uniformMatrix4fv( | 5973 void WebGLRenderingContextBase::uniformMatrix4fv( |
| 5973 const WebGLUniformLocation* location, | 5974 const WebGLUniformLocation* location, |
| 5974 GLboolean transpose, | 5975 GLboolean transpose, |
| 5975 NotShared<DOMFloat32Array> v) { | 5976 MaybeShared<DOMFloat32Array> v) { |
| 5976 if (isContextLost() || | 5977 if (isContextLost() || |
| 5977 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, | 5978 !ValidateUniformMatrixParameters("uniformMatrix4fv", location, transpose, |
| 5978 v.View(), 16, 0, v.View()->length())) | 5979 v.View(), 16, 0, v.View()->length())) |
| 5979 return; | 5980 return; |
| 5980 ContextGL()->UniformMatrix4fv(location->Location(), v.View()->length() >> 4, | 5981 ContextGL()->UniformMatrix4fv(location->Location(), v.View()->length() >> 4, |
| 5981 transpose, v.View()->Data()); | 5982 transpose, v.View()->Data()); |
| 5982 } | 5983 } |
| 5983 | 5984 |
| 5984 void WebGLRenderingContextBase::uniformMatrix4fv( | 5985 void WebGLRenderingContextBase::uniformMatrix4fv( |
| 5985 const WebGLUniformLocation* location, | 5986 const WebGLUniformLocation* location, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6029 | 6030 |
| 6030 void WebGLRenderingContextBase::vertexAttrib1f(GLuint index, GLfloat v0) { | 6031 void WebGLRenderingContextBase::vertexAttrib1f(GLuint index, GLfloat v0) { |
| 6031 if (isContextLost()) | 6032 if (isContextLost()) |
| 6032 return; | 6033 return; |
| 6033 ContextGL()->VertexAttrib1f(index, v0); | 6034 ContextGL()->VertexAttrib1f(index, v0); |
| 6034 SetVertexAttribType(index, kFloat32ArrayType); | 6035 SetVertexAttribType(index, kFloat32ArrayType); |
| 6035 } | 6036 } |
| 6036 | 6037 |
| 6037 void WebGLRenderingContextBase::vertexAttrib1fv( | 6038 void WebGLRenderingContextBase::vertexAttrib1fv( |
| 6038 GLuint index, | 6039 GLuint index, |
| 6039 NotShared<const DOMFloat32Array> v) { | 6040 MaybeShared<const DOMFloat32Array> v) { |
| 6040 if (isContextLost()) | 6041 if (isContextLost()) |
| 6041 return; | 6042 return; |
| 6042 if (!v.View() || v.View()->length() < 1) { | 6043 if (!v.View() || v.View()->length() < 1) { |
| 6043 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib1fv", "invalid array"); | 6044 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib1fv", "invalid array"); |
| 6044 return; | 6045 return; |
| 6045 } | 6046 } |
| 6046 ContextGL()->VertexAttrib1fv(index, v.View()->Data()); | 6047 ContextGL()->VertexAttrib1fv(index, v.View()->Data()); |
| 6047 SetVertexAttribType(index, kFloat32ArrayType); | 6048 SetVertexAttribType(index, kFloat32ArrayType); |
| 6048 } | 6049 } |
| 6049 | 6050 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6063 GLfloat v0, | 6064 GLfloat v0, |
| 6064 GLfloat v1) { | 6065 GLfloat v1) { |
| 6065 if (isContextLost()) | 6066 if (isContextLost()) |
| 6066 return; | 6067 return; |
| 6067 ContextGL()->VertexAttrib2f(index, v0, v1); | 6068 ContextGL()->VertexAttrib2f(index, v0, v1); |
| 6068 SetVertexAttribType(index, kFloat32ArrayType); | 6069 SetVertexAttribType(index, kFloat32ArrayType); |
| 6069 } | 6070 } |
| 6070 | 6071 |
| 6071 void WebGLRenderingContextBase::vertexAttrib2fv( | 6072 void WebGLRenderingContextBase::vertexAttrib2fv( |
| 6072 GLuint index, | 6073 GLuint index, |
| 6073 NotShared<const DOMFloat32Array> v) { | 6074 MaybeShared<const DOMFloat32Array> v) { |
| 6074 if (isContextLost()) | 6075 if (isContextLost()) |
| 6075 return; | 6076 return; |
| 6076 if (!v.View() || v.View()->length() < 2) { | 6077 if (!v.View() || v.View()->length() < 2) { |
| 6077 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib2fv", "invalid array"); | 6078 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib2fv", "invalid array"); |
| 6078 return; | 6079 return; |
| 6079 } | 6080 } |
| 6080 ContextGL()->VertexAttrib2fv(index, v.View()->Data()); | 6081 ContextGL()->VertexAttrib2fv(index, v.View()->Data()); |
| 6081 SetVertexAttribType(index, kFloat32ArrayType); | 6082 SetVertexAttribType(index, kFloat32ArrayType); |
| 6082 } | 6083 } |
| 6083 | 6084 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 6098 GLfloat v1, | 6099 GLfloat v1, |
| 6099 GLfloat v2) { | 6100 GLfloat v2) { |
| 6100 if (isContextLost()) | 6101 if (isContextLost()) |
| 6101 return; | 6102 return; |
| 6102 ContextGL()->VertexAttrib3f(index, v0, v1, v2); | 6103 ContextGL()->VertexAttrib3f(index, v0, v1, v2); |
| 6103 SetVertexAttribType(index, kFloat32ArrayType); | 6104 SetVertexAttribType(index, kFloat32ArrayType); |
| 6104 } | 6105 } |
| 6105 | 6106 |
| 6106 void WebGLRenderingContextBase::vertexAttrib3fv( | 6107 void WebGLRenderingContextBase::vertexAttrib3fv( |
| 6107 GLuint index, | 6108 GLuint index, |
| 6108 NotShared<const DOMFloat32Array> v) { | 6109 MaybeShared<const DOMFloat32Array> v) { |
| 6109 if (isContextLost()) | 6110 if (isContextLost()) |
| 6110 return; | 6111 return; |
| 6111 if (!v.View() || v.View()->length() < 3) { | 6112 if (!v.View() || v.View()->length() < 3) { |
| 6112 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib3fv", "invalid array"); | 6113 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib3fv", "invalid array"); |
| 6113 return; | 6114 return; |
| 6114 } | 6115 } |
| 6115 ContextGL()->VertexAttrib3fv(index, v.View()->Data()); | 6116 ContextGL()->VertexAttrib3fv(index, v.View()->Data()); |
| 6116 SetVertexAttribType(index, kFloat32ArrayType); | 6117 SetVertexAttribType(index, kFloat32ArrayType); |
| 6117 } | 6118 } |
| 6118 | 6119 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 6134 GLfloat v2, | 6135 GLfloat v2, |
| 6135 GLfloat v3) { | 6136 GLfloat v3) { |
| 6136 if (isContextLost()) | 6137 if (isContextLost()) |
| 6137 return; | 6138 return; |
| 6138 ContextGL()->VertexAttrib4f(index, v0, v1, v2, v3); | 6139 ContextGL()->VertexAttrib4f(index, v0, v1, v2, v3); |
| 6139 SetVertexAttribType(index, kFloat32ArrayType); | 6140 SetVertexAttribType(index, kFloat32ArrayType); |
| 6140 } | 6141 } |
| 6141 | 6142 |
| 6142 void WebGLRenderingContextBase::vertexAttrib4fv( | 6143 void WebGLRenderingContextBase::vertexAttrib4fv( |
| 6143 GLuint index, | 6144 GLuint index, |
| 6144 NotShared<const DOMFloat32Array> v) { | 6145 MaybeShared<const DOMFloat32Array> v) { |
| 6145 if (isContextLost()) | 6146 if (isContextLost()) |
| 6146 return; | 6147 return; |
| 6147 if (!v.View() || v.View()->length() < 4) { | 6148 if (!v.View() || v.View()->length() < 4) { |
| 6148 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib4fv", "invalid array"); | 6149 SynthesizeGLError(GL_INVALID_VALUE, "vertexAttrib4fv", "invalid array"); |
| 6149 return; | 6150 return; |
| 6150 } | 6151 } |
| 6151 ContextGL()->VertexAttrib4fv(index, v.View()->Data()); | 6152 ContextGL()->VertexAttrib4fv(index, v.View()->Data()); |
| 6152 SetVertexAttribType(index, kFloat32ArrayType); | 6153 SetVertexAttribType(index, kFloat32ArrayType); |
| 6153 } | 6154 } |
| 6154 | 6155 |
| (...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7816 | 7817 |
| 7817 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7818 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
| 7818 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7819 HTMLCanvasElementOrOffscreenCanvas& result) const { |
| 7819 if (canvas()) | 7820 if (canvas()) |
| 7820 result.setHTMLCanvasElement(canvas()); | 7821 result.setHTMLCanvasElement(canvas()); |
| 7821 else | 7822 else |
| 7822 result.setOffscreenCanvas(offscreenCanvas()); | 7823 result.setOffscreenCanvas(offscreenCanvas()); |
| 7823 } | 7824 } |
| 7824 | 7825 |
| 7825 } // namespace blink | 7826 } // namespace blink |
| OLD | NEW |