summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-08-12 20:52:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-08-12 20:52:13 +0000
commitd1f6b6245c546f95a44d0252544ea9e2028a33b4 (patch)
treef468b14767d669ff897de531707d10ba3958b03b /core/jni
parent890db42b0d4873bf3a19cd784bb7497db2add22e (diff)
parentb15b446f420b3ec69424dabcbcbc8cf019d6c8d6 (diff)
downloadframeworks_base-d1f6b6245c546f95a44d0252544ea9e2028a33b4.zip
frameworks_base-d1f6b6245c546f95a44d0252544ea9e2028a33b4.tar.gz
frameworks_base-d1f6b6245c546f95a44d0252544ea9e2028a33b4.tar.bz2
Merge "Take text alignment into account to compue text bounds Bug #10258621" into klp-dev
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/android_view_GLES20Canvas.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 70a4daa..6d46cf9 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -610,6 +610,7 @@ static void renderText(OpenGLRenderer* renderer, const jchar* text, int count,
const jchar* glyphs = value->getGlyphs();
size_t glyphsCount = value->getGlyphsCount();
jfloat totalAdvance = value->getTotalAdvance();
+ x += xOffsetForTextAlign(paint, totalAdvance);
const float* positions = value->getPos();
int bytesCount = glyphsCount * sizeof(jchar);
const SkRect& r = value->getBounds();
@@ -617,8 +618,7 @@ static void renderText(OpenGLRenderer* renderer, const jchar* text, int count,
bounds.translate(x, y);
renderer->drawText((const char*) glyphs, bytesCount, glyphsCount,
- x + xOffsetForTextAlign(paint, totalAdvance), y, positions,
- paint, totalAdvance, bounds);
+ x, y, positions, paint, totalAdvance, bounds);
}
static void renderTextOnPath(OpenGLRenderer* renderer, const jchar* text, int count,
@@ -646,6 +646,7 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text,
const jchar* glyphs = value->getGlyphs();
size_t glyphsCount = value->getGlyphsCount();
jfloat totalAdvance = value->getTotalAdvance();
+ x += xOffsetForTextAlign(paint, totalAdvance);
const float* positions = value->getPos();
int bytesCount = glyphsCount * sizeof(jchar);
const SkRect& r = value->getBounds();
@@ -653,8 +654,7 @@ static void renderTextRun(OpenGLRenderer* renderer, const jchar* text,
bounds.translate(x, y);
renderer->drawText((const char*) glyphs, bytesCount, glyphsCount,
- x + xOffsetForTextAlign(paint, totalAdvance), y, positions,
- paint, totalAdvance, bounds);
+ x, y, positions, paint, totalAdvance, bounds);
}
static void android_view_GLES20Canvas_drawTextArray(JNIEnv* env, jobject clazz,