| Index: android_webview/native/aw_settings.cc
|
| diff --git a/android_webview/native/aw_settings.cc b/android_webview/native/aw_settings.cc
|
| index d28afaa28379a904d39bda6463b1df63ac993ea9..55b449b82622b75d296a754963f2bc83b99d5732 100644
|
| --- a/android_webview/native/aw_settings.cc
|
| +++ b/android_webview/native/aw_settings.cc
|
| @@ -29,6 +29,46 @@
|
|
|
| namespace {
|
|
|
| +// TODO(boliu): Deduplicate with chrome/ code.
|
| +content::RendererPreferencesHintingEnum GetRendererPreferencesHintingEnum(
|
| + gfx::FontRenderParams::Hinting hinting) {
|
| + switch (hinting) {
|
| + case gfx::FontRenderParams::HINTING_NONE:
|
| + return content::RENDERER_PREFERENCES_HINTING_NONE;
|
| + case gfx::FontRenderParams::HINTING_SLIGHT:
|
| + return content::RENDERER_PREFERENCES_HINTING_SLIGHT;
|
| + case gfx::FontRenderParams::HINTING_MEDIUM:
|
| + return content::RENDERER_PREFERENCES_HINTING_MEDIUM;
|
| + case gfx::FontRenderParams::HINTING_FULL:
|
| + return content::RENDERER_PREFERENCES_HINTING_FULL;
|
| + default:
|
| + NOTREACHED() << "Unhandled hinting style " << hinting;
|
| + return content::RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT;
|
| + }
|
| +}
|
| +
|
| +// TODO(boliu): Deduplicate with chrome/ code.
|
| +content::RendererPreferencesSubpixelRenderingEnum
|
| +GetRendererPreferencesSubpixelRenderingEnum(
|
| + gfx::FontRenderParams::SubpixelRendering subpixel_rendering) {
|
| + switch (subpixel_rendering) {
|
| + case gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE:
|
| + return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE;
|
| + case gfx::FontRenderParams::SUBPIXEL_RENDERING_RGB:
|
| + return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB;
|
| + case gfx::FontRenderParams::SUBPIXEL_RENDERING_BGR:
|
| + return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR;
|
| + case gfx::FontRenderParams::SUBPIXEL_RENDERING_VRGB:
|
| + return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB;
|
| + case gfx::FontRenderParams::SUBPIXEL_RENDERING_VBGR:
|
| + return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR;
|
| + default:
|
| + NOTREACHED() << "Unhandled subpixel rendering style "
|
| + << subpixel_rendering;
|
| + return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT;
|
| + }
|
| +}
|
| +
|
| void PopulateFixedRendererPreferences(RendererPreferences* prefs) {
|
| prefs->tap_multiple_targets_strategy =
|
| content::TAP_MULTIPLE_TARGETS_STRATEGY_NONE;
|
| @@ -37,10 +77,11 @@
|
| const gfx::FontRenderParams& params = gfx::GetDefaultWebKitFontRenderParams();
|
| prefs->should_antialias_text = params.antialiasing;
|
| prefs->use_subpixel_positioning = params.subpixel_positioning;
|
| - prefs->hinting = params.hinting;
|
| + prefs->hinting = GetRendererPreferencesHintingEnum(params.hinting);
|
| prefs->use_autohinter = params.autohinter;
|
| prefs->use_bitmaps = params.use_bitmaps;
|
| - prefs->subpixel_rendering = params.subpixel_rendering;
|
| + prefs->subpixel_rendering =
|
| + GetRendererPreferencesSubpixelRenderingEnum(params.subpixel_rendering);
|
| }
|
|
|
| void PopulateFixedWebPreferences(WebPreferences* web_prefs) {
|
|
|