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

Unified Diff: Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 1136303003: Move hb_language_t determination outside of for loop (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/shaping/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
index 8115d36eb2faa0b84ab373fa9885a0c9f76eb034..e44d55753560c693ca44de87c11439bebc244319 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
@@ -818,6 +818,7 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns()
const FontDescription& fontDescription = m_font->fontDescription();
const String& localeString = fontDescription.locale();
CString locale = localeString.latin1();
+ const hb_language_t language = hb_language_from_string(locale.data(), locale.length());
HarfBuzzRun* previousRun = nullptr;
for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
@@ -830,7 +831,7 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns()
if (!face)
return false;
- hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(locale.data(), locale.length()));
+ hb_buffer_set_language(harfBuzzBuffer.get(), language);
hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698