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
FieldsModifier and TypeFieldDescriptionprotected org.robolectric.shadows.ShadowLegacyCanvas.CanvasReflectorprotected Canvas -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void__constructor__(Bitmap bitmap) voidprotected voidprotected 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 voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voiddrawRoundRect(RectF rect, float rx, float ry, Paint paint) protected voidprotected voiddrawText(CharSequence text, int start, int end, float x, float y, Paint paint) protected voidprotected voidintintprotected booleangetClipBounds(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 intintintintintintprotected intintprotected intgetWidth()booleanbooleanprotected static longinitRaster(long bitmapHandle) protected static longinitRaster(Bitmap bitmap) protected static intnative_saveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint, 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()voidprotected voidrestore()protected voidrestoreToCount(int saveCount) protected intsave()protected voidscale(float sx, float sy) protected voidscale(float sx, float sy, float px, float py) protected voidvoidsetHeight(int height) voidsetWidth(int width) protected voidtranslate(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:
appendDescriptionin classShadowCanvas
-
getDescription
- Specified by:
getDescriptionin 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:
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
- Specified by:
getDrawnPathPaintin classShadowCanvas
-
getDrawnPath
- Specified by:
getDrawnPathin classShadowCanvas
-
getDrawnCircle
- Specified by:
getDrawnCirclein classShadowCanvas
-
getDrawnArc
- Specified by:
getDrawnArcin classShadowCanvas
-
resetCanvasHistory
public void resetCanvasHistory()- Specified by:
resetCanvasHistoryin classShadowCanvas
-
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
-
getHeight
-
getClipBounds
-
getDrawnTextEvent
- Specified by:
getDrawnTextEventin classShadowCanvas
-
getTextHistoryCount
public int getTextHistoryCount()- Specified by:
getTextHistoryCountin classShadowCanvas
-
getDrawnRect
- Specified by:
getDrawnRectin classShadowCanvas
-
getLastDrawnRect
- Specified by:
getLastDrawnRectin classShadowCanvas
-
getRectPaintHistoryCount
public int getRectPaintHistoryCount()- Specified by:
getRectPaintHistoryCountin classShadowCanvas
-
getDrawnRoundRect
- Specified by:
getDrawnRoundRectin classShadowCanvas
-
getLastDrawnRoundRect
- Specified by:
getLastDrawnRoundRectin classShadowCanvas
-
getRoundRectPaintHistoryCount
public int getRoundRectPaintHistoryCount()- Specified by:
getRoundRectPaintHistoryCountin classShadowCanvas
-
getDrawnLine
- Specified by:
getDrawnLinein classShadowCanvas
-
getLinePaintHistoryCount
public int getLinePaintHistoryCount()- Specified by:
getLinePaintHistoryCountin classShadowCanvas
-
getOvalPaintHistoryCount
public int getOvalPaintHistoryCount()- Specified by:
getOvalPaintHistoryCountin classShadowCanvas
-
getDrawnOval
- Specified by:
getDrawnOvalin 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
-