diff options
author | Romain Guy <romainguy@google.com> | 2013-02-11 18:01:20 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2013-02-11 18:04:23 -0800 |
commit | e67307c816f3fdae2bfba8e9a4410dc015645e91 (patch) | |
tree | a97695ed6c6e087364fba51b3a848d4aedebdb41 /libs/hwui/font/Font.cpp | |
parent | f16c7a97548cedccea291ffebc4388a7f15c9aa1 (diff) | |
download | frameworks_base-e67307c816f3fdae2bfba8e9a4410dc015645e91.zip frameworks_base-e67307c816f3fdae2bfba8e9a4410dc015645e91.tar.gz frameworks_base-e67307c816f3fdae2bfba8e9a4410dc015645e91.tar.bz2 |
Prevent crash when setting up a stencil-based clip
Bug #8177690
Clear the layers before we setup the stencil to avoid dereferencing
the recently deleted rects.
Change-Id: I5dce5f965672f276f9490636d85b6018d3ab9422
Diffstat (limited to 'libs/hwui/font/Font.cpp')
-rw-r--r-- | libs/hwui/font/Font.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp index 1afcb46..1a75ea8 100644 --- a/libs/hwui/font/Font.cpp +++ b/libs/hwui/font/Font.cpp @@ -189,7 +189,10 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, float x, float hOffset, float vOffset += glyph->mBitmapTop + height; SkPoint destination[4]; - measure.getPosTan(x + hOffset + glyph->mBitmapLeft + halfWidth, position, tangent); + bool ok = measure.getPosTan(x + hOffset + glyph->mBitmapLeft + halfWidth, position, tangent); + if (!ok) { + ALOGW("The path for drawTextOnPath is empty or null"); + } // Move along the tangent and offset by the normal destination[0].set(-tangent->fX * halfWidth - tangent->fY * vOffset, |