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
,ShadowNativeRecordingCanvasOP
@Implements(value=android.graphics.Canvas.class,
minSdk=26,
isInAndroidSdk=false,
callNativeMethodsByDefault=true)
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
protected static void
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
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
nSetHighContrastText
(long renderer, boolean highContrastText) 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
Methods inherited from class org.robolectric.shadows.ShadowCanvas
visualize
-
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
@Implementation(minSdk=29, maxSdk=34) protected static void nSetBitmap(long canvasHandle, long bitmapHandle) -
nGetClipBounds
@Implementation(minSdk=26, maxSdk=34) protected static boolean nGetClipBounds(long nativeCanvas, Rect bounds) -
nIsOpaque
-
nGetWidth
-
nGetHeight
-
nSave
-
nSaveLayer
@Implementation(minSdk=31, maxSdk=34) 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, maxSdk=34) 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, maxSdk=34) protected static int nSaveUnclippedLayer(long nativeCanvas, int l, int t, int r, int b) -
nRestoreUnclippedLayer
@Implementation(minSdk=29, maxSdk=34) protected static void nRestoreUnclippedLayer(long nativeCanvas, int saveCount, long nativePaint) -
nRestore
-
nRestoreToCount
@Implementation(minSdk=26, maxSdk=34) protected static void nRestoreToCount(long canvasHandle, int saveCount) -
nGetSaveCount
-
nTranslate
@Implementation(minSdk=26, maxSdk=34) protected static void nTranslate(long canvasHandle, float dx, float dy) -
nScale
@Implementation(minSdk=26, maxSdk=34) protected static void nScale(long canvasHandle, float sx, float sy) -
nRotate
@Implementation(minSdk=26, maxSdk=34) protected static void nRotate(long canvasHandle, float degrees) -
nSkew
@Implementation(minSdk=26, maxSdk=34) protected static void nSkew(long canvasHandle, float sx, float sy) -
nConcat
@Implementation(minSdk=26, maxSdk=34) protected static void nConcat(long nativeCanvas, long nativeMatrix) -
nSetMatrix
@Implementation(minSdk=26, maxSdk=34) protected static void nSetMatrix(long nativeCanvas, long nativeMatrix) -
nClipRect
@Implementation(minSdk=26, maxSdk=34) protected static boolean nClipRect(long nativeCanvas, float left, float top, float right, float bottom, int regionOp) -
nClipPath
@Implementation(minSdk=26, maxSdk=34) protected static boolean nClipPath(long nativeCanvas, long nativePath, int regionOp) -
nSetDrawFilter
@Implementation(minSdk=26, maxSdk=34) protected static void nSetDrawFilter(long nativeCanvas, long nativeFilter) -
nGetMatrix
@Implementation(minSdk=26, maxSdk=34) protected static void nGetMatrix(long nativeCanvas, long nativeMatrix) -
nQuickReject
@Implementation(minSdk=26, maxSdk=34) protected static boolean nQuickReject(long nativeCanvas, long nativePath) -
nQuickReject
@Implementation(minSdk=26, maxSdk=34) protected static boolean nQuickReject(long nativeCanvas, float left, float top, float right, float bottom) -
nSetHighContrastText
@Implementation(minSdk=26, maxSdk=27) protected static void nSetHighContrastText(long renderer, boolean highContrastText) -
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.
-