Bug 1477625 - Don't use subpixel positioning for GDI fonts in WebRender. r=jrmuizel
authorLee Salzman <lsalzman@mozilla.com>
Wed, 12 Sep 2018 13:34:08 -0400
changeset 436036 efe2d390bdc5ce329ef10e45699026b122e3525b
parent 436035 e6c9581ba20e96a883ca5cab65d0055cd8df213d
child 436037 ef0c065ebe0fc1918816718d45dc7e2a42545b06
push id34625
push userdvarga@mozilla.com
push dateThu, 13 Sep 2018 02:31:40 +0000
treeherdermozilla-central@51e9e9660b3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1477625
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1477625 - Don't use subpixel positioning for GDI fonts in WebRender. r=jrmuizel
gfx/2d/ScaledFontDWrite.cpp
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -476,25 +476,27 @@ ScaledFontDWrite::GetFontInstanceData(Fo
 
 bool
 ScaledFontDWrite::GetWRFontInstanceOptions(Maybe<wr::FontInstanceOptions>* aOutOptions,
                                            Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
                                            std::vector<FontVariation>* aOutVariations)
 {
   wr::FontInstanceOptions options;
   options.render_mode = wr::ToFontRenderMode(GetDefaultAAMode());
-  options.flags = wr::FontInstanceFlags::SUBPIXEL_POSITION;
+  options.flags = 0;
   if (mFontFace->GetSimulations() & DWRITE_FONT_SIMULATIONS_BOLD) {
     options.flags |= wr::FontInstanceFlags::SYNTHETIC_BOLD;
   }
   if (UseEmbeddedBitmaps()) {
     options.flags |= wr::FontInstanceFlags::EMBEDDED_BITMAPS;
   }
   if (ForceGDIMode()) {
     options.flags |= wr::FontInstanceFlags::FORCE_GDI;
+  } else {
+    options.flags |= wr::FontInstanceFlags::SUBPIXEL_POSITION;
   }
   options.bg_color = wr::ToColorU(Color());
   options.synthetic_italics = wr::DegreesToSyntheticItalics(GetSyntheticObliqueAngle());
 
   wr::FontInstancePlatformOptions platformOptions;
   platformOptions.gamma = uint16_t(std::round(mGamma * 100.0f));
   platformOptions.contrast = uint16_t(std::round(std::min(mContrast, 1.0f) * 100.0f));