зеркало из https://github.com/mozilla/pjs.git
Bug 651858 - Part 8: Expose azure on/off state from gfxInfo. r=joedrew
This commit is contained in:
Родитель
a7aa18242e
Коммит
60b854d92c
|
@ -731,7 +731,7 @@ nsresult
|
|||
NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult)
|
||||
{
|
||||
PRBool azure = PR_FALSE;
|
||||
nsresult rv = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", &azure);
|
||||
nsresult rv = Preferences::GetBool("gfx.canvas.azure.enabled", &azure);
|
||||
|
||||
if (azure) {
|
||||
nsresult rv = NS_NewCanvasRenderingContext2DAzure(aResult);
|
||||
|
|
|
@ -48,6 +48,7 @@ interface nsIGfxInfo : nsISupports
|
|||
*/
|
||||
readonly attribute boolean D2DEnabled;
|
||||
readonly attribute boolean DWriteEnabled;
|
||||
readonly attribute boolean AzureEnabled;
|
||||
readonly attribute DOMString DWriteVersion;
|
||||
readonly attribute DOMString cleartypeParameters;
|
||||
|
||||
|
|
|
@ -65,6 +65,12 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GfxInfo::GetAzureEnabled(PRBool *aEnabled)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString DWriteVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
// rest is brought forward from GfxInfoBase.
|
||||
NS_SCRIPTABLE NS_IMETHOD GetD2DEnabled(PRBool *aD2DEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteEnabled(PRBool *aDWriteEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAzureEnabled(PRBool *aAzureEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
|
||||
|
|
|
@ -54,6 +54,7 @@ public:
|
|||
// rest is brought forward from GfxInfoBase.
|
||||
NS_SCRIPTABLE NS_IMETHOD GetD2DEnabled(PRBool *aD2DEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteEnabled(PRBool *aDWriteEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAzureEnabled(PRBool *aAzureEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
|
||||
|
|
|
@ -100,6 +100,12 @@ GfxInfo::GetD2DEnabled(PRBool *aEnabled)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAzureEnabled(PRBool *aEnabled)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "prenv.h"
|
||||
#include "prprf.h"
|
||||
#include "GfxDriverInfo.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#if defined(MOZ_CRASHREPORTER)
|
||||
#include "nsExceptionHandler.h"
|
||||
|
@ -97,6 +98,26 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GfxInfo::GetAzureEnabled(PRBool *aEnabled)
|
||||
{
|
||||
*aEnabled = PR_FALSE;
|
||||
|
||||
PRBool d2dEnabled =
|
||||
gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D;
|
||||
|
||||
if (d2dEnabled) {
|
||||
PRBool azure = PR_FALSE;
|
||||
nsresult rv = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", &azure);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && azure) {
|
||||
*aEnabled = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString DWriteVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
// rest is brought forward from GfxInfoBase.
|
||||
NS_SCRIPTABLE NS_IMETHOD GetD2DEnabled(PRBool *aD2DEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteEnabled(PRBool *aDWriteEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAzureEnabled(PRBool *aAzureEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
|
||||
|
|
|
@ -299,6 +299,12 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAzureEnabled(PRBool *aEnabled)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString DWriteVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
// rest is brought forward from GfxInfoBase.
|
||||
NS_SCRIPTABLE NS_IMETHOD GetD2DEnabled(PRBool *aD2DEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteEnabled(PRBool *aDWriteEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAzureEnabled(PRBool *aAzureEnabled);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
|
||||
|
|
Загрузка…
Ссылка в новой задаче