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.Picker
Nested 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 boolean
nClipPath(long nativeCanvas, long nativePath, int regionOp)
protected static boolean
nClipRect(long nativeCanvas, float left, float top, float right, float bottom, int regionOp)
protected static void
nConcat(long nativeCanvas, long nativeMatrix)
protected static void
nFreeCaches()
protected static void
nFreeTextLayoutCaches()
protected static boolean
nGetClipBounds(long nativeCanvas, Rect bounds)
protected static int
nGetHeight(long canvasHandle)
protected static void
nGetMatrix(long nativeCanvas, long nativeMatrix)
protected static long
nGetNativeFinalizer()
protected static int
nGetSaveCount(long canvasHandle)
protected static int
nGetWidth(long canvasHandle)
protected static long
nInitRaster(long bitmapHandle)
protected static long
nInitRaster(Bitmap bitmap)
protected static boolean
nIsOpaque(long canvasHandle)
protected static boolean
nQuickReject(long nativeCanvas, float left, float top, float right, float bottom)
protected static boolean
nQuickReject(long nativeCanvas, long nativePath)
protected static boolean
nRestore(long canvasHandle)
protected static void
nRestoreToCount(long canvasHandle, int saveCount)
protected static void
nRestoreUnclippedLayer(long nativeCanvas, int saveCount, long nativePaint)
protected static void
nRotate(long canvasHandle, float degrees)
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 static int
nSaveUnclippedLayer(long nativeCanvas, int l, int t, int r, int b)
protected static void
nScale(long canvasHandle, float sx, float sy)
protected static void
nSetBitmap(long canvasHandle, long bitmapHandle)
protected static void
nSetBitmap(long canvasHandle, Bitmap bitmap)
protected static void
nSetCompatibilityVersion(int apiLevel)
protected static void
nSetDrawFilter(long nativeCanvas, long nativeFilter)
protected static void
nSetMatrix(long nativeCanvas, long nativeMatrix)
protected static void
nSkew(long canvasHandle, float sx, float sy)
protected static void
nTranslate(long canvasHandle, float dx, float dy)
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)
.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.
-