Bug 665578 - Backed out changeset 82a297b0d0d3 for compile error
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 07 Nov 2011 17:32:07 -0500
changeset 79915 f70682372656d2b09bc704196acbb0a4538712ce
parent 79914 82a297b0d0d377f93ad09b84e2b425799c696bd1
child 79916 45c63bb1d7dfaa53acf004bf84ed9f9e6a4ceb20
push id3209
push userbjacob@mozilla.com
push dateMon, 07 Nov 2011 22:33:43 +0000
treeherdermozilla-inbound@f70682372656 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs665578
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 665578 - Backed out changeset 82a297b0d0d3 for compile error
content/canvas/src/WebGLContextGL.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -59,21 +59,16 @@
 #if defined(USE_ANGLE)
 // shader translator
 #include "angle/ShaderLang.h"
 #endif
 
 #include "WebGLTexelConversions.h"
 #include "WebGLValidateStrings.h"
 
-// needed to check if current OS is lower than 10.7
-#if defined(MOZ_WIDGET_COCOA)
-#include <Carbon/Carbon.h>
-#endif
-
 using namespace mozilla;
 
 static bool BaseTypeAndSizeFromUniformType(WebGLenum uType, WebGLenum *baseType, WebGLint *unitSize);
 static WebGLenum InternalFormatForFormatAndType(WebGLenum format, WebGLenum type, bool isGLES2);
 
 /* Helper macros for when we're just wrapping a gl method, so that
  * we can avoid having to type this 500 times.  Note that these MUST
  * NOT BE USED if we need to check any of the parameters.
@@ -4417,16 +4412,22 @@ WebGLContext::Viewport(WebGLint x, WebGL
     if (width < 0 || height < 0)
         return ErrorInvalidValue("Viewport: negative size");
 
     MakeContextCurrent();
     gl->fViewport(x, y, width, height);
     return NS_OK;
 }
 
+#ifdef XP_MACOSX
+#define WEBGL_OS_IS_MAC 1
+#else
+#define WEBGL_OS_IS_MAC 0
+#endif
+
 NS_IMETHODIMP
 WebGLContext::CompileShader(nsIWebGLShader *sobj)
 {
     if (mContextLost)
         return NS_OK;
 
     WebGLShader *shader;
     WebGLuint shadername;
@@ -4471,33 +4472,22 @@ WebGLContext::CompileShader(nsIWebGLShad
         // 7-bit ASCII range, so we can skip the NS_IsAscii() check.
         const nsCString& sourceCString = NS_LossyConvertUTF16toASCII(flatSource);
     
         const PRUint32 maxSourceLength = (PRUint32(1)<<18) - 1;
         if (sourceCString.Length() > maxSourceLength)
             return ErrorInvalidValue("compileShader: source has more than %d characters", maxSourceLength);
 
         const char *s = sourceCString.get();
-
+        
         int compileOptions = SH_OBJECT_CODE;
-
-#ifdef XP_MACOSX
+        
         // work around bug 665578
-        PRInt32 version = 0;
-        OSErr err = ::Gestalt(gestaltSystemVersion, &version);
-        if (err != noErr) {
-            version = 0;
-        } else {
-            version &= 0xFFFF; // The system version is in the lower word.
-        }
-
-        // If earlier than Snow Leopard and has an ATI card.
-        if (version < 0x1070 && gl->Vendor() == gl::GLContext::VendorATI)
+        if (WEBGL_OS_IS_MAC && gl->Vendor() == gl::GLContext::VendorATI)
             compileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS;
-#endif
 
         if (!ShCompile(compiler, &s, 1, compileOptions)) {
             int len = 0;
             ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &len);
 
             if (len) {
                 nsCAutoString info;
                 info.SetLength(len);