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 // Note: The official spec is WIP at wiki.whatwg.org/wiki/OffscreenCanvas. | 5 // Note: The official spec is WIP at wiki.whatwg.org/wiki/OffscreenCanvas. |
6 | 6 |
7 [ | 7 [ |
8 GarbageCollected, | 8 GarbageCollected, |
9 Exposed=(Window,Worker), | 9 Exposed=(Window,Worker), |
10 RuntimeEnabled=ExperimentalCanvasFeatures, | 10 RuntimeEnabled=ExperimentalCanvasFeatures, |
11 ] interface OffscreenCanvasRenderingContext2D { | 11 ] interface OffscreenCanvasRenderingContext2D { |
12 // back-reference to the canvas | 12 // back-reference to the canvas |
13 [ImplementedAs=getOffscreenCanvas] readonly attribute OffscreenCanvas offscr eenCanvas; | 13 [ImplementedAs=getOffscreenCanvas] readonly attribute OffscreenCanvas offscr eenCanvas; |
14 | 14 |
15 // colors and styles (see also the CanvasDrawingStyles interface) | 15 // colors and styles |
xlai (Olivia)
2016/03/17 15:38:53
The interface "CanvasDrawingStyles" doesn't exist
| |
16 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (de fault black) | 16 attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (de fault black) |
17 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (defa ult black) | 17 attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (defa ult black) |
18 | 18 |
19 //CanvasRect interface | 19 // CanvasRect interface |
20 void clearRect(unrestricted double x, unrestricted double y, unrestricted do uble width, unrestricted double height); | 20 void clearRect(unrestricted double x, unrestricted double y, unrestricted do uble width, unrestricted double height); |
21 void fillRect(unrestricted double x, unrestricted double y, unrestricted dou ble width, unrestricted double height); | 21 void fillRect(unrestricted double x, unrestricted double y, unrestricted dou ble width, unrestricted double height); |
22 void strokeRect(unrestricted double x, unrestricted double y, unrestricted d ouble width, unrestricted double height); | 22 void strokeRect(unrestricted double x, unrestricted double y, unrestricted d ouble width, unrestricted double height); |
23 | |
24 // Path API (See BaseRenderingContext2D) | |
25 void beginPath(); | |
26 void fill(optional CanvasFillRule winding); | |
27 void fill(Path2D path, optional CanvasFillRule winding); | |
28 void stroke(); | |
29 void stroke(Path2D path); | |
30 | |
31 // Line caps/joins | |
32 attribute unrestricted double lineWidth; // (default 1) | |
33 attribute DOMString lineCap; // "butt", "round", "square" (default "butt") | |
34 attribute DOMString lineJoin; // "round", "bevel", "miter" (default "miter") | |
35 attribute unrestricted double miterLimit; // (default 10) | |
36 | |
37 // dashed lines | |
38 void setLineDash(sequence<unrestricted double> dash); | |
39 sequence<unrestricted double> getLineDash(); | |
40 attribute unrestricted double lineDashOffset; | |
23 }; | 41 }; |
24 | 42 |
25 OffscreenCanvasRenderingContext2D implements CanvasPathMethods; | 43 OffscreenCanvasRenderingContext2D implements CanvasPathMethods; |
OLD | NEW |