2 * Copyright 2014 Google Inc.
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #ifndef SkV8Example_Path2DBuilder_DEFINED
11 #define SkV8Example_Path2DBuilder_DEFINED
20 class Path2DBuilder : SkNoncopyable {
22 Path2DBuilder() : fSkPath() {}
23 virtual ~Path2DBuilder() {}
25 const SkPath& getSkPath() { return fSkPath; }
27 // The JS Path2DBuilder constuctor implementation.
28 static void ConstructPath(const v8::FunctionCallbackInfo<v8::Value>& args);
30 // Add the Path2DBuilder JS constructor to the global context.
31 static void AddToGlobal(Global* global);
33 // Path2DBuilder JS methods.
34 static void ClosePath(const v8::FunctionCallbackInfo<v8::Value>& args);
35 static void MoveTo(const v8::FunctionCallbackInfo<v8::Value>& args);
36 static void LineTo(const v8::FunctionCallbackInfo<v8::Value>& args);
37 static void QuadraticCurveTo(
38 const v8::FunctionCallbackInfo<v8::Value>& args);
39 static void BezierCurveTo(const v8::FunctionCallbackInfo<v8::Value>& args);
40 static void Arc(const v8::FunctionCallbackInfo<v8::Value>& args);
41 static void Rect(const v8::FunctionCallbackInfo<v8::Value>& args);
42 static void Oval(const v8::FunctionCallbackInfo<v8::Value>& args);
43 static void ConicTo(const v8::FunctionCallbackInfo<v8::Value>& args);
44 static void Finalize(const v8::FunctionCallbackInfo<v8::Value>& args);
48 static Path2DBuilder* Unwrap(const v8::FunctionCallbackInfo<v8::Value>& args);
50 static Global* gGlobal;