OLD | NEW |
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/public/browser/browser_main_runner.h" | 5 #include "content/public/browser/browser_main_runner.h" |
6 | 6 |
| 7 #include <dwrite.h> |
| 8 |
7 #include "base/allocator/allocator_shim.h" | 9 #include "base/allocator/allocator_shim.h" |
8 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/debug/leak_annotations.h" | 12 #include "base/debug/leak_annotations.h" |
11 #include "base/debug/trace_event.h" | 13 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 14 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
14 #include "base/metrics/statistics_recorder.h" | 16 #include "base/metrics/statistics_recorder.h" |
15 #include "content/browser/browser_main_loop.h" | 17 #include "content/browser/browser_main_loop.h" |
16 #include "content/browser/browser_shutdown_profile_dumper.h" | 18 #include "content/browser/browser_shutdown_profile_dumper.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Not finding the DWriteCreateFactory function indicates a corrupt dll. | 135 // Not finding the DWriteCreateFactory function indicates a corrupt dll. |
134 CHECK(dwrite_create_factory_proc); | 136 CHECK(dwrite_create_factory_proc); |
135 | 137 |
136 IDWriteFactory* factory = NULL; | 138 IDWriteFactory* factory = NULL; |
137 | 139 |
138 CHECK(SUCCEEDED( | 140 CHECK(SUCCEEDED( |
139 dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED, | 141 dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED, |
140 __uuidof(IDWriteFactory), | 142 __uuidof(IDWriteFactory), |
141 reinterpret_cast<IUnknown**>(&factory)))); | 143 reinterpret_cast<IUnknown**>(&factory)))); |
142 SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory)); | 144 SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory)); |
143 gfx::PlatformFontWin::set_direct_write_factory(factory); | 145 gfx::PlatformFontWin::set_use_skia_for_font_metrics(true); |
144 } | 146 } |
145 } | 147 } |
146 | 148 |
147 } // namespace | 149 } // namespace |
148 | 150 |
149 #endif // OS_WIN | 151 #endif // OS_WIN |
150 | 152 |
151 class BrowserMainRunnerImpl : public BrowserMainRunner { | 153 class BrowserMainRunnerImpl : public BrowserMainRunner { |
152 public: | 154 public: |
153 BrowserMainRunnerImpl() | 155 BrowserMainRunnerImpl() |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 319 |
318 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); | 320 DISALLOW_COPY_AND_ASSIGN(BrowserMainRunnerImpl); |
319 }; | 321 }; |
320 | 322 |
321 // static | 323 // static |
322 BrowserMainRunner* BrowserMainRunner::Create() { | 324 BrowserMainRunner* BrowserMainRunner::Create() { |
323 return new BrowserMainRunnerImpl(); | 325 return new BrowserMainRunnerImpl(); |
324 } | 326 } |
325 | 327 |
326 } // namespace content | 328 } // namespace content |
OLD | NEW |