diff options
| author | Raph Levien <raph@google.com> | 2014-06-17 20:59:42 -0700 |
|---|---|---|
| committer | Raph Levien <raph@google.com> | 2014-06-19 11:22:45 -0700 |
| commit | 3f0d6167227d6d2cdd85f7718d92db859b443e92 (patch) | |
| tree | 0ed8dd49d93c6ff52e2a08e32bd9ca70717a08e3 /core/java | |
| parent | 45b161d24d82ef1df3ff854a1d97db0c9bad187a (diff) | |
| download | frameworks_base-3f0d6167227d6d2cdd85f7718d92db859b443e92.zip frameworks_base-3f0d6167227d6d2cdd85f7718d92db859b443e92.tar.gz frameworks_base-3f0d6167227d6d2cdd85f7718d92db859b443e92.tar.bz2 | |
Simple implementation of drawPosText
The existing implementation of drawPosText is broken in various subtle
ways, in any case doesn't work with Minikin. This patch just implements
it by drawing a separate run for each Unicode character, which should
have the least surprising results for complex scripts such as Khmer.
Part of b/11750374 Resolve TODO items for Minikin
Change-Id: I874ae3c163f0cbe3cdf0160564fab04305aed5aa
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/GLES20Canvas.java | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java index 68e2146..9fafc48 100644 --- a/core/java/android/view/GLES20Canvas.java +++ b/core/java/android/view/GLES20Canvas.java @@ -853,31 +853,7 @@ class GLES20Canvas extends HardwareCanvas { private static native void nDrawPoints(long renderer, float[] points, int offset, int count, long paint); - @SuppressWarnings("deprecation") - @Override - public void drawPosText(char[] text, int index, int count, float[] pos, Paint paint) { - if (index < 0 || index + count > text.length || count * 2 > pos.length) { - throw new IndexOutOfBoundsException(); - } - - nDrawPosText(mRenderer, text, index, count, pos, paint.mNativePaint); - } - - private static native void nDrawPosText(long renderer, char[] text, int index, int count, - float[] pos, long paint); - - @SuppressWarnings("deprecation") - @Override - public void drawPosText(String text, float[] pos, Paint paint) { - if (text.length() * 2 > pos.length) { - throw new ArrayIndexOutOfBoundsException(); - } - - nDrawPosText(mRenderer, text, 0, text.length(), pos, paint.mNativePaint); - } - - private static native void nDrawPosText(long renderer, String text, int start, int end, - float[] pos, long paint); + // Note: drawPosText just uses implementation in Canvas @Override public void drawRect(float left, float top, float right, float bottom, Paint paint) { |
