Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: include/utils/SkLuaCanvas.h

Issue 196323003: Revert of Revert "De-virtualize SkCanvas save/restore." (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/utils/SkDumpCanvas.h ('k') | include/utils/SkNWayCanvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef SkLuaCanvas_DEFINED 8 #ifndef SkLuaCanvas_DEFINED
9 #define SkLuaCanvas_DEFINED 9 #define SkLuaCanvas_DEFINED
10 10
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkString.h" 12 #include "SkString.h"
13 13
14 struct lua_State; 14 struct lua_State;
15 15
16 class SkLuaCanvas : public SkCanvas { 16 class SkLuaCanvas : public SkCanvas {
17 public: 17 public:
18 void pushThis(); 18 void pushThis();
19 19
20 SkLuaCanvas(int width, int height, lua_State*, const char function[]); 20 SkLuaCanvas(int width, int height, lua_State*, const char function[]);
21 virtual ~SkLuaCanvas(); 21 virtual ~SkLuaCanvas();
22 22
23 virtual int save(SaveFlags flags) SK_OVERRIDE;
24 virtual int saveLayer(const SkRect* bounds, const SkPaint* paint,
25 SaveFlags flags) SK_OVERRIDE;
26 virtual void restore() SK_OVERRIDE;
27
28 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE; 23 virtual bool translate(SkScalar dx, SkScalar dy) SK_OVERRIDE;
29 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE; 24 virtual bool scale(SkScalar sx, SkScalar sy) SK_OVERRIDE;
30 virtual bool rotate(SkScalar degrees) SK_OVERRIDE; 25 virtual bool rotate(SkScalar degrees) SK_OVERRIDE;
31 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE; 26 virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
32 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE; 27 virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
33 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE; 28 virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
34 29
35 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 30 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
36 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], 31 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
37 const SkPaint& paint) SK_OVERRIDE; 32 const SkPaint& paint) SK_OVERRIDE;
(...skipping 22 matching lines...) Expand all
60 const SkPaint& paint) SK_OVERRIDE; 55 const SkPaint& paint) SK_OVERRIDE;
61 virtual void drawPicture(SkPicture&) SK_OVERRIDE; 56 virtual void drawPicture(SkPicture&) SK_OVERRIDE;
62 virtual void drawVertices(VertexMode vmode, int vertexCount, 57 virtual void drawVertices(VertexMode vmode, int vertexCount,
63 const SkPoint vertices[], const SkPoint texs[], 58 const SkPoint vertices[], const SkPoint texs[],
64 const SkColor colors[], SkXfermode* xmode, 59 const SkColor colors[], SkXfermode* xmode,
65 const uint16_t indices[], int indexCount, 60 const uint16_t indices[], int indexCount,
66 const SkPaint& paint) SK_OVERRIDE; 61 const SkPaint& paint) SK_OVERRIDE;
67 virtual void drawData(const void* data, size_t length) SK_OVERRIDE; 62 virtual void drawData(const void* data, size_t length) SK_OVERRIDE;
68 63
69 protected: 64 protected:
65 virtual void onSave(SaveFlags) SK_OVERRIDE;
66 virtual bool onSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRI DE;
67 virtual void onRestore() SK_OVERRIDE;
68
70 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE; 69 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK _OVERRIDE;
71 70
72 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 71 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
73 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE; 72 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE RRIDE;
74 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE; 73 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR IDE;
75 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; 74 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
76 75
77 private: 76 private:
78 lua_State* fL; 77 lua_State* fL;
79 SkString fFunc; 78 SkString fFunc;
80 79
81 void sendverb(const char verb[]); 80 void sendverb(const char verb[]);
82 81
83 typedef SkCanvas INHERITED; 82 typedef SkCanvas INHERITED;
84 }; 83 };
85 84
86 #endif 85 #endif
OLDNEW
« no previous file with comments | « include/utils/SkDumpCanvas.h ('k') | include/utils/SkNWayCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698