summaryrefslogtreecommitdiff
path: root/libs/hwui/TextDropShadowCache.cpp
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2012-07-30 15:50:00 -0700
committerRaph Levien <raph@google.com>2012-07-30 15:53:16 -0700
commit8b4072d3fb9bb49d774d97689a065204beca1752 (patch)
tree1356548f2453c28d23458375943c2b21bd91ceb4 /libs/hwui/TextDropShadowCache.cpp
parente72a6e977b8436a993c427cf489f2ae05fdeface (diff)
Fix bug 6892600 Font (character pairs) rendering issue
Alignment on paint for actual glyph drawing needs to always be left, even when drawing centered or right aligned text. The x offset for alignment is applied by OpenGLRenderer::drawText (and needs to be early in the pipeline for quickReject to work). Similar change needed for drawing drop shadow. Also fixes bug with mispositioned underline (offset for alignment has already been applied once, no need to do it again in drawTextDecorations). Change-Id: Id3dcd62de5536a26b158d768889273a1492b35d6
Diffstat (limited to 'libs/hwui/TextDropShadowCache.cpp')
-rw-r--r--libs/hwui/TextDropShadowCache.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index 93aa8a5c0af3..8426f5869189 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -107,7 +107,9 @@ ShadowTexture* TextDropShadowCache::get(SkPaint* paint, const char* text, uint32
ShadowTexture* texture = mCache.get(entry);
if (!texture) {
- FontRenderer::DropShadow shadow = mRenderer->renderDropShadow(paint, text, 0,
+ SkPaint paintCopy(*paint);
+ paintCopy.setTextAlign(SkPaint::kLeft_Align);
+ FontRenderer::DropShadow shadow = mRenderer->renderDropShadow(&paintCopy, text, 0,
len, numGlyphs, radius, positions);
texture = new ShadowTexture;