Title: [128047] trunk/Source/WebCore
Revision
128047
Author
[email protected]
Date
2012-09-10 05:34:52 -0700 (Mon, 10 Sep 2012)

Log Message

[TexMap] Fix compilation on Windows
https://bugs.webkit.org/show_bug.cgi?id=96257

Patch by Simon Hausmann <[email protected]> on 2012-09-10
Reviewed by Noam Rosenthal.

TextureMapperGL uses near and far as variable names and unfortunately
WinDefs.h on Windows has the nasty habit of unconditionally(!) defining
near and far as empty macros. There's no way to prevent WinDefs.h from
doing so. Instead we rename the variables. (Another option would've been to
#undef)

* platform/graphics/texmap/TextureMapperGL.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (128046 => 128047)


--- trunk/Source/WebCore/ChangeLog	2012-09-10 12:14:15 UTC (rev 128046)
+++ trunk/Source/WebCore/ChangeLog	2012-09-10 12:34:52 UTC (rev 128047)
@@ -1,3 +1,18 @@
+2012-09-10  Simon Hausmann  <[email protected]>
+
+        [TexMap] Fix compilation on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=96257
+
+        Reviewed by Noam Rosenthal.
+
+        TextureMapperGL uses near and far as variable names and unfortunately
+        WinDefs.h on Windows has the nasty habit of unconditionally(!) defining
+        near and far as empty macros. There's no way to prevent WinDefs.h from
+        doing so. Instead we rename the variables. (Another option would've been to
+        #undef)
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+
 2012-09-10  Alexander Pavlov  <[email protected]>
 
         Web Inspector: [Elements] Poor performance upon continuous attribute changes

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (128046 => 128047)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-09-10 12:14:15 UTC (rev 128046)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-09-10 12:34:52 UTC (rev 128047)
@@ -750,13 +750,13 @@
 
 static inline TransformationMatrix createProjectionMatrix(const IntSize& size, bool mirrored)
 {
-    const float near = 9999999;
-    const float far = -99999;
+    const float nearValue = 9999999;
+    const float farValue = -99999;
 
     return TransformationMatrix(2.0 / float(size.width()), 0, 0, 0,
                                 0, (mirrored ? 2.0 : -2.0) / float(size.height()), 0, 0,
-                                0, 0, -2.f / (far - near), 0,
-                                -1, mirrored ? -1 : 1, -(far + near) / (far - near), 1);
+                                0, 0, -2.f / (farValue - nearValue), 0,
+                                -1, mirrored ? -1 : 1, -(farValue + nearValue) / (farValue - nearValue), 1);
 }
 
 void BitmapTextureGL::initializeStencil()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to