Backed out changeset adf5830d08b5 (bug 1532171) for build bustages on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Mon, 04 Mar 2019 23:07:02 +0200
changeset 520155 031a1548a83cfcef87cc0d0834f8a2d8c6ea4c6c
parent 520154 774a5ee90bae16072134941ebefab18f203ffe74
child 520156 02e06636f9d5e6603017e5187ddebec5bc41b2fb
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1532171
milestone67.0a1
backs outadf5830d08b510ee37df21177ac71cd9c389660f
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
Backed out changeset adf5830d08b5 (bug 1532171) for build bustages on a CLOSED TREE
gfx/skia/skia/src/ports/SkFontHost_mac.cpp
--- a/gfx/skia/skia/src/ports/SkFontHost_mac.cpp
+++ b/gfx/skia/skia/src/ports/SkFontHost_mac.cpp
@@ -2332,16 +2332,29 @@ size_t SkTypeface_Mac::onGetTableData(Sk
 }
 
 SkScalerContext* SkTypeface_Mac::onCreateScalerContext(const SkScalerContextEffects& effects,
                                                        const SkDescriptor* desc) const {
     return new SkScalerContext_Mac(sk_ref_sp(const_cast<SkTypeface_Mac*>(this)), effects, desc);
 }
 
 void SkTypeface_Mac::onFilterRec(SkScalerContextRec* rec) const {
+    if (rec->fMaskFormat == SkMask::kLCD16_Format ||
+        rec->fFlags & SkScalerContext::kGenA8FromLCD_Flag) {
+        SkColor color = rec->getLuminanceColor();
+        int r = SkColorGetR(color);
+        int g = SkColorGetG(color);
+        int b = SkColorGetB(color);
+        // Choose whether to draw using a light-on-dark mask based on observed
+        // color/luminance thresholds that CoreText uses.
+        if (r >= 85 && g >= 85 && b >= 85 && r + g + b >= 2 * 255) {
+            rec->fFlags |= SkScalerContext::kLightOnDark_Flag;
+        }
+    }
+
     if (rec->fFlags & SkScalerContext::kLCD_BGROrder_Flag ||
         rec->fFlags & SkScalerContext::kLCD_Vertical_Flag)
     {
         rec->fMaskFormat = SkMask::kA8_Format;
         // Render the glyphs as close as possible to what was requested.
         // The above turns off subpixel rendering, but the user requested it.
         // Normal hinting will cause the A8 masks to be generated from CoreGraphics subpixel masks.
         // See comments below for more details.
@@ -2413,31 +2426,16 @@ void SkTypeface_Mac::onFilterRec(SkScale
 #ifndef SK_GAMMA_APPLY_TO_A8
         // SRGBTODO: Is this correct? Do we want contrast boost?
         rec->ignorePreBlend();
 #endif
     } else {
         //CoreGraphics dialates smoothed text as needed.
         rec->setContrast(0);
     }
-
-    // Smoothing will be used if the format is either LCD or if there is hinting.
-    // In those cases, we need to choose the proper dilation mask based on the color.
-    if (rec->fMaskFormat == SkMask::kLCD16_Format ||
-        (rec->fMaskFormat == SkMask::kA8_Format && rec->getHinting() != SkPaint::kNo_Hinting())) {
-        SkColor color = rec->getLuminanceColor();
-        int r = SkColorGetR(color);
-        int g = SkColorGetG(color);
-        int b = SkColorGetB(color);
-        // Choose whether to draw using a light-on-dark mask based on observed
-        // color/luminance thresholds that CoreText uses.
-        if (r >= 85 && g >= 85 && b >= 85 && r + g + b >= 2 * 255) {
-            rec->fFlags |= SkScalerContext::kLightOnDark_Flag;
-        }
-    }
 }
 
 /** Takes ownership of the CFStringRef. */
 static const char* get_str(CFStringRef ref, SkString* str) {
     if (nullptr == ref) {
         return nullptr;
     }
     CFStringToSkString(ref, str);