Bug 1280827 - Remove some obsolete OS X version checks in gfx/. r=jrmuizel.
authorstefanh@inbox.com
Sun, 10 Jul 2016 13:11:33 +0200
changeset 344437 b5ec1de16b8155a721f9fbd6eb9dd13d9f0c3b11
parent 344436 1432b1e6d1ade9b3cdbd03caf5f1602740ab6a10
child 344438 999f189f11473c3a027f58fa859724fa7be20f30
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1280827
milestone50.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 1280827 - Remove some obsolete OS X version checks in gfx/. r=jrmuizel.
gfx/gl/GLContext.cpp
gfx/gl/GLContextFeatures.cpp
gfx/layers/opengl/CompositorOGL.cpp
gfx/thebes/gfxFontEntry.cpp
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatformMac.cpp
gfx/thebes/gfxPlatformMac.h
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -1012,25 +1012,19 @@ GLContext::InitWithPrefixImpl(const char
         if (mVendor == GLVendor::Intel) {
             // see bug 737182 for 2D textures, bug 684882 for cube map textures.
             mMaxTextureSize        = std::min(mMaxTextureSize,        4096);
             mMaxCubeMapTextureSize = std::min(mMaxCubeMapTextureSize, 512);
             // for good measure, we align renderbuffers on what we do for 2D textures
             mMaxRenderbufferSize   = std::min(mMaxRenderbufferSize,   4096);
             mNeedsTextureSizeChecks = true;
         } else if (mVendor == GLVendor::NVIDIA) {
-            if (nsCocoaFeatures::OnMountainLionOrLater()) {
-                // See bug 879656.  8192 fails, 8191 works.
-                mMaxTextureSize = std::min(mMaxTextureSize, 8191);
-                mMaxRenderbufferSize = std::min(mMaxRenderbufferSize, 8191);
-            } else {
-                // See bug 877949.
-                mMaxTextureSize = std::min(mMaxTextureSize, 4096);
-                mMaxRenderbufferSize = std::min(mMaxRenderbufferSize, 4096);
-            }
+            // See bug 879656.  8192 fails, 8191 works.
+            mMaxTextureSize = std::min(mMaxTextureSize, 8191);
+            mMaxRenderbufferSize = std::min(mMaxRenderbufferSize, 8191);
 
             // Part of the bug 879656, but it also doesn't hurt the 877949
             mNeedsTextureSizeChecks = true;
         }
     }
 #endif
 #ifdef MOZ_X11
     if (mWorkAroundDriverBugs) {
--- a/gfx/gl/GLContextFeatures.cpp
+++ b/gfx/gl/GLContextFeatures.cpp
@@ -1,20 +1,16 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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/. */
 
 #include "GLContext.h"
 #include "nsPrintfCString.h"
 
-#ifdef XP_MACOSX
-#include "nsCocoaFeatures.h"
-#endif
-
 namespace mozilla {
 namespace gl {
 
 const size_t kMAX_EXTENSION_GROUP_SIZE = 5;
 
 enum class GLVersion : uint32_t {
     NONE  = 0,   // Feature is not supported natively by GL
     GL1_2 = 120,
@@ -880,26 +876,16 @@ GLContext::InitFeatures()
     if (ShouldDumpExts()) {
         for (size_t featureId = 0; featureId < size_t(GLFeature::EnumMax); featureId++) {
             GLFeature feature = GLFeature(featureId);
             printf_stderr("[%s] Feature::%s\n",
                           IsSupported(feature) ? "enabled" : "disabled",
                           GetFeatureName(feature));
         }
     }
-
-    if (WorkAroundDriverBugs()) {
-#ifdef XP_MACOSX
-        // MacOSX 10.6 reports to support EXT_framebuffer_sRGB and EXT_texture_sRGB but
-        // fails to convert from sRGB to linear when reading from an sRGB texture attached
-        // to an FBO. (bug 843668)
-        if (!nsCocoaFeatures::OnLionOrLater())
-            MarkUnsupported(GLFeature::sRGB_framebuffer);
-#endif // XP_MACOSX
-    }
 }
 
 void
 GLContext::MarkUnsupported(GLFeature feature)
 {
     mAvailableFeatures[size_t(feature)] = false;
 
     const FeatureInfo& featureInfo = GetFeatureInfo(feature);
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -41,20 +41,16 @@
 #include "GLReadTexImageHelper.h"
 #include "GLBlitTextureImageHelper.h"
 #include "HeapCopyOfStackArray.h"
 
 #if MOZ_WIDGET_ANDROID
 #include "TexturePoolOGL.h"
 #endif
 
-#ifdef XP_MACOSX
-#include "nsCocoaFeatures.h"
-#endif
-
 #include "GeckoProfiler.h"
 
 namespace mozilla {
 
 using namespace std;
 using namespace gfx;
 
 namespace layers {
@@ -1434,31 +1430,16 @@ CompositorOGL::DrawQuad(const Rect& aRec
       BindAndDrawQuadWithTextureRect(program,
                                      aRect,
                                      effectComponentAlpha->mTextureCoords,
                                      effectComponentAlpha->mOnBlack);
 
       // Pass 2.
       gl()->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE,
                                LOCAL_GL_ONE, LOCAL_GL_ONE);
-
-#ifdef XP_MACOSX
-      if (gl()->WorkAroundDriverBugs() &&
-          gl()->Vendor() == GLVendor::NVIDIA &&
-          !nsCocoaFeatures::OnMavericksOrLater()) {
-        // Bug 987497: With some GPUs the nvidia driver on 10.8 and below
-        // won't pick up the TexturePass2 uniform change below if we don't do
-        // something to force it. Re-activating the shader seems to be one way
-        // of achieving that.
-        GLint program;
-        mGLContext->fGetIntegerv(LOCAL_GL_CURRENT_PROGRAM, &program);
-        mGLContext->fUseProgram(program);
-      }
-#endif
-
       program->SetTexturePass2(true);
       BindAndDrawQuadWithTextureRect(program,
                                      aRect,
                                      effectComponentAlpha->mTextureCoords,
                                      effectComponentAlpha->mOnBlack);
 
       mGLContext->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA,
                                      LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA);
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -33,20 +33,16 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "gfxSVGGlyphs.h"
 #include "gfxMathTable.h"
 #include "gfx2DGlue.h"
 
-#if defined(XP_MACOSX)
-#include "nsCocoaFeatures.h"
-#endif
-
 #include "cairo.h"
 
 #include "harfbuzz/hb.h"
 #include "harfbuzz/hb-ot.h"
 #include "graphite2/Font.h"
 
 #include <algorithm>
 
@@ -1770,23 +1766,16 @@ gfxFontFamily::ReadFaceNames(gfxPlatform
 {
     // if all needed names have already been read, skip
     if (mOtherFamilyNamesInitialized &&
         (mFaceNamesInitialized || !aNeedFullnamePostscriptNames))
         return;
 
     bool asyncFontLoaderDisabled = false;
 
-#if defined(XP_MACOSX)
-    // bug 975460 - async font loader crashes sometimes under 10.6, disable
-    if (!nsCocoaFeatures::OnLionOrLater()) {
-        asyncFontLoaderDisabled = true;
-    }
-#endif
-
     if (!mOtherFamilyNamesInitialized &&
         aFontInfoData &&
         aFontInfoData->mLoadOtherNames &&
         !asyncFontLoaderDisabled)
     {
         AutoTArray<nsString,4> otherFamilyNames;
         bool foundOtherNames =
             aFontInfoData->GetOtherFamilyNames(mName, otherFamilyNames);
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -1201,20 +1201,17 @@ public:
                 bool aLoadCmaps) :
         FontInfoData(aLoadOtherNames, aLoadFaceNames, aLoadCmaps)
     {}
 
     virtual ~MacFontInfo() {}
 
     virtual void Load() {
         nsAutoreleasePool localPool;
-        // bug 975460 - async font loader crashes sometimes under 10.6, disable
-        if (nsCocoaFeatures::OnLionOrLater()) {
-            FontInfoData::Load();
-        }
+        FontInfoData::Load();
     }
 
     // loads font data for all members of a given family
     virtual void LoadFontFamilyData(const nsAString& aFamilyName);
 };
 
 void
 MacFontInfo::LoadFontFamilyData(const nsAString& aFamilyName)
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -19,17 +19,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/VsyncDispatcher.h"
 #include "qcms.h"
 #include "gfx2DGlue.h"
 
 #include <dlfcn.h>
 #include <CoreVideo/CoreVideo.h>
 
-#include "nsCocoaFeatures.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "VsyncSource.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 // cribbed from CTFontManager.h
 enum {
@@ -365,24 +364,16 @@ gfxPlatformMac::ReadAntiAliasingThreshol
         }
         CFRelease(prefValue);
     }
 
     return threshold;
 }
 
 bool
-gfxPlatformMac::UseProgressivePaint()
-{
-  // Progressive painting requires cross-process mutexes, which don't work so
-  // well on OS X 10.6 so we disable there.
-  return nsCocoaFeatures::OnLionOrLater() && gfxPlatform::UseProgressivePaint();
-}
-
-bool
 gfxPlatformMac::AccelerateLayersByDefault()
 {
   return true;
 }
 
 // This is the renderer output callback function, called on the vsync thread
 static CVReturn VsyncCallback(CVDisplayLinkRef aDisplayLink,
                               const CVTimeStamp* aNow,
--- a/gfx/thebes/gfxPlatformMac.h
+++ b/gfx/thebes/gfxPlatformMac.h
@@ -71,17 +71,16 @@ public:
 
     bool RequiresAcceleratedGLContextForCompositorOGL() const override {
       // On OS X in a VM, unaccelerated CompositorOGL shows black flashes, so we
       // require accelerated GL for CompositorOGL but allow unaccelerated GL for
       // BasicCompositor.
       return true;
     }
 
-    virtual bool UseProgressivePaint() override;
     virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
 
     // lower threshold on font anti-aliasing
     uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; }
 
 protected:
     bool AccelerateLayersByDefault() override;