skia2/experimental/SkV8Example/sample.js
2014-01-06 18:17:24 +00:00

20 lines
384 B
JavaScript

/**
* @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);