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

Side by Side Diff: content/renderer/render_view_linux.cc

Issue 10544103: Chromium change of sharing some WebKit API between Android/Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For landing Created 8 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | ui/gfx/font_render_params_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include "content/public/common/renderer_preferences.h" 7 #include "content/public/common/renderer_preferences.h"
8 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontInfo.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontRenderin g.h" 8 #include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontRenderin g.h"
10 9
11 using WebKit::WebFontInfo;
12 using WebKit::WebFontRendering; 10 using WebKit::WebFontRendering;
13 11
14 static SkPaint::Hinting RendererPreferencesToSkiaHinting( 12 static SkPaint::Hinting RendererPreferencesToSkiaHinting(
15 const content::RendererPreferences& prefs) { 13 const content::RendererPreferences& prefs) {
16 if (!prefs.should_antialias_text) { 14 if (!prefs.should_antialias_text) {
17 // When anti-aliasing is off, GTK maps all non-zero hinting settings to 15 // When anti-aliasing is off, GTK maps all non-zero hinting settings to
18 // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight' 16 // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight'
19 // hinting selected will see readable text in everything expect Chromium. 17 // hinting selected will see readable text in everything expect Chromium.
20 switch (prefs.hinting) { 18 switch (prefs.hinting) {
21 case content::RENDERER_PREFERENCES_HINTING_NONE: 19 case content::RENDERER_PREFERENCES_HINTING_NONE:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 prefs.subpixel_rendering != 93 prefs.subpixel_rendering !=
96 content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE) { 94 content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_NONE) {
97 return true; 95 return true;
98 } 96 }
99 return false; 97 return false;
100 } 98 }
101 99
102 void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() { 100 void RenderViewImpl::UpdateFontRenderingFromRendererPrefs() {
103 const content::RendererPreferences& prefs = renderer_preferences_; 101 const content::RendererPreferences& prefs = renderer_preferences_;
104 WebFontRendering::setHinting(RendererPreferencesToSkiaHinting(prefs)); 102 WebFontRendering::setHinting(RendererPreferencesToSkiaHinting(prefs));
103 WebFontRendering::setAutoHint(prefs.use_autohinter);
104 WebFontRendering::setUseBitmaps(prefs.use_bitmaps);
105 WebFontRendering::setLCDOrder( 105 WebFontRendering::setLCDOrder(
106 RendererPreferencesToSkiaLCDOrder(prefs.subpixel_rendering)); 106 RendererPreferencesToSkiaLCDOrder(prefs.subpixel_rendering));
107 WebFontRendering::setLCDOrientation( 107 WebFontRendering::setLCDOrientation(
108 RendererPreferencesToSkiaLCDOrientation(prefs.subpixel_rendering)); 108 RendererPreferencesToSkiaLCDOrientation(prefs.subpixel_rendering));
109 WebFontRendering::setAntiAlias(RendererPreferencesToAntiAliasFlag(prefs)); 109 WebFontRendering::setAntiAlias(RendererPreferencesToAntiAliasFlag(prefs));
110 WebFontRendering::setSubpixelRendering( 110 WebFontRendering::setSubpixelRendering(
111 RendererPreferencesToSubpixelRenderingFlag(prefs)); 111 RendererPreferencesToSubpixelRenderingFlag(prefs));
112 WebFontRendering::setSubpixelPositioning(prefs.use_subpixel_positioning); 112 WebFontRendering::setSubpixelPositioning(prefs.use_subpixel_positioning);
113 WebFontInfo::setSubpixelPositioning(prefs.use_subpixel_positioning);
114 } 113 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | ui/gfx/font_render_params_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698