Bug 764125; sort out preferred and fallback Azure backends for all platforms (gfxInfo). r=Bas

This commit is contained in:
Nicholas Cameron 2012-07-25 12:46:20 +12:00
Родитель 3843356847
Коммит ac279f9a88
10 изменённых файлов: 22 добавлений и 50 удалений

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

@ -43,12 +43,6 @@ GfxInfo::GetDWriteEnabled(bool *aEnabled)
return NS_ERROR_FAILURE;
}
nsresult
GfxInfo::GetAzureEnabled(bool *aEnabled)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString DWriteVersion; */
NS_IMETHODIMP
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)

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

@ -25,7 +25,6 @@ public:
// rest is brought forward from GfxInfoBase.
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
NS_IMETHOD GetAzureEnabled(bool *aAzureEnabled);
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
@ -46,6 +45,7 @@ public:
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
using GfxInfoBase::GetAzureEnabled;
void EnsureInitializedFromGfxInfoData();

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

@ -24,7 +24,6 @@ public:
// rest is brought forward from GfxInfoBase.
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
NS_IMETHOD GetAzureEnabled(bool *aAzureEnabled);
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
@ -46,6 +45,7 @@ public:
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
using GfxInfoBase::GetAzureEnabled;
virtual nsresult Init();

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

@ -154,20 +154,6 @@ GfxInfo::GetD2DEnabled(bool *aEnabled)
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAzureEnabled(bool *aEnabled)
{
bool azure = false;
nsresult rv = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", &azure);
if (NS_SUCCEEDED(rv) && azure) {
*aEnabled = true;
} else {
*aEnabled = false;
}
return NS_OK;
}
NS_IMETHODIMP
GfxInfo::GetDWriteEnabled(bool *aEnabled)
{

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

@ -59,26 +59,6 @@ GfxInfo::GetDWriteEnabled(bool *aEnabled)
return NS_OK;
}
nsresult
GfxInfo::GetAzureEnabled(bool *aEnabled)
{
*aEnabled = false;
bool d2dEnabled =
gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D;
if (d2dEnabled) {
bool azure = false;
nsresult rv = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", &azure);
if (NS_SUCCEEDED(rv) && azure) {
*aEnabled = true;
}
}
return NS_OK;
}
/* readonly attribute DOMString DWriteVersion; */
NS_IMETHODIMP
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)

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

@ -22,7 +22,6 @@ public:
// rest is brought forward from GfxInfoBase.
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
NS_IMETHOD GetAzureEnabled(bool *aAzureEnabled);
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
@ -43,6 +42,7 @@ public:
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
using GfxInfoBase::GetAzureEnabled;
virtual nsresult Init();

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

@ -724,6 +724,22 @@ GfxInfoBase::GetWebGLParameter(const nsAString& aParam,
return GfxInfoWebGL::GetWebGLParameter(aParam, aResult);
}
nsresult
GfxInfoBase::GetAzureEnabled(bool *aEnabled)
{
static bool azure = false;
static bool azureInited = false;
if (!azureInited) {
azure = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", false);
azureInited = true;
}
*aEnabled = azure;
return NS_OK;
}
void
GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo)
{

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

@ -41,10 +41,12 @@ public:
// using GfxInfoBase::GetFeatureStatus;
// using GfxInfoBase::GetFeatureSuggestedDriverVersion;
// using GfxInfoBase::GetWebGLParameter;
// using GfxInfoBase::GetAzureEnabled;
// to import the relevant methods into their namespace.
NS_IMETHOD GetFeatureStatus(PRInt32 aFeature, PRInt32 *_retval);
NS_IMETHOD GetFeatureSuggestedDriverVersion(PRInt32 aFeature, nsAString & _retval);
NS_IMETHOD GetWebGLParameter(const nsAString & aParam, nsAString & _retval);
NS_IMETHOD GetAzureEnabled(bool *aAzureEnabled);
NS_IMETHOD GetFailures(PRUint32 *failureCount, char ***failures);
NS_IMETHOD_(void) LogFailure(const nsACString &failure);

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

@ -370,12 +370,6 @@ GfxInfo::GetDWriteEnabled(bool *aEnabled)
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
GfxInfo::GetAzureEnabled(bool *aEnabled)
{
return NS_ERROR_FAILURE;
}
/* readonly attribute DOMString DWriteVersion; */
NS_IMETHODIMP
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)

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

@ -21,7 +21,6 @@ public:
// rest is brought forward from GfxInfoBase.
NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
NS_IMETHOD GetAzureEnabled(bool *aAzureEnabled);
NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
@ -42,6 +41,7 @@ public:
using GfxInfoBase::GetFeatureStatus;
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
using GfxInfoBase::GetWebGLParameter;
using GfxInfoBase::GetAzureEnabled;
virtual nsresult Init();