Backed out changeset 638ce363a9b1

This commit is contained in:
Benoit Jacob 2010-10-06 17:05:19 -04:00
Родитель 1845de1c27
Коммит c16afc9807
7 изменённых файлов: 29 добавлений и 66 удалений

Просмотреть файл

@ -322,15 +322,15 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
if (gfxInfo) { if (gfxInfo) {
PRInt32 status; PRInt32 status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_OPENGL, &status))) { if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_OPENGL, &status))) {
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION || if (status == nsIGfxInfo::FEATURE_BLOCKED ||
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE) status == nsIGfxInfo::FEATURE_NOT_AVAILABLE)
{ {
useOpenGL = PR_FALSE; useOpenGL = PR_FALSE;
} }
} }
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_ANGLE, &status))) { if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_ANGLE, &status))) {
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION || if (status == nsIGfxInfo::FEATURE_BLOCKED ||
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE) status == nsIGfxInfo::FEATURE_NOT_AVAILABLE)
{ {
useANGLE = PR_FALSE; useANGLE = PR_FALSE;
} }

Просмотреть файл

@ -80,7 +80,8 @@ LayerManagerD3D9::Initialize()
if (gfxInfo) { if (gfxInfo) {
PRInt32 status; PRInt32 status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &status))) { if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &status))) {
if (status != nsIGfxInfo::FEATURE_NO_INFO) if (status != nsIGfxInfo::FEATURE_STATUS_UNKNOWN &&
status != nsIGfxInfo::FEATURE_AVAILABLE)
{ {
NS_WARNING("Direct3D 9-accelerated layers are not supported on this system."); NS_WARNING("Direct3D 9-accelerated layers are not supported on this system.");
return PR_FALSE; return PR_FALSE;

Просмотреть файл

@ -154,7 +154,8 @@ LayerManagerOGL::Initialize(GLContext *aExistingContext)
if (gfxInfo) { if (gfxInfo) {
PRInt32 status; PRInt32 status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status))) { if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status))) {
if (status != nsIGfxInfo::FEATURE_NO_INFO) { if (status != nsIGfxInfo::FEATURE_STATUS_UNKNOWN &&
status != nsIGfxInfo::FEATURE_AVAILABLE) {
NS_WARNING("OpenGL-accelerated layers are not supported on this system."); NS_WARNING("OpenGL-accelerated layers are not supported on this system.");
return PR_FALSE; return PR_FALSE;
} }

Просмотреть файл

@ -285,11 +285,11 @@ gfxWindowsPlatform::UpdateRenderMode()
if (gfxInfo) { if (gfxInfo) {
PRInt32 status; PRInt32 status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT2D, &status))) { if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT2D, &status))) {
if (status != nsIGfxInfo::FEATURE_NO_INFO) { if (status != nsIGfxInfo::FEATURE_STATUS_UNKNOWN &&
d2dDisabled = PR_TRUE; status != nsIGfxInfo::FEATURE_AVAILABLE)
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION ||
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE)
{ {
d2dDisabled = PR_TRUE;
if (status == nsIGfxInfo::FEATURE_BLOCKED) {
d2dBlocked = PR_TRUE; d2dBlocked = PR_TRUE;
} }
} }

Просмотреть файл

@ -93,27 +93,20 @@ interface nsIGfxInfo : nsISupports
/* /*
* A set of return values from GetFeatureStatus * A set of return values from GetFeatureStatus
*/ */
/* We don't explicitly block or discourage the feature. Which means we'll try getting it from the /* We don't have any information about this feature on this hardware */
* hardware, and see what happens. */ const long FEATURE_STATUS_UNKNOWN = 0;
const long FEATURE_NO_INFO = 1; /* This feature is available and can be used */
/* This feature is blocked on this driver version. Updating driver will typically unblock it. */ const long FEATURE_AVAILABLE = 1;
const long FEATURE_BLOCKED_DRIVER_VERSION = 2; /* This feature is not available */
/* This feature is blocked on this device, regardless of driver version. const long FEATURE_NOT_AVAILABLE = 2;
* Typically means we hit too many driver crashes without a good reason to hope for them to /* This feature is available, but is blocked due to a blocklist entry */
* get fixed soon. */ const long FEATURE_BLOCKED = 3;
const long FEATURE_BLOCKED_DEVICE = 3;
/* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */ /* This feature is available and can be used, but is not suggested (e.g. shouldn't be used by default */
const long FEATURE_DISCOURAGED = 4; const long FEATURE_NOT_SUGGESTED = 4;
/** /**
* Ask about a feature, and return the status of that feature * Ask about a feature, and return the status of that feature
*/ */
long getFeatureStatus(in long aFeature); long getFeatureStatus(in long aFeature);
/*
* Ask about a feature, return the minimum driver version required for it if its status is
* FEATURE_BLOCKED_DRIVER_VERSION, otherwise return an empty string.
*/
DOMString getFeatureSuggestedDriverVersion(in long aFeature);
}; };

Просмотреть файл

@ -40,7 +40,6 @@
#include "gfxWindowsPlatform.h" #include "gfxWindowsPlatform.h"
#include "GfxInfo.h" #include "GfxInfo.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
#include "nsPrintfCString.h"
#include "mozilla/FunctionTimer.h" #include "mozilla/FunctionTimer.h"
#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL) #if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
@ -315,7 +314,6 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
} }
nsresult err; nsresult err;
*aAdapterDeviceID = device.ToInteger(&err, 16); *aAdapterDeviceID = device.ToInteger(&err, 16);
return NS_OK; return NS_OK;
} }
@ -497,7 +495,7 @@ static const GfxDriverInfo driverInfo[] = {
*/ */
{ allWindowsVersions, { allWindowsVersions,
vendorIntel, deviceFamilyIntelBlockDirect2D, vendorIntel, deviceFamilyIntelBlockDirect2D,
nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED,
DRIVER_LESS_THAN, allDriverVersions }, DRIVER_LESS_THAN, allDriverVersions },
/* implement the blocklist from bug 594877 /* implement the blocklist from bug 594877
@ -507,7 +505,7 @@ static const GfxDriverInfo driverInfo[] = {
#define IMPLEMENT_INTEL_DRIVER_BLOCKLIST(winVer, devFamily, driverVer) \ #define IMPLEMENT_INTEL_DRIVER_BLOCKLIST(winVer, devFamily, driverVer) \
{ winVer, \ { winVer, \
vendorIntel, devFamily, \ vendorIntel, devFamily, \
allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, \ allFeatures, nsIGfxInfo::FEATURE_BLOCKED, \
DRIVER_LESS_THAN, driverVer }, DRIVER_LESS_THAN, driverVer },
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindowsXP, deviceFamilyIntelGMA500, V(6,14,11,1018)) IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindowsXP, deviceFamilyIntelGMA500, V(6,14,11,1018))
@ -531,14 +529,14 @@ static const GfxDriverInfo driverInfo[] = {
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX3000, V(8,15,10,1930)) IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX3000, V(8,15,10,1930))
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX4500HD, V(8,15,10,2202)) IMPLEMENT_INTEL_DRIVER_BLOCKLIST(gfxWindowsPlatform::kWindows7, deviceFamilyIntelGMAX4500HD, V(8,15,10,2202))
/* OpenGL on any Intel hardware is discouraged */ /* OpenGL on any Intel hardware is not suggested */
{ allWindowsVersions, { allWindowsVersions,
vendorIntel, allDevices, vendorIntel, allDevices,
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_DISCOURAGED, nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_NOT_SUGGESTED,
DRIVER_LESS_THAN, allDriverVersions }, DRIVER_LESS_THAN, allDriverVersions },
{ allWindowsVersions, { allWindowsVersions,
vendorIntel, allDevices, vendorIntel, allDevices,
nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_DISCOURAGED, nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_NOT_SUGGESTED,
DRIVER_LESS_THAN, allDriverVersions }, DRIVER_LESS_THAN, allDriverVersions },
/* /*
@ -569,13 +567,10 @@ ParseDriverVersion(nsAString& aVersion, PRUint64 *aNumericVersion)
return true; return true;
} }
nsresult NS_IMETHODIMP
GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion) GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
{ {
*aStatus = nsIGfxInfo::FEATURE_NO_INFO; PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
aSuggestedDriverVersion.SetIsVoid(PR_TRUE);
PRInt32 status = nsIGfxInfo::FEATURE_NO_INFO;
PRUint32 adapterVendor = 0; PRUint32 adapterVendor = 0;
PRUint32 adapterDeviceID = 0; PRUint32 adapterDeviceID = 0;
@ -592,8 +587,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aS
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
PRUint64 suggestedDriverVersion = 0;
const GfxDriverInfo *info = &driverInfo[0]; const GfxDriverInfo *info = &driverInfo[0];
while (info->windowsVersion) { while (info->windowsVersion) {
@ -629,7 +622,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aS
switch (info->op) { switch (info->op) {
case DRIVER_LESS_THAN: case DRIVER_LESS_THAN:
match = driverVersion < info->version; match = driverVersion < info->version;
suggestedDriverVersion = info->version;
break; break;
case DRIVER_LESS_THAN_OR_EQUAL: case DRIVER_LESS_THAN_OR_EQUAL:
match = driverVersion <= info->version; match = driverVersion <= info->version;
@ -673,28 +665,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aS
} }
*aStatus = status; *aStatus = status;
if (status == FEATURE_BLOCKED_DRIVER_VERSION && suggestedDriverVersion) {
aSuggestedDriverVersion.AppendPrintf("%lld.%lld.%lld.%lld",
(suggestedDriverVersion & 0xffff000000000000) >> 48,
(suggestedDriverVersion & 0x0000ffff00000000) >> 32,
(suggestedDriverVersion & 0x00000000ffff0000) >> 16,
(suggestedDriverVersion & 0x000000000000ffff));
}
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP
GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
{
nsString s;
return GetFeatureStatusImpl(aFeature, aStatus, s);
}
NS_IMETHODIMP
GfxInfo::GetFeatureSuggestedDriverVersion(PRInt32 aFeature, nsAString& aSuggestedDriverVersion)
{
PRInt32 i;
return GetFeatureStatusImpl(aFeature, &i, aSuggestedDriverVersion);
}

Просмотреть файл

@ -62,8 +62,6 @@ private:
nsString mDriverVersion; nsString mDriverVersion;
nsString mDriverDate; nsString mDriverDate;
nsString mDeviceKey; nsString mDeviceKey;
nsresult GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion);
}; };
} // namespace widget } // namespace widget