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. |