summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorTom Hudson <tomhudson@google.com>2015-04-15 13:54:32 -0400
committerTom Hudson <tomhudson@google.com>2015-04-15 13:54:32 -0400
commit20c2b3ef74ac96fee5ef1daa7959c434d6caeb97 (patch)
treed6379497325c2b8865997499eaca1160f8637112 /libs
parentad83f87bcfc4f3ee4bcc972bad4ddcaaf4e57426 (diff)
downloadframeworks_base-20c2b3ef74ac96fee5ef1daa7959c434d6caeb97.zip
frameworks_base-20c2b3ef74ac96fee5ef1daa7959c434d6caeb97.tar.gz
frameworks_base-20c2b3ef74ac96fee5ef1daa7959c434d6caeb97.tar.bz2
Fix positioned text bounds
drawPosText() bounds weren't taking their offset into account properly in absolute-positioned cases. R=djsollen@google.com BUG=skia:3673 Change-Id: Ic39fd45491231ed3e3949ffbc1f063a4fc12c3f8
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/SkiaCanvasProxy.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/hwui/SkiaCanvasProxy.cpp b/libs/hwui/SkiaCanvasProxy.cpp
index ec1bb90..8a6c8c5 100644
--- a/libs/hwui/SkiaCanvasProxy.cpp
+++ b/libs/hwui/SkiaCanvasProxy.cpp
@@ -289,6 +289,7 @@ void SkiaCanvasProxy::onDrawPosText(const void* text, size_t byteLength, const S
// but even more conservative bounds if this is too slow.
SkRect bounds;
glyphs.paint.measureText(glyphs.glyphIDs, glyphs.count << 1, &bounds);
+ bounds.offset(x, y);
SK_COMPILE_ASSERT(sizeof(SkPoint) == sizeof(float)*2, SkPoint_is_no_longer_2_floats);
mCanvas->drawText(glyphs.glyphIDs, &posArray[0].fX, glyphs.count, glyphs.paint, x, y,