Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef UI_GFX_PLATFORM_FONT_PANGO_H_ | 5 #ifndef UI_GFX_PLATFORM_FONT_PANGO_H_ |
| 6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ | 6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 // The average width of a character, initialized and cached if needed. | 87 // The average width of a character, initialized and cached if needed. |
| 88 double GetAverageWidth() const; | 88 double GetAverageWidth() const; |
| 89 | 89 |
| 90 skia::RefPtr<SkTypeface> typeface_; | 90 skia::RefPtr<SkTypeface> typeface_; |
| 91 | 91 |
| 92 // Additional information about the face. | 92 // Additional information about the face. |
| 93 // Skia actually expects a family name and not a font name. | 93 // Skia actually expects a family name and not a font name. |
| 94 std::string font_family_; | 94 std::string font_family_; |
| 95 int font_size_pixels_; | 95 int font_size_pixels_; |
| 96 int style_; | 96 int style_; |
| 97 #if defined(OS_CHROMEOS) | |
| 98 // mutable to be updated in GetFontRenderParams(). | |
| 99 mutable float device_scale_factor_; | |
|
Daniel Erat
2014/12/12 15:54:58
instead of making these mutable, would you mind ju
Jun Mukai
2014/12/12 19:40:12
Done.
| |
| 100 #endif | |
| 97 | 101 |
| 98 // Information describing how the font should be rendered. | 102 // Information describing how the font should be rendered. This parameter is |
| 99 FontRenderParams font_render_params_; | 103 // mutable to update in GetFontRenderParams(). |
| 104 mutable FontRenderParams font_render_params_; | |
| 100 | 105 |
| 101 // Cached metrics, generated at construction. | 106 // Cached metrics, generated at construction. |
| 102 int ascent_pixels_; | 107 int ascent_pixels_; |
| 103 int height_pixels_; | 108 int height_pixels_; |
| 104 int cap_height_pixels_; | 109 int cap_height_pixels_; |
| 105 | 110 |
| 106 // The pango metrics are much more expensive so we wait until we need them | 111 // The pango metrics are much more expensive so we wait until we need them |
| 107 // to compute them. | 112 // to compute them. |
| 108 bool pango_metrics_inited_; | 113 bool pango_metrics_inited_; |
| 109 double average_width_pixels_; | 114 double average_width_pixels_; |
| 110 | 115 |
| 111 // The default font, used for the default constructor. | 116 // The default font, used for the default constructor. |
| 112 static Font* default_font_; | 117 static Font* default_font_; |
| 113 | 118 |
| 114 #if defined(OS_CHROMEOS) | 119 #if defined(OS_CHROMEOS) |
| 115 // A Pango font description. | 120 // A Pango font description. |
| 116 static std::string* default_font_description_; | 121 static std::string* default_font_description_; |
| 117 #endif | 122 #endif |
| 118 | 123 |
| 119 DISALLOW_COPY_AND_ASSIGN(PlatformFontPango); | 124 DISALLOW_COPY_AND_ASSIGN(PlatformFontPango); |
| 120 }; | 125 }; |
| 121 | 126 |
| 122 } // namespace gfx | 127 } // namespace gfx |
| 123 | 128 |
| 124 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ | 129 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ |
| OLD | NEW |