summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 16:53:46 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-21 16:53:46 +0000
commit840b151b7ba47a37b10f45983d055924b1acef25 (patch)
tree346bce4b08e2605dc5b81e1c2f94e4deb3da0759 /chrome/common
parent8e95888b55b2a2668cd015367605842984fee25c (diff)
downloadchromium_src-840b151b7ba47a37b10f45983d055924b1acef25.zip
chromium_src-840b151b7ba47a37b10f45983d055924b1acef25.tar.gz
chromium_src-840b151b7ba47a37b10f45983d055924b1acef25.tar.bz2
Linux: pass users' font settings through to renderer.
The renderer doesn't give the settings to Skia yet -- that'll go in after agl's work on hinting and subpixel rendering in Skia. http://codereview.chromium.org/155787 (Patch by Dan Erat) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/render_messages.h22
-rw-r--r--chrome/common/renderer_preferences.h35
2 files changed, 55 insertions, 2 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index f769aaf..2b621456 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1487,9 +1487,29 @@ struct ParamTraits<RendererPreferences> {
typedef RendererPreferences param_type;
static void Write(Message* m, const param_type& p) {
WriteParam(m, p.can_accept_load_drops);
+ WriteParam(m, p.should_antialias_text);
+ WriteParam(m, static_cast<int>(p.hinting));
+ WriteParam(m, static_cast<int>(p.subpixel_rendering));
}
static bool Read(const Message* m, void** iter, param_type* p) {
- return ReadParam(m, iter, &p->can_accept_load_drops);
+ if (!ReadParam(m, iter, &p->can_accept_load_drops))
+ return false;
+ if (!ReadParam(m, iter, &p->should_antialias_text))
+ return false;
+
+ int hinting = 0;
+ if (!ReadParam(m, iter, &hinting))
+ return false;
+ p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting);
+
+ int subpixel_rendering = 0;
+ if (!ReadParam(m, iter, &subpixel_rendering))
+ return false;
+ p->subpixel_rendering =
+ static_cast<RendererPreferencesSubpixelRenderingEnum>(
+ subpixel_rendering);
+
+ return true;
}
static void Log(const param_type& p, std::wstring* l) {
l->append(L"<RendererPreferences>");
diff --git a/chrome/common/renderer_preferences.h b/chrome/common/renderer_preferences.h
index 2f808ac..95e8ddf 100644
--- a/chrome/common/renderer_preferences.h
+++ b/chrome/common/renderer_preferences.h
@@ -12,13 +12,46 @@
#ifndef CHROME_COMMON_RENDERER_PREFERENCES_H_
#define CHROME_COMMON_RENDERER_PREFERENCES_H_
+enum RendererPreferencesHintingEnum {
+ RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT = 0,
+ RENDERER_PREFERENCES_HINTING_NONE,
+ RENDERER_PREFERENCES_HINTING_SLIGHT,
+ RENDERER_PREFERENCES_HINTING_MEDIUM,
+ RENDERER_PREFERENCES_HINTING_FULL,
+};
+
+enum RendererPreferencesSubpixelRenderingEnum {
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT = 0,
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE,
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB,
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR,
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB,
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR,
+};
+
struct RendererPreferences {
// Whether the renderer's current browser context accept drops from the OS
// that result in navigations away from the current page.
bool can_accept_load_drops;
+ // Whether text should be antialiased.
+ // Currently only used by Linux.
+ bool should_antialias_text;
+
+ // The level of hinting to use when rendering text.
+ // Currently only used by Linux.
+ RendererPreferencesHintingEnum hinting;
+
+ // The type of subpixel rendering to use for text.
+ // Currently only used by Linux.
+ RendererPreferencesSubpixelRenderingEnum subpixel_rendering;
+
RendererPreferences()
- : can_accept_load_drops(true) {
+ : can_accept_load_drops(true),
+ should_antialias_text(true),
+ hinting(RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT),
+ subpixel_rendering(
+ RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT) {
}
};