From 0acba278661e891d32a9c094c091b3f179296f22 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 24 Jun 2019 18:45:16 +0000 Subject: [PATCH] Bug 1559810 - disallow Cairo as content/canvas backend. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D35691 --HG-- extra : moz-landing-system : lando --- gfx/thebes/gfxPlatform.cpp | 22 +++++++++++++--------- gfx/thebes/gfxWindowsPlatform.cpp | 6 ++---- modules/libpref/init/all.js | 6 +++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 55f6f8ab49c6..3ed920e442b1 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -1875,14 +1875,16 @@ mozilla::layers::DiagnosticTypes gfxPlatform::GetLayerDiagnosticTypes() { BackendPrefsData gfxPlatform::GetBackendPrefs() const { BackendPrefsData data; - data.mCanvasBitmask = BackendTypeBit(BackendType::CAIRO); - data.mContentBitmask = BackendTypeBit(BackendType::CAIRO); -#ifdef USE_SKIA - data.mCanvasBitmask |= BackendTypeBit(BackendType::SKIA); - data.mContentBitmask |= BackendTypeBit(BackendType::SKIA); + data.mCanvasBitmask = BackendTypeBit(BackendType::SKIA); + data.mContentBitmask = BackendTypeBit(BackendType::SKIA); + +#ifdef MOZ_WIDGET_GTK + data.mCanvasBitmask |= BackendTypeBit(BackendType::CAIRO); + data.mContentBitmask |= BackendTypeBit(BackendType::CAIRO); #endif - data.mCanvasDefault = BackendType::CAIRO; - data.mContentDefault = BackendType::CAIRO; + + data.mCanvasDefault = BackendType::SKIA; + data.mContentDefault = BackendType::SKIA; return data; } @@ -1915,8 +1917,10 @@ void gfxPlatform::InitBackendPrefs(BackendPrefsData&& aPrefsData) { mContentBackendBitmask |= BackendTypeBit(aPrefsData.mContentDefault); } - uint32_t swBackendBits = - BackendTypeBit(BackendType::SKIA) | BackendTypeBit(BackendType::CAIRO); + uint32_t swBackendBits = BackendTypeBit(BackendType::SKIA); +#ifdef MOZ_WIDGET_GTK + swBackendBits |= BackendTypeBit(BackendType::CAIRO); +#endif mSoftwareBackend = GetContentBackendPref(swBackendBits); if (XRE_IsParentProcess()) { diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 748bc35434d5..250ce20cb263 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -516,10 +516,8 @@ bool gfxWindowsPlatform::HandleDeviceReset() { BackendPrefsData gfxWindowsPlatform::GetBackendPrefs() const { BackendPrefsData data; - data.mCanvasBitmask = - BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA); - data.mContentBitmask = - BackendTypeBit(BackendType::CAIRO) | BackendTypeBit(BackendType::SKIA); + data.mCanvasBitmask = BackendTypeBit(BackendType::SKIA); + data.mContentBitmask = BackendTypeBit(BackendType::SKIA); data.mCanvasDefault = BackendType::SKIA; data.mContentDefault = BackendType::SKIA; diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 142dd410fa88..e33e66179edf 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -765,9 +765,9 @@ pref("gfx.font_ahem_antialias_none", false); #ifdef XP_WIN // 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", "direct2d1.1,skia,cairo"); -pref("gfx.content.azure.backends", "direct2d1.1,skia,cairo"); +// e.g., pref("gfx.canvas.azure.backends", "direct2d,skia"); +pref("gfx.canvas.azure.backends", "direct2d1.1,skia"); +pref("gfx.content.azure.backends", "direct2d1.1,skia"); pref("gfx.canvas.remote", false); #else #ifdef XP_MACOSX