| 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 "modules/webgl/WebGL2RenderingContextBase.h" | 5 #include "modules/webgl/WebGL2RenderingContextBase.h" |
| 6 | 6 |
| 7 #include "bindings/modules/v8/WebGLAny.h" | 7 #include "bindings/modules/v8/WebGLAny.h" |
| 8 #include "core/frame/ImageBitmap.h" | 8 #include "core/frame/ImageBitmap.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 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2869 return; | 2869 return; |
| 2870 contextGL()->UniformMatrix4fv( | 2870 contextGL()->UniformMatrix4fv( |
| 2871 location->location(), | 2871 location->location(), |
| 2872 (srcLength ? srcLength : (v.size() - srcOffset)) >> 4, transpose, | 2872 (srcLength ? srcLength : (v.size() - srcOffset)) >> 4, transpose, |
| 2873 v.data() + srcOffset); | 2873 v.data() + srcOffset); |
| 2874 } | 2874 } |
| 2875 | 2875 |
| 2876 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2876 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2877 const WebGLUniformLocation* location, | 2877 const WebGLUniformLocation* location, |
| 2878 GLboolean transpose, | 2878 GLboolean transpose, |
| 2879 DOMFloat32Array* value, | 2879 const MaybeShared<DOMFloat32Array>& value, |
| 2880 GLuint srcOffset, | 2880 GLuint srcOffset, |
| 2881 GLuint srcLength) { | 2881 GLuint srcLength) { |
| 2882 if (isContextLost() || | 2882 if (isContextLost() || |
| 2883 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2883 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, |
| 2884 transpose, value, 6, srcOffset, | 2884 transpose, value, 6, srcOffset, |
| 2885 srcLength)) | 2885 srcLength)) |
| 2886 return; | 2886 return; |
| 2887 contextGL()->UniformMatrix2x3fv( | 2887 contextGL()->UniformMatrix2x3fv( |
| 2888 location->location(), | 2888 location->location(), |
| 2889 (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose, | 2889 (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) / |
| 2890 value->data() + srcOffset); | 2890 6, |
| 2891 transpose, value.viewNotShared()->data() + srcOffset); |
| 2891 } | 2892 } |
| 2892 | 2893 |
| 2893 void WebGL2RenderingContextBase::uniformMatrix2x3fv( | 2894 void WebGL2RenderingContextBase::uniformMatrix2x3fv( |
| 2894 const WebGLUniformLocation* location, | 2895 const WebGLUniformLocation* location, |
| 2895 GLboolean transpose, | 2896 GLboolean transpose, |
| 2896 Vector<GLfloat>& value, | 2897 Vector<GLfloat>& value, |
| 2897 GLuint srcOffset, | 2898 GLuint srcOffset, |
| 2898 GLuint srcLength) { | 2899 GLuint srcLength) { |
| 2899 if (isContextLost() || | 2900 if (isContextLost() || |
| 2900 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, | 2901 !validateUniformMatrixParameters("uniformMatrix2x3fv", location, |
| 2901 transpose, value.data(), value.size(), 6, | 2902 transpose, value.data(), value.size(), 6, |
| 2902 srcOffset, srcLength)) | 2903 srcOffset, srcLength)) |
| 2903 return; | 2904 return; |
| 2904 contextGL()->UniformMatrix2x3fv( | 2905 contextGL()->UniformMatrix2x3fv( |
| 2905 location->location(), | 2906 location->location(), |
| 2906 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, | 2907 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, |
| 2907 value.data() + srcOffset); | 2908 value.data() + srcOffset); |
| 2908 } | 2909 } |
| 2909 | 2910 |
| 2910 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2911 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2911 const WebGLUniformLocation* location, | 2912 const WebGLUniformLocation* location, |
| 2912 GLboolean transpose, | 2913 GLboolean transpose, |
| 2913 DOMFloat32Array* value, | 2914 const MaybeShared<DOMFloat32Array>& value, |
| 2914 GLuint srcOffset, | 2915 GLuint srcOffset, |
| 2915 GLuint srcLength) { | 2916 GLuint srcLength) { |
| 2916 if (isContextLost() || | 2917 if (isContextLost() || |
| 2917 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, | 2918 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, |
| 2918 transpose, value, 6, srcOffset, | 2919 transpose, value, 6, srcOffset, |
| 2919 srcLength)) | 2920 srcLength)) |
| 2920 return; | 2921 return; |
| 2921 contextGL()->UniformMatrix3x2fv( | 2922 contextGL()->UniformMatrix3x2fv( |
| 2922 location->location(), | 2923 location->location(), |
| 2923 (srcLength ? srcLength : (value->length() - srcOffset)) / 6, transpose, | 2924 (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) / |
| 2924 value->data() + srcOffset); | 2925 6, |
| 2926 transpose, value.viewNotShared()->data() + srcOffset); |
| 2925 } | 2927 } |
| 2926 | 2928 |
| 2927 void WebGL2RenderingContextBase::uniformMatrix3x2fv( | 2929 void WebGL2RenderingContextBase::uniformMatrix3x2fv( |
| 2928 const WebGLUniformLocation* location, | 2930 const WebGLUniformLocation* location, |
| 2929 GLboolean transpose, | 2931 GLboolean transpose, |
| 2930 Vector<GLfloat>& value, | 2932 Vector<GLfloat>& value, |
| 2931 GLuint srcOffset, | 2933 GLuint srcOffset, |
| 2932 GLuint srcLength) { | 2934 GLuint srcLength) { |
| 2933 if (isContextLost() || | 2935 if (isContextLost() || |
| 2934 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, | 2936 !validateUniformMatrixParameters("uniformMatrix3x2fv", location, |
| 2935 transpose, value.data(), value.size(), 6, | 2937 transpose, value.data(), value.size(), 6, |
| 2936 srcOffset, srcLength)) | 2938 srcOffset, srcLength)) |
| 2937 return; | 2939 return; |
| 2938 contextGL()->UniformMatrix3x2fv( | 2940 contextGL()->UniformMatrix3x2fv( |
| 2939 location->location(), | 2941 location->location(), |
| 2940 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, | 2942 (srcLength ? srcLength : (value.size() - srcOffset)) / 6, transpose, |
| 2941 value.data() + srcOffset); | 2943 value.data() + srcOffset); |
| 2942 } | 2944 } |
| 2943 | 2945 |
| 2944 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2946 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2945 const WebGLUniformLocation* location, | 2947 const WebGLUniformLocation* location, |
| 2946 GLboolean transpose, | 2948 GLboolean transpose, |
| 2947 DOMFloat32Array* value, | 2949 const MaybeShared<DOMFloat32Array>& value, |
| 2948 GLuint srcOffset, | 2950 GLuint srcOffset, |
| 2949 GLuint srcLength) { | 2951 GLuint srcLength) { |
| 2950 if (isContextLost() || | 2952 if (isContextLost() || |
| 2951 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, | 2953 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, |
| 2952 transpose, value, 8, srcOffset, | 2954 transpose, value, 8, srcOffset, |
| 2953 srcLength)) | 2955 srcLength)) |
| 2954 return; | 2956 return; |
| 2955 contextGL()->UniformMatrix2x4fv( | 2957 contextGL()->UniformMatrix2x4fv( |
| 2956 location->location(), | 2958 location->location(), |
| 2957 (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose, | 2959 (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) >> |
| 2958 value->data() + srcOffset); | 2960 3, |
| 2961 transpose, value.viewNotShared()->data() + srcOffset); |
| 2959 } | 2962 } |
| 2960 | 2963 |
| 2961 void WebGL2RenderingContextBase::uniformMatrix2x4fv( | 2964 void WebGL2RenderingContextBase::uniformMatrix2x4fv( |
| 2962 const WebGLUniformLocation* location, | 2965 const WebGLUniformLocation* location, |
| 2963 GLboolean transpose, | 2966 GLboolean transpose, |
| 2964 Vector<GLfloat>& value, | 2967 Vector<GLfloat>& value, |
| 2965 GLuint srcOffset, | 2968 GLuint srcOffset, |
| 2966 GLuint srcLength) { | 2969 GLuint srcLength) { |
| 2967 if (isContextLost() || | 2970 if (isContextLost() || |
| 2968 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, | 2971 !validateUniformMatrixParameters("uniformMatrix2x4fv", location, |
| 2969 transpose, value.data(), value.size(), 8, | 2972 transpose, value.data(), value.size(), 8, |
| 2970 srcOffset, srcLength)) | 2973 srcOffset, srcLength)) |
| 2971 return; | 2974 return; |
| 2972 contextGL()->UniformMatrix2x4fv( | 2975 contextGL()->UniformMatrix2x4fv( |
| 2973 location->location(), | 2976 location->location(), |
| 2974 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, | 2977 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, |
| 2975 value.data() + srcOffset); | 2978 value.data() + srcOffset); |
| 2976 } | 2979 } |
| 2977 | 2980 |
| 2978 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2981 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 2979 const WebGLUniformLocation* location, | 2982 const WebGLUniformLocation* location, |
| 2980 GLboolean transpose, | 2983 GLboolean transpose, |
| 2981 DOMFloat32Array* value, | 2984 const MaybeShared<DOMFloat32Array>& value, |
| 2982 GLuint srcOffset, | 2985 GLuint srcOffset, |
| 2983 GLuint srcLength) { | 2986 GLuint srcLength) { |
| 2984 if (isContextLost() || | 2987 if (isContextLost() || |
| 2985 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, | 2988 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, |
| 2986 transpose, value, 8, srcOffset, | 2989 transpose, value, 8, srcOffset, |
| 2987 srcLength)) | 2990 srcLength)) |
| 2988 return; | 2991 return; |
| 2989 contextGL()->UniformMatrix4x2fv( | 2992 contextGL()->UniformMatrix4x2fv( |
| 2990 location->location(), | 2993 location->location(), |
| 2991 (srcLength ? srcLength : (value->length() - srcOffset)) >> 3, transpose, | 2994 (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) >> |
| 2992 value->data() + srcOffset); | 2995 3, |
| 2996 transpose, value.viewNotShared()->data() + srcOffset); |
| 2993 } | 2997 } |
| 2994 | 2998 |
| 2995 void WebGL2RenderingContextBase::uniformMatrix4x2fv( | 2999 void WebGL2RenderingContextBase::uniformMatrix4x2fv( |
| 2996 const WebGLUniformLocation* location, | 3000 const WebGLUniformLocation* location, |
| 2997 GLboolean transpose, | 3001 GLboolean transpose, |
| 2998 Vector<GLfloat>& value, | 3002 Vector<GLfloat>& value, |
| 2999 GLuint srcOffset, | 3003 GLuint srcOffset, |
| 3000 GLuint srcLength) { | 3004 GLuint srcLength) { |
| 3001 if (isContextLost() || | 3005 if (isContextLost() || |
| 3002 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, | 3006 !validateUniformMatrixParameters("uniformMatrix4x2fv", location, |
| 3003 transpose, value.data(), value.size(), 8, | 3007 transpose, value.data(), value.size(), 8, |
| 3004 srcOffset, srcLength)) | 3008 srcOffset, srcLength)) |
| 3005 return; | 3009 return; |
| 3006 contextGL()->UniformMatrix4x2fv( | 3010 contextGL()->UniformMatrix4x2fv( |
| 3007 location->location(), | 3011 location->location(), |
| 3008 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, | 3012 (srcLength ? srcLength : (value.size() - srcOffset)) >> 3, transpose, |
| 3009 value.data() + srcOffset); | 3013 value.data() + srcOffset); |
| 3010 } | 3014 } |
| 3011 | 3015 |
| 3012 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3016 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3013 const WebGLUniformLocation* location, | 3017 const WebGLUniformLocation* location, |
| 3014 GLboolean transpose, | 3018 GLboolean transpose, |
| 3015 DOMFloat32Array* value, | 3019 const MaybeShared<DOMFloat32Array>& value, |
| 3016 GLuint srcOffset, | 3020 GLuint srcOffset, |
| 3017 GLuint srcLength) { | 3021 GLuint srcLength) { |
| 3018 if (isContextLost() || | 3022 if (isContextLost() || |
| 3019 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3023 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, |
| 3020 transpose, value, 12, srcOffset, | 3024 transpose, value, 12, srcOffset, |
| 3021 srcLength)) | 3025 srcLength)) |
| 3022 return; | 3026 return; |
| 3023 contextGL()->UniformMatrix3x4fv( | 3027 contextGL()->UniformMatrix3x4fv( |
| 3024 location->location(), | 3028 location->location(), |
| 3025 (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose, | 3029 (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) / |
| 3026 value->data() + srcOffset); | 3030 12, |
| 3031 transpose, value.viewNotShared()->data() + srcOffset); |
| 3027 } | 3032 } |
| 3028 | 3033 |
| 3029 void WebGL2RenderingContextBase::uniformMatrix3x4fv( | 3034 void WebGL2RenderingContextBase::uniformMatrix3x4fv( |
| 3030 const WebGLUniformLocation* location, | 3035 const WebGLUniformLocation* location, |
| 3031 GLboolean transpose, | 3036 GLboolean transpose, |
| 3032 Vector<GLfloat>& value, | 3037 Vector<GLfloat>& value, |
| 3033 GLuint srcOffset, | 3038 GLuint srcOffset, |
| 3034 GLuint srcLength) { | 3039 GLuint srcLength) { |
| 3035 if (isContextLost() || | 3040 if (isContextLost() || |
| 3036 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, | 3041 !validateUniformMatrixParameters("uniformMatrix3x4fv", location, |
| 3037 transpose, value.data(), value.size(), | 3042 transpose, value.data(), value.size(), |
| 3038 12, srcOffset, srcLength)) | 3043 12, srcOffset, srcLength)) |
| 3039 return; | 3044 return; |
| 3040 contextGL()->UniformMatrix3x4fv( | 3045 contextGL()->UniformMatrix3x4fv( |
| 3041 location->location(), | 3046 location->location(), |
| 3042 (srcLength ? srcLength : (value.size() - srcOffset)) / 12, transpose, | 3047 (srcLength ? srcLength : (value.size() - srcOffset)) / 12, transpose, |
| 3043 value.data() + srcOffset); | 3048 value.data() + srcOffset); |
| 3044 } | 3049 } |
| 3045 | 3050 |
| 3046 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3051 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3047 const WebGLUniformLocation* location, | 3052 const WebGLUniformLocation* location, |
| 3048 GLboolean transpose, | 3053 GLboolean transpose, |
| 3049 DOMFloat32Array* value, | 3054 const MaybeShared<DOMFloat32Array>& value, |
| 3050 GLuint srcOffset, | 3055 GLuint srcOffset, |
| 3051 GLuint srcLength) { | 3056 GLuint srcLength) { |
| 3052 if (isContextLost() || | 3057 if (isContextLost() || |
| 3053 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3058 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, |
| 3054 transpose, value, 12, srcOffset, | 3059 transpose, value, 12, srcOffset, |
| 3055 srcLength)) | 3060 srcLength)) |
| 3056 return; | 3061 return; |
| 3057 contextGL()->UniformMatrix4x3fv( | 3062 contextGL()->UniformMatrix4x3fv( |
| 3058 location->location(), | 3063 location->location(), |
| 3059 (srcLength ? srcLength : (value->length() - srcOffset)) / 12, transpose, | 3064 (srcLength ? srcLength : (value.viewNotShared()->length() - srcOffset)) / |
| 3060 value->data() + srcOffset); | 3065 12, |
| 3066 transpose, value.viewNotShared()->data() + srcOffset); |
| 3061 } | 3067 } |
| 3062 | 3068 |
| 3063 void WebGL2RenderingContextBase::uniformMatrix4x3fv( | 3069 void WebGL2RenderingContextBase::uniformMatrix4x3fv( |
| 3064 const WebGLUniformLocation* location, | 3070 const WebGLUniformLocation* location, |
| 3065 GLboolean transpose, | 3071 GLboolean transpose, |
| 3066 Vector<GLfloat>& value, | 3072 Vector<GLfloat>& value, |
| 3067 GLuint srcOffset, | 3073 GLuint srcOffset, |
| 3068 GLuint srcLength) { | 3074 GLuint srcLength) { |
| 3069 if (isContextLost() || | 3075 if (isContextLost() || |
| 3070 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, | 3076 !validateUniformMatrixParameters("uniformMatrix4x3fv", location, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3219 GLint x, | 3225 GLint x, |
| 3220 GLint y, | 3226 GLint y, |
| 3221 GLint z, | 3227 GLint z, |
| 3222 GLint w) { | 3228 GLint w) { |
| 3223 if (isContextLost()) | 3229 if (isContextLost()) |
| 3224 return; | 3230 return; |
| 3225 contextGL()->VertexAttribI4i(index, x, y, z, w); | 3231 contextGL()->VertexAttribI4i(index, x, y, z, w); |
| 3226 setVertexAttribType(index, Int32ArrayType); | 3232 setVertexAttribType(index, Int32ArrayType); |
| 3227 } | 3233 } |
| 3228 | 3234 |
| 3229 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, | 3235 void WebGL2RenderingContextBase::vertexAttribI4iv( |
| 3230 const DOMInt32Array* v) { | 3236 GLuint index, |
| 3231 if (isContextLost()) | 3237 const MaybeShared<const DOMInt32Array>& v) { |
| 3238 if (isContextLost() || !validateNotSharedArrayBuffer("vertexAttribI4iv", v)) |
| 3232 return; | 3239 return; |
| 3233 if (!v || v->length() < 4) { | 3240 if (!v || v.viewNotShared()->length() < 4) { |
| 3234 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3241 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3235 return; | 3242 return; |
| 3236 } | 3243 } |
| 3237 contextGL()->VertexAttribI4iv(index, v->data()); | 3244 contextGL()->VertexAttribI4iv(index, v.viewNotShared()->data()); |
| 3238 setVertexAttribType(index, Int32ArrayType); | 3245 setVertexAttribType(index, Int32ArrayType); |
| 3239 } | 3246 } |
| 3240 | 3247 |
| 3241 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, | 3248 void WebGL2RenderingContextBase::vertexAttribI4iv(GLuint index, |
| 3242 const Vector<GLint>& v) { | 3249 const Vector<GLint>& v) { |
| 3243 if (isContextLost()) | 3250 if (isContextLost()) |
| 3244 return; | 3251 return; |
| 3245 if (v.size() < 4) { | 3252 if (v.size() < 4) { |
| 3246 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); | 3253 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4iv", "invalid array"); |
| 3247 return; | 3254 return; |
| 3248 } | 3255 } |
| 3249 contextGL()->VertexAttribI4iv(index, v.data()); | 3256 contextGL()->VertexAttribI4iv(index, v.data()); |
| 3250 setVertexAttribType(index, Int32ArrayType); | 3257 setVertexAttribType(index, Int32ArrayType); |
| 3251 } | 3258 } |
| 3252 | 3259 |
| 3253 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, | 3260 void WebGL2RenderingContextBase::vertexAttribI4ui(GLuint index, |
| 3254 GLuint x, | 3261 GLuint x, |
| 3255 GLuint y, | 3262 GLuint y, |
| 3256 GLuint z, | 3263 GLuint z, |
| 3257 GLuint w) { | 3264 GLuint w) { |
| 3258 if (isContextLost()) | 3265 if (isContextLost()) |
| 3259 return; | 3266 return; |
| 3260 contextGL()->VertexAttribI4ui(index, x, y, z, w); | 3267 contextGL()->VertexAttribI4ui(index, x, y, z, w); |
| 3261 setVertexAttribType(index, Uint32ArrayType); | 3268 setVertexAttribType(index, Uint32ArrayType); |
| 3262 } | 3269 } |
| 3263 | 3270 |
| 3264 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, | 3271 void WebGL2RenderingContextBase::vertexAttribI4uiv( |
| 3265 const DOMUint32Array* v) { | 3272 GLuint index, |
| 3266 if (isContextLost()) | 3273 const MaybeShared<const DOMUint32Array>& v) { |
| 3274 if (isContextLost() || !validateNotSharedArrayBuffer("vertexAttribI4uiv", v)) |
| 3267 return; | 3275 return; |
| 3268 if (!v || v->length() < 4) { | 3276 if (!v || v.viewNotShared()->length() < 4) { |
| 3269 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3277 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3270 return; | 3278 return; |
| 3271 } | 3279 } |
| 3272 contextGL()->VertexAttribI4uiv(index, v->data()); | 3280 contextGL()->VertexAttribI4uiv(index, v.viewNotShared()->data()); |
| 3273 setVertexAttribType(index, Uint32ArrayType); | 3281 setVertexAttribType(index, Uint32ArrayType); |
| 3274 } | 3282 } |
| 3275 | 3283 |
| 3276 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, | 3284 void WebGL2RenderingContextBase::vertexAttribI4uiv(GLuint index, |
| 3277 const Vector<GLuint>& v) { | 3285 const Vector<GLuint>& v) { |
| 3278 if (isContextLost()) | 3286 if (isContextLost()) |
| 3279 return; | 3287 return; |
| 3280 if (v.size() < 4) { | 3288 if (v.size() < 4) { |
| 3281 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); | 3289 synthesizeGLError(GL_INVALID_VALUE, "vertexAttribI4uiv", "invalid array"); |
| 3282 return; | 3290 return; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3475 | 3483 |
| 3476 WebGLTexture* WebGL2RenderingContextBase::validateTexImageBinding( | 3484 WebGLTexture* WebGL2RenderingContextBase::validateTexImageBinding( |
| 3477 const char* funcName, | 3485 const char* funcName, |
| 3478 TexImageFunctionID functionID, | 3486 TexImageFunctionID functionID, |
| 3479 GLenum target) { | 3487 GLenum target) { |
| 3480 if (functionID == TexImage3D || functionID == TexSubImage3D) | 3488 if (functionID == TexImage3D || functionID == TexSubImage3D) |
| 3481 return validateTexture3DBinding(funcName, target); | 3489 return validateTexture3DBinding(funcName, target); |
| 3482 return validateTexture2DBinding(funcName, target); | 3490 return validateTexture2DBinding(funcName, target); |
| 3483 } | 3491 } |
| 3484 | 3492 |
| 3485 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3493 void WebGL2RenderingContextBase::clearBufferiv( |
| 3486 GLint drawbuffer, | 3494 GLenum buffer, |
| 3487 DOMInt32Array* value) { | 3495 GLint drawbuffer, |
| 3496 const MaybeShared<DOMInt32Array>& value) { |
| 3488 if (isContextLost() || | 3497 if (isContextLost() || |
| 3489 !validateClearBuffer("clearBufferiv", buffer, value->length())) | 3498 !validateNotSharedArrayBuffer("clearBufferiv", value) || |
| 3499 !validateClearBuffer("clearBufferiv", buffer, |
| 3500 value.viewNotShared()->length())) |
| 3490 return; | 3501 return; |
| 3491 | 3502 |
| 3492 contextGL()->ClearBufferiv(buffer, drawbuffer, value->data()); | 3503 contextGL()->ClearBufferiv(buffer, drawbuffer, value.viewNotShared()->data()); |
| 3493 } | 3504 } |
| 3494 | 3505 |
| 3495 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, | 3506 void WebGL2RenderingContextBase::clearBufferiv(GLenum buffer, |
| 3496 GLint drawbuffer, | 3507 GLint drawbuffer, |
| 3497 const Vector<GLint>& value) { | 3508 const Vector<GLint>& value) { |
| 3498 if (isContextLost() || | 3509 if (isContextLost() || |
| 3499 !validateClearBuffer("clearBufferiv", buffer, value.size())) | 3510 !validateClearBuffer("clearBufferiv", buffer, value.size())) |
| 3500 return; | 3511 return; |
| 3501 | 3512 |
| 3502 contextGL()->ClearBufferiv(buffer, drawbuffer, value.data()); | 3513 contextGL()->ClearBufferiv(buffer, drawbuffer, value.data()); |
| 3503 } | 3514 } |
| 3504 | 3515 |
| 3505 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3516 void WebGL2RenderingContextBase::clearBufferuiv( |
| 3506 GLint drawbuffer, | 3517 GLenum buffer, |
| 3507 DOMUint32Array* value) { | 3518 GLint drawbuffer, |
| 3519 const MaybeShared<DOMUint32Array>& value) { |
| 3508 if (isContextLost() || | 3520 if (isContextLost() || |
| 3509 !validateClearBuffer("clearBufferuiv", buffer, value->length())) | 3521 !validateNotSharedArrayBuffer("clearBufferuiv", value) || |
| 3522 !validateClearBuffer("clearBufferuiv", buffer, |
| 3523 value.viewNotShared()->length())) |
| 3510 return; | 3524 return; |
| 3511 | 3525 |
| 3512 contextGL()->ClearBufferuiv(buffer, drawbuffer, value->data()); | 3526 contextGL()->ClearBufferuiv(buffer, drawbuffer, |
| 3527 value.viewNotShared()->data()); |
| 3513 } | 3528 } |
| 3514 | 3529 |
| 3515 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, | 3530 void WebGL2RenderingContextBase::clearBufferuiv(GLenum buffer, |
| 3516 GLint drawbuffer, | 3531 GLint drawbuffer, |
| 3517 const Vector<GLuint>& value) { | 3532 const Vector<GLuint>& value) { |
| 3518 if (isContextLost() || | 3533 if (isContextLost() || |
| 3519 !validateClearBuffer("clearBufferuiv", buffer, value.size())) | 3534 !validateClearBuffer("clearBufferuiv", buffer, value.size())) |
| 3520 return; | 3535 return; |
| 3521 | 3536 |
| 3522 contextGL()->ClearBufferuiv(buffer, drawbuffer, value.data()); | 3537 contextGL()->ClearBufferuiv(buffer, drawbuffer, value.data()); |
| 3523 } | 3538 } |
| 3524 | 3539 |
| 3525 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3540 void WebGL2RenderingContextBase::clearBufferfv( |
| 3526 GLint drawbuffer, | 3541 GLenum buffer, |
| 3527 DOMFloat32Array* value) { | 3542 GLint drawbuffer, |
| 3543 const MaybeShared<DOMFloat32Array>& value) { |
| 3528 if (isContextLost() || | 3544 if (isContextLost() || |
| 3529 !validateClearBuffer("clearBufferfv", buffer, value->length())) | 3545 !validateNotSharedArrayBuffer("clearBufferfv", value) || |
| 3546 !validateClearBuffer("clearBufferfv", buffer, |
| 3547 value.viewNotShared()->length())) |
| 3530 return; | 3548 return; |
| 3531 | 3549 |
| 3532 contextGL()->ClearBufferfv(buffer, drawbuffer, value->data()); | 3550 contextGL()->ClearBufferfv(buffer, drawbuffer, value.viewNotShared()->data()); |
| 3533 } | 3551 } |
| 3534 | 3552 |
| 3535 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, | 3553 void WebGL2RenderingContextBase::clearBufferfv(GLenum buffer, |
| 3536 GLint drawbuffer, | 3554 GLint drawbuffer, |
| 3537 const Vector<GLfloat>& value) { | 3555 const Vector<GLfloat>& value) { |
| 3538 if (isContextLost() || | 3556 if (isContextLost() || |
| 3539 !validateClearBuffer("clearBufferfv", buffer, value.size())) | 3557 !validateClearBuffer("clearBufferfv", buffer, value.size())) |
| 3540 return; | 3558 return; |
| 3541 | 3559 |
| 3542 contextGL()->ClearBufferfv(buffer, drawbuffer, value.data()); | 3560 contextGL()->ClearBufferfv(buffer, drawbuffer, value.data()); |
| (...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5667 | 5685 |
| 5668 void WebGL2RenderingContextBase:: | 5686 void WebGL2RenderingContextBase:: |
| 5669 DrawingBufferClientRestorePixelUnpackBufferBinding() { | 5687 DrawingBufferClientRestorePixelUnpackBufferBinding() { |
| 5670 if (!contextGL()) | 5688 if (!contextGL()) |
| 5671 return; | 5689 return; |
| 5672 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, | 5690 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, |
| 5673 objectOrZero(m_boundPixelUnpackBuffer.get())); | 5691 objectOrZero(m_boundPixelUnpackBuffer.get())); |
| 5674 } | 5692 } |
| 5675 | 5693 |
| 5676 } // namespace blink | 5694 } // namespace blink |
| OLD | NEW |