Bug 1516334 - Don't draw emoji as paths when they are too big. r=rhunt, a=RyanVM
authorLee Salzman <lsalzman@mozilla.com>
Thu, 27 Dec 2018 13:30:27 -0500
changeset 509207 dac7e82e8fcf945990335c5efe7d12553e18de60
parent 509206 4cb9d2d57e7d323c9759464a54b6a6dd27144a70
child 509208 d3c013ec52f1cec83c5c367d0ae18f712dc306f2
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, RyanVM
bugs1516334
milestone65.0
Bug 1516334 - Don't draw emoji as paths when they are too big. r=rhunt, a=RyanVM
gfx/skia/skia/src/core/SkGlyphRunPainter.cpp
--- a/gfx/skia/skia/src/core/SkGlyphRunPainter.cpp
+++ b/gfx/skia/skia/src/core/SkGlyphRunPainter.cpp
@@ -64,16 +64,21 @@ bool SkGlyphRunListPainter::ShouldDrawAs
         return true;
     }
 
     // we don't cache perspective
     if (matrix.hasPerspective()) {
         return true;
     }
 
+    // Glyphs like Emojis can't be rendered as a path.
+    if (paint.getTypeface() && paint.getTypeface()->hasColorGlyphs()) {
+      return false;
+    }
+
     SkMatrix textM;
     SkPaintPriv::MakeTextMatrix(&textM, paint);
     return SkPaint::TooBigToUseCache(matrix, textM, 1024);
 }
 
 bool SkGlyphRunListPainter::ensureBitmapBuffers(size_t runSize) {
     if (runSize > fMaxRunSize) {
         fPositions.reset(runSize);