Bug 1544188 - check cleartype level for WR DWrite fonts. r=jfkthame a=pascalc
authorLee Salzman <lsalzman@mozilla.com>
Sun, 21 Apr 2019 03:00:04 +0300
changeset 526261 a3857b3191a4c9b4676ab5ff603e09c39546c23a
parent 526260 bdd03a2c4e54d9bd9f6822ab5bef134d11d67f90
child 526262 6cd36394e2aeaea04ad1978e7131ac86da02f1f1
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, pascalc
bugs1544188
milestone67.0
Bug 1544188 - check cleartype level for WR DWrite fonts. r=jfkthame a=pascalc Reviewers: jfkthame Reviewed By: jfkthame Bug #: 1544188 Differential Revision: https://phabricator.services.mozilla.com/D27563
gfx/2d/ScaledFontDWrite.cpp
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -470,17 +470,18 @@ bool ScaledFontDWrite::GetFontInstanceDa
   return true;
 }
 
 bool ScaledFontDWrite::GetWRFontInstanceOptions(
     Maybe<wr::FontInstanceOptions>* aOutOptions,
     Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
     std::vector<FontVariation>* aOutVariations) {
   wr::FontInstanceOptions options;
-  options.render_mode = wr::ToFontRenderMode(GetDefaultAAMode());
+  bool useSubpixel = !mParams || mParams->GetClearTypeLevel() != 0.0f;
+  options.render_mode = wr::ToFontRenderMode(GetDefaultAAMode(), useSubpixel);
   options.flags = wr::FontInstanceFlags{0};
   if (mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD) {
     options.flags |= wr::FontInstanceFlags_SYNTHETIC_BOLD;
   }
   if (UseEmbeddedBitmaps()) {
     options.flags |= wr::FontInstanceFlags_EMBEDDED_BITMAPS;
   }
   if (ForceGDIMode()) {