Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1329)

Unified Diff: Source/platform/fonts/win/FontPlatformDataWin.cpp

Issue 339693002: [DirectWrite] Force fully aliased text for certain fonts at small sizes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/win/FontCacheSkiaWin.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/win/FontPlatformDataWin.cpp
diff --git a/Source/platform/fonts/win/FontPlatformDataWin.cpp b/Source/platform/fonts/win/FontPlatformDataWin.cpp
index 2d436cdbaebb2f6f45274e33d6dd820e6c0beb45..504a127148302d535ab0d2d78472e6164d3fd607 100644
--- a/Source/platform/fonts/win/FontPlatformDataWin.cpp
+++ b/Source/platform/fonts/win/FontPlatformDataWin.cpp
@@ -62,21 +62,23 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) cons
if (ts <= kMaxSizeForEmbeddedBitmap)
flags |= SkPaint::kEmbeddedBitmapText_Flag;
- if (m_useSubpixelPositioning)
- flags |= SkPaint::kSubpixelText_Flag;
-
- // Only set painting flags when we're actually painting.
- if (context && !context->couldUseLCDRenderedText()) {
- 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;
+ if (ts >= m_minSizeForAntiAlias) {
+ if (m_useSubpixelPositioning)
+ flags |= SkPaint::kSubpixelText_Flag;
+
+ // Only set painting flags when we're actually painting.
+ if (context && !context->couldUseLCDRenderedText()) {
+ 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;
+ }
+ SkASSERT(!(textFlags & ~textFlagsMask));
+ flags |= textFlags;
}
- SkASSERT(!(textFlags & ~textFlagsMask));
- flags |= textFlags;
paint->setFlags(flags);
}
« no previous file with comments | « Source/platform/fonts/win/FontCacheSkiaWin.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698