Commit 76ea7030 authored by art-snake's avatar art-snake Committed by Commit bot

Fix text rendering with RenderTextMac.

BUG=606705

Glyph 65535 means that the glyph is not printable.
Replacing it with 0 results in a striped glyph that's
rendered instead of non-printable glyphs.
Just remove old invalid code to fix this.
In my testing no Skia asserts were triggered.

Without this fix the title in tab of url :
https://www.google.ru/trends/yis/2016/RU?autoplay=1
will be incorrect rendered:
See https://bugs.chromium.org/p/chromium/issues/detail?id=606705#c4

Review-Url: https://codereview.chromium.org/2756683002
Cr-Commit-Position: refs/heads/master@{#457472}
parent 6eb98afe
...@@ -428,14 +428,6 @@ void RenderTextMac::ComputeRuns() { ...@@ -428,14 +428,6 @@ void RenderTextMac::ComputeRuns() {
run->width = run_width; run->width = run_width;
run->glyphs.resize(glyph_count); run->glyphs.resize(glyph_count);
CTRunGetGlyphs(ct_run, empty_cf_range, &run->glyphs[0]); CTRunGetGlyphs(ct_run, empty_cf_range, &run->glyphs[0]);
// CTRunGetGlyphs() sometimes returns glyphs with value 65535 and zero
// width (this has been observed at the beginning of a string containing
// Arabic content). Passing these to Skia will trigger an assertion;
// instead set their values to 0.
for (size_t glyph = 0; glyph < glyph_count; glyph++) {
if (run->glyphs[glyph] == 65535)
run->glyphs[glyph] = 0;
}
run->glyph_positions.resize(glyph_count); run->glyph_positions.resize(glyph_count);
const CGPoint* positions_ptr = CTRunGetPositionsPtr(ct_run); const CGPoint* positions_ptr = CTRunGetPositionsPtr(ct_run);
......
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