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`

public final class RecordingContext extends Context
This class is a public API, except where noted.

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.engine.Context

  `mDevice, mOwnerThread, mResourceProvider`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `RecordingContext(Device device)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addTask(@SharedPtr Task task)`
  `void`
  `clearStrikeCache()`
  `protected void`
  `deallocate()`
  Override this method to invoke de-allocation of the underlying resource.
  `protected void`
  `discard()`
  `void`
  `flushTrackedDevices()`
  `void`
  `freeGpuResources()`
  Frees GPU resources created and held by the Context.
  `AtlasProvider`
  `getAtlasProvider()`
  `DrawAtlas.AtlasTokenTracker`
  `getAtlasTokenTracker()`
  `final DrawBufferManager`
  `getDynamicBufferManager()`
  `GlyphStrikeCache`
  `getGlyphStrikeCache()`
  `final RenderTaskManager`
  `getRenderTaskManager()`
  `final ImageProxyCache`
  `getSurfaceProvider()`
  `TextBlobCache`
  `getTextBlobCache()`
  `UploadBufferManager`
  `getUploadBufferManager()`
  `boolean`
  `init(RecordingContextOptions options)`
  `boolean`
  `isDiscarded()`
  Reports whether the `ImmediateContext` associated with this `RecordingContext` is discarded.
  `final boolean`
  `isImageCompatible(int colorType)`
  Can a `Image` be created with the given color type.
  `final boolean`
  `isSurfaceCompatible(int colorType)`
  Can a `Surface` 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.
  `RootTask`
  `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`

  ### Methods inherited from class icyllis.arc3d.core.RefCnt

  `create, create, getRefCnt, getRefCntAcquire, getRefCntVolatile, move, move, ref, unique, unref`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RecordingContext

    protected RecordingContext(Device device)

- ## 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 class `Context`

  - ### 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 class `Context`

  - ### clearStrikeCache

    public void clearStrikeCache()

  - ### isDiscarded

    public boolean isDiscarded()
    Reports whether the `ImmediateContext` associated with this `RecordingContext` is discarded. When called on a `ImmediateContext` 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 the `ImmediateContext` to the discarded state.

  - ### isImageCompatible

    public final boolean isImageCompatible(int colorType)
    Can a `Image` be created with the given color type.
    Parameters:
      `colorType` - see `ColorInfo`

  - ### isSurfaceCompatible

    public final boolean isSurfaceCompatible(int colorType)
    Can a `Surface` be created with the given color type. To check whether MSAA is supported use `Context.getMaxSurfaceSampleCount(int)`.
    Parameters:
      `colorType` - see `ColorInfo`

  - ### getSurfaceProvider

    @Internal public final ImageProxyCache getSurfaceProvider()

  - ### getRenderTaskManager

    @Internal public final RenderTaskManager getRenderTaskManager()

  - ### getDynamicBufferManager

    @Internal public final DrawBufferManager getDynamicBufferManager()

  - ### getUploadBufferManager

    @Internal public UploadBufferManager getUploadBufferManager()

  - ### getAtlasProvider

    @Internal public AtlasProvider getAtlasProvider()

  - ### getAtlasTokenTracker

    @Internal public DrawAtlas.AtlasTokenTracker getAtlasTokenTracker()

  - ### getGlyphStrikeCache

    @Internal public GlyphStrikeCache getGlyphStrikeCache()

  - ### getTextBlobCache

    @Internal public TextBlobCache getTextBlobCache()

  - ### trackDevice

    public void trackDevice(@SharedPtr @SharedPtr GraniteDevice device)

  - ### untrackDevice

    public void untrackDevice(@RawPtr @RawPtr GraniteDevice device)

  - ### addTask

    public void addTask(@SharedPtr @SharedPtr Task task)

  - ### snap

    public RootTask snap()

  - ### flushTrackedDevices

    @Internal public void flushTrackedDevices()

  - ### init

    public boolean init(RecordingContextOptions options)

  - ### 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 class `Context`