blob: 81c717c7e822f9fecb1091dc03b6e0b2000cf5cf [file] [log] [blame]
commit-bot@chromium.org48d94b8c2013-12-16 18:24:51 +00001/**
2 * @fileoverview Sample onDraw script for use with SkV8Example.
3 */
4var onDraw = function(){
5 var tick = 0;
commit-bot@chromium.orgc8d73282014-01-06 18:17:24 +00006 function f(context) {
commit-bot@chromium.org0fc0dea2013-12-18 04:45:37 +00007 tick += 0.1;
commit-bot@chromium.orgc8d73282014-01-06 18:17:24 +00008 context.fillStyle = '#0000ff';
9 context.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
commit-bot@chromium.org48d94b8c2013-12-16 18:24:51 +000010 };
11 return f;
12}();
commit-bot@chromium.org0fc0dea2013-12-18 04:45:37 +000013
14function onTimeout() {
15 inval();
commit-bot@chromium.org872796b2013-12-20 15:56:52 +000016 print(setTimeout(onTimeout, 33));
commit-bot@chromium.org0fc0dea2013-12-18 04:45:37 +000017}
18
19setTimeout(onTimeout, 33);