Package icyllis.arc3d.engine

# Class GpuSurface

java.lang.Object
icyllis.arc3d.engine.Resource
icyllis.arc3d.engine.GpuSurface

All Implemented Interfaces:
  `RefCounted`

Direct Known Subclasses:
  `GpuRenderTarget`

@Deprecated public abstract class GpuSurface extends Resource
Deprecated.
Interface representing GPU surfaces.

There are two implementations: one is `Image`, which contains image data and allocates memory; and the other is `GpuRenderTarget`, which is a container object that represents a combination of `Image`s as attachments, and managed all objects used by the rendering pipeline for the fixed combination of attachments (compatible render passes and framebuffers).

See Also:
  - `SurfaceProxy`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `GpuSurface(Context context, boolean budgeted, boolean wrapped, long memorySize)`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `@RawPtr Image`
  `asImage()`
  Deprecated.
  If this object is image, returns this.
  `@RawPtr GpuRenderTarget`
  `asRenderTarget()`
  Deprecated.
  If this object is RT, returns this.
  `BackendFormat`
  `getBackendFormat()`
  Deprecated.
  Returns the backend format of the surface.
  `abstract int`
  `getDepthBits()`
  Deprecated.
  `abstract int`
  `getHeight()`
  Deprecated.
  `abstract int`
  `getSampleCount()`
  Deprecated.
  Returns the number of samples per pixel in color buffers (one if non-MSAA).
  `abstract int`
  `getStencilBits()`
  Deprecated.
  `abstract int`
  `getSurfaceFlags()`
  Deprecated.
  Surface flags.
  `abstract int`
  `getWidth()`
  Deprecated.
  `abstract boolean`
  `isProtected()`
  Deprecated.

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

  `getContext, getDevice, getKey, getLabel, getMemorySize, getUniqueID, hasAnyRefs, hasCacheRef, hasCommandBufferRef, hasUsageRef, isBudgeted, isDestroyed, isPurgeable, isWrapped, onRelease, onSetLabel, ref, refCommandBuffer, setKey, setLabel, setNonCacheable, unref, unrefCommandBuffer`

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

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

- ## Constructor Details

  - ### GpuSurface

    protected GpuSurface(Context context, boolean budgeted, boolean wrapped, long memorySize)
    Deprecated.

- ## Method Details

  - ### getWidth

    public abstract int getWidth()
    Deprecated.
    Returns:
      the width of the surface in pixels, greater than zero

  - ### getHeight

    public abstract int getHeight()
    Deprecated.
    Returns:
      the height of the surface in pixels, greater than zero

  - ### getBackendFormat

    @Nonnull public BackendFormat getBackendFormat()
    Deprecated.
    Returns the backend format of the surface.

    If this is RT, returns the backend format of color attachment 0.

  - ### getDepthBits

    public abstract int getDepthBits()
    Deprecated.

  - ### getStencilBits

    public abstract int getStencilBits()
    Deprecated.

  - ### getSampleCount

    public abstract int getSampleCount()
    Deprecated.
    Returns the number of samples per pixel in color buffers (one if non-MSAA).
    Returns:
      the number of samples, greater than (multi-sampled) or equal to one

  - ### getSurfaceFlags

    public abstract int getSurfaceFlags()
    Deprecated.
    Surface flags.
    - `ISurface.FLAG_BUDGETED` - Indicates whether an allocation should count against a cache budget. Budgeted when set, otherwise not budgeted.
    - `ISurface.FLAG_MIPMAPPED` - Used to say whether an image has mip levels allocated or not. Mipmaps are allocated when set, otherwise mipmaps are not allocated. `Image` only.
    - `ISurface.FLAG_RENDERABLE` - Used to say whether a surface can be rendered to, whether an image can be used as color attachments. Renderable when set, otherwise not renderable.
    - `ISurface.FLAG_PROTECTED` - Used to say whether image is backed by protected memory. Protected when set, otherwise not protected.
    - `ISurface.FLAG_READ_ONLY` - Means the pixels in the image are read-only. Non-renderable `Image` only.
    Returns:
      combination of the above flags

  - ### isProtected

    public abstract boolean isProtected()
    Deprecated.
    Returns:
      true if we are working with protected content

  - ### asImage

    @RawPtr public @RawPtr Image asImage()
    Deprecated.
    If this object is image, returns this.

    If this object is RT, returns the resolve attachment 0 if available, or returns the color attachment 0 if available, or null.

    Returns:
      raw ptr to the image

  - ### asRenderTarget

    @RawPtr public @RawPtr GpuRenderTarget asRenderTarget()
    Deprecated.
    If this object is RT, returns this.

    If this object is image, returns null.

    Returns:
      raw ptr to this