Bug 1414157 - Supply the font smoothing background color in the webrender FontInstanceOptions. r=lsalzman
authorMarkus Stange <mstange@themasta.com>
Thu, 02 Nov 2017 22:21:54 -0400
changeset 443506 a80606dac3934ba1219506c8fc6c79a31f43f4d9
parent 443505 71651421a36f04f7a2aed614abc7b539e4e7ef6e
child 443511 4e43d3919c51deab933fabe451900504078c3ec6
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1414157
milestone58.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 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,