| 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
|
|
|