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

Unified Diff: src/ports/SkTypeface_win_dw.cpp

Issue 2065833002: Support pixel antialising in DirectWrite. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use the same grid fit mode no matter the rotation. Created 4 years, 5 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 | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkTypeface_win_dw.cpp
diff --git a/src/ports/SkTypeface_win_dw.cpp b/src/ports/SkTypeface_win_dw.cpp
index 11e5727e389cb8247b5991fd530227dd78393e60..19aa4849d493f3260e27bc9ccfa7d099a4cc418b 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -253,6 +253,7 @@ SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkScalerContext
void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const {
if (rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) {
rec->fMaskFormat = SkMask::kA8_Format;
+ rec->fFlags |= SkScalerContext::kGenA8FromLCD_Flag;
}
unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag |
@@ -263,8 +264,10 @@ void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const {
rec->fFlags &= ~flagsWeDontSupport;
SkPaint::Hinting h = rec->getHinting();
- // DirectWrite does not provide for hinting hints.
- h = SkPaint::kSlight_Hinting;
+ // DirectWrite2 allows for hinting to be turned off. Force everything else to normal.
+ if (h != SkPaint::kNo_Hinting || !fFactory2 || !fDWriteFontFace2) {
+ h = SkPaint::kNormal_Hinting;
+ }
rec->setHinting(h);
#if defined(SK_FONT_HOST_USE_SYSTEM_SETTINGS)
« no previous file with comments | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698