Bug 1298833 - disable gamma correction in SkFontHost_cairo to match cairo-ft. r=mchang
authorLee Salzman <lsalzman@mozilla.com>
Mon, 29 Aug 2016 16:36:09 -0400
changeset 407019 eb085490560d00d0d2863695df142b3b6277c759
parent 407018 45c2fde6056f8523e7077646e2c04f5ca362810f
child 407020 84c2a6ebb42c4aafc8f6eacf6ea90ac7bfef3b97
push id27893
push userbmo:gasolin@mozilla.com
push dateTue, 30 Aug 2016 03:41:38 +0000
reviewersmchang
bugs1298833
milestone51.0a1
Bug 1298833 - disable gamma correction in SkFontHost_cairo to match cairo-ft. r=mchang MozReview-Commit-ID: Ee70HBUJxou
gfx/skia/skia/src/ports/SkFontHost_cairo.cpp
--- a/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp
+++ b/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp
@@ -214,16 +214,19 @@ public:
         if (!fPattern && isLCD(*rec)) {
             rec->fMaskFormat = SkMask::kA8_Format;
         }
 
         // rotated text looks bad with hinting, so we disable it as needed
         if (!gFontHintingEnabled || !isAxisAligned(*rec)) {
             rec->setHinting(SkPaint::kNo_Hinting);
         }
+
+        // Don't apply any gamma so that we match cairo-ft's results.
+        rec->ignorePreBlend();
     }
 
     virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const override
     {
         SkDEBUGCODE(SkDebugf("SkCairoFTTypeface::onGetFontDescriptor unimplemented\n"));
     }
 
     virtual int onCharsToGlyphs(void const*, SkTypeface::Encoding, uint16_t*, int) const override