aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/SkV8Example/sample.js
blob: 81c717c7e822f9fecb1091dc03b6e0b2000cf5cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * @fileoverview Sample onDraw script for use with SkV8Example.
 */
var onDraw = function(){
  var tick = 0;
  function f(context) {
    tick += 0.1;
    context.fillStyle = '#0000ff';
    context.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
  };
  return f;
}();

function onTimeout() {
  inval();
  print(setTimeout(onTimeout, 33));
}

setTimeout(onTimeout, 33);