summaryrefslogtreecommitdiffstats
path: root/gfx/thebes
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/thebes')
-rw-r--r--gfx/thebes/gfxFT2Utils.cpp30
-rw-r--r--gfx/thebes/gfxFcPlatformFontList.cpp29
-rw-r--r--gfx/thebes/gfxFcPlatformFontList.h4
-rw-r--r--gfx/thebes/gfxGDIFont.cpp3
-rw-r--r--gfx/thebes/gfxGDIFontList.cpp32
-rw-r--r--gfx/thebes/gfxGDIFontList.h3
-rw-r--r--gfx/thebes/gfxPlatform.cpp8
-rw-r--r--gfx/thebes/gfxPlatformGtk.cpp6
-rwxr-xr-xgfx/thebes/gfxWindowsPlatform.cpp86
-rw-r--r--gfx/thebes/gfxWindowsPlatform.h8
10 files changed, 73 insertions, 136 deletions
diff --git a/gfx/thebes/gfxFT2Utils.cpp b/gfx/thebes/gfxFT2Utils.cpp
index a544a8cb4..77e1c9632 100644
--- a/gfx/thebes/gfxFT2Utils.cpp
+++ b/gfx/thebes/gfxFT2Utils.cpp
@@ -10,6 +10,10 @@
#include FT_TRUETYPE_TABLES_H
#include <algorithm>
+#ifndef FT_FACE_FLAG_COLOR
+#define FT_FACE_FLAG_COLOR ( 1L << 14 )
+#endif
+
#ifdef HAVE_FONTCONFIG_FCFREETYPE_H
#include <fontconfig/fcfreetype.h>
#endif
@@ -53,7 +57,7 @@ gfxFT2LockedFace::GetMetrics(gfxFont::Metrics* aMetrics,
if (MOZ_UNLIKELY(!mFace)) {
// No face. This unfortunate situation might happen if the font
// file is (re)moved at the wrong time.
- const gfxFloat emHeight = mGfxFont->GetStyle()->size;
+ const gfxFloat emHeight = mGfxFont->GetAdjustedSize();
aMetrics->emHeight = emHeight;
aMetrics->maxAscent = aMetrics->emAscent = 0.8 * emHeight;
aMetrics->maxDescent = aMetrics->emDescent = 0.2 * emHeight;
@@ -80,6 +84,11 @@ gfxFT2LockedFace::GetMetrics(gfxFont::Metrics* aMetrics,
const FT_Size_Metrics& ftMetrics = mFace->size->metrics;
+ aMetrics->maxAscent = FLOAT_FROM_26_6(ftMetrics.ascender);
+ aMetrics->maxDescent = -FLOAT_FROM_26_6(ftMetrics.descender);
+ aMetrics->maxAdvance = FLOAT_FROM_26_6(ftMetrics.max_advance);
+ gfxFloat lineHeight = FLOAT_FROM_26_6(ftMetrics.height);
+
gfxFloat emHeight;
// Scale for vertical design metric conversion: pixels per design unit.
// If this remains at 0.0, we can't use metrics from OS/2 etc.
@@ -103,6 +112,19 @@ gfxFT2LockedFace::GetMetrics(gfxFont::Metrics* aMetrics,
const TT_Header* head =
static_cast<TT_Header*>(FT_Get_Sfnt_Table(mFace, ft_sfnt_head));
if (head) {
+ // Even if the font is not explicitly scalable, if the face has
+ // color bitmaps, it should be treated as scalable and scaled to
+ // the desired size. Metrics based on y_ppem need to be rescaled
+ // for the adjusted size. This makes metrics agree with the
+ // scales we pass to Cairo for Fontconfig fonts.
+ if (mFace->face_flags & FT_FACE_FLAG_COLOR) {
+ emHeight = mGfxFont->GetAdjustedSize();
+ gfxFloat adjustScale = emHeight / ftMetrics.y_ppem;
+ aMetrics->maxAscent *= adjustScale;
+ aMetrics->maxDescent *= adjustScale;
+ aMetrics->maxAdvance *= adjustScale;
+ lineHeight *= adjustScale;
+ }
gfxFloat emUnit = head->Units_Per_EM;
yScale = emHeight / emUnit;
}
@@ -111,11 +133,6 @@ gfxFT2LockedFace::GetMetrics(gfxFont::Metrics* aMetrics,
TT_OS2 *os2 =
static_cast<TT_OS2*>(FT_Get_Sfnt_Table(mFace, ft_sfnt_os2));
- aMetrics->maxAscent = FLOAT_FROM_26_6(ftMetrics.ascender);
- aMetrics->maxDescent = -FLOAT_FROM_26_6(ftMetrics.descender);
- aMetrics->maxAdvance = FLOAT_FROM_26_6(ftMetrics.max_advance);
-
- gfxFloat lineHeight;
if (os2 && os2->sTypoAscender && yScale > 0.0) {
aMetrics->emAscent = os2->sTypoAscender * yScale;
aMetrics->emDescent = -os2->sTypoDescender * yScale;
@@ -142,7 +159,6 @@ gfxFT2LockedFace::GetMetrics(gfxFont::Metrics* aMetrics,
} else {
aMetrics->emAscent = aMetrics->maxAscent;
aMetrics->emDescent = aMetrics->maxDescent;
- lineHeight = FLOAT_FROM_26_6(ftMetrics.height);
}
cairo_text_extents_t extents;
diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp
index 601e7a90c..75e8fb76a 100644
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -811,6 +811,15 @@ ChooseFontSize(gfxFontconfigFontEntry* aEntry,
bestSize = size;
}
}
+ // If the font has bitmaps but wants to be scaled, then let it scale.
+ if (bestSize >= 0.0) {
+ FcBool scalable;
+ if (FcPatternGetBool(aEntry->GetPattern(),
+ FC_SCALABLE, 0, &scalable) == FcResultMatch &&
+ scalable) {
+ return requestedSize;
+ }
+ }
return bestSize;
}
@@ -946,10 +955,16 @@ gfxFontconfigFontFamily::AddFontPattern(FcPattern* aFontPattern)
NS_ASSERTION(!mHasStyles,
"font patterns must not be added to already enumerated families");
- FcBool scalable;
- if (FcPatternGetBool(aFontPattern, FC_SCALABLE, 0, &scalable) != FcResultMatch ||
- !scalable) {
+ FcBool outline;
+ if (FcPatternGetBool(aFontPattern, FC_OUTLINE, 0, &outline) != FcResultMatch ||
+ !outline) {
mHasNonScalableFaces = true;
+
+ FcBool scalable;
+ if (FcPatternGetBool(aFontPattern, FC_SCALABLE, 0, &scalable) == FcResultMatch &&
+ scalable) {
+ mForceScalable = true;
+ }
}
nsCountedRef<FcPattern> pattern(aFontPattern);
@@ -961,7 +976,9 @@ static const double kRejectDistance = 10000.0;
// Calculate a distance score representing the size disparity between the
// requested style's size and the font entry's size.
static double
-SizeDistance(gfxFontconfigFontEntry* aEntry, const gfxFontStyle& aStyle)
+SizeDistance(gfxFontconfigFontEntry* aEntry,
+ const gfxFontStyle& aStyle,
+ bool aForceScalable)
{
double requestedSize = SizeForStyle(aEntry, aStyle);
double bestDist = -1.0;
@@ -978,7 +995,7 @@ SizeDistance(gfxFontconfigFontEntry* aEntry, const gfxFontStyle& aStyle)
if (bestDist < 0.0) {
// No size means scalable
return -1.0;
- } else if (5.0 * bestDist < requestedSize) {
+ } else if (aForceScalable || 5.0 * bestDist < requestedSize) {
// fontconfig prefers a matching family or lang to pixelsize of bitmap
// fonts. CSS suggests a tolerance of 20% on pixelsize.
return bestDist;
@@ -1012,7 +1029,7 @@ gfxFontconfigFontFamily::FindAllFontsForStyle(const gfxFontStyle& aFontStyle,
for (size_t i = 0; i < aFontEntryList.Length(); i++) {
gfxFontconfigFontEntry* entry =
static_cast<gfxFontconfigFontEntry*>(aFontEntryList[i]);
- double dist = SizeDistance(entry, aFontStyle);
+ double dist = SizeDistance(entry, aFontStyle, mForceScalable);
// If the entry is scalable or has a style that does not match
// the group of unscalable fonts, then start a new group.
if (dist < 0.0 ||
diff --git a/gfx/thebes/gfxFcPlatformFontList.h b/gfx/thebes/gfxFcPlatformFontList.h
index 1bc35021e..aa8f614a9 100644
--- a/gfx/thebes/gfxFcPlatformFontList.h
+++ b/gfx/thebes/gfxFcPlatformFontList.h
@@ -175,7 +175,8 @@ public:
explicit gfxFontconfigFontFamily(const nsAString& aName) :
gfxFontFamily(aName),
mContainsAppFonts(false),
- mHasNonScalableFaces(false)
+ mHasNonScalableFaces(false),
+ mForceScalable(false)
{ }
void FindStyleVariations(FontInfoData *aFontInfoData = nullptr) override;
@@ -201,6 +202,7 @@ protected:
bool mContainsAppFonts;
bool mHasNonScalableFaces;
+ bool mForceScalable;
};
class gfxFontconfigFont : public gfxFontconfigFontBase {
diff --git a/gfx/thebes/gfxGDIFont.cpp b/gfx/thebes/gfxGDIFont.cpp
index e6ceeaf6d..d6e98105c 100644
--- a/gfx/thebes/gfxGDIFont.cpp
+++ b/gfx/thebes/gfxGDIFont.cpp
@@ -461,8 +461,7 @@ gfxGDIFont::FillLogFont(LOGFONTW& aLogFont, gfxFloat aSize,
weight = mNeedsBold ? 700 : fe->Weight();
}
- fe->FillLogFont(&aLogFont, weight, aSize,
- (mAntialiasOption == kAntialiasSubpixel) ? true : false);
+ fe->FillLogFont(&aLogFont, weight, aSize);
// If GDI synthetic italic is wanted, force the lfItalic field to true
if (aUseGDIFakeItalic) {
diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp
index d80c49356..cc047ef38 100644
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -37,11 +37,6 @@ using namespace mozilla;
#define ROUND(x) floor((x) + 0.5)
-
-#ifndef CLEARTYPE_QUALITY
-#define CLEARTYPE_QUALITY 5
-#endif
-
#define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
LogLevel::Debug, args)
#define LOG_FONTLIST_ENABLED() MOZ_LOG_TEST( \
@@ -222,16 +217,7 @@ GDIFontEntry::IsSymbolFont()
gfxFont *
GDIFontEntry::CreateFontInstance(const gfxFontStyle* aFontStyle, bool aNeedsBold)
{
- bool isXP = !IsVistaOrLater();
-
- bool useClearType = isXP && !aFontStyle->systemFont &&
- (gfxWindowsPlatform::GetPlatform()->UseClearTypeAlways() ||
- (mIsDataUserFont &&
- gfxWindowsPlatform::GetPlatform()->UseClearTypeForDownloadableFonts()));
-
- return new gfxGDIFont(this, aFontStyle, aNeedsBold,
- (useClearType ? gfxFont::kAntialiasSubpixel
- : gfxFont::kAntialiasDefault));
+ return new gfxGDIFont(this, aFontStyle, aNeedsBold);
}
nsresult
@@ -263,8 +249,7 @@ GDIFontEntry::CopyFontTable(uint32_t aTableTag, nsTArray<uint8_t>& aBuffer)
void
GDIFontEntry::FillLogFont(LOGFONTW *aLogFont,
- uint16_t aWeight, gfxFloat aSize,
- bool aUseCleartype)
+ uint16_t aWeight, gfxFloat aSize)
{
memcpy(aLogFont, &mLogFont, sizeof(LOGFONTW));
@@ -290,8 +275,6 @@ GDIFontEntry::FillLogFont(LOGFONTW *aLogFont,
if (mIsDataUserFont) {
aLogFont->lfItalic = 0;
}
-
- aLogFont->lfQuality = (aUseCleartype ? CLEARTYPE_QUALITY : DEFAULT_QUALITY);
}
#define MISSING_GLYPH 0x1F // glyph index returned for missing characters
@@ -879,15 +862,8 @@ gfxGDIFontList::MakePlatformFont(const nsAString& aFontName,
gfxWindowsFontType(isCFF ? GFX_FONT_TYPE_PS_OPENTYPE : GFX_FONT_TYPE_TRUETYPE) /*type*/,
aStyle, w, aStretch, winUserFontData, false);
- if (!fe)
- return fe;
-
- fe->mIsDataUserFont = true;
-
- // Uniscribe doesn't place CFF fonts loaded privately
- // via AddFontMemResourceEx on XP/Vista
- if (isCFF && !IsWin7OrLater()) {
- fe->mForceGDI = true;
+ if (fe) {
+ fe->mIsDataUserFont = true;
}
return fe;
diff --git a/gfx/thebes/gfxGDIFontList.h b/gfx/thebes/gfxGDIFontList.h
index ffb513d64..60fb292e8 100644
--- a/gfx/thebes/gfxGDIFontList.h
+++ b/gfx/thebes/gfxGDIFontList.h
@@ -112,8 +112,7 @@ public:
virtual bool IsSymbolFont();
- void FillLogFont(LOGFONTW *aLogFont, uint16_t aWeight, gfxFloat aSize,
- bool aUseCleartype);
+ void FillLogFont(LOGFONTW *aLogFont, uint16_t aWeight, gfxFloat aSize);
static gfxWindowsFontType DetermineFontType(const NEWTEXTMETRICW& metrics,
DWORD fontType)
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 2e4ec990f..a468592fe 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -71,9 +71,6 @@
#include "nsIScreenManager.h"
#include "FrameMetrics.h"
#include "MainThreadUtils.h"
-#ifdef MOZ_CRASHREPORTER
-#include "nsExceptionHandler.h"
-#endif
#include "nsWeakReference.h"
@@ -293,12 +290,7 @@ void CrashStatsLogForwarder::UpdateCrashReport()
message << logAnnotation << Get<0>(*it) << "]" << Get<1>(*it) << " (t=" << Get<2>(*it) << ") ";
}
-#ifdef MOZ_CRASHREPORTER
- nsCString reportString(message.str().c_str());
- nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString);
-#else
nsresult annotated = NS_ERROR_NOT_IMPLEMENTED;
-#endif
if (annotated != NS_OK) {
printf("Crash Annotation %s: %s",
mCrashCriticalKey.get(), message.str().c_str());
diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp
index 9d7f512f2..1fb3bc4fd 100644
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -227,10 +227,10 @@ gfxPlatformGtk::UpdateFontList()
// out a more general list
static const char kFontDejaVuSans[] = "DejaVu Sans";
static const char kFontDejaVuSerif[] = "DejaVu Serif";
-static const char kFontEmojiOneMozilla[] = "EmojiOne Mozilla";
static const char kFontFreeSans[] = "FreeSans";
static const char kFontFreeSerif[] = "FreeSerif";
static const char kFontTakaoPGothic[] = "TakaoPGothic";
+static const char kFontTwemojiMozilla[] = "Twemoji Mozilla";
static const char kFontDroidSansFallback[] = "Droid Sans Fallback";
static const char kFontWenQuanYiMicroHei[] = "WenQuanYi Micro Hei";
static const char kFontNanumGothic[] = "NanumGothic";
@@ -242,7 +242,7 @@ gfxPlatformGtk::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
{
if (aNextCh == 0xfe0fu) {
// if char is followed by VS16, try for a color emoji glyph
- aFontList.AppendElement(kFontEmojiOneMozilla);
+ aFontList.AppendElement(kFontTwemojiMozilla);
}
aFontList.AppendElement(kFontDejaVuSerif);
@@ -254,7 +254,7 @@ gfxPlatformGtk::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
uint32_t p = aCh >> 16;
if (p == 1) { // try color emoji font, unless VS15 (text style) present
if (aNextCh != 0xfe0fu && aNextCh != 0xfe0eu) {
- aFontList.AppendElement(kFontEmojiOneMozilla);
+ aFontList.AppendElement(kFontTwemojiMozilla);
}
}
}
diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp
index be1780797..af4d932a9 100755
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -146,9 +146,6 @@ public:
NS_IMPL_ISUPPORTS(GfxD2DVramReporter, nsIMemoryReporter)
-#define GFX_USE_CLEARTYPE_ALWAYS "gfx.font_rendering.cleartype.always_use_for_content"
-#define GFX_DOWNLOADABLE_FONTS_USE_CLEARTYPE "gfx.font_rendering.cleartype.use_for_downloadable_fonts"
-
#define GFX_CLEARTYPE_PARAMS "gfx.font_rendering.cleartype_params."
#define GFX_CLEARTYPE_PARAMS_GAMMA "gfx.font_rendering.cleartype_params.gamma"
#define GFX_CLEARTYPE_PARAMS_CONTRAST "gfx.font_rendering.cleartype_params.enhanced_contrast"
@@ -194,10 +191,6 @@ public:
HMODULE gdi32Handle;
PFND3DKMTQS queryD3DKMTStatistics = nullptr;
- // GPU memory reporting is not available before Windows 7
- if (!IsWin7OrLater())
- return NS_OK;
-
if ((gdi32Handle = LoadLibrary(TEXT("gdi32.dll"))))
queryD3DKMTStatistics = (PFND3DKMTQS)GetProcAddress(gdi32Handle, "D3DKMTQueryStatistics");
@@ -320,9 +313,6 @@ NS_IMPL_ISUPPORTS(D3DSharedTexturesReporter, nsIMemoryReporter)
gfxWindowsPlatform::gfxWindowsPlatform()
: mRenderMode(RENDER_GDI)
{
- mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
- mUseClearTypeAlways = UNINITIALIZED_VALUE;
-
/*
* Initialize COM
*/
@@ -402,10 +392,6 @@ gfxWindowsPlatform::CanUseHardwareVideoDecoding()
bool
gfxWindowsPlatform::InitDWriteSupport()
{
- if (!IsVistaOrLater()) {
- return false;
- }
-
// DWrite is only supported on Windows 7 with the platform update and higher.
// We check this by seeing if D2D1 support is available.
if (!Factory::SupportsD2D1()) {
@@ -648,7 +634,6 @@ static const char kFontCambriaMath[] = "Cambria Math";
static const char kFontEbrima[] = "Ebrima";
static const char kFontEstrangeloEdessa[] = "Estrangelo Edessa";
static const char kFontEuphemia[] = "Euphemia";
-static const char kFontEmojiOneMozilla[] = "EmojiOne Mozilla";
static const char kFontGabriola[] = "Gabriola";
static const char kFontJavaneseText[] = "Javanese Text";
static const char kFontKhmerUI[] = "Khmer UI";
@@ -675,6 +660,7 @@ static const char kFontSegoeUIEmoji[] = "Segoe UI Emoji";
static const char kFontSegoeUISymbol[] = "Segoe UI Symbol";
static const char kFontSylfaen[] = "Sylfaen";
static const char kFontTraditionalArabic[] = "Traditional Arabic";
+static const char kFontTwemojiMozilla[] = "Twemoji Mozilla";
static const char kFontUtsaah[] = "Utsaah";
static const char kFontYuGothic[] = "Yu Gothic";
@@ -685,7 +671,7 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
{
if (aNextCh == 0xfe0fu) {
aFontList.AppendElement(kFontSegoeUIEmoji);
- aFontList.AppendElement(kFontEmojiOneMozilla);
+ aFontList.AppendElement(kFontTwemojiMozilla);
}
// Arial is used as the default fallback for system fallback
@@ -697,11 +683,11 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
if (aNextCh == 0xfe0eu) {
aFontList.AppendElement(kFontSegoeUISymbol);
aFontList.AppendElement(kFontSegoeUIEmoji);
- aFontList.AppendElement(kFontEmojiOneMozilla);
+ aFontList.AppendElement(kFontTwemojiMozilla);
} else {
if (aNextCh != 0xfe0fu) {
aFontList.AppendElement(kFontSegoeUIEmoji);
- aFontList.AppendElement(kFontEmojiOneMozilla);
+ aFontList.AppendElement(kFontTwemojiMozilla);
}
aFontList.AppendElement(kFontSegoeUISymbol);
}
@@ -997,26 +983,6 @@ gfxWindowsPlatform::GetPlatformCMSOutputProfile(void* &mem, size_t &mem_size)
#endif // _WIN32
}
-bool
-gfxWindowsPlatform::UseClearTypeForDownloadableFonts()
-{
- if (mUseClearTypeForDownloadableFonts == UNINITIALIZED_VALUE) {
- mUseClearTypeForDownloadableFonts = Preferences::GetBool(GFX_DOWNLOADABLE_FONTS_USE_CLEARTYPE, true);
- }
-
- return mUseClearTypeForDownloadableFonts;
-}
-
-bool
-gfxWindowsPlatform::UseClearTypeAlways()
-{
- if (mUseClearTypeAlways == UNINITIALIZED_VALUE) {
- mUseClearTypeAlways = Preferences::GetBool(GFX_USE_CLEARTYPE_ALWAYS, false);
- }
-
- return mUseClearTypeAlways;
-}
-
void
gfxWindowsPlatform::GetDLLVersion(char16ptr_t aDLLPath, nsAString& aVersion)
{
@@ -1160,14 +1126,7 @@ gfxWindowsPlatform::FontsPrefsChanged(const char *aPref)
gfxPlatform::FontsPrefsChanged(aPref);
- if (!aPref) {
- mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
- mUseClearTypeAlways = UNINITIALIZED_VALUE;
- } else if (!strcmp(GFX_DOWNLOADABLE_FONTS_USE_CLEARTYPE, aPref)) {
- mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
- } else if (!strcmp(GFX_USE_CLEARTYPE_ALWAYS, aPref)) {
- mUseClearTypeAlways = UNINITIALIZED_VALUE;
- } else if (!strncmp(GFX_CLEARTYPE_PARAMS, aPref, strlen(GFX_CLEARTYPE_PARAMS))) {
+ if (aPref && !strncmp(GFX_CLEARTYPE_PARAMS, aPref, strlen(GFX_CLEARTYPE_PARAMS))) {
SetupClearTypeParams();
} else {
clearTextFontCaches = false;
@@ -1415,17 +1374,13 @@ gfxWindowsPlatform::InitializeD3D9Config()
return;
}
- if (!IsVistaOrLater()) {
- d3d9.EnableByDefault();
- } else {
- d3d9.SetDefaultFromPref(
- gfxPrefs::GetLayersAllowD3D9FallbackPrefName(),
- true,
- gfxPrefs::GetLayersAllowD3D9FallbackPrefDefault());
+ d3d9.SetDefaultFromPref(
+ gfxPrefs::GetLayersAllowD3D9FallbackPrefName(),
+ true,
+ gfxPrefs::GetLayersAllowD3D9FallbackPrefDefault());
- if (!d3d9.IsEnabled() && gfxPrefs::LayersPreferD3D9()) {
- d3d9.UserEnable("Direct3D9 enabled via layers.prefer-d3d9");
- }
+ if (!d3d9.IsEnabled() && gfxPrefs::LayersPreferD3D9()) {
+ d3d9.UserEnable("Direct3D9 enabled via layers.prefer-d3d9");
}
nsCString message;
@@ -1596,11 +1551,6 @@ gfxWindowsPlatform::InitializeD2DConfig()
NS_LITERAL_CSTRING("FEATURE_FAILURE_D2D_D3D11_COMP"));
return;
}
- if (!IsVistaOrLater()) {
- d2d1.DisableByDefault(FeatureStatus::Unavailable, "Direct2D is not available on Windows XP",
- NS_LITERAL_CSTRING("FEATURE_FAILURE_D2D_XP"));
- return;
- }
d2d1.SetDefaultFromPref(
gfxPrefs::GetDirect2DDisabledPrefName(),
@@ -1692,14 +1642,12 @@ gfxWindowsPlatform::InitGPUProcessSupport()
"Not using GPU Process since D3D11 is unavailable",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_D3D11"));
} else if (!IsWin7SP1OrLater()) {
- // For Windows XP, we simply don't care enough to support this
- // configuration. On Windows Vista and 7 Pre-SP1, DXGI 1.2 is not
- // available and remote presentation for D3D11 will not work. Rather
- // than take a regression and use D3D9, we revert back to in-process
- // rendering.
+ // On Windows 7 Pre-SP1, DXGI 1.2 is not available and remote presentation
+ // for D3D11 will not work. Rather than take a regression and use D3D9, we
+ // revert back to in-process rendering.
gpuProc.Disable(
FeatureStatus::Unavailable,
- "Windows XP, Vista, and 7 Pre-SP1 cannot use the GPU process",
+ "Windows 7 Pre-SP1 cannot use the GPU process",
NS_LITERAL_CSTRING("FEATURE_FAILURE_OLD_WINDOWS"));
} else if (!IsWin8OrLater()) {
// Windows 7 SP1 can have DXGI 1.2 only via the Platform Update, so we
@@ -1722,10 +1670,6 @@ gfxWindowsPlatform::InitGPUProcessSupport()
bool
gfxWindowsPlatform::DwmCompositionEnabled()
{
- if (!IsVistaOrLater()) {
- return false;
- }
-
MOZ_ASSERT(WinUtils::dwmIsCompositionEnabledPtr);
BOOL dwmEnabled = false;
diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h
index 8db7cf575..f77d9a87a 100644
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -184,11 +184,6 @@ public:
mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) override;
- // ClearType is not always enabled even when available (e.g. Windows XP)
- // if either of these prefs are enabled and apply, use ClearType rendering
- bool UseClearTypeForDownloadableFonts();
- bool UseClearTypeAlways();
-
static void GetDLLVersion(char16ptr_t aDLLPath, nsAString& aVersion);
// returns ClearType tuning information for each display
@@ -247,9 +242,6 @@ protected:
protected:
RenderMode mRenderMode;
- int8_t mUseClearTypeForDownloadableFonts;
- int8_t mUseClearTypeAlways;
-
private:
void Init();
void InitAcceleration() override;