summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/graphics/Paint.java
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-06-01 15:54:47 -0700
committerRaph Levien <raph@google.com>2014-06-03 17:44:35 -0700
commitf2114d5646194100242206b267ddd6e7194b7da9 (patch)
treec98dfd08479a645873abc9c31806ce98934e6057 /graphics/java/android/graphics/Paint.java
parent1b3718ee66322b5d1bd0d4eb9cc3d20e0a6cec6c (diff)
downloadframeworks_base-f2114d5646194100242206b267ddd6e7194b7da9.zip
frameworks_base-f2114d5646194100242206b267ddd6e7194b7da9.tar.gz
frameworks_base-f2114d5646194100242206b267ddd6e7194b7da9.tar.bz2
Better Minikin integration
This patch improves the Minikin integration in a number of ways, including: Software rendering does text decorations and handles alignment correctly. This fixes bug 15139067 "Centered text isn't working". Paint implements getTextPath. This fixes bug 15143354 "Text rendering in Maps Navigation wrong typeface?" Also a bit of refactoring, since there was duplicated code for iterating font runs that's now a static method in MinikinUtils. Change-Id: I4cfdb2c0559982376348325a757d95235fab1768
Diffstat (limited to 'graphics/java/android/graphics/Paint.java')
-rw-r--r--graphics/java/android/graphics/Paint.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 92cfd6b..f97add8 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -2131,7 +2131,7 @@ public class Paint {
if ((index | count) < 0 || index + count > text.length) {
throw new ArrayIndexOutOfBoundsException();
}
- native_getTextPath(mNativePaint, mBidiFlags, text, index, count, x, y,
+ native_getTextPath(mNativePaint, mNativeTypeface, mBidiFlags, text, index, count, x, y,
path.ni());
}
@@ -2153,7 +2153,7 @@ public class Paint {
if ((start | end | (end - start) | (text.length() - end)) < 0) {
throw new IndexOutOfBoundsException();
}
- native_getTextPath(mNativePaint, mBidiFlags, text, start, end, x, y,
+ native_getTextPath(mNativePaint, mNativeTypeface, mBidiFlags, text, start, end, x, y,
path.ni());
}
@@ -2261,10 +2261,10 @@ public class Paint {
private native int native_getTextRunCursor(long native_object, String text,
int contextStart, int contextEnd, int flags, int offset, int cursorOpt);
- private static native void native_getTextPath(long native_object, int bidiFlags,
- char[] text, int index, int count, float x, float y, long path);
- private static native void native_getTextPath(long native_object, int bidiFlags,
- String text, int start, int end, float x, float y, long path);
+ private static native void native_getTextPath(long native_object, long native_typeface,
+ int bidiFlags, char[] text, int index, int count, float x, float y, long path);
+ private static native void native_getTextPath(long native_object, long native_typeface,
+ int bidiFlags, String text, int start, int end, float x, float y, long path);
private static native void nativeGetStringBounds(long nativePaint,
String text, int start, int end, int bidiFlags, Rect bounds);
private static native void nativeGetCharArrayBounds(long nativePaint,