summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text_harfbuzz.cc
diff options
context:
space:
mode:
authorananta <ananta@chromium.org>2015-03-24 15:47:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-24 22:48:06 +0000
commit2cf99389793d41131db47185a28cc153d96a2bab (patch)
tree7446edc79a977184c8fba98bcb2d0ee848ee6e0b /ui/gfx/render_text_harfbuzz.cc
parente912c8f996d898a1232d885988a54010f8ed0105 (diff)
downloadchromium_src-2cf99389793d41131db47185a28cc153d96a2bab.zip
chromium_src-2cf99389793d41131db47185a28cc153d96a2bab.tar.gz
chromium_src-2cf99389793d41131db47185a28cc153d96a2bab.tar.bz2
Don't add Segoe UI to the fallback font list if it is the system font.
In this case Segoe UI and its linked fonts are already in the fallback list. This is an attempt to fix the perf regression caused on the page_cycler.intl_hi_ru bot caused by the change to remove duplicate fonts from the fallback list. BUG=469700 Review URL: https://codereview.chromium.org/999173008 Cr-Commit-Position: refs/heads/master@{#322084}
Diffstat (limited to 'ui/gfx/render_text_harfbuzz.cc')
-rw-r--r--ui/gfx/render_text_harfbuzz.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 3c71cff..63b0e4e 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -10,6 +10,7 @@
#include "base/i18n/break_iterator.h"
#include "base/i18n/char_iterator.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "third_party/harfbuzz-ng/src/hb.h"
@@ -1296,10 +1297,13 @@ void RenderTextHarfBuzz::ShapeRun(const base::string16& text,
// http://crbug.com/467459. On some Windows configurations the default font
// could be a raster font like System, which would not give us a reasonable
// fallback font list.
- std::vector<std::string> default_fallback_families =
- GetFallbackFontFamilies("Segoe UI");
- fallback_families.insert(fallback_families.end(),
- default_fallback_families.begin(), default_fallback_families.end());
+ if (!LowerCaseEqualsASCII(primary_family, "segoe ui") &&
+ !LowerCaseEqualsASCII(uniscribe_family, "segoe ui")) {
+ std::vector<std::string> default_fallback_families =
+ GetFallbackFontFamilies("Segoe UI");
+ fallback_families.insert(fallback_families.end(),
+ default_fallback_families.begin(), default_fallback_families.end());
+ }
#endif
// Get rid of duplicate fonts in the fallback list. We use the std::unique