summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-06-25 16:32:13 -0700
committerRaph Levien <raph@google.com>2014-06-26 15:15:28 +0000
commitd194262f53799ef7cd660729a8f1027263f73e27 (patch)
tree898062e38aacab2fa9ce39b645b9de34d2c0b3f3
parentb5f6bf7ad100a38234026187879074903d1eda0c (diff)
downloadframeworks_base-d194262f53799ef7cd660729a8f1027263f73e27.zip
frameworks_base-d194262f53799ef7cd660729a8f1027263f73e27.tar.gz
frameworks_base-d194262f53799ef7cd660729a8f1027263f73e27.tar.bz2
Delete Paint.getTextGlyphs()
The Paint.getTextGlyphs() method was used for testing the old Arabic shaper and is entirely obsolete. Note that this is the very last dependency (other than some enums in the header) for the old TextLayout code path. Change-Id: I7b596f0c0942ed50987fc8e0478cd93e667f1f9e
-rw-r--r--core/jni/android/graphics/Paint.cpp44
-rw-r--r--graphics/java/android/graphics/Paint.java40
2 files changed, 0 insertions, 84 deletions
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index dc30814..ee4cc0d 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -666,47 +666,6 @@ public:
return count;
}
- static int doTextGlyphs(JNIEnv* env, SkPaint* paint, const jchar* text, jint start, jint count,
- jint contextCount, jint flags, jcharArray glyphs) {
- NPE_CHECK_RETURN_ZERO(env, paint);
- NPE_CHECK_RETURN_ZERO(env, text);
-
- if ((start | count | contextCount) < 0 || contextCount < count || !glyphs) {
- doThrowAIOOBE(env);
- return 0;
- }
- if (count == 0) {
- return 0;
- }
- size_t glypthsLength = env->GetArrayLength(glyphs);
- if ((size_t)count > glypthsLength) {
- doThrowAIOOBE(env);
- return 0;
- }
-
- jchar* glyphsArray = env->GetCharArrayElements(glyphs, NULL);
-
- sp<TextLayoutValue> value = TextLayoutEngine::getInstance().getValue(paint,
- text, start, count, contextCount, flags);
- const jchar* shapedGlyphs = value->getGlyphs();
- size_t glyphsCount = value->getGlyphsCount();
- memcpy(glyphsArray, shapedGlyphs, sizeof(jchar) * glyphsCount);
-
- env->ReleaseCharArrayElements(glyphs, glyphsArray, JNI_ABORT);
- return glyphsCount;
- }
-
- static jint getTextGlyphs__StringIIIII_C(JNIEnv* env, jobject clazz, jlong paintHandle,
- jstring text, jint start, jint end, jint contextStart, jint contextEnd, jint flags,
- jcharArray glyphs) {
- SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
- const jchar* textArray = env->GetStringChars(text, NULL);
- int count = doTextGlyphs(env, paint, textArray + contextStart, start - contextStart,
- end - start, contextEnd - contextStart, flags, glyphs);
- env->ReleaseStringChars(text, textArray);
- return count;
- }
-
static jfloat doTextRunAdvances(JNIEnv *env, SkPaint *paint, TypefaceImpl* typeface, const jchar *text,
jint start, jint count, jint contextCount, jboolean isRtl,
jfloatArray advances, jint advancesIndex) {
@@ -1154,9 +1113,6 @@ static JNINativeMethod methods[] = {
{"native_getTextRunAdvances","(JJLjava/lang/String;IIIIZ[FI)F",
(void*) SkPaintGlue::getTextRunAdvances__StringIIIIZ_FI},
-
- {"native_getTextGlyphs","(JLjava/lang/String;IIIII[C)I",
- (void*) SkPaintGlue::getTextGlyphs__StringIIIII_C},
{"native_getTextRunCursor", "(J[CIIIII)I", (void*) SkPaintGlue::getTextRunCursor___C},
{"native_getTextRunCursor", "(JLjava/lang/String;IIIII)I",
(void*) SkPaintGlue::getTextRunCursor__String},
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 17ce026..72e39bb 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1773,46 +1773,6 @@ public class Paint {
}
/**
- * Return the glyph Ids for the characters in the string.
- *
- * @param text The text to measure
- * @param start The index of the first char to to measure
- * @param end The end of the text slice to measure
- * @param contextStart the index of the first character to use for shaping context,
- * must be <= start
- * @param contextEnd the index past the last character to use for shaping context,
- * must be >= end
- * @param flags the flags to control the advances, either {@link #DIRECTION_LTR}
- * or {@link #DIRECTION_RTL}
- * @param glyphs array to receive the glyph Ids of the characters.
- * Must be at least a large as the text.
- * @return the number of glyphs in the returned array
- *
- * @hide
- *
- * Used only for BiDi / RTL Tests
- */
- public int getTextGlyphs(String text, int start, int end, int contextStart, int contextEnd,
- int flags, char[] glyphs) {
- if (text == null) {
- throw new IllegalArgumentException("text cannot be null");
- }
- if (flags != DIRECTION_LTR && flags != DIRECTION_RTL) {
- throw new IllegalArgumentException("unknown flags value: " + flags);
- }
- if ((start | end | contextStart | contextEnd | (end - start)
- | (start - contextStart) | (contextEnd - end) | (text.length() - end)
- | (text.length() - contextEnd)) < 0) {
- throw new IndexOutOfBoundsException();
- }
- if (end - start > glyphs.length) {
- throw new ArrayIndexOutOfBoundsException();
- }
- return native_getTextGlyphs(mNativePaint, text, start, end, contextStart, contextEnd,
- flags, glyphs);
- }
-
- /**
* Convenience overload that takes a char array instead of a
* String.
*