зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 32689459fc62 (bug 1782731) for causing reftest failures. CLOSED TREE
This commit is contained in:
Родитель
7e937f10b1
Коммит
0d7af74214
|
@ -2415,8 +2415,8 @@ gfxPlatformFontList::PrefFontList* gfxFcPlatformFontList::FindGenericFamilies(
|
|||
// -- select the fonts to be used for the generic
|
||||
auto prefFonts = MakeUnique<PrefFontList>(); // can be empty but in
|
||||
// practice won't happen
|
||||
uint32_t limit = StaticPrefs::
|
||||
gfx_font_rendering_fontconfig_max_generic_substitutions();
|
||||
uint32_t limit =
|
||||
gfxPlatformGtk::GetPlatform()->MaxGenericSubstitions();
|
||||
bool foundFontWithLang = false;
|
||||
for (int i = 0; i < faces->nfont; i++) {
|
||||
FcPattern* font = faces->fonts[i];
|
||||
|
|
|
@ -72,6 +72,9 @@
|
|||
|
||||
#define GDK_PIXMAP_SIZE_MAX 32767
|
||||
|
||||
#define GFX_PREF_MAX_GENERIC_SUBSTITUTIONS \
|
||||
"gfx.font_rendering.fontconfig.max_generic_substitutions"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
using namespace mozilla::unicode;
|
||||
|
@ -99,6 +102,7 @@ gfxPlatformGtk::gfxPlatformGtk() {
|
|||
gtk_init(nullptr, nullptr);
|
||||
}
|
||||
|
||||
mMaxGenericSubstitutions = UNINITIALIZED_VALUE;
|
||||
mIsX11Display = gfxPlatform::IsHeadless() ? false : GdkIsX11Display();
|
||||
if (XRE_IsParentProcess()) {
|
||||
InitX11EGLConfig();
|
||||
|
@ -464,11 +468,30 @@ gfxImageFormat gfxPlatformGtk::GetOffscreenFormat() {
|
|||
}
|
||||
|
||||
void gfxPlatformGtk::FontsPrefsChanged(const char* aPref) {
|
||||
// only checking for generic substitions, pass other changes up
|
||||
if (strcmp(GFX_PREF_MAX_GENERIC_SUBSTITUTIONS, aPref) != 0) {
|
||||
gfxPlatform::FontsPrefsChanged(aPref);
|
||||
return;
|
||||
}
|
||||
|
||||
mMaxGenericSubstitutions = UNINITIALIZED_VALUE;
|
||||
gfxFcPlatformFontList* pfl = gfxFcPlatformFontList::PlatformFontList();
|
||||
pfl->ClearGenericMappings();
|
||||
FlushFontAndWordCaches();
|
||||
}
|
||||
|
||||
uint32_t gfxPlatformGtk::MaxGenericSubstitions() {
|
||||
if (mMaxGenericSubstitutions == UNINITIALIZED_VALUE) {
|
||||
mMaxGenericSubstitutions =
|
||||
Preferences::GetInt(GFX_PREF_MAX_GENERIC_SUBSTITUTIONS, 3);
|
||||
if (mMaxGenericSubstitutions < 0) {
|
||||
mMaxGenericSubstitutions = 3;
|
||||
}
|
||||
}
|
||||
|
||||
return uint32_t(mMaxGenericSubstitutions);
|
||||
}
|
||||
|
||||
bool gfxPlatformGtk::AccelerateLayersByDefault() { return true; }
|
||||
|
||||
#if defined(MOZ_X11)
|
||||
|
|
|
@ -50,6 +50,9 @@ class gfxPlatformGtk final : public gfxPlatform {
|
|||
|
||||
void FontsPrefsChanged(const char* aPref) override;
|
||||
|
||||
// maximum number of fonts to substitute for a generic
|
||||
uint32_t MaxGenericSubstitions();
|
||||
|
||||
bool SupportsPluginDirectBitmapDrawing() override { return true; }
|
||||
|
||||
bool AccelerateLayersByDefault() override;
|
||||
|
@ -71,6 +74,8 @@ class gfxPlatformGtk final : public gfxPlatform {
|
|||
bool CheckVariationFontSupport() override;
|
||||
void BuildContentDeviceData(mozilla::gfx::ContentDeviceData* aOut) override;
|
||||
|
||||
int8_t mMaxGenericSubstitutions;
|
||||
|
||||
private:
|
||||
nsTArray<uint8_t> GetPlatformCMSOutputProfileData() override;
|
||||
|
||||
|
|
|
@ -5687,13 +5687,6 @@
|
|||
value: false
|
||||
mirror: always
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
- name: gfx.font_rendering.fontconfig.max_generic_substitutions
|
||||
type: RelaxedAtomicUint32
|
||||
value: 3
|
||||
mirror: always
|
||||
#endif
|
||||
|
||||
#if defined(XP_WIN)
|
||||
# Whether the DirectWrite bold simulation should be used when a bold font-weight
|
||||
# is requested but no bold face available in the family. This renders poorly with
|
||||
|
|
|
@ -3277,6 +3277,11 @@ pref("font.size.monospace.x-math", 13);
|
|||
// snooper. So, let's use true for its default value.
|
||||
pref("intl.ime.hack.uim.using_key_snooper", true);
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
// maximum number of fonts to substitute for a generic
|
||||
pref("gfx.font_rendering.fontconfig.max_generic_substitutions", 3);
|
||||
#endif
|
||||
|
||||
#endif // !ANDROID && !XP_MACOSX && XP_UNIX
|
||||
|
||||
#if defined(ANDROID)
|
||||
|
|
Загрузка…
Ссылка в новой задаче