testing bad rendering of mac

This commit is contained in:
rustdesk 2022-04-06 23:26:49 +08:00
parent 67a210f9a4
commit 620fe81017
2 changed files with 10 additions and 0 deletions

View File

@ -75,6 +75,15 @@ export function draw(frame) {
gl.readPixels(0, 0, canvas.width, canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
console.log(new Date().getTime() - now);
}
var testCanvas = document.getElementById("test-yuv-decoder-canvas");
if (testCanvas && currentFrame) {
var ctx = testCanvas.getContext("2d");
testCanvas.width = frame.format.displayWidth;
testCanvas.height = frame.format.displayHeight;
var img = ctx.createImageData(testCanvas.width, testCanvas.height);
img.data.set(currentFrame);
ctx.putImageData(img, 0, 0);
}
}
export function sendOffCanvas(c) {

View File

@ -24,6 +24,7 @@ if (app) {
<div id="canvas" style="display: none;">
<button id="cancel" onclick="cancel();">Cancel</button>
<canvas id="player"></canvas>
<canvas id="test-yuv-decoder-canvas"></canvas>
</div>
`;