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

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

Issue 708133002: win: build fixes (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: . Created 6 years, 1 month 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 | « third_party/zlib/BUILD.gn ('k') | ui/views/BUILD.gn » ('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_win.h" 5 #include "ui/gfx/platform_font_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <math.h> 8 #include <math.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 CLIP_DEFAULT_PRECIS, 221 CLIP_DEFAULT_PRECIS,
222 DEFAULT_QUALITY, 222 DEFAULT_QUALITY,
223 DEFAULT_PITCH | FF_DONTCARE, 223 DEFAULT_PITCH | FF_DONTCARE,
224 base::UTF8ToUTF16(font_name).c_str()); 224 base::UTF8ToUTF16(font_name).c_str());
225 font_ref_ = CreateHFontRef(hf); 225 font_ref_ = CreateHFontRef(hf);
226 } 226 }
227 227
228 // static 228 // static
229 PlatformFontWin::HFontRef* PlatformFontWin::GetBaseFontRef() { 229 PlatformFontWin::HFontRef* PlatformFontWin::GetBaseFontRef() {
230 if (base_font_ref_ == NULL) { 230 if (base_font_ref_ == NULL) {
231 NONCLIENTMETRICS metrics; 231 NONCLIENTMETRICS_XP metrics;
232 base::win::GetNonClientMetrics(&metrics); 232 base::win::GetNonClientMetrics(&metrics);
233 233
234 if (adjust_font_callback) 234 if (adjust_font_callback)
235 adjust_font_callback(&metrics.lfMessageFont); 235 adjust_font_callback(&metrics.lfMessageFont);
236 metrics.lfMessageFont.lfHeight = 236 metrics.lfMessageFont.lfHeight =
237 AdjustFontSize(metrics.lfMessageFont.lfHeight, 0); 237 AdjustFontSize(metrics.lfMessageFont.lfHeight, 0);
238 HFONT font = CreateFontIndirect(&metrics.lfMessageFont); 238 HFONT font = CreateFontIndirect(&metrics.lfMessageFont);
239 DLOG_ASSERT(font); 239 DLOG_ASSERT(font);
240 base_font_ref_ = PlatformFontWin::CreateHFontRef(font); 240 base_font_ref_ = PlatformFontWin::CreateHFontRef(font);
241 // base_font_ref_ is global, up the ref count so it's never deleted. 241 // base_font_ref_ is global, up the ref count so it's never deleted.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 return new PlatformFontWin(native_font); 377 return new PlatformFontWin(native_font);
378 } 378 }
379 379
380 // static 380 // static
381 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, 381 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
382 int font_size) { 382 int font_size) {
383 return new PlatformFontWin(font_name, font_size); 383 return new PlatformFontWin(font_name, font_size);
384 } 384 }
385 385
386 } // namespace gfx 386 } // namespace gfx
OLDNEW
« no previous file with comments | « third_party/zlib/BUILD.gn ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698