OSDN Git Service

reset mShapingPaint's SkTypeface before we use it
authorVictoria Lease <violets@google.com>
Sat, 5 Oct 2013 00:33:35 +0000 (17:33 -0700)
committerVictoria Lease <violets@google.com>
Sat, 5 Oct 2013 00:33:35 +0000 (17:33 -0700)
commit8450a6ef8b4282491857fd5af6574019983ec243
tree78b6d2aa21e44d112e30de73d32a3a1fd1c97c0d
parent778c2de060473636ba7237a460b53a2f03f50f05
reset mShapingPaint's SkTypeface before we use it

Harfbuzz works in TTF glyph-space, but most of Skia works in
fallback glyph-space. shapeFontRun() helpfully calculates the
baseGlyphCount needed to convert between the two, but leaves
mShapingPaint's SkTypeface set to the specific TTF being shaped
rather than the original SkTypeface that was requested. Needless
to say, this causes all manner of horrific malady when glyph
indices are calculated in one glyph-index-space and then applied
to another.

To fix this issue, I reset mShapingPaint's SkTypeface when done
with the Harfbuzz shaping operation so that the baseGlyphCount only
gets applied once.

Change-Id: Ia886f89d667634e15e5fc8d7af443c9d1ba89622
core/jni/android/graphics/TextLayoutCache.cpp