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

Commit 576715c7 authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android (Google) Code Review
Browse files

Merge "Fix changed native method delegates in layoutlib for ICS."

parents 13774d2e 66743a1e
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -1092,6 +1092,33 @@ public final class Canvas_Delegate {
        native_drawText(nativeCanvas, text, start, count, x, y, flags, paint);
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawTextWithGlyphs(int nativeCanvas, char[] text,
            int index, int count, float x,
            float y, int flags, int paint) {
        native_drawText(nativeCanvas, text, index, count, x, y, flags, paint);
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawTextWithGlyphs(int nativeCanvas, String text,
            int start, int end, float x,
            float y, int flags, int paint) {
        int count = end - start;
        char[] buffer = TemporaryBuffer.obtain(count);
        TextUtils.getChars(text, start, end, buffer, 0);

        native_drawText(nativeCanvas, text, 0, count, x, y, flags, paint);
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawGlyphs(int nativeCanvas, char[] glyphs,
            int index, int count, float x,
            float y, int flags, int paint) {
        // FIXME
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawGlyphs is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawPosText(int nativeCanvas,
                                                  char[] text, int index,
+10 −3
Original line number Diff line number Diff line
@@ -939,10 +939,17 @@ public class Paint_Delegate {
        return native_getTextWidths(native_object, text.toCharArray(), start, end - start, widths);
    }

    @LayoutlibDelegate
    /* package */static int native_getTextGlyphs(int native_object, String text, int start,
            int end, int contextStart, int contextEnd, int flags, char[] glyphs) {
        // FIXME
        return 0;
    }

    @LayoutlibDelegate
    /*package*/ static float native_getTextRunAdvances(int native_object,
            char[] text, int index, int count, int contextIndex, int contextCount,
            int flags, float[] advances, int advancesIndex) {
            int flags, float[] advances, int advancesIndex, int reserved) {
        // get the delegate from the native int.
        Paint_Delegate delegate = sManager.getDelegate(native_object);
        if (delegate == null) {
@@ -986,14 +993,14 @@ public class Paint_Delegate {
    @LayoutlibDelegate
    /*package*/ static float native_getTextRunAdvances(int native_object,
            String text, int start, int end, int contextStart, int contextEnd,
            int flags, float[] advances, int advancesIndex) {
            int flags, float[] advances, int advancesIndex, int reserved) {
        // FIXME: support contextStart, contextEnd and direction flag
        int count = end - start;
        char[] buffer = TemporaryBuffer.obtain(count);
        TextUtils.getChars(text, start, end, buffer, 0);

        return native_getTextRunAdvances(native_object, buffer, 0, count, contextStart,
                contextEnd - contextStart, flags, advances, advancesIndex);
                contextEnd - contextStart, flags, advances, advancesIndex, reserved);
    }

    @LayoutlibDelegate
+29 −3
Original line number Diff line number Diff line
@@ -43,6 +43,16 @@ public class ICU_Delegate {

    // --- Native methods accessing ICU's database.

    @LayoutlibDelegate
    /*package*/ static String getIcuVersion() {
        return "unknown_layoutlib";
    }

    @LayoutlibDelegate
    /*package*/ static String getUnicodeVersion() {
        return "5.2";
    }

    @LayoutlibDelegate
    /*package*/ static String[] getAvailableBreakIteratorLocalesNative() {
        return new String[0];
@@ -74,17 +84,27 @@ public class ICU_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static String getCurrencyCodeNative(String locale) {
    /*package*/ static String[] getAvailableCurrencyCodes() {
        return new String[0];
    }

    @LayoutlibDelegate
    /*package*/ static String getCurrencyCode(String locale) {
        return "";
    }

    @LayoutlibDelegate
    /*package*/ static int getCurrencyFractionDigitsNative(String currencyCode) {
    /*package*/ static String getCurrencyDisplayName(String locale, String currencyCode) {
        return "";
    }

    @LayoutlibDelegate
    /*package*/ static int getCurrencyFractionDigits(String currencyCode) {
        return 0;
    }

    @LayoutlibDelegate
    /*package*/ static String getCurrencySymbolNative(String locale, String currencyCode) {
    /*package*/ static String getCurrencySymbol(String locale, String currencyCode) {
        return "";
    }

@@ -113,6 +133,12 @@ public class ICU_Delegate {
        return "";
    }

    @LayoutlibDelegate
    /*package*/ static String addLikelySubtags(String locale) {
        return "";
    }


    @LayoutlibDelegate
    /*package*/ static String[] getISOLanguagesNative() {
        return Locale.getISOLanguages();