OLD | NEW |
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 lua.pushPath(path, "path"); | 155 lua.pushPath(path, "path"); |
156 lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa"); | 156 lua.pushBool(kSoft_ClipEdgeStyle == edgeStyle, "aa"); |
157 this->INHERITED::onClipPath(path, op, edgeStyle); | 157 this->INHERITED::onClipPath(path, op, edgeStyle); |
158 } | 158 } |
159 | 159 |
160 void SkLuaCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 160 void SkLuaCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
161 AUTO_LUA("clipRegion"); | 161 AUTO_LUA("clipRegion"); |
162 this->INHERITED::onClipRegion(deviceRgn, op); | 162 this->INHERITED::onClipRegion(deviceRgn, op); |
163 } | 163 } |
164 | 164 |
165 void SkLuaCanvas::onDrawPaint(const SkPaint& paint) { | 165 void SkLuaCanvas::drawPaint(const SkPaint& paint) { |
166 AUTO_LUA("drawPaint"); | 166 AUTO_LUA("drawPaint"); |
167 lua.pushPaint(paint, "paint"); | 167 lua.pushPaint(paint, "paint"); |
168 } | 168 } |
169 | 169 |
170 void SkLuaCanvas::onDrawPoints(PointMode mode, size_t count, | 170 void SkLuaCanvas::drawPoints(PointMode mode, size_t count, |
171 const SkPoint pts[], const SkPaint& paint) { | 171 const SkPoint pts[], const SkPaint& paint) { |
172 AUTO_LUA("drawPoints"); | 172 AUTO_LUA("drawPoints"); |
173 lua.pushArrayPoint(pts, SkToInt(count), "points"); | 173 lua.pushArrayPoint(pts, SkToInt(count), "points"); |
174 lua.pushPaint(paint, "paint"); | 174 lua.pushPaint(paint, "paint"); |
175 } | 175 } |
176 | 176 |
177 void SkLuaCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) { | 177 void SkLuaCanvas::drawOval(const SkRect& rect, const SkPaint& paint) { |
178 AUTO_LUA("drawOval"); | 178 AUTO_LUA("drawOval"); |
179 lua.pushRect(rect, "rect"); | 179 lua.pushRect(rect, "rect"); |
180 lua.pushPaint(paint, "paint"); | 180 lua.pushPaint(paint, "paint"); |
181 } | 181 } |
182 | 182 |
183 void SkLuaCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { | 183 void SkLuaCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { |
184 AUTO_LUA("drawRect"); | 184 AUTO_LUA("drawRect"); |
185 lua.pushRect(rect, "rect"); | 185 lua.pushRect(rect, "rect"); |
186 lua.pushPaint(paint, "paint"); | 186 lua.pushPaint(paint, "paint"); |
187 } | 187 } |
188 | 188 |
189 void SkLuaCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { | 189 void SkLuaCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { |
190 AUTO_LUA("drawRRect"); | 190 AUTO_LUA("drawRRect"); |
191 lua.pushRRect(rrect, "rrect"); | 191 lua.pushRRect(rrect, "rrect"); |
192 lua.pushPaint(paint, "paint"); | 192 lua.pushPaint(paint, "paint"); |
193 } | 193 } |
194 | 194 |
195 void SkLuaCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, | 195 void SkLuaCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, |
196 const SkPaint& paint) { | 196 const SkPaint& paint) { |
197 AUTO_LUA("drawDRRect"); | 197 AUTO_LUA("drawDRRect"); |
198 lua.pushRRect(outer, "outer"); | 198 lua.pushRRect(outer, "outer"); |
199 lua.pushRRect(inner, "inner"); | 199 lua.pushRRect(inner, "inner"); |
200 lua.pushPaint(paint, "paint"); | 200 lua.pushPaint(paint, "paint"); |
201 } | 201 } |
202 | 202 |
203 void SkLuaCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { | 203 void SkLuaCanvas::drawPath(const SkPath& path, const SkPaint& paint) { |
204 AUTO_LUA("drawPath"); | 204 AUTO_LUA("drawPath"); |
205 lua.pushPath(path, "path"); | 205 lua.pushPath(path, "path"); |
206 lua.pushPaint(paint, "paint"); | 206 lua.pushPaint(paint, "paint"); |
207 } | 207 } |
208 | 208 |
209 void SkLuaCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, | 209 void SkLuaCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, |
210 const SkPaint* paint) { | 210 const SkPaint* paint) { |
211 AUTO_LUA("drawBitmap"); | 211 AUTO_LUA("drawBitmap"); |
212 if (paint) { | 212 if (paint) { |
213 lua.pushPaint(*paint, "paint"); | 213 lua.pushPaint(*paint, "paint"); |
214 } | 214 } |
215 } | 215 } |
216 | 216 |
217 void SkLuaCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, co
nst SkRect& dst, | 217 void SkLuaCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src
, |
218 const SkPaint* paint, DrawBitmapRectFlags fla
gs) { | 218 const SkRect& dst, const SkPaint* paint, |
219 AUTO_LUA("drawBitmapRect"); | 219 DrawBitmapRectFlags flags) { |
| 220 AUTO_LUA("drawBitmapRectToRect"); |
220 if (paint) { | 221 if (paint) { |
221 lua.pushPaint(*paint, "paint"); | 222 lua.pushPaint(*paint, "paint"); |
222 } | 223 } |
223 } | 224 } |
224 | 225 |
225 void SkLuaCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center
, const SkRect& dst, | 226 void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, |
226 const SkPaint* paint) { | 227 const SkPaint* paint) { |
227 AUTO_LUA("drawBitmapNine"); | |
228 if (paint) { | |
229 lua.pushPaint(*paint, "paint"); | |
230 } | |
231 } | |
232 | |
233 void SkLuaCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, cons
t SkPaint* paint) { | |
234 AUTO_LUA("drawImage"); | |
235 if (paint) { | |
236 lua.pushPaint(*paint, "paint"); | |
237 } | |
238 } | |
239 | |
240 void SkLuaCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const
SkRect& dst, | |
241 const SkPaint* paint) { | |
242 AUTO_LUA("drawImageRect"); | |
243 if (paint) { | |
244 lua.pushPaint(*paint, "paint"); | |
245 } | |
246 } | |
247 | |
248 void SkLuaCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPai
nt* paint) { | |
249 AUTO_LUA("drawSprite"); | 228 AUTO_LUA("drawSprite"); |
250 if (paint) { | 229 if (paint) { |
251 lua.pushPaint(*paint, "paint"); | 230 lua.pushPaint(*paint, "paint"); |
252 } | 231 } |
253 } | 232 } |
254 | 233 |
255 void SkLuaCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, Sk
Scalar y, | 234 void SkLuaCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, Sk
Scalar y, |
256 const SkPaint& paint) { | 235 const SkPaint& paint) { |
257 AUTO_LUA("drawText"); | 236 AUTO_LUA("drawText"); |
258 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); | 237 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 lua.pushPaint(paint, "paint"); | 269 lua.pushPaint(paint, "paint"); |
291 } | 270 } |
292 | 271 |
293 void SkLuaCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix
, | 272 void SkLuaCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix
, |
294 const SkPaint* paint) { | 273 const SkPaint* paint) { |
295 AUTO_LUA("drawPicture"); | 274 AUTO_LUA("drawPicture"); |
296 // call through so we can see the nested picture ops | 275 // call through so we can see the nested picture ops |
297 this->INHERITED::onDrawPicture(picture, matrix, paint); | 276 this->INHERITED::onDrawPicture(picture, matrix, paint); |
298 } | 277 } |
299 | 278 |
300 void SkLuaCanvas::onDrawVertices(VertexMode vmode, int vertexCount, | 279 void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount, |
301 const SkPoint vertices[], const SkPoint texs[], | 280 const SkPoint vertices[], const SkPoint texs[], |
302 const SkColor colors[], SkXfermode* xmode, | 281 const SkColor colors[], SkXfermode* xmode, |
303 const uint16_t indices[], int indexCount, | 282 const uint16_t indices[], int indexCount, |
304 const SkPaint& paint) { | 283 const SkPaint& paint) { |
305 AUTO_LUA("drawVertices"); | 284 AUTO_LUA("drawVertices"); |
306 lua.pushPaint(paint, "paint"); | 285 lua.pushPaint(paint, "paint"); |
307 } | 286 } |
OLD | NEW |