Changeset 62150 in webkit
- Timestamp:
- Jun 29, 2010 3:22:16 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r62147 r62150 1 2010-06-29 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 uniformmatrix* should generate INVALID_VALUE with transpose = true 6 https://bugs.webkit.org/show_bug.cgi?id=41235 7 8 * fast/canvas/webgl/gl-uniformmatrix4fv-expected.txt: Added. 9 * fast/canvas/webgl/gl-uniformmatrix4fv.html: Added. 10 1 11 2010-06-29 Robert Hogan <robert@webkit.org> 2 12 -
trunk/WebCore/ChangeLog
r62145 r62150 1 2010-06-29 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 uniformmatrix* should generate INVALID_VALUE with transpose = true 6 https://bugs.webkit.org/show_bug.cgi?id=41235 7 8 Test: fast/canvas/webgl/gl-uniformmatrix4fv.html 9 10 * html/canvas/WebGLRenderingContext.cpp: 11 (WebCore::WebGLRenderingContext::uniformMatrix2fv): Call validateUniformMatrixParameters instead. 12 (WebCore::WebGLRenderingContext::uniformMatrix3fv): Ditto. 13 (WebCore::WebGLRenderingContext::uniformMatrix4fv): Ditto. 14 (WebCore::WebGLRenderingContext::validateUniformMatrixParameters): Validate input parameters for uniformMatrix*(). 15 * html/canvas/WebGLRenderingContext.h: Declare validateUniformMatrixParameters(). 16 1 17 2010-06-29 Kenneth Russell <kbr@google.com> 2 18 -
trunk/WebCore/html/canvas/WebGLRenderingContext.cpp
r62145 r62150 2892 2892 { 2893 2893 UNUSED_PARAM(ec); 2894 if (!location) 2895 return; 2896 2897 if (location->program() != m_currentProgram) { 2898 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2899 return; 2900 } 2901 2902 if (!v) { 2903 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 2904 return; 2905 } 2894 if (!validateUniformMatrixParameters(location, transpose, v)) 2895 return; 2906 2896 // FIXME: length needs to be a multiple of 4 2907 2897 m_context->uniformMatrix2fv(location->location(), transpose, v->data(), v->length() / 4); … … 2912 2902 { 2913 2903 UNUSED_PARAM(ec); 2914 if (!location) 2915 return; 2916 2917 if (location->program() != m_currentProgram) { 2918 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2919 return; 2920 } 2921 2922 if (!v) { 2923 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 2924 return; 2925 } 2904 if (!validateUniformMatrixParameters(location, transpose, v)) 2905 return; 2926 2906 // FIXME: length needs to be a multiple of 4 2927 2907 m_context->uniformMatrix2fv(location->location(), transpose, v, size / 4); … … 2932 2912 { 2933 2913 UNUSED_PARAM(ec); 2934 if (!location) 2935 return; 2936 2937 if (location->program() != m_currentProgram) { 2938 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2939 return; 2940 } 2941 2942 if (!v) { 2943 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 2944 return; 2945 } 2914 if (!validateUniformMatrixParameters(location, transpose, v)) 2915 return; 2946 2916 // FIXME: length needs to be a multiple of 9 2947 2917 m_context->uniformMatrix3fv(location->location(), transpose, v->data(), v->length() / 9); … … 2952 2922 { 2953 2923 UNUSED_PARAM(ec); 2954 if (!location) 2955 return; 2956 2957 if (location->program() != m_currentProgram) { 2958 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2959 return; 2960 } 2961 2962 if (!v) { 2963 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 2964 return; 2965 } 2924 if (!validateUniformMatrixParameters(location, transpose, v)) 2925 return; 2966 2926 // FIXME: length needs to be a multiple of 9 2967 2927 m_context->uniformMatrix3fv(location->location(), transpose, v, size / 9); … … 2972 2932 { 2973 2933 UNUSED_PARAM(ec); 2974 if (!location) 2975 return; 2976 2977 if (location->program() != m_currentProgram) { 2978 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2979 return; 2980 } 2981 2982 if (!v) { 2983 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 2984 return; 2985 } 2934 if (!validateUniformMatrixParameters(location, transpose, v)) 2935 return; 2986 2936 // FIXME: length needs to be a multiple of 16 2987 2937 m_context->uniformMatrix4fv(location->location(), transpose, v->data(), v->length() / 16); … … 2992 2942 { 2993 2943 UNUSED_PARAM(ec); 2994 if (!location) 2995 return; 2996 2997 if (location->program() != m_currentProgram) { 2998 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 2999 return; 3000 } 3001 3002 if (!v) { 3003 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3004 return; 3005 } 2944 if (!validateUniformMatrixParameters(location, transpose, v)) 2945 return; 3006 2946 // FIXME: length needs to be a multiple of 16 3007 2947 m_context->uniformMatrix4fv(location->location(), transpose, v, size / 16); … … 3647 3587 } 3648 3588 3589 bool WebGLRenderingContext::validateUniformMatrixParameters(const WebGLUniformLocation* location, bool transpose, void* v) 3590 { 3591 if (!location) 3592 return false; 3593 if (location->program() != m_currentProgram) { 3594 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 3595 return false; 3596 } 3597 if (!v) { 3598 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3599 return false; 3600 } 3601 if (transpose) { 3602 m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE); 3603 return false; 3604 } 3605 return true; 3606 } 3607 3649 3608 } // namespace WebCore 3650 3609 -
trunk/WebCore/html/canvas/WebGLRenderingContext.h
r62145 r62150 464 464 bool validateCapability(unsigned long); 465 465 466 // Helper function to validate input parameters for uniformMatrix functions. 467 bool validateUniformMatrixParameters(const WebGLUniformLocation* location, bool transpose, void* v); 468 466 469 friend class WebGLStateRestorer; 467 470 };
Note: See TracChangeset
for help on using the changeset viewer.