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

Side by Side Diff: src/utils/SkLuaCanvas.cpp

Issue 194923008: 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 | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkNWayCanvas.cpp » ('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 #include "SkLuaCanvas.h" 8 #include "SkLuaCanvas.h"
9 #include "SkLua.h" 9 #include "SkLua.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 /////////////////////////////////////////////////////////////////////////////// 74 ///////////////////////////////////////////////////////////////////////////////
75 75
76 SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[]) 76 SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[])
77 : INHERITED(width, height) 77 : INHERITED(width, height)
78 , fL(L) 78 , fL(L)
79 , fFunc(func) { 79 , fFunc(func) {
80 } 80 }
81 81
82 SkLuaCanvas::~SkLuaCanvas() {} 82 SkLuaCanvas::~SkLuaCanvas() {}
83 83
84 void SkLuaCanvas::onSave(SaveFlags flags) { 84 int SkLuaCanvas::save(SaveFlags flags) {
85 AUTO_LUA("save"); 85 AUTO_LUA("save");
86 this->INHERITED::onSave(flags); 86 return this->INHERITED::save(flags);
87 } 87 }
88 88
89 bool SkLuaCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint, 89 int SkLuaCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
90 SaveFlags flags) { 90 SaveFlags flags) {
91 AUTO_LUA("saveLayer"); 91 AUTO_LUA("saveLayer");
92 if (bounds) { 92 if (bounds) {
93 lua.pushRect(*bounds, "bounds"); 93 lua.pushRect(*bounds, "bounds");
94 } 94 }
95 if (paint) { 95 if (paint) {
96 lua.pushPaint(*paint, "paint"); 96 lua.pushPaint(*paint, "paint");
97 } 97 }
98 98 return this->INHERITED::save(flags);
99 this->INHERITED::onSaveLayer(bounds, paint, flags);
100 // No need for a layer.
101 return false;
102 } 99 }
103 100
104 void SkLuaCanvas::onRestore() { 101 void SkLuaCanvas::restore() {
105 AUTO_LUA("restore"); 102 AUTO_LUA("restore");
106 this->INHERITED::onRestore(); 103 this->INHERITED::restore();
107 } 104 }
108 105
109 bool SkLuaCanvas::translate(SkScalar dx, SkScalar dy) { 106 bool SkLuaCanvas::translate(SkScalar dx, SkScalar dy) {
110 AUTO_LUA("translate"); 107 AUTO_LUA("translate");
111 lua.pushScalar(dx, "dx"); 108 lua.pushScalar(dx, "dx");
112 lua.pushScalar(dy, "dy"); 109 lua.pushScalar(dy, "dy");
113 return this->INHERITED::translate(dx, dy); 110 return this->INHERITED::translate(dx, dy);
114 } 111 }
115 112
116 bool SkLuaCanvas::scale(SkScalar sx, SkScalar sy) { 113 bool SkLuaCanvas::scale(SkScalar sx, SkScalar sy) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 const SkColor colors[], SkXfermode* xmode, 283 const SkColor colors[], SkXfermode* xmode,
287 const uint16_t indices[], int indexCount, 284 const uint16_t indices[], int indexCount,
288 const SkPaint& paint) { 285 const SkPaint& paint) {
289 AUTO_LUA("drawVertices"); 286 AUTO_LUA("drawVertices");
290 lua.pushPaint(paint, "paint"); 287 lua.pushPaint(paint, "paint");
291 } 288 }
292 289
293 void SkLuaCanvas::drawData(const void* data, size_t length) { 290 void SkLuaCanvas::drawData(const void* data, size_t length) {
294 AUTO_LUA("drawData"); 291 AUTO_LUA("drawData");
295 } 292 }
OLDNEW
« no previous file with comments | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkNWayCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698