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

Unified Diff: ui/gfx/platform_font_win.cc

Issue 1021643002: Retrieve and pass subpixel lcd geometry on windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ws Created 5 years, 9 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
« ui/gfx/font_render_params_win.cc ('K') | « ui/gfx/font_render_params_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_win.cc
diff --git a/ui/gfx/platform_font_win.cc b/ui/gfx/platform_font_win.cc
index 8d8702edabc7d8f0f2b38695cf047be7455e95bf..7d63a71e002bb2ec8543c973d988b69e8670c24c 100644
--- a/ui/gfx/platform_font_win.cc
+++ b/ui/gfx/platform_font_win.cc
@@ -488,11 +488,17 @@ PlatformFontWin::HFontRef* PlatformFontWin::CreateHFontRefFromSkia(
base::SysWideToUTF8(font_info.lfFaceName).c_str(),
static_cast<SkTypeface::Style>(skia_style)));
- BOOL antialiasing = TRUE;
- SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &antialiasing, 0);
+ gfx::FontRenderParams font_params =
+ gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(false), nullptr);
+ SkFontHost::SetSubpixelOrder(
+ gfx::FontRenderParams::SubpixelRenderingToSkiaLCDOrder(
+ font_params.subpixel_rendering));
+ SkFontHost::SetSubpixelOrientation(
+ gfx::FontRenderParams::SubpixelRenderingToSkiaLCDOrientation(
+ font_params.subpixel_rendering));
SkPaint paint;
- paint.setAntiAlias(!!antialiasing);
msw 2015/03/26 20:41:26 nit: should font_render_params_win.cc:36 use the !
scottmg 2015/03/26 21:16:17 You meant :63, right? No need, it's non-zero eithe
+ paint.setAntiAlias(font_params.antialiasing);
paint.setTypeface(skia_face.get());
paint.setTextSize(-font_info.lfHeight);
SkPaint::FontMetrics skia_metrics;
« ui/gfx/font_render_params_win.cc ('K') | « ui/gfx/font_render_params_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698