OLD | NEW |
| (Empty) |
1 // DO NOT EDIT! This test has been generated by tools/gentest.py. | |
2 // OffscreenCanvas test in a worker:2d.shadow.gradient.alpha | |
3 // Description:Shadows are drawn correctly for partially-transparent gradient fi
lls | |
4 // Note: | |
5 | |
6 importScripts("/resources/testharness.js"); | |
7 importScripts("/common/canvas-tests.js"); | |
8 | |
9 var t = async_test("Shadows are drawn correctly for partially-transparent gradie
nt fills"); | |
10 t.step(function() { | |
11 | |
12 var offscreenCanvas = new OffscreenCanvas(100, 50); | |
13 var ctx = offscreenCanvas.getContext('2d'); | |
14 | |
15 var gradient = ctx.createLinearGradient(0, 0, 100, 0); | |
16 gradient.addColorStop(0, 'rgba(255,0,0,0.5)'); | |
17 gradient.addColorStop(1, 'rgba(255,0,0,0.5)'); | |
18 ctx.fillStyle = '#f00'; | |
19 ctx.fillRect(0, 0, 100, 50); | |
20 ctx.shadowOffsetY = 50; | |
21 ctx.shadowColor = '#00f'; | |
22 ctx.fillStyle = gradient; | |
23 ctx.fillRect(0, -50, 100, 50); | |
24 _assertPixelApprox(offscreenCanvas, 50,25, 127,0,127,255, "50,25", "127,0,127,25
5", 2); | |
25 | |
26 t.done(); | |
27 | |
28 }); | |
29 done(); | |
OLD | NEW |