Package icyllis.arc3d.engine

# Class ImageProxyCache

java.lang.Object
icyllis.arc3d.engine.ImageProxyCache

public final class ImageProxyCache extends Object
A factory for creating `SurfaceProxy`-derived objects. This class may be used on the creating thread of `RecordingContext`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `adoptUniqueKeyFromSurface(ImageViewProxy proxy, GpuSurface texture)`
  Sets the unique key of the provided texture to the unique key of the GPU texture.
  `boolean`
  `assignUniqueKeyToProxy(IUniqueKey key, ImageViewProxy proxy)`
  Assigns a unique key to a texture.
  `@SharedPtr ImageViewProxy`
  `createLazyTexture(BackendFormat format, int width, int height, int surfaceFlags, SurfaceProxy.LazyInstantiateCallback callback)`
  Deprecated.
  `@SharedPtr RenderTargetProxy`
  `createRenderTexture(BackendFormat format, int width, int height, int sampleCount, int surfaceFlags)`
  Deprecated.
  `@SharedPtr ImageViewProxy`
  `createTexture(BackendFormat format, int width, int height, int surfaceFlags)`
  Deprecated.
  `@SharedPtr ImageViewProxy`
  `createTextureFromPixels(Pixmap pixmap, @RawPtr Pixels pixels, int dstColorType, int surfaceFlags)`
  Deprecated.
  `void`
  `dropUniqueRefs()`
  `void`
  `dropUniqueRefsOlderThan(long nanoTime)`
  `boolean`
  `isDeferredProvider()`
  `void`
  `processInvalidUniqueKey(Object key, ImageViewProxy proxy, boolean invalidateResource)`
  `@SharedPtr RenderTargetProxy`
  `wrapBackendRenderTarget(BackendRenderTarget backendRenderTarget, Runnable rcReleaseCB)`
  Deprecated.
  `@SharedPtr RenderTargetProxy`
  `wrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership, boolean cacheable, Runnable releaseCallback)`
  Deprecated.

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

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

- ## Method Details

  - ### assignUniqueKeyToProxy

    public boolean assignUniqueKeyToProxy(IUniqueKey key, ImageViewProxy proxy)
    Assigns a unique key to a texture. The texture will be findable via this key using
    invalid reference

        #findProxyByUniqueKey()

    . It is an error if an existing texture already has a key.

  - ### dropUniqueRefs

    public void dropUniqueRefs()

  - ### dropUniqueRefsOlderThan

    public void dropUniqueRefsOlderThan(long nanoTime)

  - ### adoptUniqueKeyFromSurface

    public void adoptUniqueKeyFromSurface(ImageViewProxy proxy, GpuSurface texture)
    Sets the unique key of the provided texture to the unique key of the GPU texture. The GPU texture must have a valid unique key.

  - ### processInvalidUniqueKey

    public void processInvalidUniqueKey(Object key, ImageViewProxy proxy, boolean invalidateResource)

  - ### createTexture

    @Deprecated @Nullable @SharedPtr public @SharedPtr ImageViewProxy createTexture(BackendFormat format, int width, int height, int surfaceFlags)
    Deprecated.
    Create a lazy `ImageViewProxy` without any data.
    See Also:
      - `ImageViewProxy`
      - `ISurface.FLAG_BUDGETED`
      - `ISurface.FLAG_APPROX_FIT`
      - `ISurface.FLAG_MIPMAPPED`
      - `ISurface.FLAG_PROTECTED`
      - `ISurface.FLAG_SKIP_ALLOCATOR`

  - ### createTextureFromPixels

    @Deprecated @Nullable @SharedPtr public @SharedPtr ImageViewProxy createTextureFromPixels(@Nonnull Pixmap pixmap, @Nonnull @RawPtr @RawPtr Pixels pixels, int dstColorType, int surfaceFlags)
    Deprecated.
    Creates a lazy `ImageViewProxy` for the pixel map.
    Parameters:
      `pixmap` - pixel map
      `pixels` - raw ptr to pixel ref, must be immutable
      `dstColorType` - a color type for surface usage, see `ImageDesc`
      `surfaceFlags` - flags described as follows
    See Also:
      - `ISurface.FLAG_BUDGETED`
      - `ISurface.FLAG_APPROX_FIT`
      - `ISurface.FLAG_MIPMAPPED`

  - ### createRenderTexture

    @Deprecated @Nullable @SharedPtr public @SharedPtr RenderTargetProxy createRenderTexture(BackendFormat format, int width, int height, int sampleCount, int surfaceFlags)
    Deprecated.
    See Also:
      - `ISurface.FLAG_BUDGETED`
      - `ISurface.FLAG_APPROX_FIT`
      - `ISurface.FLAG_MIPMAPPED`
      - `ISurface.FLAG_PROTECTED`
      - `ISurface.FLAG_SKIP_ALLOCATOR`

  - ### wrapRenderableBackendTexture

    @Deprecated @Nullable @SharedPtr public @SharedPtr RenderTargetProxy wrapRenderableBackendTexture(BackendImage texture, int sampleCount, boolean ownership, boolean cacheable, Runnable releaseCallback)
    Deprecated.
    Create a RenderTarget that wraps a backend texture and is both texturable and renderable.

    The texture must be single sampled and will be used as the color attachment 0 of the non-MSAA render target. If `sampleCount` is > 1, the underlying API uses separate MSAA render buffers then a MSAA render buffer is created that resolves to the texture.

  - ### wrapBackendRenderTarget

    @Deprecated @Nullable @SharedPtr public @SharedPtr RenderTargetProxy wrapBackendRenderTarget(BackendRenderTarget backendRenderTarget, Runnable rcReleaseCB)
    Deprecated.

  - ### createLazyTexture

    @Deprecated @Nullable @SharedPtr public @SharedPtr ImageViewProxy createLazyTexture(BackendFormat format, int width, int height, int surfaceFlags, SurfaceProxy.LazyInstantiateCallback callback)
    Deprecated.
    Creates a texture that will be instantiated by a user-supplied callback during flush. The width and height must either both be greater than 0 or both less than or equal to zero. A non-positive value is a signal that the width height are currently unknown. The texture will not be renderable.
    See Also:
      - `ISurface.FLAG_BUDGETED`
      - `ISurface.FLAG_APPROX_FIT`
      - `ISurface.FLAG_MIPMAPPED`
      - `ISurface.FLAG_PROTECTED`
      - `ISurface.FLAG_READ_ONLY`
      - `ISurface.FLAG_SKIP_ALLOCATOR`

  - ### isDeferredProvider

    public boolean isDeferredProvider()