Commit 3e738789 authored by msw@chromium.org's avatar msw@chromium.org

Fix RenderTextHarfBuzz glyph offset regression.

Negate the vertical glyph offset in RenderTextHarfBuzz.
Also restores the hb_buffer_set_language call and comment.
These were victims of merge errors in r284297.

BUG=391203
TEST=Arabic diacritics are drawn correctly.
R=ckocagil@chromium.org
TBR=asvitkine@chromium.org

Review URL: https://codereview.chromium.org/408733002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284356 0039d316-1c4b-4281-b951-d872f2087c98
parent bf880955
...@@ -1011,7 +1011,8 @@ void RenderTextHarfBuzz::ShapeRunWithFont(internal::TextRunHarfBuzz* run, ...@@ -1011,7 +1011,8 @@ void RenderTextHarfBuzz::ShapeRunWithFont(internal::TextRunHarfBuzz* run,
hb_buffer_set_script(buffer, ICUScriptToHBScript(run->script)); hb_buffer_set_script(buffer, ICUScriptToHBScript(run->script));
hb_buffer_set_direction(buffer, hb_buffer_set_direction(buffer,
run->is_rtl ? HB_DIRECTION_RTL : HB_DIRECTION_LTR); run->is_rtl ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
// TODO(ckocagil): Should we call |hb_buffer_set_language()| here? // TODO(ckocagil): Should we determine the actual language?
hb_buffer_set_language(buffer, hb_language_get_default());
// Shape the text. // Shape the text.
hb_shape(harfbuzz_font, buffer, NULL, 0); hb_shape(harfbuzz_font, buffer, NULL, 0);
...@@ -1033,7 +1034,7 @@ void RenderTextHarfBuzz::ShapeRunWithFont(internal::TextRunHarfBuzz* run, ...@@ -1033,7 +1034,7 @@ void RenderTextHarfBuzz::ShapeRunWithFont(internal::TextRunHarfBuzz* run,
SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_offset)); SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_offset));
const int y_offset = const int y_offset =
SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].y_offset)); SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].y_offset));
run->positions[i].set(run->width + x_offset, y_offset); run->positions[i].set(run->width + x_offset, -y_offset);
run->width += run->width +=
SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance)); SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment