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

Unified Diff: experimental/SkV8Example/snow.js

Issue 143743004: Both gears and snow should detect if Path is available, and also report on the console if present. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/SkV8Example/gears.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/SkV8Example/snow.js
diff --git a/experimental/SkV8Example/snow.js b/experimental/SkV8Example/snow.js
index 87ce11919856549cc82087a3fa6c16b0a9ad1327..f3527dbd73fbb0cb89042082bb47e01e668f3b36 100644
--- a/experimental/SkV8Example/snow.js
+++ b/experimental/SkV8Example/snow.js
@@ -1,9 +1,10 @@
var IS_SKV8 = typeof document == "undefined";
+var HAS_PATH = typeof Path != "undefined";
function circlePath(r) {
- if (IS_SKV8) {
+ if (HAS_PATH) {
var p = new Path();
- p.oval(0, 0, r, r);
+ p.arc(0, 0, r, 0, 2*Math.PI);
p.closePath();
return p;
} else {
@@ -48,7 +49,7 @@ var onDraw = function() {
if(p.y>(H+1)){
p.y = 0;
}
- if (IS_SKV8) {
+ if (HAS_PATH) {
ctx.save();
ctx.translate(p.x, p.y);
ctx.fill(p.path);
@@ -90,3 +91,5 @@ if (!IS_SKV8) {
setTimeout(drawCallback, 1);
}
}
+
+console.log("HAS_PATH: " + HAS_PATH);
« no previous file with comments | « experimental/SkV8Example/gears.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698