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

Side by Side Diff: ui/gfx/platform_font_mac.mm

Issue 1063603003: Remove obsolete for_web_contents parameter in FontRenderParamsQuery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete for_web_contents parameter in FontRenderParamsQuery. Created 5 years, 8 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/platform_font_linux.cc ('k') | ui/gfx/platform_font_win.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 "ui/gfx/platform_font_mac.h" 5 #include "ui/gfx/platform_font_mac.h"
6 6
7 #include <Cocoa/Cocoa.h> 7 #include <Cocoa/Cocoa.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 164
165 base::scoped_nsobject<NSLayoutManager> layout_manager( 165 base::scoped_nsobject<NSLayoutManager> layout_manager(
166 [[NSLayoutManager alloc] init]); 166 [[NSLayoutManager alloc] init]);
167 height_ = SkScalarCeilToInt([layout_manager defaultLineHeightForFont:font]); 167 height_ = SkScalarCeilToInt([layout_manager defaultLineHeightForFont:font]);
168 ascent_ = SkScalarCeilToInt([font ascender]); 168 ascent_ = SkScalarCeilToInt([font ascender]);
169 cap_height_ = SkScalarCeilToInt([font capHeight]); 169 cap_height_ = SkScalarCeilToInt([font capHeight]);
170 average_width_ = 170 average_width_ =
171 NSWidth([font boundingRectForGlyph:[font glyphWithName:@"x"]]); 171 NSWidth([font boundingRectForGlyph:[font glyphWithName:@"x"]]);
172 172
173 FontRenderParamsQuery query(false); 173 FontRenderParamsQuery query;
174 query.families.push_back(font_name_); 174 query.families.push_back(font_name_);
175 query.pixel_size = font_size_; 175 query.pixel_size = font_size_;
176 query.style = font_style_; 176 query.style = font_style_;
177 render_params_ = gfx::GetFontRenderParams(query, NULL); 177 render_params_ = gfx::GetFontRenderParams(query, NULL);
178 } 178 }
179 179
180 //////////////////////////////////////////////////////////////////////////////// 180 ////////////////////////////////////////////////////////////////////////////////
181 // PlatformFont, public: 181 // PlatformFont, public:
182 182
183 // static 183 // static
184 PlatformFont* PlatformFont::CreateDefault() { 184 PlatformFont* PlatformFont::CreateDefault() {
185 return new PlatformFontMac; 185 return new PlatformFontMac;
186 } 186 }
187 187
188 // static 188 // static
189 PlatformFont* PlatformFont::CreateFromNativeFont(NativeFont native_font) { 189 PlatformFont* PlatformFont::CreateFromNativeFont(NativeFont native_font) {
190 return new PlatformFontMac(native_font); 190 return new PlatformFontMac(native_font);
191 } 191 }
192 192
193 // static 193 // static
194 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, 194 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
195 int font_size) { 195 int font_size) {
196 return new PlatformFontMac(font_name, font_size); 196 return new PlatformFontMac(font_name, font_size);
197 } 197 }
198 198
199 } // namespace gfx 199 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/platform_font_linux.cc ('k') | ui/gfx/platform_font_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698