Bug 1562316 - Fix emoji rendering on android webrender. r=lsalzman
authorJamie Nicol <jnicol@mozilla.com>
Wed, 31 Jul 2019 15:43:52 +0000
changeset 485607 bac526dab75d49d99d8802cab1c6f88e10d5198e
parent 485606 f2c7c870b1207f3ee4cf48e117276fac5f555bc6
child 485608 501b7b7bab15ae99db696bdb7701334cd8ada8ee
push id91351
push userjnicol@mozilla.com
push dateWed, 31 Jul 2019 15:45:02 +0000
treeherderautoland@bac526dab75d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1562316
milestone70.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 1562316 - Fix emoji rendering on android webrender. r=lsalzman ScaledFontFreeType::GetWRFontInstanceOptions() was neglecting to set the FontInstanceFlags::EMBEDDED_BITMAPS flag. This was causing us to always take the non-bitmap path when rasterizing the glyph, which fails on android because emoji fonts are bitmap only. Setting this flag causes glyphs to be rendered correctly on android webrender. Differential Revision: https://phabricator.services.mozilla.com/D40062
gfx/2d/ScaledFontFreeType.cpp
--- a/gfx/2d/ScaledFontFreeType.cpp
+++ b/gfx/2d/ScaledFontFreeType.cpp
@@ -52,16 +52,17 @@ bool ScaledFontFreeType::GetWRFontInstan
     Maybe<wr::FontInstanceOptions>* aOutOptions,
     Maybe<wr::FontInstancePlatformOptions>* aOutPlatformOptions,
     std::vector<FontVariation>* aOutVariations) {
   wr::FontInstanceOptions options;
   options.render_mode = wr::FontRenderMode::Alpha;
   // FIXME: Cairo-FT metrics are not compatible with subpixel positioning.
   // options.flags = wr::FontInstanceFlags_SUBPIXEL_POSITION;
   options.flags = wr::FontInstanceFlags{0};
+  options.flags |= wr::FontInstanceFlags_EMBEDDED_BITMAPS;
   options.bg_color = wr::ToColorU(Color());
   options.synthetic_italics =
       wr::DegreesToSyntheticItalics(GetSyntheticObliqueAngle());
 
   wr::FontInstancePlatformOptions platformOptions;
   platformOptions.lcd_filter = wr::FontLCDFilter::None;
   platformOptions.hinting = wr::FontHinting::None;