mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-06-29 20:09:15 +00:00
35 lines
921 B
JavaScript
35 lines
921 B
JavaScript
// DO NOT EDIT! This test has been generated by tools/gentest.py.
|
|
// OffscreenCanvas test in a worker:2d.path.transformation.changing
|
|
// Description:Transformations are applied while building paths, not when drawing
|
|
// Note:
|
|
|
|
importScripts("/resources/testharness.js");
|
|
importScripts("/common/canvas-tests.js");
|
|
|
|
var t = async_test("Transformations are applied while building paths, not when drawing");
|
|
t.step(function() {
|
|
|
|
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
|
var ctx = offscreenCanvas.getContext('2d');
|
|
|
|
ctx.fillStyle = '#f00';
|
|
ctx.fillRect(0, 0, 100, 50);
|
|
ctx.fillStyle = '#0f0';
|
|
ctx.moveTo(0, 0);
|
|
ctx.translate(100, 0);
|
|
ctx.lineTo(0, 0);
|
|
ctx.translate(0, 50);
|
|
ctx.lineTo(0, 0);
|
|
ctx.translate(-100, 0);
|
|
ctx.lineTo(0, 0);
|
|
ctx.translate(1000, 1000);
|
|
ctx.rotate(Math.PI/2);
|
|
ctx.scale(0.1, 0.1);
|
|
ctx.fill();
|
|
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
|
|
|
|
t.done();
|
|
|
|
});
|
|
done();
|