Class: StrokeRendererGL
Rendering.WebGL.StrokeRendererGL(canvas, optionsopt)
Stroke painter
Constructor
new StrokeRendererGL(canvas, optionsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
canvas | Rendering.WebGL.InkCanvasGL | view layer | |
options | Rendering.WebGL.InkLayerOptions | <optional> | Layer configuration. When not available underlying layer is auto created with default size (device screen size). |
Properties:
Name | Type | Description |
---|---|---|
brush | Rendering.WebGL.BrushGL | Rendering brush |
color | Common.Color | Rendering color |
updatedArea | Common.Rect | Current modified segments area |
preliminaryArea | Common.Rect | Last preliminary update area |
strokeBounds | Common.Rect | Current stroke area |
affectedArea | Common.Rect | Runtime 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:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
layer | Rendering.WebGL.OffscreenLayerGL | <optional> | this.canvas | Target layer for stroke blending |
dirtyArea | Common.Rect | <optional> | this.strokeBounds | Blending area |
blendMode | Rendering.BlendMode | <optional> | this.blendMode | Blending mode |
Overrides:
(async) blendStroke2D(layer, blendOptions)
Blends completed stroke with 2D layer
Parameters:
Name | Type | Description |
---|---|---|
layer | Rendering.2D.OffscreenLayer2D | Target layer for stroke blending |
blendOptions | Rendering.BlendOptions | Blending configuration |
blendStrokes(strokes, layer, blendOptions) → Common.Rect
Blends batch of strokes with another layer
Parameters:
Name | Type | Description |
---|---|---|
strokes | Array.<Stroke> | Strokes to draw |
layer | Rendering.2D.OffscreenLayer2D | Target layer for stroke blending |
blendOptions | Rendering.BlendOptions | Blending configuration |
Returns:
Affected area
Type
blendUpdatedArea(layeropt)
Blends affected area with another layer
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
layer | Rendering.WebGL.OffscreenLayerGL | <optional> | this.canvas | Target layer for stroke blending, where blendMode is previously configured |
Overrides:
configure(settings)
Configures rendering. First call is used for initialilzation.
Parameters:
Name | Type | Description |
---|---|---|
settings | Rendering.ComposeStyle | Renderer configuration settings |
Overrides:
draw(path, endStrokeopt)
Render data input
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
path | PathBuilding.InkPath|Stroke | input | ||
endStroke | boolean | <optional> | false | applicable only when path is Path, when true caps end of stroke and completes stroke rendering |
Overrides:
drawPreliminary(path)
Render preliminary curve
Parameters:
Name | Type | Description |
---|---|---|
path | PathBuilding.InterpolatedSpline | prediction 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
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:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix |
Overrides:
toStroke(builder, strokeIDopt) → Stroke
Converts current drawed path to stroke
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
builder | PathBuilding.InkBuilder | builder used for path building | ||
strokeID | string.<GUID> | <optional> | auto generated GUID | Stroke identifier |
Overrides:
Returns:
stroke
Type