Package org.robolectric.shadows
Class ShadowNativeCanvas
java.lang.Object
org.robolectric.shadows.ShadowCanvas
org.robolectric.shadows.ShadowNativeBaseCanvas
org.robolectric.shadows.ShadowNativeCanvas
- Direct Known Subclasses:
ShadowNativeBaseRecordingCanvas
@Implements(value=android.graphics.Canvas.class, minSdk=26, isInAndroidSdk=false) public class ShadowNativeCanvas extends ShadowNativeBaseCanvas
Shadow for
Canvas that is backed by native code-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowNativeBaseCanvas
ShadowNativeBaseCanvas.PickerNested classes/interfaces inherited from class org.robolectric.shadows.ShadowCanvas
ShadowCanvas.ArcPaintHistoryEvent, ShadowCanvas.CirclePaintHistoryEvent, ShadowCanvas.LinePaintHistoryEvent, ShadowCanvas.OvalPaintHistoryEvent, ShadowCanvas.RectPaintHistoryEvent, ShadowCanvas.RoundRectPaintHistoryEvent, ShadowCanvas.TextHistoryEvent -
Constructor Summary
Constructors Constructor Description ShadowNativeCanvas() -
Method Summary
Modifier and Type Method Description protected static booleannClipPath(long nativeCanvas, long nativePath, int regionOp)protected static booleannClipRect(long nativeCanvas, float left, float top, float right, float bottom, int regionOp)protected static voidnConcat(long nativeCanvas, long nativeMatrix)protected static voidnFreeCaches()protected static voidnFreeTextLayoutCaches()protected static booleannGetClipBounds(long nativeCanvas, Rect bounds)protected static intnGetHeight(long canvasHandle)protected static voidnGetMatrix(long nativeCanvas, long nativeMatrix)protected static longnGetNativeFinalizer()protected static intnGetSaveCount(long canvasHandle)protected static intnGetWidth(long canvasHandle)protected static longnInitRaster(long bitmapHandle)protected static longnInitRaster(Bitmap bitmap)protected static booleannIsOpaque(long canvasHandle)protected static booleannQuickReject(long nativeCanvas, float left, float top, float right, float bottom)protected static booleannQuickReject(long nativeCanvas, long nativePath)protected static booleannRestore(long canvasHandle)protected static voidnRestoreToCount(long canvasHandle, int saveCount)protected static voidnRestoreUnclippedLayer(long nativeCanvas, int saveCount, long nativePaint)protected static voidnRotate(long canvasHandle, float degrees)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 static intnSaveUnclippedLayer(long nativeCanvas, int l, int t, int r, int b)protected static voidnScale(long canvasHandle, float sx, float sy)protected static voidnSetBitmap(long canvasHandle, long bitmapHandle)protected static voidnSetBitmap(long canvasHandle, Bitmap bitmap)protected static voidnSetCompatibilityVersion(int apiLevel)protected static voidnSetDrawFilter(long nativeCanvas, long nativeFilter)protected static voidnSetMatrix(long nativeCanvas, long nativeMatrix)protected static voidnSkew(long canvasHandle, float sx, float sy)protected static voidnTranslate(long canvasHandle, float dx, float dy)protected intsaveUnclippedLayer(int left, int top, int right, int bottom)In Android P and below, Canvas.saveUnclippedLayer callednSaveLayer(long, float, float, float, float, long).Methods inherited from class org.robolectric.shadows.ShadowNativeBaseCanvas
appendDescription, getArcPaintHistoryCount, getCirclePaintHistoryCount, getDescription, getDrawnArc, getDrawnCircle, getDrawnLine, getDrawnOval, getDrawnPaint, getDrawnPath, getDrawnPathPaint, getDrawnRect, getDrawnRoundRect, getDrawnTextEvent, getLastDrawnRect, getLastDrawnRoundRect, getLinePaintHistoryCount, getOvalPaintHistoryCount, getPathPaintHistoryCount, getRectPaintHistoryCount, getRoundRectPaintHistoryCount, getTextHistoryCount, hasDrawnCircle, hasDrawnPath, nDrawArc, nDrawBitmap, nDrawBitmap, nDrawBitmap, nDrawBitmap, nDrawBitmap, nDrawBitmapMatrix, nDrawBitmapMatrix, nDrawBitmapMesh, nDrawBitmapMesh, nDrawCircle, nDrawColor, nDrawColor, nDrawDoubleRoundRect, nDrawDoubleRoundRect, nDrawGlyphs, nDrawLine, nDrawLines, nDrawNinePatch, nDrawOval, nDrawPaint, nDrawPath, nDrawPoint, nDrawPoints, nDrawRect, nDrawRegion, nDrawRoundRect, nDrawText, nDrawText, nDrawText, nDrawText, nDrawTextOnPath, nDrawTextOnPath, nDrawTextOnPath, nDrawTextOnPath, nDrawTextRun, nDrawTextRun, nDrawTextRun, nDrawVertices, nPunchHole, nPunchHole, resetCanvasHistory, setHeight, setWidth
-
Constructor Details
-
ShadowNativeCanvas
public ShadowNativeCanvas()
-
-
Method Details
-
nFreeCaches
-
nFreeTextLayoutCaches
-
nGetNativeFinalizer
-
nSetCompatibilityVersion
-
nInitRaster
-
nInitRaster
-
nSetBitmap
@Implementation(minSdk=26, maxSdk=28) protected static void nSetBitmap(long canvasHandle, Bitmap bitmap) -
nSetBitmap
-
nGetClipBounds
-
nIsOpaque
-
nGetWidth
-
nGetHeight
-
nSave
-
nSaveLayer
@Implementation(minSdk=31) protected static int nSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint) -
nSaveLayer
@Implementation(minSdk=26, maxSdk=30) protected static int nSaveLayer(long nativeCanvas, float l, float t, float r, float b, long nativePaint, int layerFlags) -
nSaveLayerAlpha
@Implementation(minSdk=31) protected static int nSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha) -
nSaveLayerAlpha
@Implementation(minSdk=26, maxSdk=30) protected static int nSaveLayerAlpha(long nativeCanvas, float l, float t, float r, float b, int alpha, int layerFlags) -
nSaveUnclippedLayer
@Implementation(minSdk=29) protected static int nSaveUnclippedLayer(long nativeCanvas, int l, int t, int r, int b) -
nRestoreUnclippedLayer
@Implementation(minSdk=29) protected static void nRestoreUnclippedLayer(long nativeCanvas, int saveCount, long nativePaint) -
nRestore
-
nRestoreToCount
-
nGetSaveCount
-
nTranslate
-
nScale
-
nRotate
-
nSkew
-
nConcat
-
nSetMatrix
-
nClipRect
@Implementation(minSdk=26) protected static boolean nClipRect(long nativeCanvas, float left, float top, float right, float bottom, int regionOp) -
nClipPath
@Implementation(minSdk=26) protected static boolean nClipPath(long nativeCanvas, long nativePath, int regionOp) -
nSetDrawFilter
@Implementation(minSdk=26) protected static void nSetDrawFilter(long nativeCanvas, long nativeFilter) -
nGetMatrix
-
nQuickReject
@Implementation(minSdk=26) protected static boolean nQuickReject(long nativeCanvas, long nativePath) -
nQuickReject
@Implementation(minSdk=26) protected static boolean nQuickReject(long nativeCanvas, float left, float top, float right, float bottom) -
saveUnclippedLayer
@Implementation(minSdk=28, maxSdk=28) protected int saveUnclippedLayer(int left, int top, int right, int bottom)In Android P and below, Canvas.saveUnclippedLayer callednSaveLayer(long, float, float, float, float, long).However, in Android Q, a new native method was added specifically to save unclipped layers. Use this new method to fix things like ScrollView fade effects in P and below.
-