2011-05-26 Syed Idris Shah <syed.idris-shah@nokia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 May 2011 23:58:38 +0000 (23:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 May 2011 23:58:38 +0000 (23:58 +0000)
        Reviewed by Andreas Kling.

        [Qt] fast/canvas/webgl/gl-uniform-arrays.html failing for Qt on Linux
        https://bugs.webkit.org/show_bug.cgi?id=60377

        LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html

        For an array of active uniform, we should be careful while truncating the name of the uniform.
        Currently we are truncating the last three characters of an array with out checking for [0].
        As a result we are truncating the the actual name of the active uniforms i.e. color to co.

        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getUniform): Strip "[0]" from the name if it's an array and is part of the name.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87451 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContext.cpp

index b4530ac..3b5683f 100644 (file)
@@ -1,3 +1,19 @@
+2011-05-26  Syed Idris Shah  <syed.idris-shah@nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] fast/canvas/webgl/gl-uniform-arrays.html failing for Qt on Linux
+        https://bugs.webkit.org/show_bug.cgi?id=60377 
+
+        LayoutTests/fast/canvas/webgl/gl-uniform-arrays.html
+
+        For an array of active uniform, we should be careful while truncating the name of the uniform. 
+        Currently we are truncating the last three characters of an array with out checking for [0]. 
+        As a result we are truncating the the actual name of the active uniforms i.e. color to co. 
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getUniform): Strip "[0]" from the name if it's an array and is part of the name.
+
 2011-05-26  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r87444.
index 5a9dc48..fd9d598 100644 (file)
@@ -2444,7 +2444,7 @@ WebGLGetInfo WebGLRenderingContext::getUniform(WebGLProgram* program, const WebG
         if (!m_context->getActiveUniform(objectOrZero(program), i, info))
             return WebGLGetInfo();
         // Strip "[0]" from the name if it's an array.
-        if (info.size > 1)
+        if (info.size > 1 && info.name.endsWith("[0]"))
             info.name = info.name.left(info.name.length() - 3);
         // If it's an array, we need to iterate through each element, appending "[index]" to the name.
         for (GC3Dint index = 0; index < info.size; ++index) {