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

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

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android Created 6 years, 6 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkDumpCanvas.h" 9 #include "SkDumpCanvas.h"
10 10
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 416
417 void SkDumpCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const S kPath& path, 417 void SkDumpCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const S kPath& path,
418 const SkMatrix* matrix, const SkPaint& paint ) { 418 const SkMatrix* matrix, const SkPaint& paint ) {
419 SkString str; 419 SkString str;
420 toString(text, byteLength, paint.getTextEncoding(), &str); 420 toString(text, byteLength, paint.getTextEncoding(), &str);
421 this->dump(kDrawText_Verb, &paint, "drawTextOnPath(%s [%d])", 421 this->dump(kDrawText_Verb, &paint, "drawTextOnPath(%s [%d])",
422 str.c_str(), byteLength); 422 str.c_str(), byteLength);
423 } 423 }
424 424
425 void SkDumpCanvas::drawPicture(SkPicture& picture) { 425 void SkDumpCanvas::onDrawPicture(const SkPicture* picture) {
426 this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", &picture, 426 this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", picture,
427 picture.width(), picture.height()); 427 picture->width(), picture->height());
428 fNestLevel += 1; 428 fNestLevel += 1;
429 this->INHERITED::drawPicture(picture); 429 this->INHERITED::onDrawPicture(picture);
430 fNestLevel -= 1; 430 fNestLevel -= 1;
431 this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture, 431 this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture,
432 picture.width(), picture.height()); 432 picture->width(), picture->height());
433 } 433 }
434 434
435 void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, 435 void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount,
436 const SkPoint vertices[], const SkPoint texs[], 436 const SkPoint vertices[], const SkPoint texs[],
437 const SkColor colors[], SkXfermode* xmode, 437 const SkColor colors[], SkXfermode* xmode,
438 const uint16_t indices[], int indexCount, 438 const uint16_t indices[], int indexCount,
439 const SkPaint& paint) { 439 const SkPaint& paint) {
440 this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)", 440 this->dump(kDrawVertices_Verb, &paint, "drawVertices(%s [%d] %g %g ...)",
441 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX), 441 toString(vmode), vertexCount, SkScalarToFloat(vertices[0].fX),
442 SkScalarToFloat(vertices[0].fY)); 442 SkScalarToFloat(vertices[0].fY));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 519
520 /////////////////////////////////////////////////////////////////////////////// 520 ///////////////////////////////////////////////////////////////////////////////
521 521
522 static void dumpToDebugf(const char text[], void*) { 522 static void dumpToDebugf(const char text[], void*) {
523 SkDebugf("%s\n", text); 523 SkDebugf("%s\n", text);
524 } 524 }
525 525
526 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {} 526 SkDebugfDumper::SkDebugfDumper() : INHERITED(dumpToDebugf, NULL) {}
527 527
528 #endif 528 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698