Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f825eb94 authored by Ram Peri's avatar Ram Peri Committed by Android (Google) Code Review
Browse files

Merge "Remove Robolectric workaround for nGetRunCharacterAdvance change" into main

parents c3b80dd5 7ad77412
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -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,14 +3391,9 @@ 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);
    }
    }

    /**
     * @see #getRunCharacterAdvance(char[], int, int, int, int, boolean, int, float[], int)
+0 −12
Original line number Diff line number Diff line
@@ -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},