Skip to main content

Namespace: WebGL

Rendering.WebGL

Classes

BrushGL

InkCanvasGL

InkContext

InkLayer

OffscreenCanvasGL

OffscreenLayerGL

RectGL

StrokeDrawContext

StrokeRendererGL

Type Definitions

InkLayerOptions

Properties:
NameTypeAttributesDefaultDescription
widthintLayer width, required when user defined framebuffer or renderbuffer properties are not available or specific texture size is desired
heightintLayer height, required when user defined Framebuffer or Renderbuffer properties are not available or specific texture size is desired
scaleFactorfloat<optional>1Layer is scaled
flipYboolean<optional>false
useBuffersStorageboolean<optional>falseUsed for auto allocated gl resources, by default allocates WebGLTextureWhen is true WebGLTexture is allocated else WebGLFramebuffer and WebGLRenderbuffer are allocated.Memory managment will be handled automatically.Applicable only when own resource is not available.
framebufferWebGLFramebuffer<optional>User defined framebuffer. When Renderbuffer not available it should be attached to the framebuffer.When attachment is not available or attachment is not renderbuffer exception is thrown. Renderbuffer dimensions used for layer creation.
renderbufferWebGLRenderbuffer<optional>User defined renderbuffer, Renderbuffer dimensions used for layer creation.
textureWebGLTexture<optional>User defined texture,width and height not required when desired size matches image size and image is attached to the texture (fillTexture attaches image)
ownGlResourcesboolean<optional>falseWhen own resource is attached, this property should be true.Memory managment will not be handled automatically, layer will free the GL resources when deallocated.Applicable only when own resource is available.

WebGLContextAttributes

Defines WebGL context attributes

Properties:
NameTypeAttributesDefaultDescription
alphaboolean<optional>trueBoolean that indicates if the canvas contains an alpha buffer.
antialiasboolean<optional>trueBoolean that indicates whether or not to perform anti-aliasing.
depthboolean<optional>trueBoolean that indicates whether or not to perform anti-aliasing.
desynchronizedboolean<optional>falseBoolean that hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop.
failIfMajorPerformanceCaveatboolean<optional>falseBoolean that indicates if a context will be created if the system performance is low or if no hardware GPU is available.
powerPreferencestring<optional>"default"A hint to the user agent indicating what configuration of GPU is suitable for the WebGL context. Possible values are:
"default": Let the user agent decide which GPU configuration is most suitable. This is the default value.
"high-performance": Prioritizes rendering performance over power consumption.
"low-power": Prioritizes power saving over rendering performance.
premultipliedAlphaboolean<optional>trueBoolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha.
preserveDrawingBufferboolean<optional>falseIf the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
stencilboolean<optional>falseBoolean that indicates that the drawing buffer has a stencil buffer of at least 8 bits.

Home