diff options
| author | 2024-01-12 22:05:53 +0000 | |
|---|---|---|
| committer | 2024-01-13 05:09:31 +0000 | |
| commit | 7ad774120c090227ba12b9e9e8d724db01b854f4 (patch) | |
| tree | da8c0301eb22e97f992069b677379a168abc67bb | |
| parent | 4ba6f93bbddc8bd83fe4e65e180bdc969aa8f613 (diff) | |
Remove Robolectric workaround for nGetRunCharacterAdvance change
A fix for Robolectric has been made at the same time and this
workaround can be removed.
Bug: 319192202
Test: SystemUIGoogleRobo2RNGTests
Change-Id: I57d0689d6bdc8af12d671fbb6f9cbe8ea90da085
| -rw-r--r-- | graphics/java/android/graphics/Paint.java | 11 | ||||
| -rw-r--r-- | libs/hwui/jni/Paint.cpp | 12 |
2 files changed, 2 insertions, 21 deletions
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index c5a2f983ae00..f6ba103f6f05 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -65,8 +65,6 @@ public class Paint { private long mNativeShader; private long mNativeColorFilter; - private static boolean sIsRobolectric = Build.FINGERPRINT.equals("robolectric"); - // Use a Holder to allow static initialization of Paint in the boot image. private static class NoImagePreloadHolder { public static final NativeAllocationRegistry sRegistry = @@ -3393,13 +3391,8 @@ public class Paint { return 0.0f; } - if (sIsRobolectric) { - return nGetRunCharacterAdvance(mNativePaint, text, start, end, - contextStart, contextEnd, isRtl, offset, advances, advancesIndex, drawBounds); - } else { - return nGetRunCharacterAdvance(mNativePaint, text, start, end, contextStart, contextEnd, - isRtl, offset, advances, advancesIndex, drawBounds, runInfo); - } + return nGetRunCharacterAdvance(mNativePaint, text, start, end, contextStart, contextEnd, + isRtl, offset, advances, advancesIndex, drawBounds, runInfo); } /** diff --git a/libs/hwui/jni/Paint.cpp b/libs/hwui/jni/Paint.cpp index 58d9d8b9def3..286f06a6bad8 100644 --- a/libs/hwui/jni/Paint.cpp +++ b/libs/hwui/jni/Paint.cpp @@ -578,16 +578,6 @@ namespace PaintGlue { return result; } - // This method is kept for old Robolectric JNI signature used by SystemUIGoogleRoboRNGTests. - static jfloat getRunCharacterAdvance___CIIIIZI_FI_F_ForRobolectric( - JNIEnv* env, jclass cls, jlong paintHandle, jcharArray text, jint start, jint end, - jint contextStart, jint contextEnd, jboolean isRtl, jint offset, jfloatArray advances, - jint advancesIndex, jobject drawBounds) { - return getRunCharacterAdvance___CIIIIZI_FI_F(env, cls, paintHandle, text, start, end, - contextStart, contextEnd, isRtl, offset, - advances, advancesIndex, drawBounds, nullptr); - } - static jint doOffsetForAdvance(const Paint* paint, const Typeface* typeface, const jchar buf[], jint start, jint count, jint bufSize, jboolean isRtl, jfloat advance) { minikin::Bidi bidiFlags = isRtl ? minikin::Bidi::FORCE_RTL : minikin::Bidi::FORCE_LTR; @@ -1163,8 +1153,6 @@ static const JNINativeMethod methods[] = { {"nGetRunCharacterAdvance", "(J[CIIIIZI[FILandroid/graphics/RectF;Landroid/graphics/Paint$RunInfo;)F", (void*)PaintGlue::getRunCharacterAdvance___CIIIIZI_FI_F}, - {"nGetRunCharacterAdvance", "(J[CIIIIZI[FILandroid/graphics/RectF;)F", - (void*)PaintGlue::getRunCharacterAdvance___CIIIIZI_FI_F_ForRobolectric}, {"nGetOffsetForAdvance", "(J[CIIIIZF)I", (void*)PaintGlue::getOffsetForAdvance___CIIIIZF_I}, {"nGetFontMetricsIntForText", "(J[CIIIIZLandroid/graphics/Paint$FontMetricsInt;)V", (void*)PaintGlue::getFontMetricsIntForText___C}, |