Title: [193819] trunk/Source/WebCore
Revision
193819
Author
zandober...@gmail.com
Date
2015-12-09 03:26:30 -0800 (Wed, 09 Dec 2015)

Log Message

[TextureMapper] TextureMapperShaderProgram::setMatrix() should use TransformationMatrix::FloatMatrix4
https://bugs.webkit.org/show_bug.cgi?id=152042

Reviewed by Martin Robinson.

* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::setMatrix): Instead of manually writing out
the complete matrix in a C array, simply use TransformationMatrix::FloatMatrix4
and fill that via the TransformationMatrix::toColumnMajorFloatArray() method
called on the passed-in TransformationMatrix.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (193818 => 193819)


--- trunk/Source/WebCore/ChangeLog	2015-12-09 11:22:00 UTC (rev 193818)
+++ trunk/Source/WebCore/ChangeLog	2015-12-09 11:26:30 UTC (rev 193819)
@@ -1,5 +1,18 @@
 2015-12-09  Zan Dobersek  <zdober...@igalia.com>
 
+        [TextureMapper] TextureMapperShaderProgram::setMatrix() should use TransformationMatrix::FloatMatrix4
+        https://bugs.webkit.org/show_bug.cgi?id=152042
+
+        Reviewed by Martin Robinson.
+
+        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
+        (WebCore::TextureMapperShaderProgram::setMatrix): Instead of manually writing out
+        the complete matrix in a C array, simply use TransformationMatrix::FloatMatrix4
+        and fill that via the TransformationMatrix::toColumnMajorFloatArray() method
+        called on the passed-in TransformationMatrix.
+
+2015-12-09  Zan Dobersek  <zdober...@igalia.com>
+
         [Soup] Attach the SocketStreamHandleSoup write-ready source to the thread-default context
         https://bugs.webkit.org/show_bug.cgi?id=152041
 

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp (193818 => 193819)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2015-12-09 11:22:00 UTC (rev 193818)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2015-12-09 11:26:30 UTC (rev 193819)
@@ -73,14 +73,9 @@
 
 void TextureMapperShaderProgram::setMatrix(GC3Duint location, const TransformationMatrix& matrix)
 {
-    GC3Dfloat matrixAsFloats[] = {
-        GC3Dfloat(matrix.m11()), GC3Dfloat(matrix.m12()), GC3Dfloat(matrix.m13()), GC3Dfloat(matrix.m14()),
-        GC3Dfloat(matrix.m21()), GC3Dfloat(matrix.m22()), GC3Dfloat(matrix.m23()), GC3Dfloat(matrix.m24()),
-        GC3Dfloat(matrix.m31()), GC3Dfloat(matrix.m32()), GC3Dfloat(matrix.m33()), GC3Dfloat(matrix.m34()),
-        GC3Dfloat(matrix.m41()), GC3Dfloat(matrix.m42()), GC3Dfloat(matrix.m43()), GC3Dfloat(matrix.m44())
-    };
-
-    m_context->uniformMatrix4fv(location, 1, false, matrixAsFloats);
+    TransformationMatrix::FloatMatrix4 floatMatrix;
+    matrix.toColumnMajorFloatArray(floatMatrix);
+    m_context->uniformMatrix4fv(location, 1, false, floatMatrix);
 }
 
 GC3Duint TextureMapperShaderProgram::getLocation(const AtomicString& name, VariableType type)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to