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

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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("rgba(255, 255, 255, 0)", [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