blob: d5c169805ec3a04bbdf1f61cc59ce66d3e92adba [file] [log] [blame]
reed@google.comdff7e112013-05-15 19:34:20 +00001/*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "SkLuaCanvas.h"
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +00009#include "SkRRect.h"
reed@google.comdff7e112013-05-15 19:34:20 +000010
11extern "C" {
12 #include "lua.h"
mike@reedtribe.orgf02fe3d2013-05-21 12:20:39 +000013 #include "lauxlib.h"
reed@google.comdff7e112013-05-15 19:34:20 +000014}
15
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +000016static void setfield_string(lua_State* L, const char key[], const char value[]) {
17 lua_pushstring(L, value);
18 lua_setfield(L, -2, key);
reed@google.comdff7e112013-05-15 19:34:20 +000019}
20
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +000021static void setfield_number(lua_State* L, const char key[], double value) {
22 lua_pushnumber(L, value);
23 lua_setfield(L, -2, key);
24}
25
26static void setfield_bool(lua_State* L, const char key[], bool value) {
27 lua_pushboolean(L, value);
28 lua_setfield(L, -2, key);
29}
30
reed@google.com57de5cf2013-05-16 13:51:07 +000031// sets [1]...[count] in the table on the top of the stack
32static void setfield_arrayf(lua_State* L, const SkScalar array[], int count) {
33 for (int i = 0; i < count; ++i) {
34 lua_pushnumber(L, SkScalarToDouble(i + 1)); // key
35 lua_pushnumber(L, SkScalarToDouble(array[i])); // value
36 lua_settable(L, -3);
37 }
38}
39
reed@google.com9a731042013-05-21 17:52:33 +000040static void push_rect(lua_State* L, const SkRect& r) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +000041 lua_newtable(L);
42 setfield_number(L, "left", r.fLeft);
43 setfield_number(L, "top", r.fTop);
44 setfield_number(L, "right", r.fRight);
45 setfield_number(L, "bottom", r.fBottom);
reed@google.com9a731042013-05-21 17:52:33 +000046}
47
48static void setfield_rect(lua_State* L, const char key[], const SkRect& r) {
49 push_rect(L, r);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +000050 lua_setfield(L, -2, key);
51}
52
reed@google.com57de5cf2013-05-16 13:51:07 +000053static const char* rrect_type(const SkRRect& rr) {
54 switch (rr.getType()) {
55 case SkRRect::kUnknown_Type: return "unknown";
56 case SkRRect::kEmpty_Type: return "empty";
57 case SkRRect::kRect_Type: return "rect";
58 case SkRRect::kOval_Type: return "oval";
59 case SkRRect::kSimple_Type: return "simple";
60 case SkRRect::kComplex_Type: return "complex";
61 }
62 SkASSERT(!"never get here");
63 return "";
64}
65
66static void setfield_rrect(lua_State* L, const char key[], const SkRRect& rr) {
67 lua_newtable(L);
68 setfield_rect(L, "rect", rr.getBounds());
69 setfield_string(L, "type", rrect_type(rr));
70
71 SkVector rad[4] = {
72 rr.radii(SkRRect::kUpperLeft_Corner),
73 rr.radii(SkRRect::kUpperRight_Corner),
74 rr.radii(SkRRect::kLowerRight_Corner),
75 rr.radii(SkRRect::kLowerLeft_Corner),
76 };
77 setfield_arrayf(L, &rad[0].fX, 8);
78 lua_setfield(L, -2, key);
79}
80
mike@reedtribe.orgf02fe3d2013-05-21 12:20:39 +000081static void push_matrix(lua_State* L, const SkMatrix& mat) {
82 SkScalar m[9];
83 for (int i = 0; i < 9; ++i) {
84 m[i] = mat[i];
85 }
86 lua_newtable(L);
87 setfield_arrayf(L, m, 9);
88}
89
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +000090enum PaintUsage {
91 kText_PaintUsage,
92 kImage_PaintUsage,
93 kGeometry_PaintUsage
94};
95
96static const char* color2string(SkColor c, SkString* str) {
97 str->printf("0x%08X", c);
98 return str->c_str();
99}
100
101static void setfield_paint(lua_State* L, const SkPaint& p,
102 PaintUsage pu = kGeometry_PaintUsage) {
103 SkString str;
104
105 lua_newtable(L);
106 setfield_bool(L, "aa", p.isAntiAlias());
107 setfield_string(L, "color", color2string(p.getColor(), &str));
108
109 if (kGeometry_PaintUsage == pu) {
110 if (SkPaint::kFill_Style != p.getStyle()) {
111 setfield_number(L, "stroke-width", p.getStrokeWidth());
112 }
113 }
114 lua_setfield(L, -2, "paint");
115}
116
117class AutoCallLua {
118public:
119 AutoCallLua(lua_State* L, const char func[], const char verb[]) : fL(L) {
120 lua_getglobal(L, func);
121 if (!lua_isfunction(L, -1)) {
122 int t = lua_type(L, -1);
123 SkDebugf("--- expected function %d\n", t);
124 }
skia.committer@gmail.com539f3642013-05-16 07:01:00 +0000125
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000126 lua_newtable(L);
127 setfield_string(L, "verb", verb);
128 }
129
130 ~AutoCallLua() {
131 if (lua_pcall(fL, 1, 0, 0) != LUA_OK) {
132 SkDebugf("lua err: %s\n", lua_tostring(fL, -1));
133 }
134 lua_settop(fL, -1);
135 }
136
137private:
138 lua_State* fL;
139};
140
141#define AUTO_LUA(verb) AutoCallLua acl(fL, fFunc.c_str(), verb)
142
reed@google.comdff7e112013-05-15 19:34:20 +0000143///////////////////////////////////////////////////////////////////////////////
144
mike@reedtribe.orgf02fe3d2013-05-21 12:20:39 +0000145static const char gCanvasMetaTableName[] = "SkCanvas_MetaTable";
146
147static int lcanvas_getSaveCount(lua_State* L) {
148 SkCanvas* c = *(SkCanvas**)luaL_checkudata(L, 1, gCanvasMetaTableName);
149 lua_pushnumber(L, (double)c->getSaveCount());
150 return 1;
151}
152
153static int lcanvas_getTotalMatrix(lua_State* L) {
154 SkCanvas* c = *(SkCanvas**)luaL_checkudata(L, 1, gCanvasMetaTableName);
155 push_matrix(L, c->getTotalMatrix());
156 return 1;
157}
158
159static int lcanvas_gc(lua_State* L) {
160 SkCanvas** cptr = (SkCanvas**)luaL_checkudata(L, 1, gCanvasMetaTableName);
161 SkSafeUnref(*cptr);
162 *cptr = NULL;
163 return 0;
164}
165
166static const struct luaL_Reg gLuaCanvasMethods[] = {
167 { "getSaveCount", lcanvas_getSaveCount },
168 { "getTotalMatrix", lcanvas_getTotalMatrix },
169 { "__gc", lcanvas_gc },
170 { NULL, NULL }
171};
172
173static void ensure_canvas_metatable(lua_State* L) {
174 static bool gOnce;
175 if (gOnce) {
176 return;
177 }
178 gOnce = true;
reed@google.com9a731042013-05-21 17:52:33 +0000179
mike@reedtribe.orgf02fe3d2013-05-21 12:20:39 +0000180 luaL_newmetatable(L, gCanvasMetaTableName);
181 lua_pushvalue(L, -1);
182 lua_setfield(L, -2, "__index");
reed@google.com9a731042013-05-21 17:52:33 +0000183
mike@reedtribe.orgf02fe3d2013-05-21 12:20:39 +0000184 luaL_setfuncs(L, gLuaCanvasMethods, 0);
185 lua_settop(L, -2); // pop off the meta-table
186}
187
reed@google.com9a731042013-05-21 17:52:33 +0000188///////////////////////////////////////////////////////////////////////////////
189
190static const char gPathMetaTableName[] = "SkPath_MetaTable";
191
192static int lpath_getBounds(lua_State* L) {
193 SkPath* p = (SkPath*)luaL_checkudata(L, 1, gPathMetaTableName);
194 push_rect(L, p->getBounds());
195 return 1;
196}
197
198static int lpath_isEmpty(lua_State* L) {
199 SkPath* p = (SkPath*)luaL_checkudata(L, 1, gPathMetaTableName);
200 lua_pushboolean(L, p->isEmpty());
201 return 1;
202}
203
204static int lpath_isRect(lua_State* L) {
205 SkPath* p = (SkPath*)luaL_checkudata(L, 1, gPathMetaTableName);
206 SkRect r;
207 bool pred = p->isRect(&r);
208 int ret_count = 1;
209 lua_pushboolean(L, pred);
210 if (pred) {
211 push_rect(L, r);
212 ret_count += 1;
213 }
214 return ret_count;
215}
216
217static const char* dir2string(SkPath::Direction dir) {
218 static const char* gStr[] = {
219 "unknown", "cw", "ccw"
220 };
221 SkASSERT((unsigned)dir < SK_ARRAY_COUNT(gStr));
222 return gStr[dir];
223}
224
225static int lpath_isNestedRects(lua_State* L) {
226 SkPath* p = (SkPath*)luaL_checkudata(L, 1, gPathMetaTableName);
227 SkRect rects[2];
228 SkPath::Direction dirs[2];
229 bool pred = p->isNestedRects(rects, dirs);
230 int ret_count = 1;
231 lua_pushboolean(L, pred);
232 if (pred) {
233 push_rect(L, rects[0]);
234 push_rect(L, rects[1]);
235 lua_pushstring(L, dir2string(dirs[0]));
236 lua_pushstring(L, dir2string(dirs[0]));
237 ret_count += 4;
238 }
239 return ret_count;
240 return 1;
241}
242
243static int lpath_gc(lua_State* L) {
244 SkPath* p = (SkPath*)luaL_checkudata(L, 1, gPathMetaTableName);
245 p->~SkPath();
246 return 0;
247}
248
249static const struct luaL_Reg gLuaPathMethods[] = {
250 { "getBounds", lpath_getBounds },
251 { "isEmpty", lpath_isEmpty },
252 { "isRect", lpath_isRect },
253 { "isNestedRects", lpath_isNestedRects },
254 { "__gc", lpath_gc },
255 { NULL, NULL }
256};
257
258static void ensure_path_metatable(lua_State* L) {
259 static bool gOnce;
260 if (gOnce) {
261 return;
262 }
263 gOnce = true;
264
265 luaL_newmetatable(L, gPathMetaTableName);
266 lua_pushvalue(L, -1);
267 lua_setfield(L, -2, "__index");
268
269 luaL_setfuncs(L, gLuaPathMethods, 0);
270 lua_settop(L, -2); // pop off the meta-table
271}
272
273static void push_path(lua_State* L, const SkPath& src) {
274 ensure_path_metatable(L);
275
276 SkPath* path = (SkPath*)lua_newuserdata(L, sizeof(SkPath));
277 new (path) SkPath(src);
278
279 luaL_getmetatable(L, gPathMetaTableName);
280 lua_setmetatable(L, -2);
281}
282
283static void setfield_path(lua_State* L, const char key[], const SkPath& path) {
284 push_path(L, path);
285 lua_setfield(L, -2, key);
286}
287
288///////////////////////////////////////////////////////////////////////////////
289
mike@reedtribe.orgf02fe3d2013-05-21 12:20:39 +0000290void SkLuaCanvas::pushThis() {
291 ensure_canvas_metatable(fL);
292
293 SkCanvas** canvasPtr = (SkCanvas**)lua_newuserdata(fL, sizeof(SkCanvas*));
294 luaL_getmetatable(fL, gCanvasMetaTableName);
295 lua_setmetatable(fL, -2);
296
297 this->ref();
298 *canvasPtr = this;
299}
300
301///////////////////////////////////////////////////////////////////////////////
302
reed@google.comdff7e112013-05-15 19:34:20 +0000303static SkBitmap make_bm(int width, int height) {
304 SkBitmap bm;
305 bm.setConfig(SkBitmap::kNo_Config, width, height);
306 return bm;
307}
308
309SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[])
310 : INHERITED(make_bm(width, height))
311 , fL(L)
312 , fFunc(func) {
313}
314
315SkLuaCanvas::~SkLuaCanvas() {}
316
317int SkLuaCanvas::save(SaveFlags flags) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000318 AUTO_LUA("save");
reed@google.comdff7e112013-05-15 19:34:20 +0000319 return this->INHERITED::save(flags);
320}
321
322int SkLuaCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
323 SaveFlags flags) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000324 AUTO_LUA("saveLayer");
325 if (bounds) {
326 setfield_rect(fL, "bounds", *bounds);
327 }
328 if (paint) {
329 setfield_paint(fL, *paint);
330 }
reed@google.comdff7e112013-05-15 19:34:20 +0000331 return this->INHERITED::save(flags);
332}
333
334void SkLuaCanvas::restore() {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000335 AUTO_LUA("restore");
reed@google.comdff7e112013-05-15 19:34:20 +0000336 this->INHERITED::restore();
337}
338
339bool SkLuaCanvas::translate(SkScalar dx, SkScalar dy) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000340 AUTO_LUA("translate");
341 setfield_number(fL, "dx", dx);
342 setfield_number(fL, "dy", dy);
reed@google.comdff7e112013-05-15 19:34:20 +0000343 return this->INHERITED::translate(dx, dy);
344}
345
346bool SkLuaCanvas::scale(SkScalar sx, SkScalar sy) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000347 AUTO_LUA("scale");
348 setfield_number(fL, "sx", sx);
349 setfield_number(fL, "sy", sy);
reed@google.comdff7e112013-05-15 19:34:20 +0000350 return this->INHERITED::scale(sx, sy);
351}
352
353bool SkLuaCanvas::rotate(SkScalar degrees) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000354 AUTO_LUA("rotate");
355 setfield_number(fL, "degrees", degrees);
reed@google.comdff7e112013-05-15 19:34:20 +0000356 return this->INHERITED::rotate(degrees);
357}
358
359bool SkLuaCanvas::skew(SkScalar sx, SkScalar sy) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000360 AUTO_LUA("skew");
361 setfield_number(fL, "sx", sx);
362 setfield_number(fL, "sy", sy);
reed@google.comdff7e112013-05-15 19:34:20 +0000363 return this->INHERITED::skew(sx, sy);
364}
365
366bool SkLuaCanvas::concat(const SkMatrix& matrix) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000367 AUTO_LUA("concat");
reed@google.comdff7e112013-05-15 19:34:20 +0000368 return this->INHERITED::concat(matrix);
369}
370
371void SkLuaCanvas::setMatrix(const SkMatrix& matrix) {
372 this->INHERITED::setMatrix(matrix);
373}
374
375bool SkLuaCanvas::clipRect(const SkRect& r, SkRegion::Op op, bool doAA) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000376 AUTO_LUA("clipRect");
377 setfield_rect(fL, "rect", r);
378 setfield_bool(fL, "aa", doAA);
reed@google.comdff7e112013-05-15 19:34:20 +0000379 return this->INHERITED::clipRect(r, op, doAA);
380}
381
382bool SkLuaCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000383 AUTO_LUA("clipRRect");
reed@google.com57de5cf2013-05-16 13:51:07 +0000384 setfield_rrect(fL, "rrect", rrect);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000385 setfield_bool(fL, "aa", doAA);
reed@google.comdff7e112013-05-15 19:34:20 +0000386 return this->INHERITED::clipRRect(rrect, op, doAA);
387}
388
389bool SkLuaCanvas::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000390 AUTO_LUA("clipPath");
reed@google.com9a731042013-05-21 17:52:33 +0000391 setfield_path(fL, "path", path);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000392 setfield_bool(fL, "aa", doAA);
reed@google.comdff7e112013-05-15 19:34:20 +0000393 return this->INHERITED::clipPath(path, op, doAA);
394}
395
396bool SkLuaCanvas::clipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000397 AUTO_LUA("clipRegion");
reed@google.comdff7e112013-05-15 19:34:20 +0000398 return this->INHERITED::clipRegion(deviceRgn, op);
399}
400
401void SkLuaCanvas::drawPaint(const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000402 AUTO_LUA("drawPaint");
403 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000404}
405
406void SkLuaCanvas::drawPoints(PointMode mode, size_t count,
407 const SkPoint pts[], const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000408 AUTO_LUA("drawPoints");
409 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000410}
411
412void SkLuaCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000413 AUTO_LUA("drawOval");
reed@google.com57de5cf2013-05-16 13:51:07 +0000414 setfield_rect(fL, "oval", rect);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000415 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000416}
417
418void SkLuaCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000419 AUTO_LUA("drawRect");
420 setfield_rect(fL, "rect", rect);
421 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000422}
423
424void SkLuaCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000425 AUTO_LUA("drawRRect");
reed@google.com57de5cf2013-05-16 13:51:07 +0000426 setfield_rrect(fL, "rrect", rrect);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000427 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000428}
429
430void SkLuaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000431 AUTO_LUA("drawPath");
reed@google.com9a731042013-05-21 17:52:33 +0000432 setfield_path(fL, "path", path);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000433 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000434}
435
436void SkLuaCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
437 const SkPaint* paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000438 AUTO_LUA("drawBitmap");
439 if (paint) {
440 setfield_paint(fL, *paint, kImage_PaintUsage);
441 }
reed@google.comdff7e112013-05-15 19:34:20 +0000442}
443
444void SkLuaCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
445 const SkRect& dst, const SkPaint* paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000446 AUTO_LUA("drawBitmapRectToRect");
447 if (paint) {
448 setfield_paint(fL, *paint, kImage_PaintUsage);
449 }
reed@google.comdff7e112013-05-15 19:34:20 +0000450}
451
452void SkLuaCanvas::drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
453 const SkPaint* paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000454 AUTO_LUA("drawBitmapMatrix");
455 if (paint) {
456 setfield_paint(fL, *paint, kImage_PaintUsage);
457 }
reed@google.comdff7e112013-05-15 19:34:20 +0000458}
459
460void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
461 const SkPaint* paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000462 AUTO_LUA("drawSprite");
463 if (paint) {
464 setfield_paint(fL, *paint, kImage_PaintUsage);
465 }
reed@google.comdff7e112013-05-15 19:34:20 +0000466}
467
468void SkLuaCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
469 SkScalar y, const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000470 AUTO_LUA("drawText");
471 setfield_paint(fL, paint, kText_PaintUsage);
reed@google.comdff7e112013-05-15 19:34:20 +0000472}
473
474void SkLuaCanvas::drawPosText(const void* text, size_t byteLength,
475 const SkPoint pos[], const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000476 AUTO_LUA("drawPosText");
477 setfield_paint(fL, paint, kText_PaintUsage);
reed@google.comdff7e112013-05-15 19:34:20 +0000478}
479
480void SkLuaCanvas::drawPosTextH(const void* text, size_t byteLength,
481 const SkScalar xpos[], SkScalar constY,
482 const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000483 AUTO_LUA("drawPosTextH");
484 setfield_paint(fL, paint, kText_PaintUsage);
reed@google.comdff7e112013-05-15 19:34:20 +0000485}
486
487void SkLuaCanvas::drawTextOnPath(const void* text, size_t byteLength,
488 const SkPath& path, const SkMatrix* matrix,
489 const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000490 AUTO_LUA("drawTextOnPath");
reed@google.com9a731042013-05-21 17:52:33 +0000491 setfield_path(fL, "path", path);
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000492 setfield_paint(fL, paint, kText_PaintUsage);
reed@google.comdff7e112013-05-15 19:34:20 +0000493}
494
495void SkLuaCanvas::drawPicture(SkPicture& picture) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000496 AUTO_LUA("drawPicture");
reed@google.comdff7e112013-05-15 19:34:20 +0000497 // call through so we can see the nested picture ops
498 this->INHERITED::drawPicture(picture);
499}
500
501void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount,
502 const SkPoint vertices[], const SkPoint texs[],
503 const SkColor colors[], SkXfermode* xmode,
504 const uint16_t indices[], int indexCount,
505 const SkPaint& paint) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000506 AUTO_LUA("drawVertices");
507 setfield_paint(fL, paint);
reed@google.comdff7e112013-05-15 19:34:20 +0000508}
509
510void SkLuaCanvas::drawData(const void* data, size_t length) {
mike@reedtribe.org1c5a94f2013-05-16 04:20:23 +0000511 AUTO_LUA("drawData");
reed@google.comdff7e112013-05-15 19:34:20 +0000512}