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) {
PRInt32 status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_OPENGL, &status))) {
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION ||
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE)
if (status == nsIGfxInfo::FEATURE_BLOCKED ||
status == nsIGfxInfo::FEATURE_NOT_AVAILABLE)
{
useOpenGL = PR_FALSE;
}
}
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_ANGLE, &status))) {
if (status == nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION ||
status == nsIGfxInfo::FEATURE_BLOCKED_DEVICE)
if (status == nsIGfxInfo::FEATURE_BLOCKED ||
status == nsIGfxInfo::FEATURE_NOT_AVAILABLE)
{
useANGLE = PR_FALSE;
}

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

@ -80,7 +80,8 @@ LayerManagerD3D9::Initialize()
if (gfxInfo) {
PRInt32 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.");
return PR_FALSE;

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

@ -154,7 +154,8 @@ LayerManagerOGL::Initialize(GLContext *aExistingContext)
if (gfxInfo) {
PRInt32 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.");
return PR_FALSE;
}

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

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

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

@ -93,27 +93,20 @@ interface nsIGfxInfo : nsISupports
/*
* 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
* hardware, and see what happens. */
const long FEATURE_NO_INFO = 1;
/* This feature is blocked on this driver version. Updating driver will typically unblock it. */
const long FEATURE_BLOCKED_DRIVER_VERSION = 2;
/* This feature is blocked on this device, regardless of driver version.
* Typically means we hit too many driver crashes without a good reason to hope for them to
* get fixed soon. */
const long FEATURE_BLOCKED_DEVICE = 3;
/* We don't have any information about this feature on this hardware */
const long FEATURE_STATUS_UNKNOWN = 0;
/* This feature is available and can be used */
const long FEATURE_AVAILABLE = 1;
/* This feature is not available */
const long FEATURE_NOT_AVAILABLE = 2;
/* This feature is available, but is blocked due to a blocklist entry */
const long FEATURE_BLOCKED = 3;
/* 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
*/
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 "GfxInfo.h"
#include "nsUnicharUtils.h"
#include "nsPrintfCString.h"
#include "mozilla/FunctionTimer.h"
#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
@ -315,7 +314,6 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
}
nsresult err;
*aAdapterDeviceID = device.ToInteger(&err, 16);
return NS_OK;
}
@ -497,7 +495,7 @@ static const GfxDriverInfo driverInfo[] = {
*/
{ allWindowsVersions,
vendorIntel, deviceFamilyIntelBlockDirect2D,
nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED,
DRIVER_LESS_THAN, allDriverVersions },
/* implement the blocklist from bug 594877
@ -507,7 +505,7 @@ static const GfxDriverInfo driverInfo[] = {
#define IMPLEMENT_INTEL_DRIVER_BLOCKLIST(winVer, devFamily, driverVer) \
{ winVer, \
vendorIntel, devFamily, \
allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, \
allFeatures, nsIGfxInfo::FEATURE_BLOCKED, \
DRIVER_LESS_THAN, driverVer },
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, deviceFamilyIntelGMAX4500HD, V(8,15,10,2202))
/* OpenGL on any Intel hardware is discouraged */
/* OpenGL on any Intel hardware is not suggested */
{ allWindowsVersions,
vendorIntel, allDevices,
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_DISCOURAGED,
nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_NOT_SUGGESTED,
DRIVER_LESS_THAN, allDriverVersions },
{ allWindowsVersions,
vendorIntel, allDevices,
nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_DISCOURAGED,
nsIGfxInfo::FEATURE_WEBGL_OPENGL, nsIGfxInfo::FEATURE_NOT_SUGGESTED,
DRIVER_LESS_THAN, allDriverVersions },
/*
@ -569,13 +567,10 @@ ParseDriverVersion(nsAString& aVersion, PRUint64 *aNumericVersion)
return true;
}
nsresult
GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion)
NS_IMETHODIMP
GfxInfo::GetFeatureStatus(PRInt32 aFeature, PRInt32 *aStatus)
{
*aStatus = nsIGfxInfo::FEATURE_NO_INFO;
aSuggestedDriverVersion.SetIsVoid(PR_TRUE);
PRInt32 status = nsIGfxInfo::FEATURE_NO_INFO;
PRInt32 status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
PRUint32 adapterVendor = 0;
PRUint32 adapterDeviceID = 0;
@ -592,8 +587,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aS
return NS_ERROR_FAILURE;
}
PRUint64 suggestedDriverVersion = 0;
const GfxDriverInfo *info = &driverInfo[0];
while (info->windowsVersion) {
@ -629,7 +622,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aS
switch (info->op) {
case DRIVER_LESS_THAN:
match = driverVersion < info->version;
suggestedDriverVersion = info->version;
break;
case DRIVER_LESS_THAN_OR_EQUAL:
match = driverVersion <= info->version;
@ -673,28 +665,6 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aS
}
*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;
}
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 mDriverDate;
nsString mDeviceKey;
nsresult GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion);
};
} // namespace widget