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

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

Issue 195793012: De-virtualize SkCanvas matrix ops. (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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 this->INHERITED::willSaveLayer(bounds, paint, flags); 99 this->INHERITED::willSaveLayer(bounds, paint, flags);
100 // No need for a layer. 100 // No need for a layer.
101 return kNoLayer_SaveLayerStrategy; 101 return kNoLayer_SaveLayerStrategy;
102 } 102 }
103 103
104 void SkLuaCanvas::willRestore() { 104 void SkLuaCanvas::willRestore() {
105 AUTO_LUA("restore"); 105 AUTO_LUA("restore");
106 this->INHERITED::willRestore(); 106 this->INHERITED::willRestore();
107 } 107 }
108 108
109 bool SkLuaCanvas::translate(SkScalar dx, SkScalar dy) { 109 void SkLuaCanvas::didTranslate(SkScalar dx, SkScalar dy) {
110 AUTO_LUA("translate"); 110 AUTO_LUA("translate");
111 lua.pushScalar(dx, "dx"); 111 lua.pushScalar(dx, "dx");
112 lua.pushScalar(dy, "dy"); 112 lua.pushScalar(dy, "dy");
113 return this->INHERITED::translate(dx, dy); 113 this->INHERITED::didTranslate(dx, dy);
114 } 114 }
115 115
116 bool SkLuaCanvas::scale(SkScalar sx, SkScalar sy) { 116 void SkLuaCanvas::didScale(SkScalar sx, SkScalar sy) {
117 AUTO_LUA("scale"); 117 AUTO_LUA("scale");
118 lua.pushScalar(sx, "sx"); 118 lua.pushScalar(sx, "sx");
119 lua.pushScalar(sy, "sy"); 119 lua.pushScalar(sy, "sy");
120 return this->INHERITED::scale(sx, sy); 120 this->INHERITED::didScale(sx, sy);
121 } 121 }
122 122
123 bool SkLuaCanvas::rotate(SkScalar degrees) { 123 void SkLuaCanvas::didRotate(SkScalar degrees) {
124 AUTO_LUA("rotate"); 124 AUTO_LUA("rotate");
125 lua.pushScalar(degrees, "degrees"); 125 lua.pushScalar(degrees, "degrees");
126 return this->INHERITED::rotate(degrees); 126 this->INHERITED::didRotate(degrees);
127 } 127 }
128 128
129 bool SkLuaCanvas::skew(SkScalar kx, SkScalar ky) { 129 void SkLuaCanvas::didSkew(SkScalar kx, SkScalar ky) {
130 AUTO_LUA("skew"); 130 AUTO_LUA("skew");
131 lua.pushScalar(kx, "kx"); 131 lua.pushScalar(kx, "kx");
132 lua.pushScalar(ky, "ky"); 132 lua.pushScalar(ky, "ky");
133 return this->INHERITED::skew(kx, ky); 133 this->INHERITED::didSkew(kx, ky);
134 } 134 }
135 135
136 bool SkLuaCanvas::concat(const SkMatrix& matrix) { 136 void SkLuaCanvas::didConcat(const SkMatrix& matrix) {
137 AUTO_LUA("concat"); 137 AUTO_LUA("concat");
138 return this->INHERITED::concat(matrix); 138 this->INHERITED::didConcat(matrix);
139 } 139 }
140 140
141 void SkLuaCanvas::setMatrix(const SkMatrix& matrix) { 141 void SkLuaCanvas::didSetMatrix(const SkMatrix& matrix) {
142 this->INHERITED::setMatrix(matrix); 142 this->INHERITED::didSetMatrix(matrix);
143 } 143 }
144 144
145 void SkLuaCanvas::onClipRect(const SkRect& r, SkRegion::Op op, ClipEdgeStyle edg eStyle) { 145 void SkLuaCanvas::onClipRect(const SkRect& r, SkRegion::Op op, ClipEdgeStyle edg eStyle) {
146 AUTO_LUA("clipRect"); 146 AUTO_LUA("clipRect");
147 lua.pushRect(r, "rect"); 147 lua.pushRect(r, "rect");
148 lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa"); 148 lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa");
149 this->INHERITED::onClipRect(r, op, edgeStyle); 149 this->INHERITED::onClipRect(r, op, edgeStyle);
150 } 150 }
151 151
152 void SkLuaCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeSty le edgeStyle) { 152 void SkLuaCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeSty le edgeStyle) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 const SkColor colors[], SkXfermode* xmode, 286 const SkColor colors[], SkXfermode* xmode,
287 const uint16_t indices[], int indexCount, 287 const uint16_t indices[], int indexCount,
288 const SkPaint& paint) { 288 const SkPaint& paint) {
289 AUTO_LUA("drawVertices"); 289 AUTO_LUA("drawVertices");
290 lua.pushPaint(paint, "paint"); 290 lua.pushPaint(paint, "paint");
291 } 291 }
292 292
293 void SkLuaCanvas::drawData(const void* data, size_t length) { 293 void SkLuaCanvas::drawData(const void* data, size_t length) {
294 AUTO_LUA("drawData"); 294 AUTO_LUA("drawData");
295 } 295 }
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