Package org.robolectric.nativeruntime
Class HardwareRendererNatives
java.lang.Object
org.robolectric.nativeruntime.HardwareRendererNatives
Native methods for
HardwareRenderer JNI registration.
Native method signatures are derived from https://cs.android.com/android/platform/superproject/+/android-12.0.0_r1:frameworks/base/graphics/java/android/graphics/HardwareRenderer.java
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic booleanstatic voidnAddObserver(long nativeProxy, long nativeObserver) static voidnAddRenderNode(long nativeProxy, long rootRenderNode, boolean placeFront) static voidnAllocateBuffers(long nativeProxy) static voidnBuildLayer(long nativeProxy, long node) static voidnCancelLayerUpdate(long nativeProxy, long layer) static booleannCopyLayerInto(long nativeProxy, long layer, long bitmapHandle) static intnCopySurfaceInto(Surface surface, int srcLeft, int srcTop, int srcRight, int srcBottom, long bitmapHandle) static BitmapnCreateHardwareBitmap(long renderNode, int width, int height) static longnCreateProxy(boolean translucent, long rootRenderNode) static longstatic longnCreateTextureLayer(long nativeProxy) static voidnDeleteProxy(long nativeProxy) static voidnDestroy(long nativeProxy, long rootRenderNode) static voidnDestroyHardwareResources(long nativeProxy) static voidnDetachSurfaceTexture(long nativeProxy, long layer) static voidnDrawRenderNode(long nativeProxy, long rootRenderNode) static voidnDumpProfileInfo(long nativeProxy, FileDescriptor fd, int dumpFlags) static voidnFence(long nativeProxy) static intnGetRenderThreadTid(long nativeProxy) static voidnHackySetRTAnimationsEnabled(boolean enabled) static voidnInitDisplayInfo(int width, int height, float refreshRate, int wideColorDataspace, long appVsyncOffsetNanos, long presentationDeadlineNanos) static booleannLoadSystemProperties(long nativeProxy) static voidnNotifyFramePending(long nativeProxy) static voidnOverrideProperty(String name, String value) static booleannPause(long nativeProxy) static voidnPushLayerUpdate(long nativeProxy, long layer) static voidnRegisterAnimatingRenderNode(long rootRenderNode, long animatingNode) static voidnRegisterVectorDrawableAnimator(long rootRenderNode, long animator) static voidnRemoveObserver(long nativeProxy, long nativeObserver) static voidnRemoveRenderNode(long nativeProxy, long rootRenderNode) static voidstatic voidnSetASurfaceTransactionCallback(long nativeProxy, HardwareRenderer.ASurfaceTransactionCallback callback) static voidnSetColorMode(long nativeProxy, int colorMode) static voidnSetContentDrawBounds(long nativeProxy, int left, int top, int right, int bottom) static voidnSetContextPriority(int priority) static voidnSetDebuggingEnabled(boolean enabled) static voidnSetDisplayDensityDpi(int densityDpi) static voidnSetForceDark(long nativeProxy, boolean enabled) static voidnSetFrameCallback(long nativeProxy, HardwareRenderer.FrameDrawingCallback callback) static voidnSetFrameCompleteCallback(long nativeProxy, HardwareRenderer.FrameCompleteCallback callback) static voidnSetHighContrastText(boolean enabled) static voidnSetIsHighEndGfx(boolean isHighEndGfx) static voidnSetIsolatedProcess(boolean enabled) static voidnSetLightAlpha(long nativeProxy, float ambientShadowAlpha, float spotShadowAlpha) static voidnSetLightGeometry(long nativeProxy, float lightX, float lightY, float lightZ, float lightRadius) static voidstatic voidnSetOpaque(long nativeProxy, boolean opaque) static voidnSetPictureCaptureCallback(long nativeProxy, HardwareRenderer.PictureCapturedCallback callback) static voidnSetPrepareSurfaceControlForWebviewCallback(long nativeProxy, HardwareRenderer.PrepareSurfaceControlForWebviewCallback callback) static voidnSetProcessStatsBuffer(int fd) static voidnSetSdrWhitePoint(long nativeProxy, float whitePoint) static voidnSetStopped(long nativeProxy, boolean stopped) static voidnSetSurface(long nativeProxy, Surface window, boolean discardBuffer) static voidnSetSurfaceControl(long nativeProxy, long nativeSurfaceControl) static voidnSetSurfacePtr(long nativeProxy, long surfacePtr) static voidnStopDrawing(long nativeProxy) static intnSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size) static voidnTrimMemory(int level) static voidpreload()static voidsetupShadersDiskCache(String cacheFile, String skiaCacheFile)
-
Method Details
-
disableVsync
public static void disableVsync() -
preload
public static void preload() -
isWebViewOverlaysEnabled
public static boolean isWebViewOverlaysEnabled() -
setupShadersDiskCache
-
nRotateProcessStatsBuffer
public static void nRotateProcessStatsBuffer() -
nSetProcessStatsBuffer
public static void nSetProcessStatsBuffer(int fd) -
nGetRenderThreadTid
public static int nGetRenderThreadTid(long nativeProxy) -
nCreateRootRenderNode
public static long nCreateRootRenderNode() -
nCreateProxy
public static long nCreateProxy(boolean translucent, long rootRenderNode) -
nDeleteProxy
public static void nDeleteProxy(long nativeProxy) -
nLoadSystemProperties
public static boolean nLoadSystemProperties(long nativeProxy) -
nSetName
-
nSetSurface
-
nSetSurfacePtr
public static void nSetSurfacePtr(long nativeProxy, long surfacePtr) -
nSetSurfaceControl
public static void nSetSurfaceControl(long nativeProxy, long nativeSurfaceControl) -
nPause
public static boolean nPause(long nativeProxy) -
nSetStopped
public static void nSetStopped(long nativeProxy, boolean stopped) -
nSetLightGeometry
public static void nSetLightGeometry(long nativeProxy, float lightX, float lightY, float lightZ, float lightRadius) -
nSetLightAlpha
public static void nSetLightAlpha(long nativeProxy, float ambientShadowAlpha, float spotShadowAlpha) -
nSetOpaque
public static void nSetOpaque(long nativeProxy, boolean opaque) -
nSetColorMode
public static void nSetColorMode(long nativeProxy, int colorMode) -
nSetSdrWhitePoint
public static void nSetSdrWhitePoint(long nativeProxy, float whitePoint) -
nSetIsHighEndGfx
public static void nSetIsHighEndGfx(boolean isHighEndGfx) -
nSyncAndDrawFrame
public static int nSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size) -
nDestroy
public static void nDestroy(long nativeProxy, long rootRenderNode) -
nRegisterAnimatingRenderNode
public static void nRegisterAnimatingRenderNode(long rootRenderNode, long animatingNode) -
nRegisterVectorDrawableAnimator
public static void nRegisterVectorDrawableAnimator(long rootRenderNode, long animator) -
nCreateTextureLayer
public static long nCreateTextureLayer(long nativeProxy) -
nBuildLayer
public static void nBuildLayer(long nativeProxy, long node) -
nCopyLayerInto
public static boolean nCopyLayerInto(long nativeProxy, long layer, long bitmapHandle) -
nPushLayerUpdate
public static void nPushLayerUpdate(long nativeProxy, long layer) -
nCancelLayerUpdate
public static void nCancelLayerUpdate(long nativeProxy, long layer) -
nDetachSurfaceTexture
public static void nDetachSurfaceTexture(long nativeProxy, long layer) -
nDestroyHardwareResources
public static void nDestroyHardwareResources(long nativeProxy) -
nTrimMemory
public static void nTrimMemory(int level) -
nOverrideProperty
-
nFence
public static void nFence(long nativeProxy) -
nStopDrawing
public static void nStopDrawing(long nativeProxy) -
nNotifyFramePending
public static void nNotifyFramePending(long nativeProxy) -
nDumpProfileInfo
-
nAddRenderNode
public static void nAddRenderNode(long nativeProxy, long rootRenderNode, boolean placeFront) -
nRemoveRenderNode
public static void nRemoveRenderNode(long nativeProxy, long rootRenderNode) -
nDrawRenderNode
public static void nDrawRenderNode(long nativeProxy, long rootRenderNode) -
nSetContentDrawBounds
public static void nSetContentDrawBounds(long nativeProxy, int left, int top, int right, int bottom) -
nSetPictureCaptureCallback
public static void nSetPictureCaptureCallback(long nativeProxy, HardwareRenderer.PictureCapturedCallback callback) -
nSetASurfaceTransactionCallback
public static void nSetASurfaceTransactionCallback(long nativeProxy, HardwareRenderer.ASurfaceTransactionCallback callback) -
nSetPrepareSurfaceControlForWebviewCallback
public static void nSetPrepareSurfaceControlForWebviewCallback(long nativeProxy, HardwareRenderer.PrepareSurfaceControlForWebviewCallback callback) -
nSetFrameCallback
public static void nSetFrameCallback(long nativeProxy, HardwareRenderer.FrameDrawingCallback callback) -
nSetFrameCompleteCallback
public static void nSetFrameCompleteCallback(long nativeProxy, HardwareRenderer.FrameCompleteCallback callback) -
nAddObserver
public static void nAddObserver(long nativeProxy, long nativeObserver) -
nRemoveObserver
public static void nRemoveObserver(long nativeProxy, long nativeObserver) -
nCopySurfaceInto
public static int nCopySurfaceInto(Surface surface, int srcLeft, int srcTop, int srcRight, int srcBottom, long bitmapHandle) -
nCreateHardwareBitmap
-
nSetHighContrastText
public static void nSetHighContrastText(boolean enabled) -
nHackySetRTAnimationsEnabled
public static void nHackySetRTAnimationsEnabled(boolean enabled) -
nSetDebuggingEnabled
public static void nSetDebuggingEnabled(boolean enabled) -
nSetIsolatedProcess
public static void nSetIsolatedProcess(boolean enabled) -
nSetContextPriority
public static void nSetContextPriority(int priority) -
nAllocateBuffers
public static void nAllocateBuffers(long nativeProxy) -
nSetForceDark
public static void nSetForceDark(long nativeProxy, boolean enabled) -
nSetDisplayDensityDpi
public static void nSetDisplayDensityDpi(int densityDpi) -
nInitDisplayInfo
public static void nInitDisplayInfo(int width, int height, float refreshRate, int wideColorDataspace, long appVsyncOffsetNanos, long presentationDeadlineNanos)
-