OLD | NEW |
---|---|
(Empty) | |
1 /* | |
robertphillips
2014/01/06 15:37:04
2014
jcgregorio
2014/01/06 15:57:31
Done.
| |
2 * Copyright 2013 Google Inc. | |
3 * | |
4 * | |
5 * Use of this source code is governed by a BSD-style license that can be | |
6 * found in the LICENSE file. | |
7 * | |
8 */ | |
9 | |
10 #ifndef SkV8Example_Path_DEFINED | |
11 #define SkV8Example_Path_DEFINED | |
12 | |
13 #include <v8.h> | |
14 | |
15 using namespace v8; | |
16 | |
17 #include "SkPath.h" | |
18 #include "SkTypes.h" | |
19 | |
20 class Global; | |
21 | |
22 class Path : SkNoncopyable { | |
23 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
| |
24 Path() | |
25 : fSkPath() | |
26 {} | |
27 virtual ~Path() {} | |
28 | |
robertphillips
2014/01/06 15:37:04
One line?
jcgregorio
2014/01/06 15:57:31
Done.
| |
29 const SkPath& getSkPath() { | |
30 return fSkPath; | |
31 } | |
32 | |
33 // The JS Path constuctor implementation. | |
34 static void ConstructPath(const v8::FunctionCallbackInfo<Value>& args); | |
35 | |
36 // Add the Path JS constructor to the global context. | |
37 static void AddToGlobal(Global* global); | |
38 | |
39 // Path JS methods. | |
40 static void ClosePath(const v8::FunctionCallbackInfo<Value>& args); | |
41 static void MoveTo(const v8::FunctionCallbackInfo<Value>& args); | |
42 static void LineTo(const v8::FunctionCallbackInfo<Value>& args); | |
43 static void QuadraticCurveTo(const v8::FunctionCallbackInfo<Value>& args); | |
44 static void BezierCurveTo(const v8::FunctionCallbackInfo<Value>& args); | |
45 static void Arc(const v8::FunctionCallbackInfo<Value>& args); | |
46 static void Rect(const v8::FunctionCallbackInfo<Value>& args); | |
47 private: | |
48 SkPath fSkPath; | |
49 | |
50 static Path* Unwrap(const v8::FunctionCallbackInfo<Value>& args); | |
51 | |
52 static Global* gGlobal; | |
53 }; | |
54 | |
55 #endif | |
OLD | NEW |