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 #include "SkLuaCanvas.h" | 8 #include "SkLuaCanvas.h" |
9 #include "SkLua.h" | 9 #include "SkLua.h" |
10 | 10 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, | 232 void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, |
233 const SkPaint* paint) { | 233 const SkPaint* paint) { |
234 AUTO_LUA("drawSprite"); | 234 AUTO_LUA("drawSprite"); |
235 if (paint) { | 235 if (paint) { |
236 lua.pushPaint(*paint, "paint"); | 236 lua.pushPaint(*paint, "paint"); |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 void SkLuaCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, Sk
Scalar y, | 240 void SkLuaCanvas::drawText(const void* text, size_t byteLength, SkScalar x, |
241 const SkPaint& paint) { | 241 SkScalar y, const SkPaint& paint) { |
242 AUTO_LUA("drawText"); | 242 AUTO_LUA("drawText"); |
243 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); | 243 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); |
244 lua.pushPaint(paint, "paint"); | 244 lua.pushPaint(paint, "paint"); |
245 } | 245 } |
246 | 246 |
247 void SkLuaCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoi
nt pos[], | 247 void SkLuaCanvas::drawPosText(const void* text, size_t byteLength, |
248 const SkPaint& paint) { | 248 const SkPoint pos[], const SkPaint& paint) { |
249 AUTO_LUA("drawPosText"); | 249 AUTO_LUA("drawPosText"); |
250 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); | 250 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); |
251 lua.pushPaint(paint, "paint"); | 251 lua.pushPaint(paint, "paint"); |
252 } | 252 } |
253 | 253 |
254 void SkLuaCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkSc
alar xpos[], | 254 void SkLuaCanvas::drawPosTextH(const void* text, size_t byteLength, |
255 SkScalar constY, const SkPaint& paint) { | 255 const SkScalar xpos[], SkScalar constY, |
| 256 const SkPaint& paint) { |
256 AUTO_LUA("drawPosTextH"); | 257 AUTO_LUA("drawPosTextH"); |
257 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); | 258 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); |
258 lua.pushPaint(paint, "paint"); | 259 lua.pushPaint(paint, "paint"); |
259 } | 260 } |
260 | 261 |
261 void SkLuaCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const Sk
Path& path, | 262 void SkLuaCanvas::drawTextOnPath(const void* text, size_t byteLength, |
262 const SkMatrix* matrix, const SkPaint& paint)
{ | 263 const SkPath& path, const SkMatrix* matrix, |
| 264 const SkPaint& paint) { |
263 AUTO_LUA("drawTextOnPath"); | 265 AUTO_LUA("drawTextOnPath"); |
264 lua.pushPath(path, "path"); | 266 lua.pushPath(path, "path"); |
265 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); | 267 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); |
266 lua.pushPaint(paint, "paint"); | 268 lua.pushPaint(paint, "paint"); |
267 } | 269 } |
268 | 270 |
269 void SkLuaCanvas::drawPicture(SkPicture& picture) { | 271 void SkLuaCanvas::drawPicture(SkPicture& picture) { |
270 AUTO_LUA("drawPicture"); | 272 AUTO_LUA("drawPicture"); |
271 // call through so we can see the nested picture ops | 273 // call through so we can see the nested picture ops |
272 this->INHERITED::drawPicture(picture); | 274 this->INHERITED::drawPicture(picture); |
273 } | 275 } |
274 | 276 |
275 void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount, | 277 void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount, |
276 const SkPoint vertices[], const SkPoint texs[], | 278 const SkPoint vertices[], const SkPoint texs[], |
277 const SkColor colors[], SkXfermode* xmode, | 279 const SkColor colors[], SkXfermode* xmode, |
278 const uint16_t indices[], int indexCount, | 280 const uint16_t indices[], int indexCount, |
279 const SkPaint& paint) { | 281 const SkPaint& paint) { |
280 AUTO_LUA("drawVertices"); | 282 AUTO_LUA("drawVertices"); |
281 lua.pushPaint(paint, "paint"); | 283 lua.pushPaint(paint, "paint"); |
282 } | 284 } |
283 | 285 |
284 void SkLuaCanvas::drawData(const void* data, size_t length) { | 286 void SkLuaCanvas::drawData(const void* data, size_t length) { |
285 AUTO_LUA("drawData"); | 287 AUTO_LUA("drawData"); |
286 } | 288 } |
OLD | NEW |