| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // https://drafts.css-houdini.org/css-paint-api/#paintrenderingcontext2d | 5 // https://drafts.css-houdini.org/css-paint-api/#paintrenderingcontext2d |
| 6 | 6 |
| 7 [ | 7 [ |
| 8 Exposed=PaintWorklet, | 8 Exposed=PaintWorklet, |
| 9 RuntimeEnabled=CSSPaintAPI, | 9 RuntimeEnabled=CSSPaintAPI, |
| 10 ] interface PaintRenderingContext2D { | 10 ] interface PaintRenderingContext2D { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // image smoothing | 28 // image smoothing |
| 29 attribute boolean imageSmoothingEnabled; // (default True) | 29 attribute boolean imageSmoothingEnabled; // (default True) |
| 30 [RuntimeEnabled=ExperimentalCanvasFeatures] attribute ImageSmoothingQuality
imageSmoothingQuality; // (default "low") | 30 [RuntimeEnabled=ExperimentalCanvasFeatures] attribute ImageSmoothingQuality
imageSmoothingQuality; // (default "low") |
| 31 | 31 |
| 32 // colors and styles (see also the CanvasDrawingStyles interface) | 32 // colors and styles (see also the CanvasDrawingStyles interface) |
| 33 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (de
fault black) | 33 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (de
fault black) |
| 34 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (defa
ult black) | 34 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (defa
ult black) |
| 35 CanvasGradient createLinearGradient(double x0, double y0, double x1, double
y1); | 35 CanvasGradient createLinearGradient(double x0, double y0, double x1, double
y1); |
| 36 [RaisesException] CanvasGradient createRadialGradient(double x0, double y0,
double r0, double x1, double y1, double r1); | 36 [RaisesException] CanvasGradient createRadialGradient(double x0, double y0,
double r0, double x1, double y1, double r1); |
| 37 [CallWith=ScriptState, RaisesException] CanvasPattern? createPattern(CanvasI
mageSource image, [TreatNullAs=NullString] DOMString repetitionType); | 37 [CallWith=ExecutionContext, RaisesException] CanvasPattern? createPattern(Ca
nvasImageSource image, [TreatNullAs=NullString] DOMString repetitionType); |
| 38 | 38 |
| 39 // shadows | 39 // shadows |
| 40 attribute unrestricted double shadowOffsetX; | 40 attribute unrestricted double shadowOffsetX; |
| 41 attribute unrestricted double shadowOffsetY; | 41 attribute unrestricted double shadowOffsetY; |
| 42 attribute unrestricted double shadowBlur; | 42 attribute unrestricted double shadowBlur; |
| 43 attribute DOMString shadowColor; | 43 attribute DOMString shadowColor; |
| 44 | 44 |
| 45 // rects | 45 // rects |
| 46 void clearRect(unrestricted double x, unrestricted double y, unrestricted do
uble width, unrestricted double height); | 46 void clearRect(unrestricted double x, unrestricted double y, unrestricted do
uble width, unrestricted double height); |
| 47 void fillRect(unrestricted double x, unrestricted double y, unrestricted dou
ble width, unrestricted double height); | 47 void fillRect(unrestricted double x, unrestricted double y, unrestricted dou
ble width, unrestricted double height); |
| 48 void strokeRect(unrestricted double x, unrestricted double y, unrestricted d
ouble width, unrestricted double height); | 48 void strokeRect(unrestricted double x, unrestricted double y, unrestricted d
ouble width, unrestricted double height); |
| 49 | 49 |
| 50 // path API (see also CanvasPathMethods) | 50 // path API (see also CanvasPathMethods) |
| 51 void beginPath(); | 51 void beginPath(); |
| 52 void fill(optional CanvasFillRule winding); | 52 void fill(optional CanvasFillRule winding); |
| 53 void fill(Path2D path, optional CanvasFillRule winding); | 53 void fill(Path2D path, optional CanvasFillRule winding); |
| 54 void stroke(); | 54 void stroke(); |
| 55 void stroke(Path2D path); | 55 void stroke(Path2D path); |
| 56 | 56 |
| 57 void clip(optional CanvasFillRule winding); | 57 void clip(optional CanvasFillRule winding); |
| 58 void clip(Path2D path, optional CanvasFillRule winding); | 58 void clip(Path2D path, optional CanvasFillRule winding); |
| 59 boolean isPointInPath(unrestricted double x, unrestricted double y, optional
CanvasFillRule winding); | 59 boolean isPointInPath(unrestricted double x, unrestricted double y, optional
CanvasFillRule winding); |
| 60 boolean isPointInPath(Path2D path, unrestricted double x, unrestricted doubl
e y, optional CanvasFillRule winding); | 60 boolean isPointInPath(Path2D path, unrestricted double x, unrestricted doubl
e y, optional CanvasFillRule winding); |
| 61 boolean isPointInStroke(unrestricted double x, unrestricted double y); | 61 boolean isPointInStroke(unrestricted double x, unrestricted double y); |
| 62 boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted dou
ble y); | 62 boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted dou
ble y); |
| 63 | 63 |
| 64 // drawing images | 64 // drawing images |
| 65 [RaisesException] void drawImage(CanvasImageSource image, unrestricted doubl
e x, unrestricted double y); | 65 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double x, unrestricted double y); |
| 66 [RaisesException] void drawImage(CanvasImageSource image, unrestricted doubl
e x, unrestricted double y, unrestricted double width, unrestricted double heigh
t); | 66 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double x, unrestricted double y, unrestricted double width
, unrestricted double height); |
| 67 [RaisesException] void drawImage(CanvasImageSource image, unrestricted doubl
e sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, un
restricted double dx, unrestricted double dy, unrestricted double dw, unrestrict
ed double dh); | 67 [CallWith=ExecutionContext, RaisesException] void drawImage(CanvasImageSourc
e image, unrestricted double sx, unrestricted double sy, unrestricted double sw,
unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestr
icted double dw, unrestricted double dh); |
| 68 | 68 |
| 69 // FIXME: factor out to CanvasDrawingStyles | 69 // FIXME: factor out to CanvasDrawingStyles |
| 70 // line caps/joins | 70 // line caps/joins |
| 71 attribute unrestricted double lineWidth; // (default 1) | 71 attribute unrestricted double lineWidth; // (default 1) |
| 72 attribute DOMString lineCap; // "butt", "round", "square" (default "butt") | 72 attribute DOMString lineCap; // "butt", "round", "square" (default "butt") |
| 73 attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter") | 73 attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter") |
| 74 attribute unrestricted double miterLimit; // (default 10) | 74 attribute unrestricted double miterLimit; // (default 10) |
| 75 | 75 |
| 76 // dashed lines | 76 // dashed lines |
| 77 void setLineDash(sequence<unrestricted double> dash); | 77 void setLineDash(sequence<unrestricted double> dash); |
| 78 sequence<unrestricted double> getLineDash(); | 78 sequence<unrestricted double> getLineDash(); |
| 79 attribute unrestricted double lineDashOffset; | 79 attribute unrestricted double lineDashOffset; |
| 80 }; | 80 }; |
| 81 PaintRenderingContext2D implements CanvasPathMethods; | 81 PaintRenderingContext2D implements CanvasPathMethods; |
| OLD | NEW |