OLD | NEW |
| (Empty) |
1 // DO NOT EDIT! This test has been generated by tools/gentest.py. | |
2 // OffscreenCanvas test in a worker:2d.line.miter.acute | |
3 // Description:Miter joins are drawn correctly with acute angles | |
4 // Note: | |
5 | |
6 importScripts("/resources/testharness.js"); | |
7 importScripts("/common/canvas-tests.js"); | |
8 | |
9 var t = async_test("Miter joins are drawn correctly with acute angles"); | |
10 t.step(function() { | |
11 | |
12 var offscreenCanvas = new OffscreenCanvas(100, 50); | |
13 var ctx = offscreenCanvas.getContext('2d'); | |
14 | |
15 ctx.fillStyle = '#f00'; | |
16 ctx.fillRect(0, 0, 100, 50); | |
17 ctx.lineWidth = 200; | |
18 ctx.lineJoin = 'miter'; | |
19 ctx.strokeStyle = '#0f0'; | |
20 ctx.miterLimit = 2.614; | |
21 ctx.beginPath(); | |
22 ctx.moveTo(100, 1000); | |
23 ctx.lineTo(100, 100); | |
24 ctx.lineTo(1000, 1000); | |
25 ctx.stroke(); | |
26 ctx.strokeStyle = '#f00'; | |
27 ctx.miterLimit = 2.613; | |
28 ctx.beginPath(); | |
29 ctx.moveTo(100, 1000); | |
30 ctx.lineTo(100, 100); | |
31 ctx.lineTo(1000, 1000); | |
32 ctx.stroke(); | |
33 _assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); | |
34 _assertPixel(offscreenCanvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255"); | |
35 _assertPixel(offscreenCanvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255"); | |
36 _assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); | |
37 | |
38 t.done(); | |
39 | |
40 }); | |
41 done(); | |
OLD | NEW |