Package icyllis.arc3d.core

# Class PaintFilterCanvas

java.lang.Object
icyllis.arc3d.core.Canvas
icyllis.arc3d.core.NoDrawCanvas
icyllis.arc3d.core.NWayCanvas
icyllis.arc3d.core.PaintFilterCanvas

All Implemented Interfaces:
  `AutoCloseable`

public abstract class PaintFilterCanvas extends NWayCanvas

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.core.Canvas

  `Canvas.PointMode, Canvas.SaveLayerFlag, Canvas.SrcRectConstraint`

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.core.NWayCanvas

  `mList, mSize`

  ### Fields inherited from class icyllis.arc3d.core.Canvas

  `F16_COLOR_TYPE_SAVE_LAYER_FLAG, FULL_LAYER_SAVE_LAYER_STRATEGY, INIT_WITH_PREVIOUS_SAVE_LAYER_FLAG, NO_LAYER_SAVE_LAYER_STRATEGY, POINT_MODE_LINES, POINT_MODE_POINTS, POINT_MODE_POLYGON, SRC_RECT_CONSTRAINT_FAST, SRC_RECT_CONSTRAINT_STRICT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PaintFilterCanvas(@RawPtr Canvas canvas)`
  The new PaintFilterCanvas is configured for forwarding to the specified canvas.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBaseLayerHeight()`
  Gets the size of the base or root layer in global canvas coordinates.
  `int`
  `getBaseLayerWidth()`
  Gets the size of the base or root layer in global canvas coordinates.
  `RecordingContext`
  `getRecordingContext()`
  Returns GPU context of the GPU surface associated with Canvas.
  `protected void`
  `onDrawArc(float cx, float cy, float radius, float startAngle, float sweepAngle, int cap, float width, Paint paint)`
  `protected void`
  `onDrawChord(float cx, float cy, float radius, float startAngle, float sweepAngle, Paint paint)`
  `protected void`
  `onDrawCircle(float cx, float cy, float radius, Paint paint)`
  `protected void`
  `onDrawGlyphRunList(GlyphRunList glyphRunList, Paint paint)`
  `protected void`
  `onDrawImageRect(@RawPtr Image image, Rect2fc src, Rect2fc dst, SamplingOptions sampling, Paint paint, int constraint)`
  `protected void`
  `onDrawLine(float x0, float y0, float x1, float y1, int cap, float width, Paint paint)`
  `protected void`
  `onDrawPaint(Paint paint)`
  `protected void`
  `onDrawPie(float cx, float cy, float radius, float startAngle, float sweepAngle, Paint paint)`
  `protected void`
  `onDrawPoints(int mode, float[] pts, int offset, int count, Paint paint)`
  `protected void`
  `onDrawRect(Rect2fc r, Paint paint)`
  `protected void`
  `onDrawRoundRect(RoundRect rr, Paint paint)`
  `protected void`
  `onDrawTextBlob(TextBlob blob, float originX, float originY, Paint paint)`
  `protected void`
  `onDrawVertices(Vertices vertices, @SharedPtr Blender blender, Paint paint)`
  `abstract boolean`
  `onFilter(Paint paint)`
  Called with the paint that will be used to draw the specified type.
  `protected ImageInfo`
  `onGetImageInfo()`
  `protected Surface`
  `onNewSurface(ImageInfo info)`

  ### Methods inherited from class icyllis.arc3d.core.NWayCanvas

  `addCanvas, close, didConcat, didScale, didSetMatrix, didTranslate, onClipRect, removeAll, removeCanvas, willRestore, willSave`

  ### Methods inherited from class icyllis.arc3d.core.Canvas

  `clear, clear, clipRect, clipRect, clipRect, clipRect, clipRect, clipRect, clipRect, clipRect, clipRect, concat, concat, didRestore, discard, drawArc, drawArc, drawChord, drawCircle, drawColor, drawColor, drawColor, drawColor, drawGlyphs, drawImage, drawImageRect, drawImageRect, drawLine, drawLine, drawPaint, drawPie, drawPoint, drawPoint, drawPoints, drawRect, drawRect, drawRect, drawRoundRect, drawRoundRect, drawRoundRect, drawRoundRect, drawRoundRect, drawTextBlob, drawTriangle, drawVertices, getDeviceClipBounds, getImageInfo, getLocalClipBounds, getLocalToDevice, getLocalToDevice, getRootDevice, getSaveCount, getSaveLayerStrategy, getSurface, isClipEmpty, isClipRect, makeSurface, onDiscard, quickReject, quickReject, resetMatrix, restore, restoreToCount, rotate, rotate, save, saveLayer, saveLayer, saveLayer, saveLayer, saveLayerAlpha, saveLayerAlpha, scale, scale, scale, setMatrix, shear, shear, translate, translate`

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

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

- ## Constructor Details

  - ### PaintFilterCanvas

    public PaintFilterCanvas(@RawPtr @Nonnull @RawPtr Canvas canvas)
    The new PaintFilterCanvas is configured for forwarding to the specified canvas. Also copies the target canvas matrix and clip bounds.

- ## Method Details

  - ### onFilter

    public abstract boolean onFilter(Paint paint)
    Called with the paint that will be used to draw the specified type. The implementation may modify the paint as they wish.

    The result bool is used to determine whether the draw op is to be executed (true) or skipped (false).

    Note: The base implementation calls onFilter() for top-level/explicit paints only. To also filter encapsulated paints (e.g. Picture, TextBlob), clients may need to override the relevant methods (i.e. drawPicture, drawTextBlob).

  - ### getBaseLayerWidth

    public int getBaseLayerWidth()
    Description copied from class: `Canvas`
    Gets the size of the base or root layer in global canvas coordinates. The origin of the base layer is always (0,0). The area available for drawing may be smaller (due to clipping or saveLayer).
    Overrides:
      `getBaseLayerWidth` in class `Canvas`
    Returns:
      integral width of base layer

  - ### getBaseLayerHeight

    public int getBaseLayerHeight()
    Description copied from class: `Canvas`
    Gets the size of the base or root layer in global canvas coordinates. The origin of the base layer is always (0,0). The area available for drawing may be smaller (due to clipping or saveLayer).
    Overrides:
      `getBaseLayerHeight` in class `Canvas`
    Returns:
      integral height of base layer

  - ### getRecordingContext

    @Nullable public RecordingContext getRecordingContext()
    Description copied from class: `Canvas`
    Returns GPU context of the GPU surface associated with Canvas.
    Overrides:
      `getRecordingContext` in class `Canvas`
    Returns:
      GPU context, if available; null otherwise

  - ### onDrawPaint

    protected void onDrawPaint(Paint paint)
    Overrides:
      `onDrawPaint` in class `NWayCanvas`

  - ### onDrawPoints

    protected void onDrawPoints(int mode, float[] pts, int offset, int count, Paint paint)
    Overrides:
      `onDrawPoints` in class `NWayCanvas`

  - ### onDrawLine

    protected void onDrawLine(float x0, float y0, float x1, float y1, int cap, float width, Paint paint)
    Overrides:
      `onDrawLine` in class `NWayCanvas`

  - ### onDrawRect

    protected void onDrawRect(Rect2fc r, Paint paint)
    Overrides:
      `onDrawRect` in class `NWayCanvas`

  - ### onDrawRoundRect

    protected void onDrawRoundRect(RoundRect rr, Paint paint)
    Overrides:
      `onDrawRoundRect` in class `NWayCanvas`

  - ### onDrawCircle

    protected void onDrawCircle(float cx, float cy, float radius, Paint paint)
    Overrides:
      `onDrawCircle` in class `NWayCanvas`

  - ### onDrawArc

    protected void onDrawArc(float cx, float cy, float radius, float startAngle, float sweepAngle, int cap, float width, Paint paint)
    Overrides:
      `onDrawArc` in class `NWayCanvas`

  - ### onDrawPie

    protected void onDrawPie(float cx, float cy, float radius, float startAngle, float sweepAngle, Paint paint)
    Overrides:
      `onDrawPie` in class `NWayCanvas`

  - ### onDrawChord

    protected void onDrawChord(float cx, float cy, float radius, float startAngle, float sweepAngle, Paint paint)
    Overrides:
      `onDrawChord` in class `NWayCanvas`

  - ### onDrawImageRect

    protected void onDrawImageRect(@RawPtr @RawPtr Image image, Rect2fc src, Rect2fc dst, SamplingOptions sampling, Paint paint, int constraint)
    Overrides:
      `onDrawImageRect` in class `NWayCanvas`

  - ### onDrawTextBlob

    protected void onDrawTextBlob(TextBlob blob, float originX, float originY, Paint paint)
    Overrides:
      `onDrawTextBlob` in class `NWayCanvas`

  - ### onDrawGlyphRunList

    protected void onDrawGlyphRunList(GlyphRunList glyphRunList, Paint paint)
    Overrides:
      `onDrawGlyphRunList` in class `NWayCanvas`

  - ### onDrawVertices

    protected void onDrawVertices(Vertices vertices, @SharedPtr @SharedPtr Blender blender, Paint paint)
    Overrides:
      `onDrawVertices` in class `NWayCanvas`

  - ### onNewSurface

    @Nullable protected Surface onNewSurface(ImageInfo info)
    Overrides:
      `onNewSurface` in class `Canvas`

  - ### onGetImageInfo

    @Nonnull protected ImageInfo onGetImageInfo()
    Overrides:
      `onGetImageInfo` in class `Canvas`