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

Unified Diff: experimental/SkV8Example/Path.h

Issue 121303004: Fleshed out a lot of the Path interfac (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
Index: experimental/SkV8Example/Path.h
diff --git a/experimental/SkV8Example/Path.h b/experimental/SkV8Example/Path.h
new file mode 100644
index 0000000000000000000000000000000000000000..693fe63cdd33080e007f19c211ddb7177dafcf63
--- /dev/null
+++ b/experimental/SkV8Example/Path.h
@@ -0,0 +1,55 @@
+/*
robertphillips 2014/01/06 15:37:04 2014
jcgregorio 2014/01/06 15:57:31 Done.
+ * Copyright 2013 Google Inc.
+ *
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ */
+
+#ifndef SkV8Example_Path_DEFINED
+#define SkV8Example_Path_DEFINED
+
+#include <v8.h>
+
+using namespace v8;
+
+#include "SkPath.h"
+#include "SkTypes.h"
+
+class Global;
+
+class Path : SkNoncopyable {
+public:
robertphillips 2014/01/06 15:37:04 All on one line? Do we even need the ": fSkPath()"
jcgregorio 2014/01/06 15:57:31 Made all one line, but left fSkPath(), I like expl
+ Path()
+ : fSkPath()
+ {}
+ virtual ~Path() {}
+
robertphillips 2014/01/06 15:37:04 One line?
jcgregorio 2014/01/06 15:57:31 Done.
+ const SkPath& getSkPath() {
+ return fSkPath;
+ }
+
+ // The JS Path constuctor implementation.
+ static void ConstructPath(const v8::FunctionCallbackInfo<Value>& args);
+
+ // Add the Path JS constructor to the global context.
+ static void AddToGlobal(Global* global);
+
+ // Path JS methods.
+ static void ClosePath(const v8::FunctionCallbackInfo<Value>& args);
+ static void MoveTo(const v8::FunctionCallbackInfo<Value>& args);
+ static void LineTo(const v8::FunctionCallbackInfo<Value>& args);
+ static void QuadraticCurveTo(const v8::FunctionCallbackInfo<Value>& args);
+ static void BezierCurveTo(const v8::FunctionCallbackInfo<Value>& args);
+ static void Arc(const v8::FunctionCallbackInfo<Value>& args);
+ static void Rect(const v8::FunctionCallbackInfo<Value>& args);
+private:
+ SkPath fSkPath;
+
+ static Path* Unwrap(const v8::FunctionCallbackInfo<Value>& args);
+
+ static Global* gGlobal;
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698