Class ShadowLegacyCanvas

java.lang.Object
org.robolectric.shadows.ShadowCanvas
org.robolectric.shadows.ShadowLegacyCanvas
Direct Known Subclasses:
ShadowDisplayListCanvas, ShadowRecordingCanvas

@Implements(value=android.graphics.Canvas.class, isInAndroidSdk=false) public class ShadowLegacyCanvas extends ShadowCanvas
Broken. This implementation is very specific to the application for which it was developed. Todo: Reimplement. Consider using the same strategy of collecting a history of draw events and providing methods for writing queries based on type, number, and order of events.
  • Field Details

    • realCanvas

      @RealObject protected Canvas realCanvas
    • canvasReflector

      @ReflectorObject protected org.robolectric.shadows.ShadowLegacyCanvas.CanvasReflector canvasReflector
  • Constructor Details

    • ShadowLegacyCanvas

      public ShadowLegacyCanvas()
  • Method Details

    • __constructor__

      @Implementation protected void __constructor__(Bitmap bitmap)
    • appendDescription

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

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

      @Implementation protected void setBitmap(Bitmap bitmap)
    • drawText

      @Implementation protected void drawText(String text, float x, float y, Paint paint)
    • drawText

      @Implementation protected void drawText(CharSequence text, int start, int end, float x, float y, Paint paint)
    • drawText

      @Implementation protected void drawText(char[] text, int index, int count, float x, float y, Paint paint)
    • drawText

      @Implementation protected void drawText(String text, int start, int end, float x, float y, Paint paint)
    • translate

      @Implementation protected void translate(float x, float y)
    • scale

      @Implementation protected void scale(float sx, float sy)
    • scale

      @Implementation protected void scale(float sx, float sy, float px, float py)
    • drawPaint

      @Implementation protected void drawPaint(Paint paint)
    • drawColor

      @Implementation protected void drawColor(int color)
    • drawBitmap

      @Implementation protected void drawBitmap(Bitmap bitmap, float left, float top, Paint paint)
    • drawBitmap

      @Implementation protected void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)
    • drawBitmap

      @Implementation protected void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)
    • drawBitmap

      @Implementation protected void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint)
    • drawPath

      @Implementation protected void drawPath(Path path, Paint paint)
    • drawCircle

      @Implementation protected void drawCircle(float cx, float cy, float radius, Paint paint)
    • drawArc

      @Implementation protected void drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint)
    • drawRect

      @Implementation protected void drawRect(float left, float top, float right, float bottom, Paint paint)
    • drawRect

      @Implementation protected void drawRect(Rect r, Paint paint)
    • drawRoundRect

      @Implementation protected void drawRoundRect(RectF rect, float rx, float ry, Paint paint)
    • drawLine

      @Implementation protected void drawLine(float startX, float startY, float stopX, float stopY, Paint paint)
    • drawOval

      @Implementation protected void drawOval(RectF oval, Paint paint)
    • 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
    • getWidth

      @Implementation protected int getWidth()
    • getHeight

      @Implementation protected int getHeight()
    • getClipBounds

      @Implementation protected boolean getClipBounds(Rect bounds)
    • 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
    • save

      @Implementation(maxSdk=25) protected int save()
    • restore

      @Implementation(maxSdk=25) protected void restore()
    • getSaveCount

      @Implementation(maxSdk=25) protected int getSaveCount()
    • restoreToCount

      @Implementation(maxSdk=25) protected void restoreToCount(int saveCount)
    • release

      @Implementation protected void release()
    • initRaster

      @Implementation(maxSdk=20) protected static int initRaster(int bitmapHandle)
    • initRaster

      @Implementation(minSdk=21, maxSdk=22) protected static long initRaster(long bitmapHandle)
    • initRaster

      @Implementation(minSdk=23, maxSdk=25) protected static long initRaster(Bitmap bitmap)
    • nInitRaster

      @Implementation(minSdk=26, maxSdk=28) protected static long nInitRaster(Bitmap bitmap)
    • nInitRaster

      @Implementation(minSdk=29) protected static long nInitRaster(long bitmapHandle)
    • nGetSaveCount

      @Implementation(minSdk=26) protected static int nGetSaveCount(long canvasHandle)
    • nSave

      @Implementation(minSdk=26) protected static int nSave(long canvasHandle, int saveFlags)
    • native_saveLayer

      @Implementation(maxSdk=20) protected static int native_saveLayer(int nativeCanvas, RectF bounds, int paint, int layerFlags)
    • native_saveLayer

      @Implementation(maxSdk=20) protected static int native_saveLayer(int nativeCanvas, float l, float t, float r, float b, int paint, int layerFlags)
    • native_saveLayer

      @Implementation(minSdk=21, maxSdk=25) protected static int native_saveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags)
    • nSaveLayer

      @Implementation(minSdk=26, maxSdk=30) protected static int nSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags)
    • nSaveLayer

      @Implementation(minSdk=31) protected static int nSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint)
    • native_saveLayerAlpha

      @Implementation(maxSdk=20) protected static int native_saveLayerAlpha(int nativeCanvas, RectF bounds, int alpha, int layerFlags)
    • native_saveLayerAlpha

      @Implementation(maxSdk=20) protected static int native_saveLayerAlpha(int nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags)
    • native_saveLayerAlpha

      @Implementation(minSdk=21, maxSdk=25) protected static int native_saveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags)
    • nSaveLayerAlpha

      @Implementation(minSdk=26, maxSdk=30) protected static int nSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags)
    • nSaveLayerAlpha

      @Implementation(minSdk=31) protected static int nSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha)
    • nRestore

      @Implementation(minSdk=26) protected static boolean nRestore(long canvasHandle)
    • nRestoreToCount

      @Implementation(minSdk=26) protected static void nRestoreToCount(long canvasHandle, int saveCount)
    • reset

      @Resetter public static void reset()