Bug 1414157 - Supply the font smoothing background color in the webrender FontInstanceOptions. r?lsalzman
MozReview-Commit-ID: CaI4FH7GoI8
--- 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,