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

Side by Side Diff: ui/gfx/win/direct_write.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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/render_text.cc ('k') | ui/gl/gl_gl_api_implementation.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/win/direct_write.h" 5 #include "ui/gfx/win/direct_write.h"
6 6
7 #include <dwrite.h> 7 #include <dwrite.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return group_name != "Disabled"; 57 return group_name != "Disabled";
58 } 58 }
59 59
60 void MaybeInitializeDirectWrite() { 60 void MaybeInitializeDirectWrite() {
61 static bool tried_dwrite_initialize = false; 61 static bool tried_dwrite_initialize = false;
62 if (tried_dwrite_initialize) 62 if (tried_dwrite_initialize)
63 return; 63 return;
64 tried_dwrite_initialize = true; 64 tried_dwrite_initialize = true;
65 65
66 if (!ShouldUseDirectWrite() || 66 if (!ShouldUseDirectWrite() ||
67 CommandLine::ForCurrentProcess()->HasSwitch( 67 base::CommandLine::ForCurrentProcess()->HasSwitch(
68 switches::kDisableDirectWriteForUI) || 68 switches::kDisableDirectWriteForUI) ||
69 CommandLine::ForCurrentProcess()->HasSwitch( 69 base::CommandLine::ForCurrentProcess()->HasSwitch(
70 switches::kDisableHarfBuzzRenderText)) { 70 switches::kDisableHarfBuzzRenderText)) {
71 return; 71 return;
72 } 72 }
73 73
74 using DWriteCreateFactoryProc = decltype(DWriteCreateFactory)*; 74 using DWriteCreateFactoryProc = decltype(DWriteCreateFactory)*;
75 HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll"); 75 HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll");
76 if (!dwrite_dll) 76 if (!dwrite_dll)
77 return; 77 return;
78 78
79 DWriteCreateFactoryProc dwrite_create_factory_proc = 79 DWriteCreateFactoryProc dwrite_create_factory_proc =
(...skipping 21 matching lines...) Expand all
101 SetDefaultSkiaFactory(direct_write_font_mgr); 101 SetDefaultSkiaFactory(direct_write_font_mgr);
102 gfx::PlatformFontWin::SetDirectWriteFactory(factory.get()); 102 gfx::PlatformFontWin::SetDirectWriteFactory(factory.get());
103 } 103 }
104 104
105 bool IsDirectWriteEnabled() { 105 bool IsDirectWriteEnabled() {
106 return dwrite_enabled; 106 return dwrite_enabled;
107 } 107 }
108 108
109 } // namespace win 109 } // namespace win
110 } // namespace gfx 110 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698