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

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: re-disable dwrite in tests, re-enable dwrite metrics 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 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') | ui/gfx/render_text.cc » ('J')
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 ab548c6c06495bda8c2cd016b173a9f1d9b6ce40..2975ef864747646aec4a2fa68028d0c697b1bb66 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -20,16 +20,11 @@
#include "ui/base/ime/input_method_initializer.h"
#if defined(OS_WIN)
-#include <dwrite.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
@@ -117,34 +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);
-
- IDWriteFactory* factory = NULL;
-
- CHECK(SUCCEEDED(
- dwrite_create_factory_proc(DWRITE_FACTORY_TYPE_SHARED,
- __uuidof(IDWriteFactory),
- reinterpret_cast<IUnknown**>(&factory))));
- SetDefaultSkiaFactory(SkFontMgr_New_DirectWrite(factory));
- gfx::PlatformFontWin::SetDirectWriteFactory(factory);
- }
-}
-
} // namespace
#endif // OS_WIN
@@ -198,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') | ui/gfx/render_text.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698