bug 907946 - re-enable EXT_packed_depth_stencil on OS X 10.9 - r=bjacob,jgilbert
authorGuillaume Abadie <gabadie@mozilla.com>
Thu, 22 Aug 2013 20:13:59 -0400
changeset 143981 13bbb02033f88cb8bee4e8ef6cb26b5f6101540e
parent 143980 fba54a00792c73a1b481b07fab9a01d7ac83c764
child 143982 6bedadef5f1395826583827d499c0c2139661200
push id32831
push usergabadie@mozilla.com
push dateFri, 23 Aug 2013 00:14:13 +0000
treeherdermozilla-inbound@13bbb02033f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob, jgilbert
bugs907946
milestone26.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 907946 - re-enable EXT_packed_depth_stencil on OS X 10.9 - r=bjacob,jgilbert
gfx/gl/GLContext.cpp
widget/cocoa/nsCocoaFeatures.h
widget/cocoa/nsCocoaFeatures.mm
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -23,16 +23,20 @@
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Preferences.h"
 
 #ifdef XP_MACOSX
 #include <CoreServices/CoreServices.h>
 #endif
 
+#if defined(MOZ_WIDGET_COCOA)
+#include "nsCocoaFeatures.h"
+#endif
+
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace gl {
 
 #ifdef DEBUG
 unsigned GLContext::sCurrentGLContextTLS = -1;
 #endif
@@ -906,18 +910,20 @@ GLContext::InitExtensions()
 
         // Some Adreno drivers do not report GL_OES_EGL_sync, but they really do support it.
         MarkExtensionSupported(OES_EGL_sync);
     }
 
 #ifdef XP_MACOSX
     // The Mac Nvidia driver, for versions up to and including 10.8, don't seem
     // to properly support this.  See 814839
+    // this has been fixed in Mac OS X 10.9. See 907946
     if (WorkAroundDriverBugs() &&
-        Vendor() == gl::GLContext::VendorNVIDIA)
+        Vendor() == gl::GLContext::VendorNVIDIA &&
+        !nsCocoaFeatures::OnMavericksOrLater())
     {
         MarkExtensionUnsupported(gl::GLContext::EXT_packed_depth_stencil);
     }
 #endif
 
 #ifdef DEBUG
     firstRun = false;
 #endif
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -9,13 +9,14 @@
 #include <stdint.h>
 
 class nsCocoaFeatures {
 public:
   static int32_t OSXVersion();
   static bool OnLionOrLater();
   static bool OnMountainLionOrLater();
   static bool SupportCoreAnimationPlugins();
+  static bool OnMavericksOrLater();
 
 private:
   static int32_t mOSXVersion;
 };
 #endif // nsCocoaFeatures_h_
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -2,16 +2,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #define MAC_OS_X_VERSION_MASK     0x0000FFFF
 #define MAC_OS_X_VERSION_10_6_HEX 0x00001060
 #define MAC_OS_X_VERSION_10_7_HEX 0x00001070
 #define MAC_OS_X_VERSION_10_8_HEX 0x00001080
+#define MAC_OS_X_VERSION_10_9_HEX 0x00001090
 
 // This API will not work for OS X 10.10, see Gestalt.h.
 
 #include "nsCocoaFeatures.h"
 #include "nsDebug.h"
 #include "nsObjCExceptions.h"
 
 #import <Cocoa/Cocoa.h>
@@ -81,8 +82,14 @@ nsCocoaFeatures::OnLionOrLater()
     return (OSXVersion() >= MAC_OS_X_VERSION_10_7_HEX);
 }
 
 /* static */ bool
 nsCocoaFeatures::OnMountainLionOrLater()
 {
     return (OSXVersion() >= MAC_OS_X_VERSION_10_8_HEX);
 }
+
+/* static */ bool
+nsCocoaFeatures::OnMavericksOrLater()
+{
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_9_HEX);
+}