Class CanvasNatives

java.lang.Object
org.robolectric.nativeruntime.CanvasNatives

public final class CanvasNatives extends Object
Native methods for Canvas JNI registration.

Native method signatures are derived from https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/graphics/java/android/graphics/Canvas.java

  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    nClipPath(long nativeCanvas, long nativePath, int regionOp)
     
    static boolean
    nClipRect(long nativeCanvas, float left, float top, float right, float bottom, int regionOp)
     
    static void
    nConcat(long nativeCanvas, long nativeMatrix)
     
    static void
     
    static void
     
    static boolean
    nGetClipBounds(long nativeCanvas, Rect bounds)
     
    static int
    nGetHeight(long canvasHandle)
     
    static void
    nGetMatrix(long nativeCanvas, long nativeMatrix)
     
    static long
     
    static int
    nGetSaveCount(long canvasHandle)
     
    static int
    nGetWidth(long canvasHandle)
     
    static long
    nInitRaster(long bitmapHandle)
     
    static boolean
    nIsOpaque(long canvasHandle)
     
    static boolean
    nQuickReject(long nativeCanvas, float left, float top, float right, float bottom)
     
    static boolean
    nQuickReject(long nativeCanvas, long nativePath)
     
    static boolean
    nRestore(long canvasHandle)
     
    static void
    nRestoreToCount(long canvasHandle, int saveCount)
     
    static void
    nRestoreUnclippedLayer(long nativeCanvas, int saveCount, long nativePaint)
     
    static void
    nRotate(long canvasHandle, float degrees)
     
    static int
    nSave(long canvasHandle, int saveFlags)
     
    static int
    nSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint)
     
    static int
    nSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha)
     
    static int
    nSaveUnclippedLayer(long nativeCanvas, int l, int t, int r, int b)
     
    static void
    nScale(long canvasHandle, float sx, float sy)
     
    static void
    nSetBitmap(long canvasHandle, long bitmapHandle)
     
    static void
     
    static void
    nSetDrawFilter(long nativeCanvas, long nativeFilter)
     
    static void
    nSetMatrix(long nativeCanvas, long nativeMatrix)
     
    static void
    nSkew(long canvasHandle, float sx, float sy)
     
    static void
    nTranslate(long canvasHandle, float dx, float dy)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • nFreeCaches

      public static void nFreeCaches()
    • nFreeTextLayoutCaches

      public static void nFreeTextLayoutCaches()
    • nGetNativeFinalizer

      public static long nGetNativeFinalizer()
    • nSetCompatibilityVersion

      public static void nSetCompatibilityVersion(int apiLevel)
    • nInitRaster

      public static long nInitRaster(long bitmapHandle)
    • nSetBitmap

      public static void nSetBitmap(long canvasHandle, long bitmapHandle)
    • nGetClipBounds

      public static boolean nGetClipBounds(long nativeCanvas, Rect bounds)
    • nIsOpaque

      public static boolean nIsOpaque(long canvasHandle)
    • nGetWidth

      public static int nGetWidth(long canvasHandle)
    • nGetHeight

      public static int nGetHeight(long canvasHandle)
    • nSave

      public static int nSave(long canvasHandle, int saveFlags)
    • nSaveLayer

      public static int nSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint)
    • nSaveLayerAlpha

      public static int nSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha)
    • nSaveUnclippedLayer

      public static int nSaveUnclippedLayer(long nativeCanvas, int l, int t, int r, int b)
    • nRestoreUnclippedLayer

      public static void nRestoreUnclippedLayer(long nativeCanvas, int saveCount, long nativePaint)
    • nRestore

      public static boolean nRestore(long canvasHandle)
    • nRestoreToCount

      public static void nRestoreToCount(long canvasHandle, int saveCount)
    • nGetSaveCount

      public static int nGetSaveCount(long canvasHandle)
    • nTranslate

      public static void nTranslate(long canvasHandle, float dx, float dy)
    • nScale

      public static void nScale(long canvasHandle, float sx, float sy)
    • nRotate

      public static void nRotate(long canvasHandle, float degrees)
    • nSkew

      public static void nSkew(long canvasHandle, float sx, float sy)
    • nConcat

      public static void nConcat(long nativeCanvas, long nativeMatrix)
    • nSetMatrix

      public static void nSetMatrix(long nativeCanvas, long nativeMatrix)
    • nClipRect

      public static boolean nClipRect(long nativeCanvas, float left, float top, float right, float bottom, int regionOp)
    • nClipPath

      public static boolean nClipPath(long nativeCanvas, long nativePath, int regionOp)
    • nSetDrawFilter

      public static void nSetDrawFilter(long nativeCanvas, long nativeFilter)
    • nGetMatrix

      public static void nGetMatrix(long nativeCanvas, long nativeMatrix)
    • nQuickReject

      public static boolean nQuickReject(long nativeCanvas, long nativePath)
    • nQuickReject

      public static boolean nQuickReject(long nativeCanvas, float left, float top, float right, float bottom)