diff options
author | Raph Levien <raph@google.com> | 2012-07-17 15:36:33 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2012-07-17 15:42:57 -0700 |
commit | b4fad178c792687c50683880bcfaf507d54b30ca (patch) | |
tree | c7661c0427d8587ead948cd11e796ec22ce97e3b | |
parent | 669f287c3eec9ca1755d8d27ba1b5e17464b714a (diff) | |
download | external_skia-b4fad178c792687c50683880bcfaf507d54b30ca.zip external_skia-b4fad178c792687c50683880bcfaf507d54b30ca.tar.gz external_skia-b4fad178c792687c50683880bcfaf507d54b30ca.tar.bz2 |
Accurately calculate advances in general case. Fixes bug 6833339.
The advance values computed by generateAdvance() were inconsistent with
those computed by generateMetrics, because the fMatrix22 was being
applied in the latter but not former case. Since fMatrix22.xx is 1.0
almost all the time (the exception is only when skew and scale are both
applied), failures were rare.
This patch is an alternative to ag/#/c/207887, in that they both fix the
problem, but in different ways. That patch made fMatrix22.xx equal to
1.0 in almost all cases, while this one gives correct advance values
for arbitrary fMatrix22 values.
Change-Id: Iedfa36e884e3e3e2f078a5d4edfc82004a54e895
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 621c94a..da00d51 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -951,8 +951,8 @@ void SkScalerContext_FreeType::generateAdvance(SkGlyph* glyph) { if (0 == error) { glyph->fRsbDelta = 0; glyph->fLsbDelta = 0; - glyph->fAdvanceX = advance; // advance *2/3; //DEBUG - glyph->fAdvanceY = 0; + glyph->fAdvanceX = SkFixedMul(fMatrix22.xx, advance); // advance *2/3; //DEBUG + glyph->fAdvanceY = -SkFixedMul(fMatrix22.yx, advance); return; } } |