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

Side by Side Diff: src/ports/SkTypeface_win_dw.cpp

Issue 2075913002: Revert of 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 unified diff | Download patch
« no previous file with comments | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkScalerContext Effects& effects, 247 SkScalerContext* DWriteFontTypeface::onCreateScalerContext(const SkScalerContext Effects& effects,
248 const SkDescriptor* d esc) const { 248 const SkDescriptor* d esc) const {
249 return new SkScalerContext_DW(const_cast<DWriteFontTypeface*>(this), effects , desc); 249 return new SkScalerContext_DW(const_cast<DWriteFontTypeface*>(this), effects , desc);
250 } 250 }
251 251
252 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const { 252 void DWriteFontTypeface::onFilterRec(SkScalerContext::Rec* rec) const {
253 if (rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) { 253 if (rec->fFlags & SkScalerContext::kLCD_Vertical_Flag) {
254 rec->fMaskFormat = SkMask::kA8_Format; 254 rec->fMaskFormat = SkMask::kA8_Format;
255 rec->fFlags |= SkScalerContext::kGenA8FromLCD_Flag;
256 } 255 }
257 256
258 unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag | 257 unsigned flagsWeDontSupport = SkScalerContext::kVertical_Flag |
259 SkScalerContext::kDevKernText_Flag | 258 SkScalerContext::kDevKernText_Flag |
260 SkScalerContext::kForceAutohinting_Flag | 259 SkScalerContext::kForceAutohinting_Flag |
261 SkScalerContext::kEmbolden_Flag | 260 SkScalerContext::kEmbolden_Flag |
262 SkScalerContext::kLCD_Vertical_Flag; 261 SkScalerContext::kLCD_Vertical_Flag;
263 rec->fFlags &= ~flagsWeDontSupport; 262 rec->fFlags &= ~flagsWeDontSupport;
264 263
265 SkPaint::Hinting h = rec->getHinting(); 264 SkPaint::Hinting h = rec->getHinting();
266 // DirectWrite2 allows for hinting to be turned off. Force everything else t o normal. 265 // DirectWrite does not provide for hinting hints.
267 if (h != SkPaint::kNo_Hinting || !fFactory2 || !fDWriteFontFace2) { 266 h = SkPaint::kSlight_Hinting;
268 h = SkPaint::kNormal_Hinting;
269 }
270 rec->setHinting(h); 267 rec->setHinting(h);
271 268
272 #if defined(SK_FONT_HOST_USE_SYSTEM_SETTINGS) 269 #if defined(SK_FONT_HOST_USE_SYSTEM_SETTINGS)
273 IDWriteFactory* factory = sk_get_dwrite_factory(); 270 IDWriteFactory* factory = sk_get_dwrite_factory();
274 if (factory != nullptr) { 271 if (factory != nullptr) {
275 SkTScopedComPtr<IDWriteRenderingParams> defaultRenderingParams; 272 SkTScopedComPtr<IDWriteRenderingParams> defaultRenderingParams;
276 if (SUCCEEDED(factory->CreateRenderingParams(&defaultRenderingParams))) { 273 if (SUCCEEDED(factory->CreateRenderingParams(&defaultRenderingParams))) {
277 float gamma = defaultRenderingParams->GetGamma(); 274 float gamma = defaultRenderingParams->GetGamma();
278 rec->setDeviceGamma(gamma); 275 rec->setDeviceGamma(gamma);
279 rec->setPaintGamma(gamma); 276 rec->setPaintGamma(gamma);
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId , int16_t* data) { 458 SkAdvancedTypefaceMetrics::GetAdvance([borrowedFontFace](int gId , int16_t* data) {
462 return getWidthAdvance(borrowedFontFace, gId, data); 459 return getWidthAdvance(borrowedFontFace, gId, data);
463 }) 460 })
464 ); 461 );
465 } 462 }
466 } 463 }
467 464
468 return info; 465 return info;
469 } 466 }
470 #endif//defined(SK_BUILD_FOR_WIN32) 467 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« 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