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

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: Created 4 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
« src/ports/SkTypeface_win_dw.h ('K') | « 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 a12438c88f14cf6f28d50fd02e1c828dfcb948c4..78e3cac558fe40e7c58bd57781733eb26e4879e7 100644
--- a/src/ports/SkTypeface_win_dw.cpp
+++ b/src/ports/SkTypeface_win_dw.cpp
@@ -252,6 +252,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;
bungeman-skia 2016/06/14 14:40:52 Previously this flag was logically implicitly alwa
}
unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag |
@@ -262,8 +263,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)
« src/ports/SkTypeface_win_dw.h ('K') | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698