+2012-01-26 Mike Reed <reed@google.com>
+
+ Signal to skia to force A8 text from LCD output, but only when we have to disable LCD because we're in a layer
+ https://bugs.webkit.org/show_bug.cgi?id=76547
+
+ Reviewed by Stephen White.
+
+ Existing tests should confirm nothing is broken. Antialiased text
+ is disabled in layouttests, so they should be unaffected by the
+ difference in antialiasing quality.
+
+ * platform/graphics/skia/SkiaFontWin.cpp:
+ (WebCore::setupPaintForFont):
+
+
2012-01-26 Anders Carlsson <andersca@apple.com>
Use PlatformWheelEvent::phase() to determine if a scroll gesture begins or ends
textFlags &= getDefaultGDITextFlags();
// do this check after our switch on lfQuality
- if (disableTextLCD(pcs))
+ if (disableTextLCD(pcs)) {
textFlags &= ~SkPaint::kLCDRenderText_Flag;
+ // If we *just* clear our request for LCD, then GDI seems to
+ // sometimes give us AA text, and sometimes give us BW text. Since the
+ // original intent was LCD, we want to force AA (rather than BW), so we
+ // add a special bit to tell Skia to do its best to avoid the BW: by
+ // drawing LCD offscreen and downsampling that to AA.
+ textFlags |= SkPaint::kGenA8FromLCD_Flag;
+ }
+
+ static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag |
+ SkPaint::kLCDRenderText_Flag |
+ SkPaint::kGenA8FromLCD_Flag;
// now copy in just the text flags
+ SkASSERT(!(textFlags & ~textFlagsMask));
uint32_t flags = paint->getFlags();
- flags &= ~(SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag);
+ flags &= ~textFlagsMask;
flags |= textFlags;
paint->setFlags(flags);
}