Refactor HpackDecoder's public API to ease integration into SpdyFramer.
[chromium-blink-merge.git] / ui / gfx / font_render_params_android.cc
blob3dfd6688d29544328a0a921da9e57f1cfd8b6eb3
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
3 // found in the LICENSE file.
5 #include "ui/gfx/font_render_params_linux.h"
7 namespace gfx {
9 namespace {
11 // Initializes |params| with the system's default settings.
12 void LoadDefaults(FontRenderParams* params) {
13 params->antialiasing = true;
14 params->autohinter = true;
15 params->use_bitmaps = true;
16 params->subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_NONE;
18 // Use subpixel text positioning to keep consistent character spacing when
19 // the page is scaled by a fractional factor.
20 params->subpixel_positioning = true;
21 // Slight hinting renders much better than normal hinting on Android.
22 params->hinting = FontRenderParams::HINTING_SLIGHT;
25 } // namespace
27 const FontRenderParams& GetDefaultFontRenderParams() {
28 static bool loaded_defaults = false;
29 static FontRenderParams default_params;
30 if (!loaded_defaults)
31 LoadDefaults(&default_params);
32 loaded_defaults = true;
33 return default_params;
36 const FontRenderParams& GetDefaultWebKitFontRenderParams() {
37 return GetDefaultFontRenderParams();
40 } // namespace gfx