Correctly linearize Windows AA from ClearType.
authorbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 13 Aug 2012 20:01:51 +0000 (20:01 +0000)
committerbungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 13 Aug 2012 20:01:51 +0000 (20:01 +0000)
http://codereview.appspot.com/6446129/

git-svn-id: http://skia.googlecode.com/svn/trunk@5069 2bbb7eff-a529-9590-31e7-b0007b416f81

src/ports/SkFontHost_win.cpp

index 814053c..7ea3d49 100755 (executable)
@@ -1135,9 +1135,13 @@ void SkScalerContext_Windows::generateImage(const SkGlyph& glyph, SkMaskGamma::P
     }
 
     if (!isBW) {
-        const uint8_t* table = getInverseGammaTableClearType();
-        if (isAA) {
-          table = getInverseGammaTableGDI();
+        const uint8_t* table;
+        //The offscreen contains a GDI blit if isAA and kGenA8FromLCD_Flag is not set.
+        //Otherwise the offscreen contains a ClearType blit.
+        if (isAA && !(fRec.fFlags & SkScalerContext::kGenA8FromLCD_Flag)) {
+            table = getInverseGammaTableGDI();
+        } else {
+            table = getInverseGammaTableClearType();
         }
         //Note that the following cannot really be integrated into the
         //pre-blend, since we may not be applying the pre-blend; when we aren't