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

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

Issue 549303004: Allow default font size changing on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove CHECKs Created 6 years, 2 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
« no previous file with comments | « content/public/common/renderer_preferences.cc ('k') | no next file » | 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/public/web/linux/WebFontRendering.h" 8 #include "third_party/WebKit/public/web/linux/WebFontRendering.h"
9 9
10 using blink::WebFontRendering; 10 using blink::WebFontRendering;
11 11
12 namespace content { 12 namespace content {
13 13
14 namespace { 14 namespace {
15 15
16 const int kMaxDefaultFontSize = 999;
17
16 SkPaint::Hinting RendererPreferencesToSkiaHinting( 18 SkPaint::Hinting RendererPreferencesToSkiaHinting(
17 const RendererPreferences& prefs) { 19 const RendererPreferences& prefs) {
18 if (!prefs.should_antialias_text) { 20 if (!prefs.should_antialias_text) {
19 // When anti-aliasing is off, GTK maps all non-zero hinting settings to 21 // When anti-aliasing is off, GTK maps all non-zero hinting settings to
20 // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight' 22 // 'Normal' hinting so we do the same. Otherwise, folks who have 'Slight'
21 // hinting selected will see readable text in everything expect Chromium. 23 // hinting selected will see readable text in everything expect Chromium.
22 switch (prefs.hinting) { 24 switch (prefs.hinting) {
23 case gfx::FontRenderParams::HINTING_NONE: 25 case gfx::FontRenderParams::HINTING_NONE:
24 return SkPaint::kNo_Hinting; 26 return SkPaint::kNo_Hinting;
25 case gfx::FontRenderParams::HINTING_SLIGHT: 27 case gfx::FontRenderParams::HINTING_SLIGHT:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 WebFontRendering::setAutoHint(prefs.use_autohinter); 85 WebFontRendering::setAutoHint(prefs.use_autohinter);
84 WebFontRendering::setUseBitmaps(prefs.use_bitmaps); 86 WebFontRendering::setUseBitmaps(prefs.use_bitmaps);
85 WebFontRendering::setLCDOrder(RendererPreferencesToSkiaLCDOrder(prefs)); 87 WebFontRendering::setLCDOrder(RendererPreferencesToSkiaLCDOrder(prefs));
86 WebFontRendering::setLCDOrientation( 88 WebFontRendering::setLCDOrientation(
87 RendererPreferencesToSkiaLCDOrientation(prefs)); 89 RendererPreferencesToSkiaLCDOrientation(prefs));
88 WebFontRendering::setAntiAlias(prefs.should_antialias_text); 90 WebFontRendering::setAntiAlias(prefs.should_antialias_text);
89 WebFontRendering::setSubpixelRendering( 91 WebFontRendering::setSubpixelRendering(
90 prefs.subpixel_rendering != 92 prefs.subpixel_rendering !=
91 gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE); 93 gfx::FontRenderParams::SUBPIXEL_RENDERING_NONE);
92 WebFontRendering::setSubpixelPositioning(prefs.use_subpixel_positioning); 94 WebFontRendering::setSubpixelPositioning(prefs.use_subpixel_positioning);
95 if (prefs.default_font_size > 0 &&
96 prefs.default_font_size <= kMaxDefaultFontSize)
jochen (gone - plz use gerrit) 2014/10/15 15:27:40 nit add { }
97 WebFontRendering::setDefaultFontSize(prefs.default_font_size);
93 } 98 }
94 99
95 } // namespace content 100 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/renderer_preferences.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698