Chromium Code Reviews| Index: ui/gfx/win/direct_write.cc |
| diff --git a/ui/gfx/win/direct_write.cc b/ui/gfx/win/direct_write.cc |
| index fcc185c433dc17acdd1151b34ed421d05e80c18b..7ca1f00c17ccf70ce0b4397f7cebadc08c2ecea1 100644 |
| --- a/ui/gfx/win/direct_write.cc |
| +++ b/ui/gfx/win/direct_write.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/basictypes.h" |
| #include "base/command_line.h" |
| #include "base/metrics/field_trial.h" |
| +#include "base/win/registry.h" |
| #include "base/win/windows_version.h" |
| #include "ui/gfx/switches.h" |
| #include "ui/gfx/win/dpi.h" |
| @@ -38,6 +39,14 @@ bool ShouldUseDirectWrite() { |
| if (gfx::GetDPIScale() > 1.0f) |
| return true; |
| + const wchar_t kWindowsFontsRegistryKey[] = |
|
cpu_(ooo_6.6-7.5)
2014/10/20 20:01:10
lets add a comment here with the bug link.
Shrikant Kelkar
2014/10/20 20:14:48
Done.
|
| + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"; |
| + base::win::RegistryValueIterator reg_iterator(HKEY_LOCAL_MACHINE, |
| + kWindowsFontsRegistryKey); |
| + const DWORD kMaxAllowedFontsBeforeFallbackToGDI = 1750; |
| + if (reg_iterator.ValueCount() >= kMaxAllowedFontsBeforeFallbackToGDI) |
| + return false; |
| + |
| // Otherwise, check the field trial. |
| const std::string group_name = |
| base::FieldTrialList::FindFullName("DirectWrite"); |