| Index: content/renderer/render_view_linux.cc
|
| ===================================================================
|
| --- content/renderer/render_view_linux.cc (revision 108004)
|
| +++ content/renderer/render_view_linux.cc (working copy)
|
| @@ -4,24 +4,24 @@
|
|
|
| #include "content/renderer/render_view_impl.h"
|
|
|
| -#include "content/common/renderer_preferences.h"
|
| +#include "content/public/common/renderer_preferences.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontRendering.h"
|
|
|
| using WebKit::WebFontRendering;
|
|
|
| static SkPaint::Hinting RendererPreferencesToSkiaHinting(
|
| - const RendererPreferences& prefs) {
|
| + const content::RendererPreferences& prefs) {
|
| if (!prefs.should_antialias_text) {
|
| // When anti-aliasing is off, GTK maps all non-zero hinting settings to
|
| // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight'
|
| // hinting selected will see readable text in everything expect Chromium.
|
| switch (prefs.hinting) {
|
| - case RENDERER_PREFERENCES_HINTING_NONE:
|
| + case content::RENDERER_PREFERENCES_HINTING_NONE:
|
| return SkPaint::kNo_Hinting;
|
| - case RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT:
|
| - case RENDERER_PREFERENCES_HINTING_SLIGHT:
|
| - case RENDERER_PREFERENCES_HINTING_MEDIUM:
|
| - case RENDERER_PREFERENCES_HINTING_FULL:
|
| + case content::RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT:
|
| + case content::RENDERER_PREFERENCES_HINTING_SLIGHT:
|
| + case content::RENDERER_PREFERENCES_HINTING_MEDIUM:
|
| + case content::RENDERER_PREFERENCES_HINTING_FULL:
|
| return SkPaint::kNormal_Hinting;
|
| default:
|
| NOTREACHED();
|
| @@ -30,15 +30,15 @@
|
| }
|
|
|
| switch (prefs.hinting) {
|
| - case RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT:
|
| + case content::RENDERER_PREFERENCES_HINTING_SYSTEM_DEFAULT:
|
| return SkPaint::kNormal_Hinting;
|
| - case RENDERER_PREFERENCES_HINTING_NONE:
|
| + case content::RENDERER_PREFERENCES_HINTING_NONE:
|
| return SkPaint::kNo_Hinting;
|
| - case RENDERER_PREFERENCES_HINTING_SLIGHT:
|
| + case content::RENDERER_PREFERENCES_HINTING_SLIGHT:
|
| return SkPaint::kSlight_Hinting;
|
| - case RENDERER_PREFERENCES_HINTING_MEDIUM:
|
| + case content::RENDERER_PREFERENCES_HINTING_MEDIUM:
|
| return SkPaint::kNormal_Hinting;
|
| - case RENDERER_PREFERENCES_HINTING_FULL:
|
| + case content::RENDERER_PREFERENCES_HINTING_FULL:
|
| return SkPaint::kFull_Hinting;
|
| default:
|
| NOTREACHED();
|
| @@ -47,15 +47,15 @@
|
| }
|
|
|
| static SkFontHost::LCDOrder RendererPreferencesToSkiaLCDOrder(
|
| - RendererPreferencesSubpixelRenderingEnum subpixel) {
|
| + content::RendererPreferencesSubpixelRenderingEnum subpixel) {
|
| switch (subpixel) {
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB:
|
| return SkFontHost::kRGB_LCDOrder;
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR:
|
| return SkFontHost::kBGR_LCDOrder;
|
| default:
|
| NOTREACHED();
|
| @@ -65,15 +65,15 @@
|
|
|
| static SkFontHost::LCDOrientation
|
| RendererPreferencesToSkiaLCDOrientation(
|
| - RendererPreferencesSubpixelRenderingEnum subpixel) {
|
| + content::RendererPreferencesSubpixelRenderingEnum subpixel) {
|
| switch (subpixel) {
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_RGB:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_BGR:
|
| return SkFontHost::kHorizontal_LCDOrientation;
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB:
|
| - case RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VRGB:
|
| + case content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_VBGR:
|
| return SkFontHost::kVertical_LCDOrientation;
|
| default:
|
| NOTREACHED();
|
| @@ -82,16 +82,16 @@
|
| }
|
|
|
| static bool RendererPreferencesToAntiAliasFlag(
|
| - const RendererPreferences& prefs) {
|
| + const content::RendererPreferences& prefs) {
|
| return prefs.should_antialias_text;
|
| }
|
|
|
| static bool RendererPreferencesToSubpixelGlyphsFlag(
|
| - const RendererPreferences& prefs) {
|
| + const content::RendererPreferences& prefs) {
|
| if (prefs.subpixel_rendering !=
|
| - RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT &&
|
| + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT &&
|
| prefs.subpixel_rendering !=
|
| - RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE) {
|
| + content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE) {
|
| return true;
|
| }
|
|
|
| @@ -99,14 +99,13 @@
|
| }
|
|
|
| void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() {
|
| - const RendererPreferences& prefs = renderer_preferences_;
|
| - WebFontRendering::setHinting(
|
| - RendererPreferencesToSkiaHinting(prefs));
|
| - WebFontRendering::setLCDOrder(
|
| - RendererPreferencesToSkiaLCDOrder(prefs.subpixel_rendering));
|
| - WebFontRendering::setLCDOrientation(
|
| - RendererPreferencesToSkiaLCDOrientation(prefs.subpixel_rendering));
|
| + const content::RendererPreferences& prefs = renderer_preferences_;
|
| + WebFontRendering::setHinting(RendererPreferencesToSkiaHinting(prefs));
|
| + WebFontRendering::setLCDOrder(RendererPreferencesToSkiaLCDOrder(
|
| + prefs.subpixel_rendering));
|
| + WebFontRendering::setLCDOrientation(RendererPreferencesToSkiaLCDOrientation(
|
| + prefs.subpixel_rendering));
|
| WebFontRendering::setAntiAlias(RendererPreferencesToAntiAliasFlag(prefs));
|
| - WebFontRendering::setSubpixelGlyphs(
|
| - RendererPreferencesToSubpixelGlyphsFlag(prefs));
|
| + WebFontRendering::setSubpixelGlyphs(RendererPreferencesToSubpixelGlyphsFlag(
|
| + prefs));
|
| }
|
|
|