mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
WebGLRenderingContext getters and getParameter
This implements the `canvas`, `drawingBufferHeight` and `drawingBufferWidth` getters to `WebGLRenderingContext`, and an initial version of `getParameter`.
This commit is contained in:
parent
0de09b936e
commit
eff2bb4310
6 changed files with 89 additions and 13 deletions
14
tests/html/test_webgl_context_getters.html
Normal file
14
tests/html/test_webgl_context_getters.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>WebGLRenderingContext attributes test</title>
|
||||
<script>
|
||||
var canvas = document.createElement('canvas'),
|
||||
gl = canvas.getContext('webgl');
|
||||
|
||||
if ( gl.canvas !== canvas )
|
||||
console.error("Expected a canvas getter");
|
||||
|
||||
if ( typeof gl.drawingBufferWidth !== "number" ||
|
||||
typeof gl.drawingBufferHeight !== "number" )
|
||||
console.error("drawingBuffer{Height/Width} should be numbers");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue