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

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

Merge "LayoutLib: remove some exceptions."

parents 8cdc31f7 8a80a855
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -383,13 +383,15 @@ public final class Bitmap_Delegate {
    @LayoutlibDelegate
    /*package*/ static void nativeCopyPixelsToBuffer(int nativeBitmap, Buffer dst) {
        // FIXME implement native delegate
        throw new UnsupportedOperationException("Native delegate needed for Bitmap.nativeCopyPixelsToBuffer");
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Bitmap.copyPixelsToBuffer is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void nativeCopyPixelsFromBuffer(int nb, Buffer src) {
        // FIXME implement native delegate
        throw new UnsupportedOperationException("Native delegate needed for Bitmap.nativeCopyPixelsFromBuffer");
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Bitmap.copyPixelsFromBuffer is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
+34 −25
Original line number Diff line number Diff line
@@ -273,13 +273,15 @@ public final class Canvas_Delegate {
    /*package*/ static void drawPoints(Canvas thisCanvas, float[] pts, int offset, int count,
            Paint paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawPoint is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void drawPoint(Canvas thisCanvas, float x, float y, Paint paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawPoint is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -645,7 +647,8 @@ public final class Canvas_Delegate {
    @LayoutlibDelegate
    /*package*/ static void native_drawPaint(int nativeCanvas, int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawPaint is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -718,20 +721,19 @@ public final class Canvas_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawCircle(int nativeCanvas, float cx,
                                                 float cy, float radius,
                                                 int paint) {
    /*package*/ static void native_drawCircle(int nativeCanvas,
            float cx, float cy, float radius, int paint) {
        native_drawOval(nativeCanvas,
                new RectF(cx - radius, cy - radius, radius*2, radius*2),
                paint);
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawArc(int nativeCanvas, RectF oval,
                                              float startAngle, float sweep,
                                              boolean useCenter, int paint) {
    /*package*/ static void native_drawArc(int nativeCanvas,
            RectF oval, float startAngle, float sweep, boolean useCenter, int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawArc is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -764,8 +766,7 @@ public final class Canvas_Delegate {
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawPath(int nativeCanvas, int path,
                                               int paint) {
    /*package*/ static void native_drawPath(int nativeCanvas, int path, int paint) {
        final Path_Delegate pathDelegate = Path_Delegate.getDelegate(path);
        if (pathDelegate == null) {
            return;
@@ -929,20 +930,23 @@ public final class Canvas_Delegate {

    @LayoutlibDelegate
    /*package*/ static void nativeDrawBitmapMesh(int nCanvas, int nBitmap,
                                                    int meshWidth, int meshHeight,
                                                    float[] verts, int vertOffset,
                                                    int[] colors, int colorOffset, int nPaint) {
            int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors,
            int colorOffset, int nPaint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawBitmapMesh is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void nativeDrawVertices(int nCanvas, int mode, int n,
                   float[] verts, int vertOffset, float[] texs, int texOffset,
                   int[] colors, int colorOffset, short[] indices,
                   int indexOffset, int indexCount, int nPaint) {
            float[] verts, int vertOffset,
            float[] texs, int texOffset,
            int[] colors, int colorOffset,
            short[] indices, int indexOffset,
            int indexCount, int nPaint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawVertices is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -1080,7 +1084,8 @@ public final class Canvas_Delegate {
                                                  int count, float[] pos,
                                                  int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawPosText is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -1088,7 +1093,8 @@ public final class Canvas_Delegate {
                                                  String text, float[] pos,
                                                  int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawPosText is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -1099,7 +1105,8 @@ public final class Canvas_Delegate {
                                                     float vOffset, int bidiFlags,
                                                     int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawTextOnPath is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -1109,14 +1116,16 @@ public final class Canvas_Delegate {
                                                     float vOffset,
                                                     int flags, int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawTextOnPath is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_drawPicture(int nativeCanvas,
                                                  int nativePicture) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Canvas.drawPicture is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
+26 −10
Original line number Diff line number Diff line
@@ -568,14 +568,18 @@ public class Paint_Delegate {
    /*package*/ static int native_breakText(Paint thisPaint, char[] text, int index, int count,
            float maxWidth, float[] measuredWidth) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.native_breakText is not supported.", null, null /*data*/);
        return 0;
    }

    @LayoutlibDelegate
    /*package*/ static int native_breakText(Paint thisPaint, String text, boolean measureForwards,
            float maxWidth, float[] measuredWidth) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.native_breakText is not supported.", null, null /*data*/);
        return 0;
    }

    @LayoutlibDelegate
@@ -859,14 +863,18 @@ public class Paint_Delegate {
    /*package*/ static int native_getTextWidths(int native_object, char[] text, int index,
            int count, float[] widths) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getTextWidths is not supported.", null, null /*data*/);
        return 0;
    }

    @LayoutlibDelegate
    /*package*/ static int native_getTextWidths(int native_object, String text, int start,
            int end, float[] widths) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getTextWidths is not supported.", null, null /*data*/);
        return 0;
    }

    @LayoutlibDelegate
@@ -930,42 +938,50 @@ public class Paint_Delegate {
    /*package*/ static int native_getTextRunCursor(Paint thisPaint, int native_object, char[] text,
            int contextStart, int contextLength, int flags, int offset, int cursorOpt) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getTextRunCursor is not supported.", null, null /*data*/);
        return 0;
    }

    @LayoutlibDelegate
    /*package*/ static int native_getTextRunCursor(Paint thisPaint, int native_object, String text,
            int contextStart, int contextEnd, int flags, int offset, int cursorOpt) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getTextRunCursor is not supported.", null, null /*data*/);
        return 0;
    }

    @LayoutlibDelegate
    /*package*/ static void native_getTextPath(int native_object, int bidiFlags,
                char[] text, int index, int count, float x, float y, int path) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getTextPath is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_getTextPath(int native_object, int bidiFlags,
            String text, int start, int end, float x, float y, int path) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getTextPath is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void nativeGetStringBounds(int nativePaint, String text, int start,
            int end, Rect bounds) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getStringBounds is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void nativeGetCharArrayBounds(int nativePaint, char[] text, int index,
            int count, Rect bounds) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Paint.getCharArrayBounds is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
+14 −7
Original line number Diff line number Diff line
@@ -332,39 +332,45 @@ public final class Path_Delegate {
    @LayoutlibDelegate
    /*package*/ static void native_addOval(int nPath, RectF oval, int dir) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addOval is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_addCircle(int nPath, float x, float y, float radius, int dir) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addCircle is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_addArc(int nPath, RectF oval,
            float startAngle, float sweepAngle) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addArc is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_addRoundRect(int nPath, RectF rect,
            float rx, float ry, int dir) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addRoundRect is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_addRoundRect(int nPath, RectF r, float[] radii, int dir) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addRoundRect is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
    /*package*/ static void native_addPath(int nPath, int src, float dx, float dy) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addPath is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
@@ -375,7 +381,8 @@ public final class Path_Delegate {
    @LayoutlibDelegate
    /*package*/ static void native_addPath(int nPath, int src, int matrix) {
        // FIXME
        throw new UnsupportedOperationException();
        Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
                "Path.addPath is not supported.", null, null /*data*/);
    }

    @LayoutlibDelegate
+5 −2
Original line number Diff line number Diff line
@@ -485,8 +485,11 @@ public final class BridgeTypedArray extends TypedArray {
        if (f == 0) return 0;
        if (f > 0) return 1;

        throw new UnsupportedOperationException("Can't convert to dimension: " +
                Integer.toString(index));
        Bridge.getLog().error(LayoutLog.TAG_RESOURCES_FORMAT,
                "Can't convert to dimension: " + Integer.toString(index),
                null, null /*data*/);

        return defValue;
    }

    /**