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

Unified Diff: ui/gfx/win/direct_write.cc

Issue 785763002: Disable subpixel positioning if DirectWrite isn't initialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test more columns; extract constants 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
« ui/gfx/render_text_unittest.cc ('K') | « ui/gfx/win/direct_write.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/direct_write.cc
diff --git a/ui/gfx/win/direct_write.cc b/ui/gfx/win/direct_write.cc
index 207b2c165b542c7811512add11e6e93d759403e3..16f705574524eb2b9090f5fa0923877efaece6e1 100644
--- a/ui/gfx/win/direct_write.cc
+++ b/ui/gfx/win/direct_write.cc
@@ -21,6 +21,12 @@
namespace gfx {
namespace win {
+namespace {
+
+static bool dwrite_enabled = false;
+
+}
+
bool ShouldUseDirectWrite() {
// If the flag is currently on, and we're on Win7 or above, we enable
// DirectWrite. Skia does not require the additions to DirectWrite in QFE
@@ -103,10 +109,15 @@ void MaybeInitializeDirectWrite() {
// 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());
- }
+ if (!direct_write_font_mgr)
+ return;
+ dwrite_enabled = true;
+ SetDefaultSkiaFactory(direct_write_font_mgr);
+ gfx::PlatformFontWin::SetDirectWriteFactory(factory.get());
+}
+
+bool IsDirectWriteEnabled() {
+ return dwrite_enabled;
}
} // namespace win
« ui/gfx/render_text_unittest.cc ('K') | « ui/gfx/win/direct_write.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698