Class ShadowNativeBaseCanvas

java.lang.Object
org.robolectric.shadows.ShadowCanvas
org.robolectric.shadows.ShadowNativeBaseCanvas
Direct Known Subclasses:
ShadowNativeCanvas

Shadow for BaseCanvas that is backed by native code
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Shadow picker for BaseCanvas.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    int
     
    int
     
     
    getDrawnArc(int i)
     
     
    getDrawnLine(int i)
     
    getDrawnOval(int i)
     
     
    getDrawnPath(int i)
     
     
    getDrawnRect(int i)
     
     
     
     
     
    int
     
    int
     
    int
     
    int
     
    int
     
    int
     
    boolean
     
    boolean
     
    protected static void
    nDrawArc(long nativeCanvas, float left, float top, float right, float bottom, float startAngle, float sweep, boolean useCenter, long nativePaint)
     
    protected static void
    nDrawBitmap(long nativeCanvas, int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, long nativePaintOrZero)
     
    protected static void
    nDrawBitmap(long nativeCanvas, long bitmapHandle, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity)
     
    protected static void
    nDrawBitmap(long nativeCanvas, long bitmapHandle, float left, float top, long nativePaintOrZero, int canvasDensity, int screenDensity, int bitmapDensity)
     
    protected static void
    nDrawBitmap(long nativeCanvas, Bitmap bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity)
     
    protected static void
    nDrawBitmap(long nativeCanvas, Bitmap bitmap, float left, float top, long nativePaintOrZero, int canvasDensity, int screenDensity, int bitmapDensity)
     
    protected static void
    nDrawBitmapMatrix(long nativeCanvas, long bitmapHandle, long nativeMatrix, long nativePaint)
     
    protected static void
    nDrawBitmapMatrix(long nativeCanvas, Bitmap bitmap, long nativeMatrix, long nativePaint)
     
    protected static void
    nDrawBitmapMesh(long nativeCanvas, long bitmapHandle, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nativePaint)
     
    protected static void
    nDrawBitmapMesh(long nativeCanvas, Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nativePaint)
     
    protected static void
    nDrawCircle(long nativeCanvas, float cx, float cy, float radius, long nativePaint)
     
    protected static void
    nDrawColor(long nativeCanvas, int color, int mode)
     
    protected static void
    nDrawColor(long nativeCanvas, long nativeColorSpace, long color, int mode)
     
    protected static void
    nDrawDoubleRoundRect(long nativeCanvas, float outerLeft, float outerTop, float outerRight, float outerBottom, float[] outerRadii, float innerLeft, float innerTop, float innerRight, float innerBottom, float[] innerRadii, long nativePaint)
     
    protected static void
    nDrawDoubleRoundRect(long nativeCanvas, float outerLeft, float outerTop, float outerRight, float outerBottom, float outerRx, float outerRy, float innerLeft, float innerTop, float innerRight, float innerBottom, float innerRx, float innerRy, long nativePaint)
     
    protected static void
    nDrawGlyphs(long nativeCanvas, int[] glyphIds, float[] positions, int glyphIdStart, int positionStart, int glyphCount, long nativeFont, long nativePaint)
     
    protected static void
    nDrawLine(long nativeCanvas, float startX, float startY, float stopX, float stopY, long nativePaint)
     
    protected static void
    nDrawLines(long canvasHandle, float[] pts, int offset, int count, long paintHandle)
     
    protected static void
    nDrawNinePatch(long nativeCanvas, long nativeBitmap, long ninePatch, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity)
     
    protected static void
    nDrawOval(long nativeCanvas, float left, float top, float right, float bottom, long nativePaint)
     
    protected static void
    nDrawPaint(long nativeCanvas, long nativePaint)
     
    protected static void
    nDrawPath(long nativeCanvas, long nativePath, long nativePaint)
     
    protected static void
    nDrawPoint(long canvasHandle, float x, float y, long paintHandle)
     
    protected static void
    nDrawPoints(long canvasHandle, float[] pts, int offset, int count, long paintHandle)
     
    protected static void
    nDrawRect(long nativeCanvas, float left, float top, float right, float bottom, long nativePaint)
     
    protected static void
    nDrawRegion(long nativeCanvas, long nativeRegion, long nativePaint)
     
    protected static void
    nDrawRoundRect(long nativeCanvas, float left, float top, float right, float bottom, float rx, float ry, long nativePaint)
     
    protected static void
    nDrawText(long nativeCanvas, char[] text, int index, int count, float x, float y, int flags, long nativePaint)
     
    protected static void
    nDrawText(long nativeCanvas, char[] text, int index, int count, float x, float y, int flags, long nativePaint, long nativeTypeface)
     
    protected static void
    nDrawText(long nativeCanvas, String text, int start, int end, float x, float y, int flags, long nativePaint)
     
    protected static void
    nDrawText(long nativeCanvas, String text, int start, int end, float x, float y, int flags, long nativePaint, long nativeTypeface)
     
    protected static void
    nDrawTextOnPath(long nativeCanvas, char[] text, int index, int count, long nativePath, float hOffset, float vOffset, int bidiFlags, long nativePaint)
     
    protected static void
    nDrawTextOnPath(long nativeCanvas, char[] text, int index, int count, long nativePath, float hOffset, float vOffset, int bidiFlags, long nativePaint, long nativeTypeface)
     
    protected static void
    nDrawTextOnPath(long nativeCanvas, String text, long nativePath, float hOffset, float vOffset, int flags, long nativePaint)
     
    protected static void
    nDrawTextOnPath(long nativeCanvas, String text, long nativePath, float hOffset, float vOffset, int flags, long nativePaint, long nativeTypeface)
     
    protected static void
    nDrawTextRun(long nativeCanvas, char[] text, int start, int count, int contextStart, int contextCount, float x, float y, boolean isRtl, long nativePaint, long nativeTypefaceOrPrecomputedText)
    The signature of this method is the same from SDK levels O and above, but the last native pointer changed from a Typeface pointer to a MeasuredParagraph pointer in P.
    protected static void
    nDrawTextRun(long nativeCanvas, String text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, long nativePaint)
     
    protected static void
    nDrawTextRun(long nativeCanvas, String text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, long nativePaint, long nativeTypeface)
     
    protected static void
    nDrawVertices(long nativeCanvas, int mode, int n, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, long nativePaint)
     
    protected static void
    nPunchHole(long renderer, float left, float top, float right, float bottom, float rx, float ry)
     
    protected static void
    nPunchHole(long renderer, float left, float top, float right, float bottom, float rx, float ry, float alpha)
     
    void
     
    void
    setHeight(int height)
     
    void
    setWidth(int width)
     

    Methods inherited from class org.robolectric.shadows.ShadowCanvas

    visualize

    Methods inherited from class java.lang.Object

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

    • ShadowNativeBaseCanvas

      public ShadowNativeBaseCanvas()
  • Method Details

    • nDrawBitmap

      @Implementation(minSdk=29) protected static void nDrawBitmap(long nativeCanvas, long bitmapHandle, float left, float top, long nativePaintOrZero, int canvasDensity, int screenDensity, int bitmapDensity)
    • nDrawBitmap

      @Implementation(minSdk=29) protected static void nDrawBitmap(long nativeCanvas, long bitmapHandle, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity)
    • nDrawBitmap

      @Implementation(minSdk=26) protected static void nDrawBitmap(long nativeCanvas, int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, long nativePaintOrZero)
    • nDrawBitmap

      @Implementation(minSdk=26, maxSdk=28) protected static void nDrawBitmap(long nativeCanvas, Bitmap bitmap, float left, float top, long nativePaintOrZero, int canvasDensity, int screenDensity, int bitmapDensity)
    • nDrawBitmap

      @Implementation(minSdk=26, maxSdk=28) protected static void nDrawBitmap(long nativeCanvas, Bitmap bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity)
    • nDrawColor

      @Implementation(minSdk=26) protected static void nDrawColor(long nativeCanvas, int color, int mode)
    • nDrawColor

      @Implementation(minSdk=29) protected static void nDrawColor(long nativeCanvas, long nativeColorSpace, long color, int mode)
    • nDrawPaint

      @Implementation(minSdk=26) protected static void nDrawPaint(long nativeCanvas, long nativePaint)
    • nDrawPoint

      @Implementation(minSdk=26) protected static void nDrawPoint(long canvasHandle, float x, float y, long paintHandle)
    • nDrawPoints

      @Implementation(minSdk=26) protected static void nDrawPoints(long canvasHandle, float[] pts, int offset, int count, long paintHandle)
    • nDrawLine

      @Implementation(minSdk=26) protected static void nDrawLine(long nativeCanvas, float startX, float startY, float stopX, float stopY, long nativePaint)
    • nDrawLines

      @Implementation(minSdk=26) protected static void nDrawLines(long canvasHandle, float[] pts, int offset, int count, long paintHandle)
    • nDrawRect

      @Implementation(minSdk=26) protected static void nDrawRect(long nativeCanvas, float left, float top, float right, float bottom, long nativePaint)
    • nDrawOval

      @Implementation(minSdk=26) protected static void nDrawOval(long nativeCanvas, float left, float top, float right, float bottom, long nativePaint)
    • nDrawCircle

      @Implementation(minSdk=26) protected static void nDrawCircle(long nativeCanvas, float cx, float cy, float radius, long nativePaint)
    • nDrawArc

      @Implementation(minSdk=26) protected static void nDrawArc(long nativeCanvas, float left, float top, float right, float bottom, float startAngle, float sweep, boolean useCenter, long nativePaint)
    • nDrawRoundRect

      @Implementation(minSdk=26) protected static void nDrawRoundRect(long nativeCanvas, float left, float top, float right, float bottom, float rx, float ry, long nativePaint)
    • nDrawDoubleRoundRect

      @Implementation(minSdk=29) protected static void nDrawDoubleRoundRect(long nativeCanvas, float outerLeft, float outerTop, float outerRight, float outerBottom, float outerRx, float outerRy, float innerLeft, float innerTop, float innerRight, float innerBottom, float innerRx, float innerRy, long nativePaint)
    • nDrawDoubleRoundRect

      @Implementation(minSdk=29) protected static void nDrawDoubleRoundRect(long nativeCanvas, float outerLeft, float outerTop, float outerRight, float outerBottom, float[] outerRadii, float innerLeft, float innerTop, float innerRight, float innerBottom, float[] innerRadii, long nativePaint)
    • nDrawPath

      @Implementation(minSdk=26) protected static void nDrawPath(long nativeCanvas, long nativePath, long nativePaint)
    • nDrawRegion

      @Implementation(minSdk=26) protected static void nDrawRegion(long nativeCanvas, long nativeRegion, long nativePaint)
    • nDrawNinePatch

      @Implementation(minSdk=26) protected static void nDrawNinePatch(long nativeCanvas, long nativeBitmap, long ninePatch, float dstLeft, float dstTop, float dstRight, float dstBottom, long nativePaintOrZero, int screenDensity, int bitmapDensity)
    • nDrawBitmapMatrix

      @Implementation(minSdk=29) protected static void nDrawBitmapMatrix(long nativeCanvas, long bitmapHandle, long nativeMatrix, long nativePaint)
    • nDrawBitmapMatrix

      @Implementation(minSdk=26, maxSdk=28) protected static void nDrawBitmapMatrix(long nativeCanvas, Bitmap bitmap, long nativeMatrix, long nativePaint)
    • nDrawBitmapMesh

      @Implementation(minSdk=29) protected static void nDrawBitmapMesh(long nativeCanvas, long bitmapHandle, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nativePaint)
    • nDrawBitmapMesh

      @Implementation(minSdk=26, maxSdk=28) protected static void nDrawBitmapMesh(long nativeCanvas, Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, long nativePaint)
    • nDrawVertices

      @Implementation(minSdk=26) protected static void nDrawVertices(long nativeCanvas, int mode, int n, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, long nativePaint)
    • nDrawGlyphs

      @Implementation(minSdk=31) protected static void nDrawGlyphs(long nativeCanvas, int[] glyphIds, float[] positions, int glyphIdStart, int positionStart, int glyphCount, long nativeFont, long nativePaint)
    • nDrawText

      @Implementation(minSdk=28) protected static void nDrawText(long nativeCanvas, char[] text, int index, int count, float x, float y, int flags, long nativePaint)
    • nDrawText

      @Implementation(minSdk=28) protected static void nDrawText(long nativeCanvas, String text, int start, int end, float x, float y, int flags, long nativePaint)
    • nDrawText

      @Implementation(minSdk=26, maxSdk=27) protected static void nDrawText(long nativeCanvas, char[] text, int index, int count, float x, float y, int flags, long nativePaint, long nativeTypeface)
    • nDrawText

      @Implementation(minSdk=26, maxSdk=27) protected static void nDrawText(long nativeCanvas, String text, int start, int end, float x, float y, int flags, long nativePaint, long nativeTypeface)
    • nDrawTextRun

      @Implementation(minSdk=28) protected static void nDrawTextRun(long nativeCanvas, String text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, long nativePaint)
    • nDrawTextRun

      @Implementation(minSdk=26) protected static void nDrawTextRun(long nativeCanvas, char[] text, int start, int count, int contextStart, int contextCount, float x, float y, boolean isRtl, long nativePaint, long nativeTypefaceOrPrecomputedText)
      The signature of this method is the same from SDK levels O and above, but the last native pointer changed from a Typeface pointer to a MeasuredParagraph pointer in P.
    • nDrawTextRun

      @Implementation(minSdk=26, maxSdk=27) protected static void nDrawTextRun(long nativeCanvas, String text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, long nativePaint, long nativeTypeface)
    • nDrawTextOnPath

      @Implementation(minSdk=28) protected static void nDrawTextOnPath(long nativeCanvas, char[] text, int index, int count, long nativePath, float hOffset, float vOffset, int bidiFlags, long nativePaint)
    • nDrawTextOnPath

      @Implementation(minSdk=28) protected static void nDrawTextOnPath(long nativeCanvas, String text, long nativePath, float hOffset, float vOffset, int flags, long nativePaint)
    • nDrawTextOnPath

      @Implementation(minSdk=26, maxSdk=27) protected static void nDrawTextOnPath(long nativeCanvas, char[] text, int index, int count, long nativePath, float hOffset, float vOffset, int bidiFlags, long nativePaint, long nativeTypeface)
    • nDrawTextOnPath

      @Implementation(minSdk=26, maxSdk=27) protected static void nDrawTextOnPath(long nativeCanvas, String text, long nativePath, float hOffset, float vOffset, int flags, long nativePaint, long nativeTypeface)
    • nPunchHole

      @Implementation(minSdk=31, maxSdk=33) protected static void nPunchHole(long renderer, float left, float top, float right, float bottom, float rx, float ry)
    • nPunchHole

      @Implementation(minSdk=34) protected static void nPunchHole(long renderer, float left, float top, float right, float bottom, float rx, float ry, float alpha)
    • appendDescription

      public void appendDescription(String s)
      Specified by:
      appendDescription in class ShadowCanvas
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class ShadowCanvas
    • getPathPaintHistoryCount

      public int getPathPaintHistoryCount()
      Specified by:
      getPathPaintHistoryCount in class ShadowCanvas
    • getCirclePaintHistoryCount

      public int getCirclePaintHistoryCount()
      Specified by:
      getCirclePaintHistoryCount in class ShadowCanvas
    • getArcPaintHistoryCount

      public int getArcPaintHistoryCount()
      Specified by:
      getArcPaintHistoryCount in class ShadowCanvas
    • hasDrawnPath

      public boolean hasDrawnPath()
      Specified by:
      hasDrawnPath in class ShadowCanvas
    • hasDrawnCircle

      public boolean hasDrawnCircle()
      Specified by:
      hasDrawnCircle in class ShadowCanvas
    • getDrawnPathPaint

      public Paint getDrawnPathPaint(int i)
      Specified by:
      getDrawnPathPaint in class ShadowCanvas
    • getDrawnPath

      public Path getDrawnPath(int i)
      Specified by:
      getDrawnPath in class ShadowCanvas
    • getDrawnCircle

      public ShadowCanvas.CirclePaintHistoryEvent getDrawnCircle(int i)
      Specified by:
      getDrawnCircle in class ShadowCanvas
    • getDrawnArc

      public ShadowCanvas.ArcPaintHistoryEvent getDrawnArc(int i)
      Specified by:
      getDrawnArc in class ShadowCanvas
    • resetCanvasHistory

      public void resetCanvasHistory()
      Specified by:
      resetCanvasHistory in class ShadowCanvas
    • getDrawnPaint

      public Paint getDrawnPaint()
      Specified by:
      getDrawnPaint in class ShadowCanvas
    • setHeight

      public void setHeight(int height)
      Specified by:
      setHeight in class ShadowCanvas
    • setWidth

      public void setWidth(int width)
      Specified by:
      setWidth in class ShadowCanvas
    • getDrawnTextEvent

      public ShadowCanvas.TextHistoryEvent getDrawnTextEvent(int i)
      Specified by:
      getDrawnTextEvent in class ShadowCanvas
    • getTextHistoryCount

      public int getTextHistoryCount()
      Specified by:
      getTextHistoryCount in class ShadowCanvas
    • getDrawnRect

      public ShadowCanvas.RectPaintHistoryEvent getDrawnRect(int i)
      Specified by:
      getDrawnRect in class ShadowCanvas
    • getLastDrawnRect

      public ShadowCanvas.RectPaintHistoryEvent getLastDrawnRect()
      Specified by:
      getLastDrawnRect in class ShadowCanvas
    • getRectPaintHistoryCount

      public int getRectPaintHistoryCount()
      Specified by:
      getRectPaintHistoryCount in class ShadowCanvas
    • getDrawnRoundRect

      public ShadowCanvas.RoundRectPaintHistoryEvent getDrawnRoundRect(int i)
      Specified by:
      getDrawnRoundRect in class ShadowCanvas
    • getLastDrawnRoundRect

      public ShadowCanvas.RoundRectPaintHistoryEvent getLastDrawnRoundRect()
      Specified by:
      getLastDrawnRoundRect in class ShadowCanvas
    • getRoundRectPaintHistoryCount

      public int getRoundRectPaintHistoryCount()
      Specified by:
      getRoundRectPaintHistoryCount in class ShadowCanvas
    • getDrawnLine

      public ShadowCanvas.LinePaintHistoryEvent getDrawnLine(int i)
      Specified by:
      getDrawnLine in class ShadowCanvas
    • getLinePaintHistoryCount

      public int getLinePaintHistoryCount()
      Specified by:
      getLinePaintHistoryCount in class ShadowCanvas
    • getOvalPaintHistoryCount

      public int getOvalPaintHistoryCount()
      Specified by:
      getOvalPaintHistoryCount in class ShadowCanvas
    • getDrawnOval

      public ShadowCanvas.OvalPaintHistoryEvent getDrawnOval(int i)
      Specified by:
      getDrawnOval in class ShadowCanvas