Package icyllis.arc3d.granite

# Class ClipStack

java.lang.Object
icyllis.arc3d.granite.ClipStack

public final class ClipStack extends Object
GPU hierarchical clipping.

We use scissor test and depth test to apply clip, antialiasing only works on multisampled targets.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `ClipStack.ClipGeometry`
  `static class`
  `ClipStack.Element`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CLIP_GEOMETRY_A_ONLY`
  `static final int`
  `CLIP_GEOMETRY_B_ONLY`
  `static final int`
  `CLIP_GEOMETRY_BOTH`
  `static final int`
  `CLIP_GEOMETRY_EMPTY`
  `static final int`
  `OP_DIFFERENCE`
  Clip ops.
  `static final int`
  `OP_INTERSECT`
  Clip ops.
  `static final int`
  `STATE_COMPLEX`
  Clip states.
  `static final int`
  `STATE_DEVICE_RECT`
  Clip states.
  `static final int`
  `STATE_EMPTY`
  Clip states.
  `static final int`
  `STATE_WIDE_OPEN`
  Clip states.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClipStack(GraniteDevice device)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clipRect(Matrixc viewMatrix, Rect2fc localRect, int clipOp)`
  `int`
  `currentClipState()`
  `@UnmodifiableView Collection<ClipStack.Element>`
  `elements()`
  `static int`
  `getClipGeometry(ClipStack.ClipGeometry A, ClipStack.ClipGeometry B)`
  `void`
  `getConservativeBounds(Rect2f out)`
  `static boolean`
  `intersects(ClipStack.ClipGeometry A, ClipStack.ClipGeometry B)`
  `int`
  `maxDeferredClipDraws()`
  `<GEO> boolean`
  `prepareForDraw(Draw draw, GEO geometry, BiConsumer<GEO,Rect2f> boundsFn, boolean outsetBoundsForAA, List<ClipStack.Element> elementsForMask)`
  `void`
  `recordDeferredClipDraws()`
  `void`
  `restore()`
  `void`
  `save()`
  `int`
  `updateForDraw(Draw draw, List<ClipStack.Element> elementsForMask, BoundsManager boundsManager, int depth)`

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

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

- ## Field Details

  - ### OP_DIFFERENCE

    public static final int OP_DIFFERENCE
    Clip ops.
    See Also:
      - Constant Field Values

  - ### OP_INTERSECT

    public static final int OP_INTERSECT
    Clip ops.
    See Also:
      - Constant Field Values

  - ### STATE_EMPTY

    public static final int STATE_EMPTY
    Clip states.
    See Also:
      - Constant Field Values

  - ### STATE_WIDE_OPEN

    public static final int STATE_WIDE_OPEN
    Clip states.
    See Also:
      - Constant Field Values

  - ### STATE_DEVICE_RECT

    public static final int STATE_DEVICE_RECT
    Clip states.
    See Also:
      - Constant Field Values

  - ### STATE_COMPLEX

    public static final int STATE_COMPLEX
    Clip states.
    See Also:
      - Constant Field Values

  - ### CLIP_GEOMETRY_EMPTY

    public static final int CLIP_GEOMETRY_EMPTY
    See Also:
      - Constant Field Values

  - ### CLIP_GEOMETRY_A_ONLY

    public static final int CLIP_GEOMETRY_A_ONLY
    See Also:
      - Constant Field Values

  - ### CLIP_GEOMETRY_B_ONLY

    public static final int CLIP_GEOMETRY_B_ONLY
    See Also:
      - Constant Field Values

  - ### CLIP_GEOMETRY_BOTH

    public static final int CLIP_GEOMETRY_BOTH
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ClipStack

    public ClipStack(GraniteDevice device)

- ## Method Details

  - ### currentClipState

    public int currentClipState()

  - ### save

    public void save()

  - ### restore

    public void restore()

  - ### elements

    public @UnmodifiableView Collection<ClipStack.Element> elements()

  - ### clipRect

    public void clipRect(@Nullable Matrixc viewMatrix, @Nonnull Rect2fc localRect, int clipOp)

  - ### maxDeferredClipDraws

    public int maxDeferredClipDraws()

  - ### getConservativeBounds

    public void getConservativeBounds(Rect2f out)

  - ### prepareForDraw

    public <GEO> boolean prepareForDraw(Draw draw, GEO geometry, BiConsumer<GEO,Rect2f> boundsFn, boolean outsetBoundsForAA, List<ClipStack.Element> elementsForMask)

  - ### updateForDraw

    public int updateForDraw(Draw draw, List<ClipStack.Element> elementsForMask, BoundsManager boundsManager, int depth)

  - ### recordDeferredClipDraws

    public void recordDeferredClipDraws()

  - ### intersects

    public static boolean intersects(ClipStack.ClipGeometry A, ClipStack.ClipGeometry B)

  - ### getClipGeometry

    public static int getClipGeometry(ClipStack.ClipGeometry A, ClipStack.ClipGeometry B)