Skip to content

Commit

Permalink
Fix image-decoder-to-texture in WebGL 2 mode.
Browse files Browse the repository at this point in the history
The test was fetching nonexistent "width" and "height" properties on
the VideoFrame, leading to a (0, 0)-sized texture upload. codedWidth
and codedHeight are the best approximation without handling the full
visibleRect in the test.

Follow-on to #3641 .

Associated with Chromium bug crbug.com/337904214 .
  • Loading branch information
kenrussell committed May 4, 2024
1 parent 992583d commit 621c1b8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
let frame = decodeResult.image;
if (window.WebGL2RenderingContext && gl instanceof window.WebGL2RenderingContext) {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, frame.width, frame.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, frame);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, frame.codedWidth, frame.codedHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, frame);
} else {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, frame);
}
Expand Down

0 comments on commit 621c1b8

Please sign in to comment.