Only set dw antialias mode to grayscale for A8.
authorBen Wagner <bungeman@google.com>
Fri, 17 Mar 2017 15:23:32 +0000 (11:23 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 17 Mar 2017 16:01:11 +0000 (16:01 +0000)
The previous code would also set 'grayscale' for aliased which would
then cause the code to use the new renderer, which has issues with
aliased glyphs.

BUG=skia:5416

Change-Id: Ia856322b59d0eba258522d73c3a4d827ab4429e1
Reviewed-on: https://skia-review.googlesource.com/9834
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

src/ports/SkScalerContext_win_dw.cpp

index 33ee9dc..3f5fc99 100644 (file)
@@ -343,7 +343,8 @@ SkScalerContext_DW::SkScalerContext_DW(sk_sp<DWriteFontTypeface> typefaceRef,
     fAntiAliasMode = DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE;
 #ifndef SK_IGNORE_DW_GRAY_FIX
     if (typeface->fFactory2 && typeface->fDWriteFontFace2 &&
-        !isLCD(fRec) && !(fRec.fFlags & SkScalerContext::kGenA8FromLCD_Flag))
+        SkMask::kA8_Format == fRec.fMaskFormat &&
+        !(fRec.fFlags & SkScalerContext::kGenA8FromLCD_Flag))
     {
         // DWRITE_TEXTURE_ALIASED_1x1 is now misnamed, it must also be used with grayscale.
         fTextureType = DWRITE_TEXTURE_ALIASED_1x1;