| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/webgl/WebGL2RenderingContextBase.h" | 6 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 7 | 7 |
| 8 #include "bindings/modules/v8/WebGLAny.h" | 8 #include "bindings/modules/v8/WebGLAny.h" |
| 9 #include "core/html/HTMLCanvasElement.h" | 9 #include "core/html/HTMLCanvasElement.h" |
| 10 #include "core/html/HTMLImageElement.h" | 10 #include "core/html/HTMLImageElement.h" |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 return; | 916 return; |
| 917 | 917 |
| 918 if (location->program() != m_currentProgram) { | 918 if (location->program() != m_currentProgram) { |
| 919 synthesizeGLError(GL_INVALID_OPERATION, "uniform4ui", "location not for
current program"); | 919 synthesizeGLError(GL_INVALID_OPERATION, "uniform4ui", "location not for
current program"); |
| 920 return; | 920 return; |
| 921 } | 921 } |
| 922 | 922 |
| 923 webContext()->uniform4ui(location->location(), v0, v1, v2, v3); | 923 webContext()->uniform4ui(location->location(), v0, v1, v2, v3); |
| 924 } | 924 } |
| 925 | 925 |
| 926 void WebGL2RenderingContextBase::uniform1uiv(const WebGLUniformLocation* locatio
n, const FlexibleUint32ArrayView& v) |
| 927 { |
| 928 if (isContextLost() || !validateUniformParameters<WTF::Uint32Array>("uniform
1uiv", location, v, 1)) |
| 929 return; |
| 930 |
| 931 webContext()->uniform1uiv(location->location(), v.length(), v.dataMaybeOnSta
ck()); |
| 932 } |
| 933 |
| 926 void WebGL2RenderingContextBase::uniform1uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) | 934 void WebGL2RenderingContextBase::uniform1uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) |
| 927 { | 935 { |
| 928 if (isContextLost() || validateUniformParameters("uniform1uiv", location, va
lue.data(), value.size(), 1)) | 936 if (isContextLost() || !validateUniformParameters("uniform1uiv", location, v
alue.data(), value.size(), 1)) |
| 929 return; | 937 return; |
| 930 | 938 |
| 931 webContext()->uniform1uiv(location->location(), value.size(), value.data()); | 939 webContext()->uniform1uiv(location->location(), value.size(), value.data()); |
| 932 } | 940 } |
| 933 | 941 |
| 942 void WebGL2RenderingContextBase::uniform2uiv(const WebGLUniformLocation* locatio
n, const FlexibleUint32ArrayView& v) |
| 943 { |
| 944 if (isContextLost() || !validateUniformParameters<WTF::Uint32Array>("uniform
2uiv", location, v, 2)) |
| 945 return; |
| 946 |
| 947 webContext()->uniform2uiv(location->location(), v.length() >> 1, v.dataMaybe
OnStack()); |
| 948 } |
| 949 |
| 934 void WebGL2RenderingContextBase::uniform2uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) | 950 void WebGL2RenderingContextBase::uniform2uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) |
| 935 { | 951 { |
| 936 if (isContextLost() || !validateUniformParameters("uniform2uiv", location, v
alue.data(), value.size(), 2)) | 952 if (isContextLost() || !validateUniformParameters("uniform2uiv", location, v
alue.data(), value.size(), 2)) |
| 937 return; | 953 return; |
| 938 | 954 |
| 939 webContext()->uniform2uiv(location->location(), value.size() / 2, value.data
()); | 955 webContext()->uniform2uiv(location->location(), value.size() / 2, value.data
()); |
| 940 } | 956 } |
| 941 | 957 |
| 958 void WebGL2RenderingContextBase::uniform3uiv(const WebGLUniformLocation* locatio
n, const FlexibleUint32ArrayView& v) |
| 959 { |
| 960 if (isContextLost() || !validateUniformParameters<WTF::Uint32Array>("uniform
3uiv", location, v, 3)) |
| 961 return; |
| 962 |
| 963 webContext()->uniform3uiv(location->location(), v.length() / 3, v.dataMaybeO
nStack()); |
| 964 } |
| 965 |
| 942 void WebGL2RenderingContextBase::uniform3uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) | 966 void WebGL2RenderingContextBase::uniform3uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) |
| 943 { | 967 { |
| 944 if (isContextLost() || !validateUniformParameters("uniform3uiv", location, v
alue.data(), value.size(), 3)) | 968 if (isContextLost() || !validateUniformParameters("uniform3uiv", location, v
alue.data(), value.size(), 3)) |
| 945 return; | 969 return; |
| 946 | 970 |
| 947 webContext()->uniform3uiv(location->location(), value.size() / 3, value.data
()); | 971 webContext()->uniform3uiv(location->location(), value.size() / 3, value.data
()); |
| 948 } | 972 } |
| 949 | 973 |
| 974 void WebGL2RenderingContextBase::uniform4uiv(const WebGLUniformLocation* locatio
n, const FlexibleUint32ArrayView& v) |
| 975 { |
| 976 if (isContextLost() || !validateUniformParameters<WTF::Uint32Array>("uniform
4uiv", location, v, 4)) |
| 977 return; |
| 978 |
| 979 webContext()->uniform4uiv(location->location(), v.length() >> 2, v.dataMaybe
OnStack()); |
| 980 } |
| 981 |
| 950 void WebGL2RenderingContextBase::uniform4uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) | 982 void WebGL2RenderingContextBase::uniform4uiv(const WebGLUniformLocation* locatio
n, Vector<GLuint>& value) |
| 951 { | 983 { |
| 952 if (isContextLost() || !validateUniformParameters("uniform4uiv", location, v
alue.data(), value.size(), 4)) | 984 if (isContextLost() || !validateUniformParameters("uniform4uiv", location, v
alue.data(), value.size(), 4)) |
| 953 return; | 985 return; |
| 954 | 986 |
| 955 webContext()->uniform4uiv(location->location(), value.size() / 4, value.data
()); | 987 webContext()->uniform4uiv(location->location(), value.size() / 4, value.data
()); |
| 956 } | 988 } |
| 957 | 989 |
| 958 void WebGL2RenderingContextBase::uniformMatrix2x3fv(const WebGLUniformLocation*
location, GLboolean transpose, DOMFloat32Array* value) | 990 void WebGL2RenderingContextBase::uniformMatrix2x3fv(const WebGLUniformLocation*
location, GLboolean transpose, DOMFloat32Array* value) |
| 959 { | 991 { |
| (...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2908 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() | 2940 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat() |
| 2909 { | 2941 { |
| 2910 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) | 2942 if (m_readFramebufferBinding && m_readFramebufferBinding->object()) |
| 2911 return m_readFramebufferBinding->colorBufferFormat(); | 2943 return m_readFramebufferBinding->colorBufferFormat(); |
| 2912 if (m_requestedAttributes.alpha()) | 2944 if (m_requestedAttributes.alpha()) |
| 2913 return GL_RGBA; | 2945 return GL_RGBA; |
| 2914 return GL_RGB; | 2946 return GL_RGB; |
| 2915 } | 2947 } |
| 2916 | 2948 |
| 2917 } // namespace blink | 2949 } // namespace blink |
| OLD | NEW |