mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 764125; sort out preferred and fallback Azure backends for all platforms (canvas and prefs). r=Bas
This commit is contained in:
parent
ca6e9953e8
commit
8dabb5c5b9
@ -549,27 +549,6 @@ PRUint8 (*nsCanvasRenderingContext2DAzure::sPremultiplyTable)[256] = nsnull;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
static bool
|
||||
AzureCanvasEnabledOnPlatform()
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() !=
|
||||
gfxWindowsPlatform::RENDER_DIRECT2D ||
|
||||
!gfxWindowsPlatform::GetPlatform()->DWriteEnabled()) {
|
||||
static bool checkedPref = false;
|
||||
static bool preferSkia;
|
||||
if (!checkedPref) {
|
||||
preferSkia = Preferences::GetBool("gfx.canvas.azure.prefer-skia", false);
|
||||
checkedPref = true;
|
||||
}
|
||||
return preferSkia;
|
||||
}
|
||||
#elif !defined(XP_MACOSX) && !defined(ANDROID) && !defined(LINUX)
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AzureCanvasEnabled()
|
||||
{
|
||||
@ -579,7 +558,9 @@ AzureCanvasEnabled()
|
||||
azureEnabled = Preferences::GetBool("gfx.canvas.azure.enabled", false);
|
||||
checkedPref = true;
|
||||
}
|
||||
return azureEnabled && AzureCanvasEnabledOnPlatform();
|
||||
|
||||
BackendType dontCare;
|
||||
return azureEnabled && gfxPlatform::GetPlatform()->SupportsAzure(dontCare);
|
||||
}
|
||||
|
||||
}
|
||||
@ -588,7 +569,9 @@ AzureCanvasEnabled()
|
||||
nsresult
|
||||
NS_NewCanvasRenderingContext2DAzure(nsIDOMCanvasRenderingContext2D** aResult)
|
||||
{
|
||||
if (!AzureCanvasEnabledOnPlatform()) {
|
||||
// XXX[nrc] remove this check when Thebes canvas is removed
|
||||
// (because we will always support Azure)
|
||||
if (!AzureCanvasEnabled()) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
|
@ -225,10 +225,17 @@ pref("gfx.font_rendering.directwrite.use_gdi_table_loading", true);
|
||||
|
||||
#ifdef XP_WIN
|
||||
pref("gfx.canvas.azure.enabled", true);
|
||||
// comma separated list of backends to use in order of preference
|
||||
// e.g., pref("gfx.canvas.azure.backends", "direct2d,skia,cairo");
|
||||
pref("gfx.canvas.azure.backends", "direct2d");
|
||||
pref("gfx.content.azure.enabled", true);
|
||||
#else
|
||||
#ifdef XP_MACOSX
|
||||
pref("gfx.canvas.azure.enabled", true);
|
||||
pref("gfx.canvas.azure.backends", "cg");
|
||||
#else
|
||||
pref("gfx.canvas.azure.enabled", false);
|
||||
pref("gfx.canvas.azure.backends", "cairo,skia");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user