browser/devtools/canvasdebugger/test/doc_simple-canvas.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!-- Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ -->
michael@0 3 <!doctype html>
michael@0 4
michael@0 5 <html>
michael@0 6 <head>
michael@0 7 <meta charset="utf-8"/>
michael@0 8 <title>Canvas inspector test page</title>
michael@0 9 </head>
michael@0 10
michael@0 11 <body>
michael@0 12 <canvas width="128" height="128"></canvas>
michael@0 13
michael@0 14 <script type="text/javascript;version=1.8">
michael@0 15 "use strict";
michael@0 16
michael@0 17 var ctx = document.querySelector("canvas").getContext("2d");
michael@0 18
michael@0 19 function drawRect(fill, size) {
michael@0 20 ctx.fillStyle = fill;
michael@0 21 ctx.fillRect(size[0], size[1], size[2], size[3]);
michael@0 22 }
michael@0 23
michael@0 24 function drawScene() {
michael@0 25 ctx.clearRect(0, 0, 128, 128);
michael@0 26 drawRect("rgb(192, 192, 192)", [0, 0, 128, 128]);
michael@0 27 drawRect("rgba(0, 0, 192, 0.5)", [30, 30, 55, 50]);
michael@0 28 drawRect("rgba(192, 0, 0, 0.5)", [10, 10, 55, 50]);
michael@0 29
michael@0 30 window.requestAnimationFrame(drawScene);
michael@0 31 }
michael@0 32
michael@0 33 drawScene();
michael@0 34 </script>
michael@0 35 </body>
michael@0 36
michael@0 37 </html>

mercurial