Commit 0d1edb8e authored by Doug Sherk's avatar Doug Sherk
Browse files

Bug 706739: don't evaluate static blocklist or special cases when evaluating...

Bug 706739: don't evaluate static blocklist or special cases when evaluating downloaded blocklist r=joe

A bug was introduced in 668004 which caused features to be preffed off while
evaluating the downloaded blocklist, even if they weren't in the list. This
shouldn't actually have any impact on the end user experience, but is definitely
not optimal.
parent 674cb871
Loading
Loading
Loading
Loading
+25 −25
Original line number Diff line number Diff line
@@ -301,12 +301,15 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
                              const nsTArray<GfxDriverInfo>& aDriverInfo, 
                              OperatingSystem* aOS /* = nsnull */)
{
  PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;

  NS_ENSURE_ARG_POINTER(aStatus);
  aSuggestedDriverVersion.SetIsVoid(true);

  *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
  OperatingSystem os = DRIVER_OS_ANDROID;
  if (aOS)
    *aOS = os;

  // Don't evaluate special cases when evaluating the downlaoded blocklist.
  if (!aDriverInfo.Length()) {
    if (aFeature == FEATURE_OPENGL_LAYERS) {
      if (!mSetCrashReportAnnotations) {
        AddOpenGLCrashReportAnnotations();
@@ -327,10 +330,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
      //   }
      // }
    }

  *aStatus = status;
  if (aOS)
    *aOS = os;
  }

  return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}
+56 −58
Original line number Diff line number Diff line
@@ -387,20 +387,21 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
                              OperatingSystem* aOS /* = nsnull */)
{
  NS_ENSURE_ARG_POINTER(aStatus);

  aSuggestedDriverVersion.SetIsVoid(true);

  PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;

  *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
  OperatingSystem os = OSXVersionToOperatingSystem(nsToolkit::OSXVersion());
  if (aOS)
    *aOS = os;

  // Don't evaluate special cases when we're evaluating the downloaded blocklist.
  if (!aDriverInfo.Length()) {
    // Many WebGL issues on 10.5, especially:
    //   * bug 631258: WebGL shader paints using textures belonging to other processes on Mac OS 10.5
    //   * bug 618848: Post process shaders and texture mapping crash OS X 10.5
    if (aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL &&
      !nsToolkit::OnSnowLeopardOrLater())
  {
    status = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
        !nsToolkit::OnSnowLeopardOrLater()) {
      *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
      return NS_OK;
    }

    // The code around the following has been moved into the global blocklist.
@@ -451,10 +452,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
        return NS_OK;
      }
    }

  if (aOS)
    *aOS = os;
  *aStatus = status;
  }

  return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}
+72 −72
Original line number Diff line number Diff line
@@ -940,10 +940,15 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
                              const nsTArray<GfxDriverInfo>& aDriverInfo,
                              OperatingSystem* aOS /* = nsnull */)
{
  NS_ENSURE_ARG_POINTER(aStatus);
  aSuggestedDriverVersion.SetIsVoid(true);
  OperatingSystem os = WindowsVersionToOperatingSystem(mWindowsVersion);
  *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
  if (aOS)
    *aOS = os;

  PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;

  // Don't evaluate special cases if we're checking the downloaded blocklist.
  if (!aDriverInfo.Length()) {
    nsAutoString adapterVendorID;
    nsAutoString adapterDeviceID;
    nsAutoString adapterDriverVersionString;
@@ -1003,8 +1008,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
      return NS_OK;
    }

  OperatingSystem os = WindowsVersionToOperatingSystem(mWindowsVersion);

    // Windows Server 2003 should be just like Windows XP for present purpose, but still has a different version number.
    // OTOH Windows Server 2008 R1 and R2 already have the same version numbers as Vista and Seven respectively
    if (os == DRIVER_OS_WINDOWS_SERVER_2003)
@@ -1019,10 +1022,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
        return NS_OK;
      }
    }

  *aStatus = status;
  if (aOS)
    *aOS = os;
  }

  return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}
+34 −31
Original line number Diff line number Diff line
@@ -264,9 +264,12 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
                              OperatingSystem* aOS /* = nsnull */)

{
    GetData();
  NS_ENSURE_ARG_POINTER(aStatus);
  *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
  aSuggestedDriverVersion.SetIsVoid(true);
  OperatingSystem os = DRIVER_OS_LINUX;
  if (aOS)
    *aOS = os;

#ifdef MOZ_PLATFORM_MAEMO
  *aStatus = nsIGfxInfo::FEATURE_NO_INFO;
@@ -274,7 +277,9 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
  return NS_OK;
#endif

    OperatingSystem os = DRIVER_OS_LINUX;
  // Don't evaluate any special cases if we're checking the downloaded blocklist.
  if (!aDriverInfo.Length()) {
    GetData();

    // Disable OpenGL layers when we don't have texture_from_pixmap because it regresses performance. 
    if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS && !mHasTextureFromPixmap) {
@@ -317,9 +322,7 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature,
      // Also, this case is hit whenever the GLXtest probe failed to get driver info or crashed.
      *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
    }

  if (aOS)
    *aOS = os;
  }

  return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, &os);
}