OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkLua_DEFINED | 8 #ifndef SkLua_DEFINED |
9 #define SkLua_DEFINED | 9 #define SkLua_DEFINED |
10 | 10 |
11 #include "SkClipStack.h" | 11 #include "SkClipStack.h" |
12 #include "SkColor.h" | 12 #include "SkColor.h" |
13 #include "SkPathEffect.h" | 13 #include "SkPathEffect.h" |
14 #include "SkScalar.h" | 14 #include "SkScalar.h" |
15 #include "SkString.h" | 15 #include "SkString.h" |
16 | 16 |
17 struct lua_State; | 17 struct lua_State; |
18 | 18 |
19 class SkCanvas; | 19 class SkCanvas; |
20 class SkMatrix; | 20 class SkMatrix; |
21 class SkPaint; | 21 class SkPaint; |
22 class SkPath; | 22 class SkPath; |
23 struct SkRect; | 23 struct SkRect; |
24 class SkRRect; | 24 class SkRRect; |
| 25 class SkTextBlob; |
25 | 26 |
26 #define SkScalarToLua(x) SkScalarToDouble(x) | 27 #define SkScalarToLua(x) SkScalarToDouble(x) |
27 #define SkLuaToScalar(x) SkDoubleToScalar(x) | 28 #define SkLuaToScalar(x) SkDoubleToScalar(x) |
28 | 29 |
29 class SkLua { | 30 class SkLua { |
30 public: | 31 public: |
31 static void Load(lua_State*); | 32 static void Load(lua_State*); |
32 | 33 |
33 SkLua(const char termCode[] = NULL); // creates a new L, will close it | 34 SkLua(const char termCode[] = NULL); // creates a new L, will close it |
34 SkLua(lua_State*); // uses L, will not close it | 35 SkLua(lua_State*); // uses L, will not close it |
(...skipping 18 matching lines...) Expand all Loading... |
53 void pushScalar(SkScalar, const char tableKey[] = NULL); | 54 void pushScalar(SkScalar, const char tableKey[] = NULL); |
54 void pushRect(const SkRect&, const char tableKey[] = NULL); | 55 void pushRect(const SkRect&, const char tableKey[] = NULL); |
55 void pushRRect(const SkRRect&, const char tableKey[] = NULL); | 56 void pushRRect(const SkRRect&, const char tableKey[] = NULL); |
56 void pushDash(const SkPathEffect::DashInfo&, const char tableKey[] = NULL); | 57 void pushDash(const SkPathEffect::DashInfo&, const char tableKey[] = NULL); |
57 void pushMatrix(const SkMatrix&, const char tableKey[] = NULL); | 58 void pushMatrix(const SkMatrix&, const char tableKey[] = NULL); |
58 void pushPaint(const SkPaint&, const char tableKey[] = NULL); | 59 void pushPaint(const SkPaint&, const char tableKey[] = NULL); |
59 void pushPath(const SkPath&, const char tableKey[] = NULL); | 60 void pushPath(const SkPath&, const char tableKey[] = NULL); |
60 void pushCanvas(SkCanvas*, const char tableKey[] = NULL); | 61 void pushCanvas(SkCanvas*, const char tableKey[] = NULL); |
61 void pushClipStack(const SkClipStack&, const char tableKey[] = NULL); | 62 void pushClipStack(const SkClipStack&, const char tableKey[] = NULL); |
62 void pushClipStackElement(const SkClipStack::Element& element, const char ta
bleKey[] = NULL); | 63 void pushClipStackElement(const SkClipStack::Element& element, const char ta
bleKey[] = NULL); |
| 64 void pushTextBlob(const SkTextBlob*, const char tableKey[] = NULL); |
63 | 65 |
64 // This SkCanvas lua methods is declared here to benefit from SkLua's friend
ship with SkCanvas. | 66 // This SkCanvas lua methods is declared here to benefit from SkLua's friend
ship with SkCanvas. |
65 static int lcanvas_getReducedClipStack(lua_State* L); | 67 static int lcanvas_getReducedClipStack(lua_State* L); |
66 | 68 |
67 private: | 69 private: |
68 lua_State* fL; | 70 lua_State* fL; |
69 SkString fTermCode; | 71 SkString fTermCode; |
70 bool fWeOwnL; | 72 bool fWeOwnL; |
71 }; | 73 }; |
72 | 74 |
73 #endif | 75 #endif |
OLD | NEW |