Package icyllis.arc3d.granite

# Class SurfaceDrawContext

java.lang.Object
icyllis.arc3d.granite.SurfaceDrawContext

All Implemented Interfaces:
  `AutoCloseable`

public final class SurfaceDrawContext extends Object implements AutoCloseable
Used by `GraniteDevice`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear(float[] clearColor)`
  `void`
  `close()`
  Destructs this context.
  `void`
  `discard()`
  `void`
  `flush(RecordingContext context)`
  `int`
  `getAlphaType()`
  `int`
  `getColorType()`
  `int`
  `getHeight()`
  `ImageInfo`
  `getImageInfo()`
  `int`
  `getOrigin()`
  Read view and write view have the same origin.
  `short`
  `getReadSwizzle()`
  `@RawPtr ImageViewProxy`
  `getReadView()`
  `int`
  `getWidth()`
  `boolean`
  `isMipmapped()`
  `static SurfaceDrawContext`
  `make(RecordingContext context, @SharedPtr ImageViewProxy targetView, ImageInfo deviceInfo)`
  `int`
  `numPendingSteps()`
  `void`
  `recordDependency(@SharedPtr Task task)`
  `void`
  `recordDraw(Draw draw)`
  `boolean`
  `recordUpload(RecordingContext context, @SharedPtr ImageViewProxy imageViewProxy, int srcColorType, int srcAlphaType, ColorSpace srcColorSpace, int dstColorType, int dstAlphaType, ColorSpace dstColorSpace, ImageUploadTask.MipLevel[] levels, Rect2ic dstRect, ImageUploadTask.UploadCondition condition)`
  `@SharedPtr DrawTask`
  `snapDrawTask(RecordingContext context)`

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

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

- ## Method Details

  - ### make

    @Nullable public static SurfaceDrawContext make(RecordingContext context, @SharedPtr @SharedPtr ImageViewProxy targetView, ImageInfo deviceInfo)

  - ### close

    public void close()
    Destructs this context.
    Specified by:
      `close` in interface `AutoCloseable`

  - ### getReadView

    @RawPtr public @RawPtr ImageViewProxy getReadView()
    Returns:
      raw ptr to the read view

  - ### getImageInfo

    public ImageInfo getImageInfo()

  - ### getColorType

    public int getColorType()
    See Also:
      - `ColorInfo.ColorType`

  - ### getAlphaType

    public int getAlphaType()
    See Also:
      - `ColorInfo.AlphaType`

  - ### getWidth

    public int getWidth()

  - ### getHeight

    public int getHeight()

  - ### isMipmapped

    public boolean isMipmapped()

  - ### getOrigin

    public int getOrigin()
    Read view and write view have the same origin.
    See Also:
      - `Engine.SurfaceOrigin`

  - ### getReadSwizzle

    public short getReadSwizzle()
    See Also:
      - `Swizzle`

  - ### clear

    public void clear(@Nullable float[] clearColor)
    Parameters:
      `clearColor` - premultiplied RGBA color, null means (0,0,0,0)

  - ### discard

    public void discard()

  - ### numPendingSteps

    public int numPendingSteps()

  - ### recordDraw

    public void recordDraw(Draw draw)

  - ### recordUpload

    public boolean recordUpload(RecordingContext context, @SharedPtr @SharedPtr ImageViewProxy imageViewProxy, int srcColorType, int srcAlphaType, ColorSpace srcColorSpace, int dstColorType, int dstAlphaType, ColorSpace dstColorSpace, ImageUploadTask.MipLevel[] levels, Rect2ic dstRect, ImageUploadTask.UploadCondition condition)

  - ### recordDependency

    public void recordDependency(@SharedPtr @SharedPtr Task task)

  - ### flush

    public void flush(RecordingContext context)

  - ### snapDrawTask

    @Nullable @SharedPtr public @SharedPtr DrawTask snapDrawTask(RecordingContext context)