Chromium Code Reviews| 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 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 SubpixelRendering subpixel_rendering; | 60 SubpixelRendering subpixel_rendering; |
| 61 | 61 |
| 62 static SkFontHost::LCDOrder SubpixelRenderingToSkiaLCDOrder( | 62 static SkFontHost::LCDOrder SubpixelRenderingToSkiaLCDOrder( |
| 63 SubpixelRendering subpixel_rendering); | 63 SubpixelRendering subpixel_rendering); |
| 64 static SkFontHost::LCDOrientation SubpixelRenderingToSkiaLCDOrientation( | 64 static SkFontHost::LCDOrientation SubpixelRenderingToSkiaLCDOrientation( |
| 65 SubpixelRendering subpixel_rendering); | 65 SubpixelRendering subpixel_rendering); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // A query used to determine the appropriate FontRenderParams. | 68 // A query used to determine the appropriate FontRenderParams. |
| 69 struct GFX_EXPORT FontRenderParamsQuery { | 69 struct GFX_EXPORT FontRenderParamsQuery { |
| 70 explicit FontRenderParamsQuery(bool for_web_contents); | 70 explicit FontRenderParamsQuery(); |
|
Daniel Erat
2015/04/06 12:23:29
nit: remove 'explicit'
stapelberg
2015/04/06 13:14:48
Done.
| |
| 71 ~FontRenderParamsQuery(); | 71 ~FontRenderParamsQuery(); |
| 72 | 72 |
| 73 bool is_empty() const { | 73 bool is_empty() const { |
| 74 return families.empty() && pixel_size <= 0 && point_size <= 0 && style < 0; | 74 return families.empty() && pixel_size <= 0 && point_size <= 0 && style < 0; |
| 75 } | 75 } |
| 76 | 76 |
| 77 // True if rendering text for the web. | |
| 78 // TODO(derat): Remove this once FontRenderParams::subpixel_positioning is | |
| 79 // gone: http://crbug.com/396659 | |
| 80 bool for_web_contents; | |
| 81 | |
| 82 // Requested font families, or empty if unset. | 77 // Requested font families, or empty if unset. |
| 83 std::vector<std::string> families; | 78 std::vector<std::string> families; |
| 84 | 79 |
| 85 // Font size in pixels or points, or 0 if unset. | 80 // Font size in pixels or points, or 0 if unset. |
| 86 int pixel_size; | 81 int pixel_size; |
| 87 int point_size; | 82 int point_size; |
| 88 | 83 |
| 89 // gfx::Font::FontStyle bit field, or -1 if unset. | 84 // gfx::Font::FontStyle bit field, or -1 if unset. |
| 90 int style; | 85 int style; |
| 91 | 86 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 113 | 108 |
| 114 // Sets the device scale factor for FontRenderParams to decide | 109 // Sets the device scale factor for FontRenderParams to decide |
| 115 // if it should enable subpixel positioning. | 110 // if it should enable subpixel positioning. |
| 116 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( | 111 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( |
| 117 float device_scale_factor); | 112 float device_scale_factor); |
| 118 #endif | 113 #endif |
| 119 | 114 |
| 120 } // namespace gfx | 115 } // namespace gfx |
| 121 | 116 |
| 122 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ | 117 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ |
| OLD | NEW |