summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-12-06 18:47:50 -0800
committer Romain Guy <romainguy@google.com> 2010-12-06 18:47:50 -0800
commit3a3fa1be9ab8e11edc660ecb35ae21ae0b5c8cc2 (patch)
treea89791749cd509428f2b9b82603ffcf4c64363c7 /libs/hwui/OpenGLRenderer.cpp
parent6620c6d413f972819fada92b574f0fa9e96d36c1 (diff)
Draw text decorations correctly.
Change-Id: I237c0ca8bfe9f233e62476e80f72bcea4359398e
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index b24c04febdee..fc14777c7881 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1116,6 +1116,8 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
}
// TODO: Handle paint->getTextScaleX()
+ const float oldX = x;
+ const float oldY = y;
const bool pureTranslate = mSnapshot->transform->isPureTranslate();
if (pureTranslate) {
x = (int) floorf(x + mSnapshot->transform->getTranslateX() + 0.5f);
@@ -1194,7 +1196,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glDisableVertexAttribArray(mCaches.currentProgram->getAttrib("texCoords"));
- drawTextDecorations(text, bytesCount, length, x, y, paint);
+ drawTextDecorations(text, bytesCount, length, oldX, oldY, paint);
}
void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) {