Interface ISurface


public interface ISurface
Defines Surface-hierarchy constants. Do NOT directly this class as type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates whether a backing store needs to be an exact match or can be larger than is strictly necessary.
    static final int
    Indicates whether an allocation should count against a cache budget.
    static final int
    For ImageViewProxy created in a deferred list recording thread it is possible for the unique key to be cleared on the backing Image while the unique key remains on the proxy.
    static final int
    Used to create memoryless images, especially for MSAA attachments.
    static final int
    Used to say whether an image has or should have mip levels allocated or not.
    static final int
    Surface flags shared between the Surface invalid input: '&' SurfaceProxy class hierarchies.
    static final int
    Used to say whether image is backed by protected memory.
    static final int
    Means the pixels in the image are read-only.
    static final int
    Used to say whether a surface can be rendered to, whether an image can be used as color or depth/stencil attachments.
    static final int
    Used to say whether an image can be a sampled image (i.e.
    static final int
    When set, the proxy will be instantiated outside the allocator (e.g.
    static final int
    Used to say whether an image can be a storage image.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static int
    getApproxSize(int size)
    Map size to a larger multiple of 2.
  • Field Details

    • FLAG_NONE

      static final int FLAG_NONE
      Surface flags shared between the Surface invalid input: '&' SurfaceProxy class hierarchies. These flags can be used to create a surface or represent the state of the created surface. An arbitrary combination of flags may result in unexpected behaviors.
      See Also:
    • FLAG_BUDGETED

      static final int FLAG_BUDGETED
      Indicates whether an allocation should count against a cache budget. Budgeted when set, otherwise not budgeted. This can be used for SurfaceProxy and GpuSurface at creation-time. Since a single budgeted GPU surface can be used by multiple SurfaceProxy at different times, its budgeted state may alter (SurfaceProxy can make a budgeted GPU surface become un-budgeted).
      See Also:
    • FLAG_APPROX_FIT

      static final int FLAG_APPROX_FIT
      Indicates whether a backing store needs to be an exact match or can be larger than is strictly necessary. Approx fit when set, otherwise exact fit. This is a SurfaceProxy flag and a GpuSurface at creation-time flag.
      See Also:
    • FLAG_MIPMAPPED

      static final int FLAG_MIPMAPPED
      Used to say whether an image has or should have mip levels allocated or not. Mipmaps are allocated when set, otherwise mipmaps are not allocated.
      See Also:
    • FLAG_SAMPLED_IMAGE

      static final int FLAG_SAMPLED_IMAGE
      Used to say whether an image can be a sampled image (i.e. a texture). This is not compatible with FLAG_MEMORYLESS.

      A valid SurfaceFlags should have at least one of FLAG_SAMPLED_IMAGE, FLAG_STORAGE_IMAGE and FLAG_RENDERABLE set.

      See Also:
    • FLAG_STORAGE_IMAGE

      static final int FLAG_STORAGE_IMAGE
      Used to say whether an image can be a storage image. This is not compatible with FLAG_MEMORYLESS.
      See Also:
    • FLAG_RENDERABLE

      static final int FLAG_RENDERABLE
      Used to say whether a surface can be rendered to, whether an image can be used as color or depth/stencil attachments. Renderable when set, otherwise not renderable.
      See Also:
    • FLAG_MEMORYLESS

      static final int FLAG_MEMORYLESS
      Used to create memoryless images, especially for MSAA attachments. If so, load op must NOT be Engine.LoadOp.kLoad and store op must NOT be Engine.StoreOp.kStore, and rendering may be efficient on TBDR GPU. This is also known as discardable and transient attachments.

      Note: Memoryless must be FLAG_RENDERABLE and must NOT be either FLAG_SAMPLED_IMAGE or FLAG_STORAGE_IMAGE.

      See Also:
    • FLAG_PROTECTED

      static final int FLAG_PROTECTED
      Used to say whether image is backed by protected memory. Protected when set, otherwise not protected. Vulkan only.
      See Also:
    • FLAG_READ_ONLY

      @Internal static final int FLAG_READ_ONLY
      Means the pixels in the image are read-only. Image and ImageViewProxy only, typically for wrapped images. Read-only images cannot be renderable.
      See Also:
    • FLAG_SKIP_ALLOCATOR

      @Internal static final int FLAG_SKIP_ALLOCATOR
      When set, the proxy will be instantiated outside the allocator (e.g. for proxies that are instantiated in on-flush callbacks). Otherwise, SurfaceAllocator should instantiate the proxy. SurfaceProxy only.
      See Also:
    • FLAG_DEFERRED_PROVIDER

      @Internal static final int FLAG_DEFERRED_PROVIDER
      For ImageViewProxy created in a deferred list recording thread it is possible for the unique key to be cleared on the backing Image while the unique key remains on the proxy. When set, it loosens up asserts that the key of an instantiated uniquely-keyed texture proxy is also always set on the backing Image. ImageViewProxy only.
      See Also:
  • Method Details

    • getApproxSize

      static int getApproxSize(int size)
      Map size to a larger multiple of 2. Values invalid input: '<'= 1024 will pop up to the next power of 2. Those above 1024 will only go up half the floor power of 2.

      Possible values: 16, 32, 64, 128, 256, 512, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384

      See Also: