SkLuaCanvas::~SkLuaCanvas() {}
-void SkLuaCanvas::willSave(SaveFlags flags) {
+void SkLuaCanvas::willSave() {
AUTO_LUA("save");
- this->INHERITED::willSave(flags);
+ this->INHERITED::willSave();
}
SkCanvas::SaveLayerStrategy SkLuaCanvas::willSaveLayer(const SkRect* bounds, const SkPaint* paint,
}
default: {
AUTO_LUA("concat");
- lua.pushMatrix(matrix);
+ // pushMatrix added in https://codereview.chromium.org/203203004/
+ // Doesn't seem to have ever been working correctly since added
+ // lua.pushMatrix(matrix);
break;
}
}
void SkLuaCanvas::drawPoints(PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
AUTO_LUA("drawPoints");
- lua.pushArrayPoint(pts, count, "points");
+ lua.pushArrayPoint(pts, SkToInt(count), "points");
lua.pushPaint(paint, "paint");
}
}
}
-void SkLuaCanvas::drawText(const void* text, size_t byteLength, SkScalar x,
- SkScalar y, const SkPaint& paint) {
+void SkLuaCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
+ const SkPaint& paint) {
AUTO_LUA("drawText");
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
lua.pushPaint(paint, "paint");
}
-void SkLuaCanvas::drawPosText(const void* text, size_t byteLength,
- const SkPoint pos[], const SkPaint& paint) {
+void SkLuaCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
+ const SkPaint& paint) {
AUTO_LUA("drawPosText");
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
lua.pushPaint(paint, "paint");
}
-void SkLuaCanvas::drawPosTextH(const void* text, size_t byteLength,
- const SkScalar xpos[], SkScalar constY,
- const SkPaint& paint) {
+void SkLuaCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
+ SkScalar constY, const SkPaint& paint) {
AUTO_LUA("drawPosTextH");
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
lua.pushPaint(paint, "paint");
}
-void SkLuaCanvas::drawTextOnPath(const void* text, size_t byteLength,
- const SkPath& path, const SkMatrix* matrix,
- const SkPaint& paint) {
+void SkLuaCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
+ const SkMatrix* matrix, const SkPaint& paint) {
AUTO_LUA("drawTextOnPath");
lua.pushPath(path, "path");
lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
lua.pushPaint(paint, "paint");
}
-void SkLuaCanvas::drawPicture(SkPicture& picture) {
+void SkLuaCanvas::onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y,
+ const SkPaint &paint) {
+ AUTO_LUA("drawTextBlob");
+ lua.pushTextBlob(blob, "blob");
+ lua.pushScalar(x, "x");
+ lua.pushScalar(y, "y");
+ lua.pushPaint(paint, "paint");
+}
+
+void SkLuaCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix,
+ const SkPaint* paint) {
AUTO_LUA("drawPicture");
// call through so we can see the nested picture ops
- this->INHERITED::drawPicture(picture);
+ this->INHERITED::onDrawPicture(picture, matrix, paint);
}
void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount,