Home | History | Annotate | Download | only in SkV8Example
      1 /**
      2  * @fileoverview Sample onDraw script for use with SkV8Example.
      3  */
      4 var onDraw = function(){
      5   var tick = 0;
      6   function f(context) {
      7     tick += 0.1;
      8     context.fillStyle = '#0000ff';
      9     context.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100);
     10   };
     11   return f;
     12 }();
     13 
     14 function onTimeout() {
     15   inval();
     16   print(setTimeout(onTimeout, 33));
     17 }
     18 
     19 setTimeout(onTimeout, 33);
     20