blob: 5b0f0013546d18c3e92a1a3e435e21bcdff4ef93 [file] [log] [blame]
commit-bot@chromium.orgc8d73282014-01-06 18:17:24 +00001/**
2 * @fileoverview Sample onDraw script for use with SkV8Example.
3 */
4var onDraw = function(){
5 var tick = 0;
6 function f(canvas) {
7 tick += 0.1;
8 canvas.fillStyle = '#0000ff';
9 canvas.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
10 inval();
11 };
12
13 function onTimeout() {
14 print(tick*10, " FPS");
15 setTimeout(onTimeout, 1000);
16 tick=0;
17 }
18
19 setTimeout(onTimeout, 1000);
20
21 return f;
22}();
23