blob: 2d06e9f8c80c396619ecd4ef480b95362ecc5ac5 [file] [log] [blame]
<html>
<script src="./resources/webgl-test-utils-full.js"></script>
<script src="./resources/tex-image-and-sub-image-utils.js"></script>
<script src="./resources/tex-image-and-sub-image-image-bitmap-utils-resize.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
function setCanvasToRedGreen(ctx) {
var width = ctx.canvas.width;
var halfWidth = Math.floor(width / 2);
var height = ctx.canvas.height;
var halfHeight = Math.floor(height / 2);
ctx.fillStyle = "rgba(255, 0, 0, 1)";
ctx.fillRect(0, 0, halfWidth, halfHeight);
ctx.fillStyle = "rgba(255, 0, 0, 0.1)";
ctx.fillRect(halfWidth, 0, halfWidth, halfHeight);
ctx.fillStyle = "rgba(0, 255, 0, 1)";
ctx.fillRect(0, halfHeight, halfWidth, halfHeight);
ctx.fillStyle = "rgba(0, 255, 0, 0.1)";
ctx.fillRect(halfWidth, halfHeight, halfWidth, halfHeight);
}
var testCanvas = document.createElement('canvas');
testCanvas.width = 2;
testCanvas.height = 2;
var offscreen = testCanvas.transferControlToOffscreen();
var ctx = offscreen.getContext("2d");
setCanvasToRedGreen(ctx);
var testOptions = {sourceName: "OffscreenCanvas", imageSource: offscreen,
sourceIsPremul: true, resizeWidth: 4, resizeHeight: 4};
prepareWebGLContext();
prepareResizedImageBitmapsAndRuntTests(testOptions);
</script>