| Members | Methods |
|---|---|
Constructor
new WebGLDrawer(options)
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options for this Drawer.
Properties
|
- Source:
Members
canvas :Element
The HTML element (canvas) that this drawer uses for drawing
Type:
- Element
- Source:
container :Element
The parent element of this Drawer instance, passed in when the Drawer was created.
The parent of
OpenSeadragon.WebGLDrawer#canvas.
Type:
- Element
- Source:
Methods
(static) isSupported() → {Boolean}
Functional test: true if WebGL is supported and the real first-pass shader pipeline
can render (same shaders/context path used at runtime). Uses a temp context and
WebglContextManager, draws known non-black pixels to an FBO, then readPixels.
- Source:
Returns:
true if WebGL is supported and the pipeline renders successfully
- Type
- Boolean
canRotate() → {Boolean}
- Source:
Returns:
true
- Type
- Boolean
destroy()
Clean up the renderer, removing all resources
- Source:
draw(tiledImages, isRetryopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
tiledImages |
Array | Array of TiledImage objects to draw | ||
isRetry |
Boolean |
<optional> |
false | Internal flag to prevent infinite retry loops |
- Source:
drawDebuggingRect(rect)
Draw a rect onto the output canvas for debugging purposes
Parameters:
| Name | Type | Description |
|---|---|---|
rect |
OpenSeadragon.Rect |
- Source:
getType() → {string}
- Source:
Returns:
'webgl'
- Type
- string
isContextRecoveryEnabled() → {Boolean}
Check if context recovery is enabled
- Source:
Returns:
true if recovery is enabled, false otherwise
- Type
- Boolean
isWebGL2() → {Boolean}
Check if the drawer is using WebGL2
- Source:
Returns:
true if WebGL2 is being used, false if WebGL1
- Type
- Boolean
setContextRecoveryEnabled(enabled)
Enable or disable automatic WebGL context re-initialization on context loss.
When enabled, the drawer will attempt to recover from context exhaustion errors
by re-initializing the WebGL context.
Parameters:
| Name | Type | Description |
|---|---|---|
enabled |
Boolean | true to enable recovery, false to disable |
- Source:
setImageSmoothingEnabled(enabled)
Sets whether image smoothing is enabled or disabled
Parameters:
| Name | Type | Description |
|---|---|---|
enabled |
Boolean | If true, uses gl.LINEAR as the TEXTURE_MIN_FILTER and TEXTURE_MAX_FILTER, otherwise gl.NEAREST. |
- Source:
setUnpackWithPremultipliedAlpha(enabled)
Sets whether textures are unpacked with premultiplied alpha
Parameters:
| Name | Type | Description |
|---|---|---|
enabled |
Boolean | If true, sets gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL to true. |
- Source: