1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-03 03:56:26 +02:00

Test cleanup.

This commit is contained in:
kkapsner 2017-08-13 23:44:31 +02:00
parent d8f6fb1ac9
commit 7d0c9681df
11 changed files with 437 additions and 395 deletions

View file

@ -1,22 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<title>webGL test</title>
</head>
<body>
<canvas id="canvas" width="10" height="10"></canvas>
<span id="output"></span>
<script>
(function(){
var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
var values = [];
for (var i = 0; i < pixels.length; i += 1){
values[pixels[i]] = (values[pixels[i]] || 0) + 1;
}
document.getElementById("output").textContent = JSON.stringify(values);
}());
</script>
<h1>webGL test</h1>
Checks if the addon also supports webGL.
<div id="output"></div>
<script src="webGL-Test.js"></script>
</body></html>