-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpu_test.html
36 lines (31 loc) · 1.01 KB
/
gpu_test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="styles/common.css" />
<title>GPU-related problems</title>
</head>
<body onload="drawImages()">
<div>
<a href="gpu_tiled_image.html">GPU tiled image, beware, HUGE size</a><br>
</div>
<div>
<h4>GPU accelerated canvas</h4>
<canvas id="gpu_canvas" width=400 height=400 style="height: 400px; width: 400px; top: 0px; left: 0px; transform: translate3d(0px, 0px, 0px) scale(1, 1); z-index: 2500; cursor: default; border-style: solid; border-width: 2px;"></canvas>
<br>
Image above should not have any glitches on its sides, like tiling effect.
<br>
<img id="not_mult4_image" src="images/achievement.jpg">
</div>
<script type="text/javascript">
function drawNotMultOf4Image() {
var canvas = document.getElementById('gpu_canvas');
var ctx = canvas.getContext('2d');
var image = document.getElementById('not_mult4_image');
ctx.drawImage(image, 0, 0);
}
function drawImages() {
drawNotMultOf4Image();
}
</script>
</body>
</html>