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:
George Wright 2012-01-27 14:38:00 -08:00
Родитель dd13affd40
Коммит 4163ec22f7
5 изменённых файлов: 21 добавлений и 3 удалений

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

@ -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;
} }