Bug 1414157 - Supply the font smoothing background color in the webrender FontInstanceOptions. r?lsalzman draft
authorMarkus Stange <mstange@themasta.com>
Thu, 02 Nov 2017 22:21:54 -0400
changeset 693238 2468328f2d77ce5eac8e760a5ee642822d42f9b7
parent 693237 079798c2dbb39d796486aa838a61a14584ee138b
child 693939 f183530993df277a746cdac741863166366320ed
push id87733
push userbmo:mstange@themasta.com
push dateSat, 04 Nov 2017 16:43:23 +0000
reviewerslsalzman
bugs1414157
milestone58.0a1
Bug 1414157 - Supply the font smoothing background color in the webrender FontInstanceOptions. r?lsalzman MozReview-Commit-ID: CaI4FH7GoI8
gfx/2d/ScaledFontMac.cpp
--- a/gfx/2d/ScaledFontMac.cpp
+++ b/gfx/2d/ScaledFontMac.cpp
@@ -376,16 +376,23 @@ ScaledFontMac::GetFontInstanceData(FontI
 
 bool
 ScaledFontMac::GetWRFontInstanceOptions(Maybe<wr::FontInstanceOptions>* aOutOptions,
                                         Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
                                         std::vector<FontVariation>* aOutVariations)
 {
     GetVariationsForCTFont(mCTFont, aOutVariations);
 
+    wr::FontInstanceOptions options;
+    options.render_mode = wr::FontRenderMode::Subpixel;
+    options.subpx_dir = wr::SubpixelDirection::Horizontal;
+    options.synthetic_italics = false;
+    options.bg_color = wr::ToColorU(mFontSmoothingBackgroundColor);
+    *aOutOptions = Some(options);
+
     wr::FontInstancePlatformOptions platformOptions;
     platformOptions.font_smoothing = mUseFontSmoothing;
     *aOutPlatformOptions = Some(platformOptions);
     return true;
 }
 
 static CFDictionaryRef
 CreateVariationDictionaryOrNull(CGFontRef aCGFont, uint32_t aVariationCount,