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

Side by Side Diff: experimental/SkV8Example/path.js

Issue 121303004: Fleshed out a lot of the Path interfac (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: unused imports Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « experimental/SkV8Example/SkV8Example.cpp ('k') | experimental/SkV8Example/sample.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /**
2 * @fileoverview Sample onDraw script for use with SkV8Example.
3 */
4 var onDraw = function(){
5 var p = new Path();
6 p.moveTo(0, 0);
7 p.bezierCurveTo(0, 100, 100, 0, 200, 200);
8 p.close();
9 p.moveTo(0, 300);
10 p.arc(0, 300, 40, Math.PI/2, 3/2*Math.PI);
11 function f(context) {
12 context.translate(10, 10);
13 for (var i=0; i<256; i++) {
14 context.fillStyle = '#0000' + toHex(i);
15 context.stroke(p);
16 context.translate(1, 0);
17 }
18 context.fillStyle = '#ff0000';
19 print(context.width, context.height);
20 context.resetTransform();
21 context.fillRect(context.width/2, context.height/2, 20, 20);
22
23 };
24 return f;
25 }();
26
27
28 function toHex(n) {
29 var s = n.toString(16);
30 if (s.length == 1) {
31 s = "0" + s;
32 }
33 return s;
34 }
OLDNEW
« no previous file with comments | « experimental/SkV8Example/SkV8Example.cpp ('k') | experimental/SkV8Example/sample.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698