Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1099)

Unified Diff: experimental/SkV8Example/js/sample.js

Issue 676423002: Start moving to the new canvas structure. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/SkV8Example/JsContext.h ('k') | gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}();
« no previous file with comments | « experimental/SkV8Example/JsContext.h ('k') | gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698