summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-30 00:57:22 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-30 00:57:22 +0000
commitcb081d11b539315067855506f3d096f87e033b48 (patch)
tree0fd418363b461a233050221f52ce748374af8401 /ui/gfx
parent2be407f6172abb4e3c505cca7df74733ccca187b (diff)
downloadchromium_src-cb081d11b539315067855506f3d096f87e033b48.zip
chromium_src-cb081d11b539315067855506f3d096f87e033b48.tar.gz
chromium_src-cb081d11b539315067855506f3d096f87e033b48.tar.bz2
Ignore Unicode BiDi control characters in missing glyphs check in RenderTextWin.
BUG=135160 TEST=Open chrome.exe with --lang=he and bring up context menu. There should be no lag opening t. Review URL: https://chromiumcodereview.appspot.com/10696058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145046 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/render_text_win.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/ui/gfx/render_text_win.cc b/ui/gfx/render_text_win.cc
index b99cf20..c2a2c2c 100644
--- a/ui/gfx/render_text_win.cc
+++ b/ui/gfx/render_text_win.cc
@@ -224,6 +224,17 @@ void DeriveFontIfNecessary(int font_size,
*font = font->DeriveFont(font_size - current_size, font_style);
}
+// Returns true if |c| is a Unicode BiDi control character.
+bool IsUnicodeBidiControlCharacter(char16 c) {
+ return c == base::i18n::kRightToLeftMark ||
+ c == base::i18n::kLeftToRightMark ||
+ c == base::i18n::kLeftToRightEmbeddingMark ||
+ c == base::i18n::kRightToLeftEmbeddingMark ||
+ c == base::i18n::kPopDirectionalFormatting ||
+ c == base::i18n::kLeftToRightOverride ||
+ c == base::i18n::kRightToLeftOverride;
+}
+
} // namespace
namespace internal {
@@ -844,7 +855,8 @@ bool RenderTextWin::HasMissingGlyphs(internal::TextRun* run) const {
// See: http://crbug.com/125629
if (run->glyphs[glyph_index] == properties.wgBlank &&
run->visible_attributes[glyph_index].fZeroWidth &&
- !IsWhitespace(run_text[char_index])) {
+ !IsWhitespace(run_text[char_index]) &&
+ !IsUnicodeBidiControlCharacter(run_text[char_index])) {
return true;
}
}