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 "third_party/skia/include/core/SkFontHost.h" |
11 #include "ui/gfx/gfx_export.h" | 12 #include "ui/gfx/gfx_export.h" |
12 | 13 |
13 namespace gfx { | 14 namespace gfx { |
14 | 15 |
15 // A collection of parameters describing how text should be rendered on Linux. | 16 // A collection of parameters describing how text should be rendered on Linux. |
16 struct GFX_EXPORT FontRenderParams { | 17 struct GFX_EXPORT FontRenderParams { |
17 FontRenderParams(); | 18 FontRenderParams(); |
18 ~FontRenderParams(); | 19 ~FontRenderParams(); |
19 | 20 |
20 // Level of hinting to be applied. | 21 // Level of hinting to be applied. |
(...skipping 29 matching lines...) Expand all Loading... |
50 | 51 |
51 // Should embedded bitmaps in fonts should be used? | 52 // Should embedded bitmaps in fonts should be used? |
52 bool use_bitmaps; | 53 bool use_bitmaps; |
53 | 54 |
54 // Hinting level. | 55 // Hinting level. |
55 Hinting hinting; | 56 Hinting hinting; |
56 | 57 |
57 // Whether subpixel rendering should be used or not, and if so, the display's | 58 // Whether subpixel rendering should be used or not, and if so, the display's |
58 // subpixel order. | 59 // subpixel order. |
59 SubpixelRendering subpixel_rendering; | 60 SubpixelRendering subpixel_rendering; |
| 61 |
| 62 static SkFontHost::LCDOrder SubpixelRenderingToSkiaLCDOrder( |
| 63 SubpixelRendering subpixel_rendering); |
| 64 static SkFontHost::LCDOrientation SubpixelRenderingToSkiaLCDOrientation( |
| 65 SubpixelRendering subpixel_rendering); |
60 }; | 66 }; |
61 | 67 |
62 // A query used to determine the appropriate FontRenderParams. | 68 // A query used to determine the appropriate FontRenderParams. |
63 struct GFX_EXPORT FontRenderParamsQuery { | 69 struct GFX_EXPORT FontRenderParamsQuery { |
64 explicit FontRenderParamsQuery(bool for_web_contents); | 70 explicit FontRenderParamsQuery(bool for_web_contents); |
65 ~FontRenderParamsQuery(); | 71 ~FontRenderParamsQuery(); |
66 | 72 |
67 bool is_empty() const { | 73 bool is_empty() const { |
68 return families.empty() && pixel_size <= 0 && point_size <= 0 && style < 0; | 74 return families.empty() && pixel_size <= 0 && point_size <= 0 && style < 0; |
69 } | 75 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 113 |
108 // Sets the device scale factor for FontRenderParams to decide | 114 // Sets the device scale factor for FontRenderParams to decide |
109 // if it should enable subpixel positioning. | 115 // if it should enable subpixel positioning. |
110 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( | 116 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( |
111 float device_scale_factor); | 117 float device_scale_factor); |
112 #endif | 118 #endif |
113 | 119 |
114 } // namespace gfx | 120 } // namespace gfx |
115 | 121 |
116 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ | 122 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ |
OLD | NEW |