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 435947 efe2d390bdc5ce329ef10e45699026b122e3525b
parent 435946 e6c9581ba20e96a883ca5cab65d0055cd8df213d
child 435948 ef0c065ebe0fc1918816718d45dc7e2a42545b06
push id107755
push userlsalzman@mozilla.com
push dateWed, 12 Sep 2018 17:34:27 +0000
treeherdermozilla-inbound@efe2d390bdc5 [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));