Bug 1918529 - fix some subpixel misalignment issues with gfx.webrender.svg-filter...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance / more / functions / isTests.html
blob54c1cb0603b2be266abd939e746b874954fecb05
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <!--
6 Copyright (c) 2019 The Khronos Group Inc.
7 Use of this source code is governed by an MIT-style license that can be
8 found in the LICENSE.txt file.
9 -->
10 <link rel="stylesheet" type="text/css" href="../unit.css" />
11 <script type="application/javascript" src="../unit.js"></script>
12 <script type="application/javascript" src="../util.js"></script>
13 <script type="application/javascript">
15 Tests.startUnit = function () {
16 var canvas = document.getElementById('gl');
17 var gl = wrapGLContext(getGLContext(canvas));
18 return [gl];
21 Tests.testIs = function(gl) {
22 var tex = loadTexture(gl, document.getElementById('2d'));
23 gl.bindTexture(gl.TEXTURE_2D, tex);
24 var fbo = new FBO(gl, 1, 1);
25 fbo.use();
26 var prog = gl.createProgram();
27 var sh1 = gl.createShader(gl.VERTEX_SHADER);
28 var sh2 = gl.createShader(gl.FRAGMENT_SHADER);
29 var buf = gl.createBuffer();
30 gl.bindBuffer(gl.ARRAY_BUFFER, buf);
31 assert("tex", gl.isTexture(tex));
32 assert("fbo", gl.isFramebuffer(fbo.fbo));
33 assert("rbo", gl.isRenderbuffer(fbo.rbo));
34 assert("prog", gl.isProgram(prog));
35 assert("sh1", gl.isShader(sh1));
36 assert("sh2", gl.isShader(sh2));
37 assert("buf", gl.isBuffer(buf));
38 gl.deleteTexture(tex);
39 gl.deleteFramebuffer(fbo.fbo);
40 gl.deleteRenderbuffer(fbo.rbo);
41 gl.deleteProgram(prog);
42 gl.deleteShader(sh1);
43 gl.deleteShader(sh2);
44 gl.deleteBuffer(buf);
45 // NOTE: we purposely do not unbind things.
46 assert("tex", !gl.isTexture(tex));
47 assert("fbo", !gl.isFramebuffer(fbo.fbo));
48 assert("rbo", !gl.isRenderbuffer(fbo.rbo));
49 assert("prog", !gl.isProgram(prog));
50 assert("sh1", !gl.isShader(sh1));
51 assert("sh2", !gl.isShader(sh2));
52 assert("buf", !gl.isBuffer(buf));
55 </script>
57 <style>canvas{ position:absolute; }</style>
58 </head><body>
59 <canvas id="gl" width="1" height="1"></canvas>
60 <canvas id="2d" width="16" height="16"></canvas>
61 </body></html>