Package icyllis.arc3d.engine

# Class RenderTargetProxy

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.SurfaceProxy
icyllis.arc3d.engine.RenderTargetProxy

All Implemented Interfaces:
  `RefCounted`

@VisibleForTesting public final class RenderTargetProxy extends SurfaceProxy
Deferred, lazy-callback or wrapped a render target.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.engine.SurfaceProxy

  `SurfaceProxy.LazyCallbackResult, SurfaceProxy.LazyInstantiateCallback`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ImageViewProxy`
  `asImageProxy()`
  `RenderTargetProxy`
  `asRenderTargetProxy()`
  `void`
  `clear()`
  De-instantiate.
  `protected void`
  `deallocate()`
  Override this method to invoke de-allocation of the underlying resource.
  `boolean`
  `doLazyInstantiation(ResourceProvider resourceProvider)`
  `int`
  `getBackingHeight()`
  Returns the physical height of the backing surface.
  `UniqueID`
  `getBackingUniqueID()`
  `int`
  `getBackingWidth()`
  Returns the physical width of the backing surface.
  `Image`
  `getGpuImage()`
  If this is a texturable surface and the surface is already instantiated, return its backing `Image`; if not, return null.
  `GpuRenderTarget`
  `getGpuRenderTarget()`
  If this is a renderable surface and the surface is already instantiated, return its backing `GpuRenderTarget`; if not, return null.
  `GpuSurface`
  `getGpuSurface()`
  `Rect2ic`
  `getResolveRect()`
  `int`
  `getSampleCount()`
  Returns the number of samples per pixel in color buffers (one if non-MSAA).
  `boolean`
  `instantiate(ResourceProvider resourceProvider)`
  Instantiates the backing store, if necessary.
  `boolean`
  `isBackingWrapped()`
  Returns whether the backing store references the wrapped object.
  `boolean`
  `isInstantiated()`
  Returns true if the backing store is instantiated.
  `boolean`
  `isLazy()`
  Returns true if the surface has a lazy callback and not instantiated.
  `boolean`
  `needsResolve()`
  `void`
  `setResolveRect(int left, int top, int right, int bottom)`
  `boolean`
  `shouldSkipAllocator()`
  Proxies that are already instantiated and whose backing texture cannot be recycled to instantiate other proxies do not need to be considered by `SurfaceAllocator`.

  ### Methods inherited from class icyllis.arc3d.engine.SurfaceProxy

  `equals, getBackendFormat, getHeight, getMemorySize, getTaskTargetCount, getUniqueID, getUniqueKey, getWidth, hashCode, isBudgeted, isDeferredListTarget, isExact, isLazyMost, isManualMSAAResolve, isProtected, isReadOnly, isUsedAsTaskTarget, isUserExact, setIsDeferredListTarget, wrapsGLDefaultFB, wrapsVkSecondaryCB`

  ### 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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### deallocate

    protected void deallocate()
    Description copied from class: `RefCnt`
    Override this method to invoke de-allocation of the underlying resource.
    Specified by:
      `deallocate` in class `RefCnt`

  - ### isLazy

    public boolean isLazy()
    Description copied from class: `SurfaceProxy`
    Returns true if the surface has a lazy callback and not instantiated.
    Specified by:
      `isLazy` in class `SurfaceProxy`

  - ### getBackingWidth

    public int getBackingWidth()
    Description copied from class: `SurfaceProxy`
    Returns the physical width of the backing surface. The result is undefined if `SurfaceProxy.isLazyMost()` returns true.
    Specified by:
      `getBackingWidth` in class `SurfaceProxy`
    Returns:
      the width of the backing store

  - ### getBackingHeight

    public int getBackingHeight()
    Description copied from class: `SurfaceProxy`
    Returns the physical height of the backing surface. The result is undefined if `SurfaceProxy.isLazyMost()` returns true.
    Specified by:
      `getBackingHeight` in class `SurfaceProxy`
    Returns:
      the height of the backing store

  - ### getSampleCount

    public int getSampleCount()
    Description copied from class: `SurfaceProxy`
    Returns the number of samples per pixel in color buffers (one if non-MSAA). If this surface it non-renderable, this method always returns one.
    Specified by:
      `getSampleCount` in class `SurfaceProxy`
    Returns:
      the number of samples, greater than (multisample) or equal to one

  - ### setResolveRect

    public void setResolveRect(int left, int top, int right, int bottom)

  - ### needsResolve

    public boolean needsResolve()

  - ### getResolveRect

    public Rect2ic getResolveRect()

  - ### getBackingUniqueID

    public UniqueID getBackingUniqueID()
    Specified by:
      `getBackingUniqueID` in class `SurfaceProxy`

  - ### isInstantiated

    public boolean isInstantiated()
    Description copied from class: `SurfaceProxy`
    Returns true if the backing store is instantiated.
    Specified by:
      `isInstantiated` in class `SurfaceProxy`

  - ### instantiate

    public boolean instantiate(ResourceProvider resourceProvider)
    Description copied from class: `SurfaceProxy`
    Instantiates the backing store, if necessary.
    Specified by:
      `instantiate` in class `SurfaceProxy`
    Parameters:
      `resourceProvider` - the resource provider to create textures
    Returns:
      success or not

  - ### clear

    public void clear()
    Description copied from class: `SurfaceProxy`
    De-instantiate. Called after instantiated.
    Specified by:
      `clear` in class `SurfaceProxy`

  - ### shouldSkipAllocator

    public boolean shouldSkipAllocator()
    Description copied from class: `SurfaceProxy`
    Proxies that are already instantiated and whose backing texture cannot be recycled to instantiate other proxies do not need to be considered by `SurfaceAllocator`.
    Specified by:
      `shouldSkipAllocator` in class `SurfaceProxy`

  - ### isBackingWrapped

    public boolean isBackingWrapped()
    Description copied from class: `SurfaceProxy`
    Returns whether the backing store references the wrapped object. Always false if not instantiated.
    Specified by:
      `isBackingWrapped` in class `SurfaceProxy`

  - ### getGpuSurface

    @Nullable public GpuSurface getGpuSurface()
    Specified by:
      `getGpuSurface` in class `SurfaceProxy`

  - ### getGpuImage

    @Nullable public Image getGpuImage()
    Description copied from class: `SurfaceProxy`
    If this is a texturable surface and the surface is already instantiated, return its backing `Image`; if not, return null.
    Overrides:
      `getGpuImage` in class `SurfaceProxy`

  - ### getGpuRenderTarget

    @Nullable public GpuRenderTarget getGpuRenderTarget()
    Description copied from class: `SurfaceProxy`
    If this is a renderable surface and the surface is already instantiated, return its backing `GpuRenderTarget`; if not, return null.
    Overrides:
      `getGpuRenderTarget` in class `SurfaceProxy`

  - ### asImageProxy

    public ImageViewProxy asImageProxy()
    Overrides:
      `asImageProxy` in class `SurfaceProxy`
    Returns:
      the texture proxy associated with the surface proxy, may be NULL.

  - ### asRenderTargetProxy

    public RenderTargetProxy asRenderTargetProxy()
    Overrides:
      `asRenderTargetProxy` in class `SurfaceProxy`
    Returns:
      the render target proxy associated with the surface proxy, may be NULL.

  - ### doLazyInstantiation

    public boolean doLazyInstantiation(ResourceProvider resourceProvider)
    Specified by:
      `doLazyInstantiation` in class `SurfaceProxy`