Package org.robolectric.shadows
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowCanvas
ShadowCanvas.ArcPaintHistoryEvent, ShadowCanvas.CirclePaintHistoryEvent, ShadowCanvas.LinePaintHistoryEvent, ShadowCanvas.OvalPaintHistoryEvent, ShadowCanvas.Picker, ShadowCanvas.RectPaintHistoryEvent, ShadowCanvas.RoundRectPaintHistoryEvent, ShadowCanvas.TextHistoryEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.robolectric.shadows.ShadowLegacyCanvas.CanvasReflector
protected Canvas
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
__constructor__
(Bitmap bitmap) void
protected void
protected void
drawBitmap
(Bitmap bitmap, float left, float top, Paint paint) protected void
drawBitmap
(Bitmap bitmap, Matrix matrix, Paint paint) protected void
drawBitmap
(Bitmap bitmap, Rect src, RectF dst, Paint paint) protected void
drawBitmap
(Bitmap bitmap, Rect src, Rect dst, Paint paint) protected void
drawCircle
(float cx, float cy, float radius, Paint paint) protected void
drawColor
(int color) protected void
protected void
protected void
protected void
protected void
protected void
protected void
drawRoundRect
(RectF rect, float rx, float ry, Paint paint) protected void
protected void
drawText
(CharSequence text, int start, int end, float x, float y, Paint paint) protected void
protected void
int
int
protected boolean
getClipBounds
(Rect bounds) getDrawnArc
(int i) getDrawnCircle
(int i) getDrawnLine
(int i) getDrawnOval
(int i) getDrawnPath
(int i) getDrawnPathPaint
(int i) getDrawnRect
(int i) getDrawnRoundRect
(int i) getDrawnTextEvent
(int i) protected int
int
int
int
int
int
protected int
int
protected int
getWidth()
boolean
boolean
protected static long
initRaster
(long bitmapHandle) protected static long
initRaster
(Bitmap bitmap) protected static int
native_saveLayer
(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags) protected static int
native_saveLayerAlpha
(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags) protected static int
nGetSaveCount
(long canvasHandle) protected static long
nInitRaster
(long bitmapHandle) protected static long
nInitRaster
(Bitmap bitmap) protected static boolean
nRestore
(long canvasHandle) protected static void
nRestoreToCount
(long canvasHandle, int saveCount) protected static int
nSave
(long canvasHandle, int saveFlags) protected static int
nSaveLayer
(long nativeCanvas, float l, float t, float r, float b, long nativePaint) protected static int
nSaveLayer
(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags) protected static int
nSaveLayerAlpha
(long nativeCanvas, float l, float t, float r, float b, int alpha) protected static int
nSaveLayerAlpha
(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags) protected void
release()
static void
reset()
void
protected void
restore()
protected void
restoreToCount
(int saveCount) protected int
save()
protected void
scale
(float sx, float sy) protected void
scale
(float sx, float sy, float px, float py) protected void
void
setHeight
(int height) void
setWidth
(int width) protected void
translate
(float x, float y) Methods inherited from class org.robolectric.shadows.ShadowCanvas
visualize
-
Field Details
-
realCanvas
-
canvasReflector
@ReflectorObject protected org.robolectric.shadows.ShadowLegacyCanvas.CanvasReflector canvasReflector
-
-
Constructor Details
-
ShadowLegacyCanvas
public ShadowLegacyCanvas()
-
-
Method Details
-
__constructor__
-
appendDescription
- Specified by:
appendDescription
in classShadowCanvas
-
getDescription
- Specified by:
getDescription
in classShadowCanvas
-
setBitmap
-
drawText
-
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
-
scale
-
scale
-
drawPaint
-
drawColor
-
drawBitmap
-
drawBitmap
-
drawBitmap
-
drawBitmap
-
drawPath
-
drawCircle
-
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
-
drawRoundRect
-
drawLine
@Implementation protected void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) -
drawOval
-
getPathPaintHistoryCount
public int getPathPaintHistoryCount()- Specified by:
getPathPaintHistoryCount
in classShadowCanvas
-
getCirclePaintHistoryCount
public int getCirclePaintHistoryCount()- Specified by:
getCirclePaintHistoryCount
in classShadowCanvas
-
getArcPaintHistoryCount
public int getArcPaintHistoryCount()- Specified by:
getArcPaintHistoryCount
in classShadowCanvas
-
hasDrawnPath
public boolean hasDrawnPath()- Specified by:
hasDrawnPath
in classShadowCanvas
-
hasDrawnCircle
public boolean hasDrawnCircle()- Specified by:
hasDrawnCircle
in classShadowCanvas
-
getDrawnPathPaint
- Specified by:
getDrawnPathPaint
in classShadowCanvas
-
getDrawnPath
- Specified by:
getDrawnPath
in classShadowCanvas
-
getDrawnCircle
- Specified by:
getDrawnCircle
in classShadowCanvas
-
getDrawnArc
- Specified by:
getDrawnArc
in classShadowCanvas
-
resetCanvasHistory
public void resetCanvasHistory()- Specified by:
resetCanvasHistory
in classShadowCanvas
-
getDrawnPaint
- Specified by:
getDrawnPaint
in classShadowCanvas
-
setHeight
public void setHeight(int height) - Specified by:
setHeight
in classShadowCanvas
-
setWidth
public void setWidth(int width) - Specified by:
setWidth
in classShadowCanvas
-
getWidth
-
getHeight
-
getClipBounds
-
getDrawnTextEvent
- Specified by:
getDrawnTextEvent
in classShadowCanvas
-
getTextHistoryCount
public int getTextHistoryCount()- Specified by:
getTextHistoryCount
in classShadowCanvas
-
getDrawnRect
- Specified by:
getDrawnRect
in classShadowCanvas
-
getLastDrawnRect
- Specified by:
getLastDrawnRect
in classShadowCanvas
-
getRectPaintHistoryCount
public int getRectPaintHistoryCount()- Specified by:
getRectPaintHistoryCount
in classShadowCanvas
-
getDrawnRoundRect
- Specified by:
getDrawnRoundRect
in classShadowCanvas
-
getLastDrawnRoundRect
- Specified by:
getLastDrawnRoundRect
in classShadowCanvas
-
getRoundRectPaintHistoryCount
public int getRoundRectPaintHistoryCount()- Specified by:
getRoundRectPaintHistoryCount
in classShadowCanvas
-
getDrawnLine
- Specified by:
getDrawnLine
in classShadowCanvas
-
getLinePaintHistoryCount
public int getLinePaintHistoryCount()- Specified by:
getLinePaintHistoryCount
in classShadowCanvas
-
getOvalPaintHistoryCount
public int getOvalPaintHistoryCount()- Specified by:
getOvalPaintHistoryCount
in classShadowCanvas
-
getDrawnOval
- Specified by:
getDrawnOval
in classShadowCanvas
-
save
-
restore
-
getSaveCount
-
restoreToCount
-
release
-
initRaster
-
initRaster
-
nInitRaster
-
nInitRaster
-
nGetSaveCount
-
nSave
-
native_saveLayer
@Implementation(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=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
-
nRestoreToCount
-
reset
-