зеркало из https://github.com/mozilla/pjs.git
Bug 721855 - Honour the gfx.canvas.azure.prefer-skia pref on OS X, r=joe
--HG-- extra : rebase_source : 93aba135b44e5e0f944a8bf604b77a5b414185cf
This commit is contained in:
Родитель
dd13affd40
Коммит
4163ec22f7
|
@ -68,6 +68,7 @@ enum SurfaceFormat
|
||||||
|
|
||||||
enum BackendType
|
enum BackendType
|
||||||
{
|
{
|
||||||
|
BACKEND_NONE,
|
||||||
BACKEND_DIRECT2D,
|
BACKEND_DIRECT2D,
|
||||||
BACKEND_COREGRAPHICS,
|
BACKEND_COREGRAPHICS,
|
||||||
BACKEND_CAIRO,
|
BACKEND_CAIRO,
|
||||||
|
|
|
@ -237,6 +237,12 @@ gfxPlatform::gfxPlatform()
|
||||||
mGraphiteShapingEnabled = UNINITIALIZED_VALUE;
|
mGraphiteShapingEnabled = UNINITIALIZED_VALUE;
|
||||||
#endif
|
#endif
|
||||||
mBidiNumeralOption = UNINITIALIZED_VALUE;
|
mBidiNumeralOption = UNINITIALIZED_VALUE;
|
||||||
|
|
||||||
|
if (Preferences::GetBool("gfx.canvas.azure.prefer-skia", false)) {
|
||||||
|
mPreferredDrawTargetBackend = BACKEND_SKIA;
|
||||||
|
} else {
|
||||||
|
mPreferredDrawTargetBackend = BACKEND_NONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxPlatform*
|
gfxPlatform*
|
||||||
|
|
|
@ -158,6 +158,8 @@ GetBackendName(mozilla::gfx::BackendType aBackend)
|
||||||
return "cairo";
|
return "cairo";
|
||||||
case mozilla::gfx::BACKEND_SKIA:
|
case mozilla::gfx::BACKEND_SKIA:
|
||||||
return "skia";
|
return "skia";
|
||||||
|
case mozilla::gfx::BACKEND_NONE:
|
||||||
|
return "none";
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid backend type!");
|
NS_ERROR("Invalid backend type!");
|
||||||
return "";
|
return "";
|
||||||
|
@ -448,6 +450,9 @@ protected:
|
||||||
// which scripts should be shaped with harfbuzz
|
// which scripts should be shaped with harfbuzz
|
||||||
PRInt32 mUseHarfBuzzScripts;
|
PRInt32 mUseHarfBuzzScripts;
|
||||||
|
|
||||||
|
// The preferred draw target backend to use
|
||||||
|
mozilla::gfx::BackendType mPreferredDrawTargetBackend;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual qcms_profile* GetPlatformCMSOutputProfile();
|
virtual qcms_profile* GetPlatformCMSOutputProfile();
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,12 @@ gfxPlatformMac::GetScaledFontForFont(gfxFont *aFont)
|
||||||
bool
|
bool
|
||||||
gfxPlatformMac::SupportsAzure(BackendType& aBackend)
|
gfxPlatformMac::SupportsAzure(BackendType& aBackend)
|
||||||
{
|
{
|
||||||
aBackend = BACKEND_COREGRAPHICS;
|
if (mPreferredDrawTargetBackend != BACKEND_NONE) {
|
||||||
|
aBackend = mPreferredDrawTargetBackend;
|
||||||
|
} else {
|
||||||
|
aBackend = BACKEND_COREGRAPHICS;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -552,10 +552,11 @@ gfxWindowsPlatform::SupportsAzure(BackendType& aBackend)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (Preferences::GetBool("gfx.canvas.azure.prefer-skia", false)) {
|
if (mPreferredDrawTargetBackend != BACKEND_NONE) {
|
||||||
aBackend = BACKEND_SKIA;
|
aBackend = mPreferredDrawTargetBackend;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче