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
Fields Modifier and Type Field Description protected org.robolectric.shadows.ShadowLegacyCanvas.CanvasReflectorcanvasReflectorprotected CanvasrealCanvas
-
Constructor Summary
Constructors Constructor Description ShadowLegacyCanvas()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void__constructor__(Bitmap bitmap)voidappendDescription(String s)protected voiddrawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint)protected voiddrawBitmap(Bitmap bitmap, float left, float top, Paint paint)protected voiddrawBitmap(Bitmap bitmap, Matrix matrix, Paint paint)protected voiddrawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint)protected voiddrawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)protected voiddrawCircle(float cx, float cy, float radius, Paint paint)protected voiddrawColor(int color)protected voiddrawLine(float startX, float startY, float stopX, float stopY, Paint paint)protected voiddrawOval(RectF oval, Paint paint)protected voiddrawPaint(Paint paint)protected voiddrawPath(Path path, Paint paint)protected voiddrawRect(float left, float top, float right, float bottom, Paint paint)protected voiddrawRect(Rect r, Paint paint)protected voiddrawRoundRect(RectF rect, float rx, float ry, Paint paint)protected voiddrawText(char[] text, int index, int count, float x, float y, Paint paint)protected voiddrawText(CharSequence text, int start, int end, float x, float y, Paint paint)protected voiddrawText(String text, float x, float y, Paint paint)protected voiddrawText(String text, int start, int end, float x, float y, Paint paint)intgetArcPaintHistoryCount()intgetCirclePaintHistoryCount()protected booleangetClipBounds(Rect bounds)StringgetDescription()ShadowCanvas.ArcPaintHistoryEventgetDrawnArc(int i)ShadowCanvas.CirclePaintHistoryEventgetDrawnCircle(int i)ShadowCanvas.LinePaintHistoryEventgetDrawnLine(int i)ShadowCanvas.OvalPaintHistoryEventgetDrawnOval(int i)PaintgetDrawnPaint()PathgetDrawnPath(int i)PaintgetDrawnPathPaint(int i)ShadowCanvas.RectPaintHistoryEventgetDrawnRect(int i)ShadowCanvas.RoundRectPaintHistoryEventgetDrawnRoundRect(int i)ShadowCanvas.TextHistoryEventgetDrawnTextEvent(int i)protected intgetHeight()ShadowCanvas.RectPaintHistoryEventgetLastDrawnRect()ShadowCanvas.RoundRectPaintHistoryEventgetLastDrawnRoundRect()intgetLinePaintHistoryCount()intgetOvalPaintHistoryCount()intgetPathPaintHistoryCount()intgetRectPaintHistoryCount()intgetRoundRectPaintHistoryCount()protected intgetSaveCount()intgetTextHistoryCount()protected intgetWidth()booleanhasDrawnCircle()booleanhasDrawnPath()protected static intinitRaster(int bitmapHandle)protected static longinitRaster(long bitmapHandle)protected static longinitRaster(Bitmap bitmap)protected static intnative_saveLayer(int nativeCanvas, float l, float t, float r, float b, int paint, int layerFlags)protected static intnative_saveLayer(int nativeCanvas, RectF bounds, int paint, int layerFlags)protected static intnative_saveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags)protected static intnative_saveLayerAlpha(int nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags)protected static intnative_saveLayerAlpha(int nativeCanvas, RectF bounds, int alpha, int layerFlags)protected static intnative_saveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags)protected static intnGetSaveCount(long canvasHandle)protected static longnInitRaster(long bitmapHandle)protected static longnInitRaster(Bitmap bitmap)protected static booleannRestore(long canvasHandle)protected static voidnRestoreToCount(long canvasHandle, int saveCount)protected static intnSave(long canvasHandle, int saveFlags)protected static intnSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint)protected static intnSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags)protected static intnSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha)protected static intnSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags)protected voidrelease()static voidreset()voidresetCanvasHistory()protected voidrestore()protected voidrestoreToCount(int saveCount)protected intsave()protected voidscale(float sx, float sy)protected voidscale(float sx, float sy, float px, float py)protected voidsetBitmap(Bitmap bitmap)voidsetHeight(int height)voidsetWidth(int width)protected voidtranslate(float x, float y)-
Methods inherited from class org.robolectric.shadows.ShadowCanvas
visualize
-
-
-
-
Field Detail
-
realCanvas
@RealObject protected Canvas realCanvas
-
canvasReflector
@ReflectorObject protected org.robolectric.shadows.ShadowLegacyCanvas.CanvasReflector canvasReflector
-
-
Method Detail
-
__constructor__
@Implementation protected void __constructor__(Bitmap bitmap)
-
appendDescription
public void appendDescription(String s)
- Specified by:
appendDescriptionin classShadowCanvas
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin classShadowCanvas
-
setBitmap
@Implementation protected void setBitmap(Bitmap bitmap)
-
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)
-
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)
-
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)
-
getPathPaintHistoryCount
public int getPathPaintHistoryCount()
- Specified by:
getPathPaintHistoryCountin classShadowCanvas
-
getCirclePaintHistoryCount
public int getCirclePaintHistoryCount()
- Specified by:
getCirclePaintHistoryCountin classShadowCanvas
-
getArcPaintHistoryCount
public int getArcPaintHistoryCount()
- Specified by:
getArcPaintHistoryCountin classShadowCanvas
-
hasDrawnPath
public boolean hasDrawnPath()
- Specified by:
hasDrawnPathin classShadowCanvas
-
hasDrawnCircle
public boolean hasDrawnCircle()
- Specified by:
hasDrawnCirclein classShadowCanvas
-
getDrawnPathPaint
public Paint getDrawnPathPaint(int i)
- Specified by:
getDrawnPathPaintin classShadowCanvas
-
getDrawnPath
public Path getDrawnPath(int i)
- Specified by:
getDrawnPathin classShadowCanvas
-
getDrawnCircle
public ShadowCanvas.CirclePaintHistoryEvent getDrawnCircle(int i)
- Specified by:
getDrawnCirclein classShadowCanvas
-
getDrawnArc
public ShadowCanvas.ArcPaintHistoryEvent getDrawnArc(int i)
- Specified by:
getDrawnArcin classShadowCanvas
-
resetCanvasHistory
public void resetCanvasHistory()
- Specified by:
resetCanvasHistoryin classShadowCanvas
-
getDrawnPaint
public Paint getDrawnPaint()
- Specified by:
getDrawnPaintin classShadowCanvas
-
setHeight
public void setHeight(int height)
- Specified by:
setHeightin classShadowCanvas
-
setWidth
public void setWidth(int width)
- Specified by:
setWidthin classShadowCanvas
-
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:
getDrawnTextEventin classShadowCanvas
-
getTextHistoryCount
public int getTextHistoryCount()
- Specified by:
getTextHistoryCountin classShadowCanvas
-
getDrawnRect
public ShadowCanvas.RectPaintHistoryEvent getDrawnRect(int i)
- Specified by:
getDrawnRectin classShadowCanvas
-
getLastDrawnRect
public ShadowCanvas.RectPaintHistoryEvent getLastDrawnRect()
- Specified by:
getLastDrawnRectin classShadowCanvas
-
getRectPaintHistoryCount
public int getRectPaintHistoryCount()
- Specified by:
getRectPaintHistoryCountin classShadowCanvas
-
getDrawnRoundRect
public ShadowCanvas.RoundRectPaintHistoryEvent getDrawnRoundRect(int i)
- Specified by:
getDrawnRoundRectin classShadowCanvas
-
getLastDrawnRoundRect
public ShadowCanvas.RoundRectPaintHistoryEvent getLastDrawnRoundRect()
- Specified by:
getLastDrawnRoundRectin classShadowCanvas
-
getRoundRectPaintHistoryCount
public int getRoundRectPaintHistoryCount()
- Specified by:
getRoundRectPaintHistoryCountin classShadowCanvas
-
getDrawnLine
public ShadowCanvas.LinePaintHistoryEvent getDrawnLine(int i)
- Specified by:
getDrawnLinein classShadowCanvas
-
getLinePaintHistoryCount
public int getLinePaintHistoryCount()
- Specified by:
getLinePaintHistoryCountin classShadowCanvas
-
getOvalPaintHistoryCount
public int getOvalPaintHistoryCount()
- Specified by:
getOvalPaintHistoryCountin classShadowCanvas
-
getDrawnOval
public ShadowCanvas.OvalPaintHistoryEvent getDrawnOval(int i)
- Specified by:
getDrawnOvalin classShadowCanvas
-
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(minSdk=19) 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()
-
-