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

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

Issue 248083002: Make drawText calls non-virtual, to ease SkFont and TextBlob (https://codereview.chromium.org/24385… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y, 232 void SkLuaCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
233 const SkPaint* paint) { 233 const SkPaint* paint) {
234 AUTO_LUA("drawSprite"); 234 AUTO_LUA("drawSprite");
235 if (paint) { 235 if (paint) {
236 lua.pushPaint(*paint, "paint"); 236 lua.pushPaint(*paint, "paint");
237 } 237 }
238 } 238 }
239 239
240 void SkLuaCanvas::drawText(const void* text, size_t byteLength, SkScalar x, 240 void SkLuaCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, Sk Scalar y,
241 SkScalar y, const SkPaint& paint) { 241 const SkPaint& paint) {
242 AUTO_LUA("drawText"); 242 AUTO_LUA("drawText");
243 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); 243 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
244 lua.pushPaint(paint, "paint"); 244 lua.pushPaint(paint, "paint");
245 } 245 }
246 246
247 void SkLuaCanvas::drawPosText(const void* text, size_t byteLength, 247 void SkLuaCanvas::onDrawPosText(const void* text, size_t byteLength, const SkPoi nt pos[],
248 const SkPoint pos[], const SkPaint& paint) { 248 const SkPaint& paint) {
249 AUTO_LUA("drawPosText"); 249 AUTO_LUA("drawPosText");
250 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); 250 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
251 lua.pushPaint(paint, "paint"); 251 lua.pushPaint(paint, "paint");
252 } 252 }
253 253
254 void SkLuaCanvas::drawPosTextH(const void* text, size_t byteLength, 254 void SkLuaCanvas::onDrawPosTextH(const void* text, size_t byteLength, const SkSc alar xpos[],
255 const SkScalar xpos[], SkScalar constY, 255 SkScalar constY, const SkPaint& paint) {
256 const SkPaint& paint) {
257 AUTO_LUA("drawPosTextH"); 256 AUTO_LUA("drawPosTextH");
258 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); 257 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
259 lua.pushPaint(paint, "paint"); 258 lua.pushPaint(paint, "paint");
260 } 259 }
261 260
262 void SkLuaCanvas::drawTextOnPath(const void* text, size_t byteLength, 261 void SkLuaCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const Sk Path& path,
263 const SkPath& path, const SkMatrix* matrix, 262 const SkMatrix* matrix, const SkPaint& paint) {
264 const SkPaint& paint) {
265 AUTO_LUA("drawTextOnPath"); 263 AUTO_LUA("drawTextOnPath");
266 lua.pushPath(path, "path"); 264 lua.pushPath(path, "path");
267 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength); 265 lua.pushEncodedText(paint.getTextEncoding(), text, byteLength);
268 lua.pushPaint(paint, "paint"); 266 lua.pushPaint(paint, "paint");
269 } 267 }
270 268
271 void SkLuaCanvas::drawPicture(SkPicture& picture) { 269 void SkLuaCanvas::drawPicture(SkPicture& picture) {
272 AUTO_LUA("drawPicture"); 270 AUTO_LUA("drawPicture");
273 // call through so we can see the nested picture ops 271 // call through so we can see the nested picture ops
274 this->INHERITED::drawPicture(picture); 272 this->INHERITED::drawPicture(picture);
275 } 273 }
276 274
277 void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount, 275 void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount,
278 const SkPoint vertices[], const SkPoint texs[], 276 const SkPoint vertices[], const SkPoint texs[],
279 const SkColor colors[], SkXfermode* xmode, 277 const SkColor colors[], SkXfermode* xmode,
280 const uint16_t indices[], int indexCount, 278 const uint16_t indices[], int indexCount,
281 const SkPaint& paint) { 279 const SkPaint& paint) {
282 AUTO_LUA("drawVertices"); 280 AUTO_LUA("drawVertices");
283 lua.pushPaint(paint, "paint"); 281 lua.pushPaint(paint, "paint");
284 } 282 }
285 283
286 void SkLuaCanvas::drawData(const void* data, size_t length) { 284 void SkLuaCanvas::drawData(const void* data, size_t length) {
287 AUTO_LUA("drawData"); 285 AUTO_LUA("drawData");
288 } 286 }
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