Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: ui/gfx/font_render_params.h

Issue 789583002: Updates subpixel positioning and hinting when DSF is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // Requested font families, or empty if unset. 76 // Requested font families, or empty if unset.
77 std::vector<std::string> families; 77 std::vector<std::string> families;
78 78
79 // Font size in pixels or points, or 0 if unset. 79 // Font size in pixels or points, or 0 if unset.
80 int pixel_size; 80 int pixel_size;
81 int point_size; 81 int point_size;
82 82
83 // gfx::Font::FontStyle bit field, or -1 if unset. 83 // gfx::Font::FontStyle bit field, or -1 if unset.
84 int style; 84 int style;
85
86 // The device scale factor of the display, or 0 if unset.
87 float device_scale_factor;
85 }; 88 };
86 89
87 // Returns the appropriate parameters for rendering the font described by 90 // Returns the appropriate parameters for rendering the font described by
88 // |query|. If |family_out| is non-NULL, it will be updated to contain the 91 // |query|. If |family_out| is non-NULL, it will be updated to contain the
89 // recommended font family from |query.families|. 92 // recommended font family from |query.families|.
90 GFX_EXPORT FontRenderParams GetFontRenderParams( 93 GFX_EXPORT FontRenderParams GetFontRenderParams(
91 const FontRenderParamsQuery& query, 94 const FontRenderParamsQuery& query,
92 std::string* family_out); 95 std::string* family_out);
93 96
94 // Clears GetFontRenderParams()'s cache. Intended to be called by tests that are 97 // Clears GetFontRenderParams()'s cache. Intended to be called by tests that are
95 // changing Fontconfig's configuration. 98 // changing Fontconfig's configuration.
96 // TODO(derat): This is only defined for Linux, but OS_LINUX doesn't seem to be 99 // TODO(derat): This is only defined for Linux, but OS_LINUX doesn't seem to be
97 // set when font_render_params_linux_unittest.cc includes this header. Figure 100 // set when font_render_params_linux_unittest.cc includes this header. Figure
98 // out what's going on here. 101 // out what's going on here.
99 GFX_EXPORT void ClearFontRenderParamsCacheForTest(); 102 GFX_EXPORT void ClearFontRenderParamsCacheForTest();
100 103
101 #if defined(OS_CHROMEOS) 104 #if defined(OS_CHROMEOS)
105 // Gets the device scale factor to query the FontRenderParams.
106 float GetFontRenderParamsDeviceScaleFactor();
107
102 // Sets the device scale factor for FontRenderParams to decide 108 // Sets the device scale factor for FontRenderParams to decide
103 // if it should enable subpixel positioning. 109 // if it should enable subpixel positioning.
104 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor( 110 GFX_EXPORT void SetFontRenderParamsDeviceScaleFactor(
105 float device_scale_factor); 111 float device_scale_factor);
106 #endif 112 #endif
107 113
108 } // namespace gfx 114 } // namespace gfx
109 115
110 #endif // UI_GFX_FONT_RENDER_PARAMS_H_ 116 #endif // UI_GFX_FONT_RENDER_PARAMS_H_
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ui/gfx/font_render_params.cc » ('j') | ui/gfx/platform_font_pango.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698