OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> |
| 3 <title>OffscreenCanvas test: 2d.line.join.miter</title> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="/common/canvas-tests.js"></script> |
| 7 |
| 8 <h1>2d.line.join.miter</h1> |
| 9 <p class="desc">lineJoin 'miter' is rendered correctly</p> |
| 10 |
| 11 |
| 12 <script> |
| 13 var t = async_test("lineJoin 'miter' is rendered correctly"); |
| 14 t.step(function() { |
| 15 |
| 16 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 17 var ctx = offscreenCanvas.getContext('2d'); |
| 18 |
| 19 ctx.fillStyle = '#0f0'; |
| 20 ctx.fillRect(0, 0, 100, 50); |
| 21 ctx.lineJoin = 'miter'; |
| 22 ctx.lineWidth = 20; |
| 23 ctx.fillStyle = '#f00'; |
| 24 ctx.strokeStyle = '#0f0'; |
| 25 ctx.fillStyle = '#f00'; |
| 26 ctx.strokeStyle = '#0f0'; |
| 27 ctx.fillRect(10, 10, 30, 20); |
| 28 ctx.fillRect(20, 10, 20, 30); |
| 29 ctx.beginPath(); |
| 30 ctx.moveTo(10, 20); |
| 31 ctx.lineTo(30, 20); |
| 32 ctx.lineTo(30, 40); |
| 33 ctx.stroke(); |
| 34 ctx.fillStyle = '#0f0'; |
| 35 ctx.strokeStyle = '#f00'; |
| 36 ctx.beginPath(); |
| 37 ctx.moveTo(60, 20); |
| 38 ctx.lineTo(80, 20); |
| 39 ctx.lineTo(80, 40); |
| 40 ctx.stroke(); |
| 41 ctx.fillRect(60, 10, 30, 20); |
| 42 ctx.fillRect(70, 10, 20, 30); |
| 43 _assertPixel(offscreenCanvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255"); |
| 44 _assertPixel(offscreenCanvas, 39,11, 0,255,0,255, "39,11", "0,255,0,255"); |
| 45 _assertPixel(offscreenCanvas, 40,10, 0,255,0,255, "40,10", "0,255,0,255"); |
| 46 _assertPixel(offscreenCanvas, 41,9, 0,255,0,255, "41,9", "0,255,0,255"); |
| 47 _assertPixel(offscreenCanvas, 42,8, 0,255,0,255, "42,8", "0,255,0,255"); |
| 48 _assertPixel(offscreenCanvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255"); |
| 49 _assertPixel(offscreenCanvas, 89,11, 0,255,0,255, "89,11", "0,255,0,255"); |
| 50 _assertPixel(offscreenCanvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255"); |
| 51 _assertPixel(offscreenCanvas, 91,9, 0,255,0,255, "91,9", "0,255,0,255"); |
| 52 _assertPixel(offscreenCanvas, 92,8, 0,255,0,255, "92,8", "0,255,0,255"); |
| 53 |
| 54 t.done(); |
| 55 |
| 56 }); |
| 57 </script> |
OLD | NEW |