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

Unified 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: GN 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/font.cc ('k') | ui/gfx/font_render_params.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_render_params.h
diff --git a/ui/gfx/font_render_params.h b/ui/gfx/font_render_params.h
index 4ec8d3502f15a2981f179b9fb02547a942743e3a..bfb226da26730e1ef6b702b1bec595f2be222908 100644
--- a/ui/gfx/font_render_params.h
+++ b/ui/gfx/font_render_params.h
@@ -84,12 +84,40 @@ struct GFX_EXPORT FontRenderParamsQuery {
int style;
};
+// This class is used to modify the FontRenderParams based on the current
+// status of the system.
+class GFX_EXPORT FontRenderParamsRewriter {
Daniel Erat 2014/12/09 16:24:35 i don't think i like this being a general interfac
Jun Mukai 2014/12/12 00:04:49 Removed this class.
+ public:
+ // Gets/sets/removes the singleton instance. These are safe if instance is not
+ // set yet.
+ static FontRenderParamsRewriter* GetInstance();
+ static void SetInstance(FontRenderParamsRewriter* instance);
+ static void Shutdown();
+
+ virtual ~FontRenderParamsRewriter();
+
+ // Rewrite the FontRenderParams based on the current system configuration.
+ virtual void RewriteParams(FontRenderParams* params) = 0;
+};
+
// Returns the appropriate parameters for rendering the font described by
// |query|. If |family_out| is non-NULL, it will be updated to contain the
// recommended font family from |query.families|.
-GFX_EXPORT FontRenderParams GetFontRenderParams(
- const FontRenderParamsQuery& query,
- std::string* family_out);
+// The return value should not be cached, because the result is already
+// rewritten by the current FontRenderParamsRewriter instance. To cache the
+// parameters, consider using GetSystemFontRenderParams() below and rewrite
+// the result by yourself.
+GFX_EXPORT FontRenderParams
+GetCurrentFontRenderParams(const FontRenderParamsQuery& query,
+ std::string* family_out);
+
+// Returns the appropriate parameters for rendering the font described by
+// |query|. This is similar to GetCurrentFontRenderParams(), but the return
+// value is not yet rewritten by FontRenderParamsRewirter, hence it can be
+// cached.
+GFX_EXPORT FontRenderParams
+GetSystemFontRenderParams(const FontRenderParamsQuery& query,
+ std::string* family_out);
// Clears GetFontRenderParams()'s cache. Intended to be called by tests that are
// changing Fontconfig's configuration.
« no previous file with comments | « ui/gfx/font.cc ('k') | ui/gfx/font_render_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698