зеркало из 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
|
||||
{
|
||||
BACKEND_NONE,
|
||||
BACKEND_DIRECT2D,
|
||||
BACKEND_COREGRAPHICS,
|
||||
BACKEND_CAIRO,
|
||||
|
|
|
@ -237,6 +237,12 @@ gfxPlatform::gfxPlatform()
|
|||
mGraphiteShapingEnabled = UNINITIALIZED_VALUE;
|
||||
#endif
|
||||
mBidiNumeralOption = UNINITIALIZED_VALUE;
|
||||
|
||||
if (Preferences::GetBool("gfx.canvas.azure.prefer-skia", false)) {
|
||||
mPreferredDrawTargetBackend = BACKEND_SKIA;
|
||||
} else {
|
||||
mPreferredDrawTargetBackend = BACKEND_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
gfxPlatform*
|
||||
|
|
|
@ -158,6 +158,8 @@ GetBackendName(mozilla::gfx::BackendType aBackend)
|
|||
return "cairo";
|
||||
case mozilla::gfx::BACKEND_SKIA:
|
||||
return "skia";
|
||||
case mozilla::gfx::BACKEND_NONE:
|
||||
return "none";
|
||||
default:
|
||||
NS_ERROR("Invalid backend type!");
|
||||
return "";
|
||||
|
@ -448,6 +450,9 @@ protected:
|
|||
// which scripts should be shaped with harfbuzz
|
||||
PRInt32 mUseHarfBuzzScripts;
|
||||
|
||||
// The preferred draw target backend to use
|
||||
mozilla::gfx::BackendType mPreferredDrawTargetBackend;
|
||||
|
||||
private:
|
||||
virtual qcms_profile* GetPlatformCMSOutputProfile();
|
||||
|
||||
|
|
|
@ -163,7 +163,12 @@ gfxPlatformMac::GetScaledFontForFont(gfxFont *aFont)
|
|||
bool
|
||||
gfxPlatformMac::SupportsAzure(BackendType& aBackend)
|
||||
{
|
||||
aBackend = BACKEND_COREGRAPHICS;
|
||||
if (mPreferredDrawTargetBackend != BACKEND_NONE) {
|
||||
aBackend = mPreferredDrawTargetBackend;
|
||||
} else {
|
||||
aBackend = BACKEND_COREGRAPHICS;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -552,10 +552,11 @@ gfxWindowsPlatform::SupportsAzure(BackendType& aBackend)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (Preferences::GetBool("gfx.canvas.azure.prefer-skia", false)) {
|
||||
aBackend = BACKEND_SKIA;
|
||||
if (mPreferredDrawTargetBackend != BACKEND_NONE) {
|
||||
aBackend = mPreferredDrawTargetBackend;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче