aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-23 13:53:12 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-23 13:53:12 +0000
commitc896f4de12a8bb5c2404f03e5be9089fe3f2c7bd (patch)
tree0cdff24ff07a5a86b3d488b6f1082f7a40e93022 /experimental
parent5a064e3af8e30d8160e9e67dbe263baf9762c9b6 (diff)
Both gears and snow should detect if Path is available, and also report on the console if present.
BUG=skia: R=robertphillips@google.com Author: jcgregorio@google.com Review URL: https://codereview.chromium.org/143743004 git-svn-id: http://skia.googlecode.com/svn/trunk@13147 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental')
-rw-r--r--experimental/SkV8Example/gears.js1
-rw-r--r--experimental/SkV8Example/snow.js9
2 files changed, 7 insertions, 3 deletions
diff --git a/experimental/SkV8Example/gears.js b/experimental/SkV8Example/gears.js
index 5ba2f995c2..82b4b1e602 100644
--- a/experimental/SkV8Example/gears.js
+++ b/experimental/SkV8Example/gears.js
@@ -139,3 +139,4 @@ if (!IS_SKV8) {
}
}
+console.log("HAS_PATH: " + HAS_PATH);
diff --git a/experimental/SkV8Example/snow.js b/experimental/SkV8Example/snow.js
index 87ce119198..f3527dbd73 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);