Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf authored Oct 20, 2022
1 parent 5989797 commit 73da362
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions webcodecs/videoFrame-texImage.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ function testTexImage2DFromVideoFrame(
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');
let canvas;
if (self.HTMLCanvasElement) {
canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
} else
canvas = new OffscreenCanvas(width, height);
let gl = canvas.getContext('webgl');

let program = WebGLTestUtils.setupTexturedQuad(gl);
gl.clearColor(0, 0, 0, 1);
Expand Down Expand Up @@ -91,8 +97,14 @@ function testTexImageWithClosedVideoFrame(useTexSubImage2D) {
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');
let canvas;
if (self.HTMLCanvasElement) {
canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
} else
canvas = new OffscreenCanvas(width, height);
let gl = canvas.getContext('webgl');

frame.close();
if (useTexSubImage2D) {
Expand Down

0 comments on commit 73da362

Please sign in to comment.