2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkLuaCanvas_DEFINED
9 #define SkLuaCanvas_DEFINED
16 class SkLuaCanvas : public SkCanvas {
20 SkLuaCanvas(int width, int height, lua_State*, const char function[]);
21 virtual ~SkLuaCanvas();
24 void willSave() override;
25 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override;
26 void willRestore() override;
28 void didConcat(const SkMatrix&) override;
29 void didSetMatrix(const SkMatrix&) override;
31 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
32 virtual void onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
33 const SkPaint&) override;
34 virtual void onDrawPosText(const void* text, size_t byteLength, const SkPoint pos[],
35 const SkPaint&) override;
36 virtual void onDrawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[],
37 SkScalar constY, const SkPaint&) override;
38 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
39 const SkMatrix* matrix, const SkPaint&) override;
40 void onDrawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[],
41 const SkRect* cull, const SkPaint& paint) override;
42 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
43 const SkPaint& paint) override;
45 void onDrawPaint(const SkPaint&) override;
46 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
47 void onDrawRect(const SkRect&, const SkPaint&) override;
48 void onDrawOval(const SkRect&, const SkPaint&) override;
49 void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override;
50 void onDrawRRect(const SkRRect&, const SkPaint&) override;
51 void onDrawPath(const SkPath&, const SkPaint&) override;
52 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override;
53 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*,
54 SrcRectConstraint) override;
55 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override;
56 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst,
57 const SkPaint*, SrcRectConstraint) override;
58 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
59 const SkPaint*) override;
60 void onDrawVertices(VertexMode vmode, int vertexCount,
61 const SkPoint vertices[], const SkPoint texs[],
62 const SkColor colors[], SkXfermode* xmode,
63 const uint16_t indices[], int indexCount,
64 const SkPaint&) override;
66 void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
67 void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
68 void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
69 void onClipRegion(const SkRegion&, ClipOp) override;
71 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
77 void sendverb(const char verb[]);
79 typedef SkCanvas INHERITED;