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

Side by Side Diff: ui/gfx/font_render_params_linux.cc

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « ui/gfx/display.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/font_render_params.h" 5 #include "ui/gfx/font_render_params.h"
6 6
7 #include <fontconfig/fontconfig.h> 7 #include <fontconfig/fontconfig.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/containers/mru_cache.h" 10 #include "base/containers/mru_cache.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // less than that looks awful; do the same here. Requesting subpixel 210 // less than that looks awful; do the same here. Requesting subpixel
211 // rendering or positioning doesn't make sense either. 211 // rendering or positioning doesn't make sense either.
212 params.hinting = FontRenderParams::HINTING_FULL; 212 params.hinting = FontRenderParams::HINTING_FULL;
213 params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE; 213 params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
214 params.subpixel_positioning = false; 214 params.subpixel_positioning = false;
215 } else { 215 } else {
216 // Fontconfig doesn't support configuring subpixel positioning; check a 216 // Fontconfig doesn't support configuring subpixel positioning; check a
217 // flag. 217 // flag.
218 params.subpixel_positioning = 218 params.subpixel_positioning =
219 query.for_web_contents ? 219 query.for_web_contents ?
220 CommandLine::ForCurrentProcess()->HasSwitch( 220 base::CommandLine::ForCurrentProcess()->HasSwitch(
221 switches::kEnableWebkitTextSubpixelPositioning) : 221 switches::kEnableWebkitTextSubpixelPositioning) :
222 IsBrowserTextSubpixelPositioningEnabled(); 222 IsBrowserTextSubpixelPositioningEnabled();
223 223
224 // To enable subpixel positioning, we need to disable hinting. 224 // To enable subpixel positioning, we need to disable hinting.
225 if (params.subpixel_positioning) 225 if (params.subpixel_positioning)
226 params.hinting = FontRenderParams::HINTING_NONE; 226 params.hinting = FontRenderParams::HINTING_NONE;
227 } 227 }
228 228
229 // Use the first family from the list if Fontconfig didn't suggest a family. 229 // Use the first family from the list if Fontconfig didn't suggest a family.
230 if (family_out && family_out->empty() && !query.families.empty()) 230 if (family_out && family_out->empty() && !query.families.empty())
(...skipping 16 matching lines...) Expand all
247 synchronized_cache->cache.Clear(); 247 synchronized_cache->cache.Clear();
248 } 248 }
249 249
250 #if defined(OS_CHROMEOS) 250 #if defined(OS_CHROMEOS)
251 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) { 251 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) {
252 device_scale_factor_for_internal_display = device_scale_factor; 252 device_scale_factor_for_internal_display = device_scale_factor;
253 } 253 }
254 #endif 254 #endif
255 255
256 } // namespace gfx 256 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/display.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698