mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -24,12 +24,11 @@ function testGLCanvas(gl, width, height, expectedPixel, assertCompares) {
|
|||
|
||||
function testTexImage2DFromVideoFrame(
|
||||
width, height, useTexSubImage2D, expectedPixel) {
|
||||
let vfInit = {timestamp: 0, codedWidth: width, codedHeight: height};
|
||||
let u32Data = new Uint32Array(vfInit.codedWidth * vfInit.codedHeight);
|
||||
u32Data.fill(0xFF966432); // 'rgb(50, 100, 150)';
|
||||
let argbPlaneData = new Uint8Array(u32Data.buffer);
|
||||
let argbPlane = {src: argbPlaneData, stride: width * 4, rows: height};
|
||||
let frame = new VideoFrame('ABGR', [argbPlane], vfInit);
|
||||
let vfInit =
|
||||
{format: 'RGBA', timestamp: 0, codedWidth: width, codedHeight: height};
|
||||
let argbData = new Uint32Array(vfInit.codedWidth * vfInit.codedHeight);
|
||||
argbData.fill(0xFF966432); // 'rgb(50, 100, 150)';
|
||||
let frame = new VideoFrame(argbData, vfInit);
|
||||
|
||||
let gl_canvas = new OffscreenCanvas(width, height);
|
||||
let gl = gl_canvas.getContext('webgl');
|
||||
|
@ -83,18 +82,48 @@ function testTexImage2DFromVideoFrame(
|
|||
testGLCanvas(gl, width, height, expectedPixel, assert_equals);
|
||||
}
|
||||
|
||||
test(() => {
|
||||
return testTexImage2DFromVideoFrame(48, 36, false, kSRGBPixel);
|
||||
}, 'drawImage(VideoFrame) with texImage2D (48x36) srgb.');
|
||||
function testTexImageWithClosedVideoFrame(useTexSubImage2D) {
|
||||
let width = 128;
|
||||
let height = 128;
|
||||
let vfInit =
|
||||
{format: 'RGBA', timestamp: 0, codedWidth: width, codedHeight: height};
|
||||
let argbData = new Uint32Array(vfInit.codedWidth * vfInit.codedHeight);
|
||||
argbData.fill(0xFF966432); // 'rgb(50, 100, 150)';
|
||||
let frame = new VideoFrame(argbData, vfInit);
|
||||
|
||||
test(() => {
|
||||
return testTexImage2DFromVideoFrame(48, 36, true, kSRGBPixel);
|
||||
}, 'drawImage(VideoFrame) with texSubImage2D (48x36) srgb.');
|
||||
let gl_canvas = new OffscreenCanvas(width, height);
|
||||
let gl = gl_canvas.getContext('webgl');
|
||||
|
||||
test(() => {
|
||||
return testTexImage2DFromVideoFrame(480, 360, false, kSRGBPixel);
|
||||
}, 'drawImage(VideoFrame) with texImage2D (480x360) srgb.');
|
||||
frame.close();
|
||||
if (useTexSubImage2D) {
|
||||
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, frame);
|
||||
} else {
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);
|
||||
}
|
||||
|
||||
test(() => {
|
||||
return testTexImage2DFromVideoFrame(480, 360, true, kSRGBPixel);
|
||||
}, 'drawImage(VideoFrame) with texSubImage2D (480x360) srgb.');
|
||||
assert_equals(gl.getError(), gl.INVALID_OPERATION);
|
||||
}
|
||||
|
||||
test(_ => {
|
||||
testTexImage2DFromVideoFrame(48, 36, false, kSRGBPixel);
|
||||
}, 'texImage2D with 48x36 srgb VideoFrame.');
|
||||
|
||||
test(_ => {
|
||||
testTexImage2DFromVideoFrame(48, 36, true, kSRGBPixel);
|
||||
}, 'texSubImage2D with 48x36 srgb VideoFrame.');
|
||||
|
||||
test(_ => {
|
||||
testTexImage2DFromVideoFrame(480, 360, false, kSRGBPixel);
|
||||
}, 'texImage2D with 480x360 srgb VideoFrame.');
|
||||
|
||||
test(_ => {
|
||||
testTexImage2DFromVideoFrame(480, 360, true, kSRGBPixel);
|
||||
}, 'texSubImage2D with 480x360 srgb VideoFrame.');
|
||||
|
||||
test(_ => {
|
||||
testTexImageWithClosedVideoFrame(false);
|
||||
}, 'texImage2D with a closed VideoFrame.');
|
||||
|
||||
test(_ => {
|
||||
testTexImageWithClosedVideoFrame(true);
|
||||
}, 'texSubImage2D with a closed VideoFrame.');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue