OffscreenCanvasRenderingContext2D extension type

The OffscreenCanvasRenderingContext2D interface is a CanvasRenderingContext2D rendering context for drawing to the bitmap of an OffscreenCanvas object. It is similar to the CanvasRenderingContext2D object, with the following differences:

  • there is no support for user-interface features (drawFocusIfNeeded, and scrollPathIntoView)
  • its canvas attribute refers to an OffscreenCanvas object rather than a canvas element
  • it has a commit() method for pushing rendered images to the context's OffscreenCanvas object's placeholder canvas element
on
Implemented types

Properties

canvas OffscreenCanvas
no setter
direction CanvasDirection
getter/setter pair
fillStyle JSAny
getter/setter pair
filter String
getter/setter pair
font String
getter/setter pair
fontKerning CanvasFontKerning
getter/setter pair
fontStretch CanvasFontStretch
getter/setter pair
fontVariantCaps CanvasFontVariantCaps
getter/setter pair
globalAlpha num
getter/setter pair
globalCompositeOperation String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
imageSmoothingEnabled bool
getter/setter pair
imageSmoothingQuality ImageSmoothingQuality
getter/setter pair
letterSpacing String
getter/setter pair
lineCap CanvasLineCap
getter/setter pair
lineDashOffset num
getter/setter pair
lineJoin CanvasLineJoin
getter/setter pair
lineWidth num
getter/setter pair
miterLimit num
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowBlur num
getter/setter pair
shadowColor String
getter/setter pair
shadowOffsetX num
getter/setter pair
shadowOffsetY num
getter/setter pair
strokeStyle JSAny
getter/setter pair
textAlign CanvasTextAlign
getter/setter pair
textBaseline CanvasTextBaseline
getter/setter pair
textRendering CanvasTextRendering
getter/setter pair
wordSpacing String
getter/setter pair

Methods

arc(num x, num y, num radius, num startAngle, num endAngle, [bool counterclockwise]) → void
arcTo(num x1, num y1, num x2, num y2, num radius) → void
beginPath() → void
bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y) → void
clearRect(num x, num y, num w, num h) → void
clip([JSAny fillRuleOrPath, CanvasFillRule fillRule]) → void
closePath() → void
commit() → void
The OffscreenCanvasRenderingContext2D.commit() method of the Canvas 2D API copies the rendering context's bitmap to the bitmap of the placeholder canvas element of the associated OffscreenCanvas object. The copy operation is synchronous. Calling this method is not needed for the transfer, since it happens automatically during the event-loop execution.
createConicGradient(num startAngle, num x, num y) CanvasGradient
createImageData(JSAny imagedataOrSw, [int sh, ImageDataSettings settings]) ImageData
createLinearGradient(num x0, num y0, num x1, num y1) CanvasGradient
createPattern(CanvasImageSource image, String repetition) CanvasPattern?
createRadialGradient(num x0, num y0, num r0, num x1, num y1, num r1) CanvasGradient
drawImage(CanvasImageSource image, num dxOrSx, num dyOrSy, [num dwOrSw, num dhOrSh, num dx, num dy, num dw, num dh]) → void
ellipse(num x, num y, num radiusX, num radiusY, num rotation, num startAngle, num endAngle, [bool counterclockwise]) → void
fill([JSAny fillRuleOrPath, CanvasFillRule fillRule]) → void
fillRect(num x, num y, num w, num h) → void
fillText(String text, num x, num y, [num maxWidth]) → void
getImageData(int sx, int sy, int sw, int sh, [ImageDataSettings settings]) ImageData
getLineDash() JSArray<JSNumber>
getTransform() DOMMatrix
isContextLost() bool
isPointInPath(JSAny pathOrX, num xOrY, [JSAny fillRuleOrY, CanvasFillRule fillRule]) bool
isPointInStroke(JSAny pathOrX, num xOrY, [num y]) bool
lineTo(num x, num y) → void
measureText(String text) TextMetrics
moveTo(num x, num y) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putImageData(ImageData imagedata, int dx, int dy, [int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight]) → void
quadraticCurveTo(num cpx, num cpy, num x, num y) → void
rect(num x, num y, num w, num h) → void
reset() → void
resetTransform() → void
restore() → void
rotate(num angle) → void
roundRect(num x, num y, num w, num h, [JSAny radii]) → void
save() → void
scale(num x, num y) → void
setLineDash(JSArray<JSNumber> segments) → void
setTransform([JSAny aOrTransform, num b, num c, num d, num e, num f]) → void
stroke([Path2D path]) → void
strokeRect(num x, num y, num w, num h) → void
strokeText(String text, num x, num y, [num maxWidth]) → void
toString() String
A string representation of this object.
inherited
transform(num a, num b, num c, num d, num e, num f) → void
translate(num x, num y) → void

Operators

operator ==(Object other) bool
The equality operator.
inherited