Index: experimental/SkV8Example/js/sample.js |
diff --git a/experimental/SkV8Example/js/sample.js b/experimental/SkV8Example/js/sample.js |
index 81c717c7e822f9fecb1091dc03b6e0b2000cf5cf..7e7e40a918c02957bcc92d5db641db0ea461c5a3 100644 |
--- a/experimental/SkV8Example/js/sample.js |
+++ b/experimental/SkV8Example/js/sample.js |
@@ -3,10 +3,15 @@ |
*/ |
var onDraw = function(){ |
var tick = 0; |
+ var p = new Path2D(); |
+ p.rect(0, 0, 200, 200); |
+ |
function f(context) { |
tick += 0.1; |
- context.fillStyle = '#0000ff'; |
- context.fillRect(100, 100, Math.sin(tick)*100, Math.cos(tick)*100); |
+ |
+ context.translate(context.width/2, context.height/2); |
+ context.rotate(tick); |
+ context.drawPath(p); |
}; |
return f; |
}(); |