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

Side by Side Diff: ui/gfx/font.cc

Issue 14348033: NOT FOR SUBMIT - Windows Views HiDPI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revert spurious changes, plus some corrections. Created 7 years, 6 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 | « ui/gfx/font.h ('k') | ui/gfx/rect_conversions.h » ('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 "ui/gfx/font.h" 5 #include "ui/gfx/font.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/gfx/platform_font.h" 8 #include "ui/gfx/platform_font.h"
9 9
10 namespace gfx { 10 namespace gfx {
(...skipping 24 matching lines...) Expand all
35 font_size)) { 35 font_size)) {
36 } 36 }
37 37
38 Font::~Font() { 38 Font::~Font() {
39 } 39 }
40 40
41 Font Font::DeriveFont(int size_delta) const { 41 Font Font::DeriveFont(int size_delta) const {
42 return DeriveFont(size_delta, GetStyle()); 42 return DeriveFont(size_delta, GetStyle());
43 } 43 }
44 44
45 Font Font::DeriveFontScaled(float size_scale) const {
46 return DeriveFont(static_cast<int>((size_scale-1.0)*GetFontSize()));
47 }
48
45 Font Font::DeriveFont(int size_delta, int style) const { 49 Font Font::DeriveFont(int size_delta, int style) const {
46 return platform_font_->DeriveFont(size_delta, style); 50 return platform_font_->DeriveFont(size_delta, style);
47 } 51 }
48 52
49 int Font::GetHeight() const { 53 int Font::GetHeight() const {
50 return platform_font_->GetHeight(); 54 return platform_font_->GetHeight();
51 } 55 }
52 56
53 int Font::GetBaseline() const { 57 int Font::GetBaseline() const {
54 return platform_font_->GetBaseline(); 58 return platform_font_->GetBaseline();
(...skipping 21 matching lines...) Expand all
76 80
77 int Font::GetFontSize() const { 81 int Font::GetFontSize() const {
78 return platform_font_->GetFontSize(); 82 return platform_font_->GetFontSize();
79 } 83 }
80 84
81 NativeFont Font::GetNativeFont() const { 85 NativeFont Font::GetNativeFont() const {
82 return platform_font_->GetNativeFont(); 86 return platform_font_->GetNativeFont();
83 } 87 }
84 88
85 } // namespace gfx 89 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font.h ('k') | ui/gfx/rect_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698