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

Unified Diff: content/browser/browser_main_runner.cc

Issue 738363002: Enable subpixel positioning for UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: std::round to std::floor(+0.5) Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/font_render_params_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_runner.cc
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index 491f6c0fd8e5a20438dd955f660c79e05a7d4a00..2975ef864747646aec4a2fa68028d0c697b1bb66 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -20,17 +20,11 @@
#include "ui/base/ime/input_method_initializer.h"
#if defined(OS_WIN)
-#include <dwrite.h>
-#include "base/win/scoped_comptr.h"
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "net/cert/sha256_legacy_support_win.h"
#include "sandbox/win/src/sidestep/preamble_patcher.h"
-#include "skia/ext/fontmgr_default_win.h"
-#include "third_party/skia/include/ports/SkFontMgr.h"
-#include "third_party/skia/include/ports/SkTypeface_win.h"
#include "ui/base/win/scoped_ole_initializer.h"
-#include "ui/gfx/platform_font_win.h"
#include "ui/gfx/switches.h"
#include "ui/gfx/win/direct_write.h"
#endif
@@ -118,43 +112,6 @@ void InstallSha256LegacyHooks() {
#endif // _WIN64
}
-void MaybeEnableDirectWriteFontRendering() {
- if (gfx::win::ShouldUseDirectWrite() &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableDirectWriteForUI) &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableHarfBuzzRenderText)) {
- typedef decltype(DWriteCreateFactory)* DWriteCreateFactoryProc;
- HMODULE dwrite_dll = LoadLibraryW(L"dwrite.dll");
- if (!dwrite_dll)
- return;
-
- DWriteCreateFactoryProc dwrite_create_factory_proc =
- reinterpret_cast<DWriteCreateFactoryProc>(
- GetProcAddress(dwrite_dll, "DWriteCreateFactory"));
- // Not finding the DWriteCreateFactory function indicates a corrupt dll.
- CHECK(dwrite_create_factory_proc);
-
- base::win::ScopedComPtr<IDWriteFactory> factory;
-
- CHECK(SUCCEEDED(
- dwrite_create_factory_proc(
- DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
- reinterpret_cast<IUnknown**>(factory.Receive()))));
- // The skia call to create a new DirectWrite font manager instance can fail
- // if we are unable to get the system font collection from the DirectWrite
- // factory. The GetSystemFontCollection method in the IDWriteFactory
- // interface fails with E_INVALIDARG on certain Windows 7 gold versions
- // (6.1.7600.*). We should just use GDI in these cases.
- SkFontMgr* direct_write_font_mgr = SkFontMgr_New_DirectWrite(factory.get());
- if (direct_write_font_mgr) {
- SetDefaultSkiaFactory(direct_write_font_mgr);
- gfx::PlatformFontWin::SetDirectWriteFactory(factory.get());
- }
- }
-}
-
} // namespace
#endif // OS_WIN
@@ -208,7 +165,7 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
// on Windows 8 Metro mode.
ole_initializer_.reset(new ui::ScopedOleInitializer);
// Enable DirectWrite font rendering if needed.
- MaybeEnableDirectWriteFontRendering();
+ gfx::win::MaybeInitializeDirectWrite();
#endif // OS_WIN
main_loop_.reset(new BrowserMainLoop(parameters));
« no previous file with comments | « no previous file | ui/gfx/font_render_params_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698