Package icyllis.arc3d.engine
Class RecordingContext
java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.Context
icyllis.arc3d.engine.RecordingContext
- All Implemented Interfaces:
RefCounted
This class is a public API, except where noted.
-
Field Summary
Fields inherited from class icyllis.arc3d.engine.Context
mDevice, mOwnerThread, mResourceProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTask
(@SharedPtr Task task) void
protected void
Override this method to invoke de-allocation of the underlying resource.protected void
discard()
void
void
Frees GPU resources created and held by the Context.final DrawBufferManager
final RenderTaskManager
final ImageProxyCache
boolean
init
(RecordingContextOptions options) boolean
Reports whether theImmediateContext
associated with thisRecordingContext
is discarded.final boolean
isImageCompatible
(int colorType) Can aImage
be created with the given color type.final boolean
isSurfaceCompatible
(int colorType) Can aSurface
be created with the given color type.void
performDeferredCleanup
(long msNotUsed) Purge GPU resources on the Context that haven't been used in the past 'msNotUsed' milliseconds or are otherwise marked for deletion, regardless of whether the context is under budget.snap()
void
trackDevice
(@SharedPtr GraniteDevice device) void
untrackDevice
(@RawPtr GraniteDevice device) Methods inherited from class icyllis.arc3d.engine.Context
checkOwnerThread, getBackend, getCaps, getCompressedBackendFormat, getContextID, getCurrentBudgetedBytes, getCurrentPurgeableBytes, getDefaultBackendFormat, getDevice, getLogger, getMaxBudgetedBytes, getMaxRenderTargetSize, getMaxSurfaceSampleCount, getMaxTextureSize, getOptions, getOwnerThread, getRendererProvider, getResourceProvider, getSharedResourceCache, init, isDeviceLost, isImmediate, isOwnerThread, matches
-
Constructor Details
-
RecordingContext
-
-
Method Details
-
freeGpuResources
public void freeGpuResources()Description copied from class:Context
Frees GPU resources created and held by the Context. Can be called to reduce GPU memory pressure. Any resources that are still in use (e.g. being used by work submitted to the GPU) will not be deleted by this call. If the caller wants to make sure all resources are freed, then they should first make sure to submit and wait on any outstanding work.- Specified by:
freeGpuResources
in classContext
-
performDeferredCleanup
public void performDeferredCleanup(long msNotUsed) Description copied from class:Context
Purge GPU resources on the Context that haven't been used in the past 'msNotUsed' milliseconds or are otherwise marked for deletion, regardless of whether the context is under budget.- Specified by:
performDeferredCleanup
in classContext
-
clearStrikeCache
public void clearStrikeCache() -
isDiscarded
public boolean isDiscarded()Reports whether theImmediateContext
associated with thisRecordingContext
is discarded. When called on aImmediateContext
it may actively check whether the underlying 3D API device/context has been disconnected before reporting the status. If so, calling this method will transition theImmediateContext
to the discarded state. -
isImageCompatible
public final boolean isImageCompatible(int colorType) Can aImage
be created with the given color type.- Parameters:
colorType
- seeColorInfo
-
isSurfaceCompatible
public final boolean isSurfaceCompatible(int colorType) Can aSurface
be created with the given color type. To check whether MSAA is supported useContext.getMaxSurfaceSampleCount(int)
.- Parameters:
colorType
- seeColorInfo
-
getSurfaceProvider
-
getRenderTaskManager
-
getDynamicBufferManager
-
getUploadBufferManager
-
getAtlasProvider
-
getAtlasTokenTracker
-
getGlyphStrikeCache
-
getTextBlobCache
-
trackDevice
-
untrackDevice
-
addTask
-
snap
-
flushTrackedDevices
@Internal public void flushTrackedDevices() -
init
-
discard
protected void discard() -
deallocate
protected void deallocate()Description copied from class:RefCnt
Override this method to invoke de-allocation of the underlying resource.- Overrides:
deallocate
in classContext
-