Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / utils / SkLuaCanvas.cpp
index 7e1d5a8..8fe1aa2 100644 (file)
@@ -81,9 +81,9 @@ SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[])
 
 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,
@@ -122,7 +122,9 @@ void SkLuaCanvas::didConcat(const SkMatrix& matrix) {
         }
         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;
         }
     }
@@ -168,7 +170,7 @@ void SkLuaCanvas::drawPaint(const SkPaint& paint) {
 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");
 }
 
@@ -237,41 +239,49 @@ void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
     }
 }
 
-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,