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

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

Issue 104813005: Explicitly set text direction for TextRuns (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 11 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 | « Source/platform/fonts/harfbuzz/HarfBuzzShaper.h ('k') | Source/platform/text/BidiResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
index 77f482cce26842a0f6e6a969a95a7086c1b2e249..7483929dd41194d098e3542714c76aa12e3e3916 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -542,9 +542,7 @@ bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
return false;
m_totalWidth = 0;
- // WebKit doesn't set direction when calulating widths. Leave the direction setting to
- // HarfBuzz when we are calculating widths (except when directionalOverride() is set).
- if (!shapeHarfBuzzRuns(glyphBuffer || m_run.directionalOverride()))
+ if (!shapeHarfBuzzRuns())
return false;
if (!RuntimeEnabledFeatures::subpixelFontScalingEnabled())
@@ -634,7 +632,7 @@ static const uint16_t* toUint16(const UChar* src)
return reinterpret_cast<const uint16_t*>(src);
}
-bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection)
+bool HarfBuzzShaper::shapeHarfBuzzRuns()
{
HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_destroy);
@@ -654,11 +652,7 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection)
return false;
hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
- if (shouldSetDirection)
- hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
- else
- // Leaving direction to HarfBuzz to guess is *really* bad, but will do for now.
- hb_buffer_guess_segment_properties(harfBuzzBuffer.get());
+ hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
hb_segment_properties_t props;
hb_buffer_get_segment_properties(harfBuzzBuffer.get(), &props);
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzShaper.h ('k') | Source/platform/text/BidiResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698