Skip to main content

Class: StrokeRendererGL

Rendering.WebGL.StrokeRendererGL(canvas, optionsopt)

Stroke painter

Constructor

new StrokeRendererGL(canvas, optionsopt)

Parameters:
NameTypeAttributesDescription
canvasRendering.WebGL.InkCanvasGLview layer
optionsRendering.WebGL.InkLayerOptions<optional>Layer configuration. When not available underlying layer is auto created with default size (device screen size).
Properties:
NameTypeDescription
brushRendering.WebGL.BrushGLRendering brush
colorCommon.ColorRendering color
updatedAreaCommon.RectCurrent modified segments area
preliminaryAreaCommon.RectLast preliminary update area
strokeBoundsCommon.RectCurrent stroke area
affectedAreaCommon.RectRuntime graphics updates area for drawn segments + preliminary area

Since:

  • version 1.0

Extends

Methods

abort()

Restarts StrokeRenderer instance lifecycle for next usage

Overrides:

blendStroke(layeropt, dirtyAreaopt, blendModeopt)

Blends completed stroke with another layer

Parameters:
NameTypeAttributesDefaultDescription
layerRendering.WebGL.OffscreenLayerGL<optional>this.canvasTarget layer for stroke blending
dirtyAreaCommon.Rect<optional>this.strokeBoundsBlending area
blendModeRendering.BlendMode<optional>this.blendModeBlending mode

Overrides:

(async) blendStroke2D(layer, blendOptions)

Blends completed stroke with 2D layer

Parameters:
NameTypeDescription
layerRendering.2D.OffscreenLayer2DTarget layer for stroke blending
blendOptionsRendering.BlendOptionsBlending configuration

blendStrokes(strokes, layer, blendOptions) → Common.Rect

Blends batch of strokes with another layer

Parameters:
NameTypeDescription
strokesArray.<Stroke>Strokes to draw
layerRendering.2D.OffscreenLayer2DTarget layer for stroke blending
blendOptionsRendering.BlendOptionsBlending configuration
Returns:

Affected area

Type

Common.Rect

blendUpdatedArea(layeropt)

Blends affected area with another layer

Parameters:
NameTypeAttributesDefaultDescription
layerRendering.WebGL.OffscreenLayerGL<optional>this.canvasTarget layer for stroke blending, where blendMode is previously configured

Overrides:

configure(settings)

Configures rendering. First call is used for initialilzation.

Parameters:
NameTypeDescription
settingsRendering.ComposeStyleRenderer configuration settings

Overrides:

draw(path, endStrokeopt)

Render data input

Parameters:
NameTypeAttributesDefaultDescription
pathPathBuilding.InkPath|Strokeinput
endStrokeboolean<optional>falseapplicable only when path is Path, when true caps end of stroke and completes stroke rendering

Overrides:

drawPreliminary(path)

Render preliminary curve

Parameters:
NameTypeDescription
pathPathBuilding.InterpolatedSplineprediction input

Overrides:

(abstract) drawSegment()

Overrides:

(abstract) drawStroke()

Overrides:

requestComposeLayer() → Rendering.OffscreenLayer

When data is composed, raster data could be acquired. This action resets stroke renderer internal state.

Overrides:

Returns:

Composition layer

Type

Rendering.OffscreenLayer

reset()

Reset current state

Overrides:

resize()

Resize underlying layers

Overrides:

setTransform(matrix)

Configures ink transformation over stroke layer and it's preliminary when available

Parameters:
NameTypeDescription
matrixCommon.Matrix

Overrides:

toStroke(builder, strokeIDopt) → Stroke

Converts current drawed path to stroke

Parameters:
NameTypeAttributesDefaultDescription
builderPathBuilding.InkBuilderbuilder used for path building
strokeIDstring.<GUID><optional>auto generated GUIDStroke identifier

Overrides:

Returns:

stroke

Type

Stroke

Home