OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_GFX_FONT_RENDER_PARAMS_H_ | 5 #ifndef UI_GFX_FONT_RENDER_PARAMS_H_ |
6 #define UI_GFX_FONT_RENDER_PARAMS_H_ | 6 #define UI_GFX_FONT_RENDER_PARAMS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "device/vr/features.h" |
12 #include "third_party/skia/include/core/SkFontLCDConfig.h" | 13 #include "third_party/skia/include/core/SkFontLCDConfig.h" |
13 #include "ui/gfx/font.h" | 14 #include "ui/gfx/font.h" |
14 #include "ui/gfx/gfx_export.h" | 15 #include "ui/gfx/gfx_export.h" |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 | 18 |
18 // A collection of parameters describing how text should be rendered on Linux. | 19 // A collection of parameters describing how text should be rendered on Linux. |
19 struct GFX_EXPORT FontRenderParams { | 20 struct GFX_EXPORT FontRenderParams { |
20 FontRenderParams(); | 21 FontRenderParams(); |
21 FontRenderParams(const FontRenderParams& other); | 22 FontRenderParams(const FontRenderParams& other); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 GFX_EXPORT FontRenderParams GetFontRenderParams( | 106 GFX_EXPORT FontRenderParams GetFontRenderParams( |
106 const FontRenderParamsQuery& query, | 107 const FontRenderParamsQuery& query, |
107 std::string* family_out); | 108 std::string* family_out); |
108 | 109 |
109 #if defined(OS_LINUX) | 110 #if defined(OS_LINUX) |
110 // Clears GetFontRenderParams()'s cache. Intended to be called by tests that are | 111 // Clears GetFontRenderParams()'s cache. Intended to be called by tests that are |
111 // changing Fontconfig's configuration. | 112 // changing Fontconfig's configuration. |
112 GFX_EXPORT void ClearFontRenderParamsCacheForTest(); | 113 GFX_EXPORT void ClearFontRenderParamsCacheForTest(); |
113 #endif | 114 #endif |
114 | 115 |
115 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | 116 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || \ |
| 117 (defined(OS_ANDROID) && BUILDFLAG(ENABLE_VR)) |
116 // Gets the device scale factor to query the FontRenderParams. | 118 // Gets the device scale factor to query the FontRenderParams. |
117 GFX_EXPORT float GetFontRenderParamsDeviceScaleFactor(); | 119 GFX_EXPORT float GetFontRenderParamsDeviceScaleFactor(); |
118 | 120 |
119 // Sets the device scale factor for FontRenderParams to decide | 121 // Sets the device scale factor for FontRenderParams to decide |
120 // if it should enable subpixel positioning. | 122 // if it should enable subpixel positioning. |
121 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( | 123 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( |
122 float device_scale_factor); | 124 float device_scale_factor); |
123 #endif | 125 #endif |
124 | 126 |
125 } // namespace gfx | 127 } // namespace gfx |
126 | 128 |
127 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ | 129 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ |
OLD | NEW |