diff options
author | Romain Guy <romainguy@google.com> | 2012-01-18 12:39:17 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-01-18 18:00:12 -0800 |
commit | 671d6cf460531825a321edb200523d0faa7792c9 (patch) | |
tree | 7fde21ba8f48911629c3dd67a1138bd6a569c084 /core/jni/android_view_GLES20Canvas.cpp | |
parent | fb9ffe02609c9c4ffca64927e72bc935cfe87768 (diff) | |
download | frameworks_base-671d6cf460531825a321edb200523d0faa7792c9.zip frameworks_base-671d6cf460531825a321edb200523d0faa7792c9.tar.gz frameworks_base-671d6cf460531825a321edb200523d0faa7792c9.tar.bz2 |
Full support for Canvas.drawPosText
This also introduces a small optimization when rendering text.
Change-Id: Iff620ac97bf878eaac406bccc6daa07052c93890
Diffstat (limited to 'core/jni/android_view_GLES20Canvas.cpp')
-rw-r--r-- | core/jni/android_view_GLES20Canvas.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp index 3bf28eb..064dcac 100644 --- a/core/jni/android_view_GLES20Canvas.cpp +++ b/core/jni/android_view_GLES20Canvas.cpp @@ -585,10 +585,10 @@ static void renderPosText(OpenGLRenderer* renderer, const jchar* text, int count const jchar* glyphs = value->getGlyphs(); size_t glyphsCount = value->getGlyphsCount(); + if (count < int(glyphsCount)) glyphsCount = count; int bytesCount = glyphsCount * sizeof(jchar); - renderer->drawPosText((const char*) glyphs, bytesCount, - count < int(glyphsCount) ? count : glyphsCount, positions, paint); + renderer->drawPosText((const char*) glyphs, bytesCount, glyphsCount, positions, paint); } static void android_view_GLES20Canvas_drawPosTextArray(JNIEnv* env, jobject clazz, |