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

Side by Side Diff: src/utils/debugger/SkDebugCanvas.cpp

Issue 835913002: Revert of move remaining virtual draw methods to onDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.h ('k') | tests/RecordDrawTest.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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 matrix.getScaleY())); 424 matrix.getScaleY()));
425 break; 425 break;
426 default: 426 default:
427 this->addDrawCommand(new SkConcatCommand(matrix)); 427 this->addDrawCommand(new SkConcatCommand(matrix));
428 break; 428 break;
429 } 429 }
430 430
431 this->INHERITED::didConcat(matrix); 431 this->INHERITED::didConcat(matrix);
432 } 432 }
433 433
434 void SkDebugCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, 434 void SkDebugCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left,
435 SkScalar top, const SkPaint* paint) { 435 SkScalar top, const SkPaint* paint = NULL) {
436 this->addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); 436 this->addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint));
437 } 437 }
438 438
439 void SkDebugCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, 439 void SkDebugCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
440 const SkPaint* paint, DrawBitmapRectFlags f lags) { 440 const SkRect* src, const SkRect& dst,
441 const SkPaint* paint,
442 SkCanvas::DrawBitmapRectFlags flags) {
441 this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, fl ags)); 443 this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, fl ags));
442 } 444 }
443 445
444 void SkDebugCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cent er, 446 void SkDebugCanvas::drawBitmapNine(const SkBitmap& bitmap,
445 const SkRect& dst, const SkPaint* paint) { 447 const SkIRect& center, const SkRect& dst, const SkPaint* paint) {
446 this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint) ); 448 this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint) );
447 } 449 }
448 450
449 void SkDebugCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar to p,
450 const SkPaint* paint) {
451 SkDebugf("SkDebugCanvas::onDrawImage unimplemented\n");
452 }
453
454 void SkDebugCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, con st SkRect& dst,
455 const SkPaint* paint) {
456 SkDebugf("SkDebugCanvas::onDrawImageRect unimplemented\n");
457 }
458
459 void SkDebugCanvas::beginCommentGroup(const char* description) { 451 void SkDebugCanvas::beginCommentGroup(const char* description) {
460 this->addDrawCommand(new SkBeginCommentGroupCommand(description)); 452 this->addDrawCommand(new SkBeginCommentGroupCommand(description));
461 } 453 }
462 454
463 void SkDebugCanvas::addComment(const char* kywd, const char* value) { 455 void SkDebugCanvas::addComment(const char* kywd, const char* value) {
464 this->addDrawCommand(new SkCommentCommand(kywd, value)); 456 this->addDrawCommand(new SkCommentCommand(kywd, value));
465 } 457 }
466 458
467 void SkDebugCanvas::endCommentGroup() { 459 void SkDebugCanvas::endCommentGroup() {
468 this->addDrawCommand(new SkEndCommentGroupCommand()); 460 this->addDrawCommand(new SkEndCommentGroupCommand());
469 } 461 }
470 462
471 void SkDebugCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) { 463 void SkDebugCanvas::drawOval(const SkRect& oval, const SkPaint& paint) {
472 this->addDrawCommand(new SkDrawOvalCommand(oval, paint)); 464 this->addDrawCommand(new SkDrawOvalCommand(oval, paint));
473 } 465 }
474 466
475 void SkDebugCanvas::onDrawPaint(const SkPaint& paint) { 467 void SkDebugCanvas::drawPaint(const SkPaint& paint) {
476 this->addDrawCommand(new SkDrawPaintCommand(paint)); 468 this->addDrawCommand(new SkDrawPaintCommand(paint));
477 } 469 }
478 470
479 void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { 471 void SkDebugCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
480 this->addDrawCommand(new SkDrawPathCommand(path, paint)); 472 this->addDrawCommand(new SkDrawPathCommand(path, paint));
481 } 473 }
482 474
483 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, 475 void SkDebugCanvas::onDrawPicture(const SkPicture* picture,
484 const SkMatrix* matrix, 476 const SkMatrix* matrix,
485 const SkPaint* paint) { 477 const SkPaint* paint) {
486 this->addDrawCommand(new SkDrawPictureCommand(picture, matrix, paint)); 478 this->addDrawCommand(new SkDrawPictureCommand(picture, matrix, paint));
487 } 479 }
488 480
489 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count, 481 void SkDebugCanvas::drawPoints(PointMode mode, size_t count,
490 const SkPoint pts[], const SkPaint& paint) { 482 const SkPoint pts[], const SkPaint& paint) {
491 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); 483 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint));
492 } 484 }
493 485
494 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP oint pos[], 486 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP oint pos[],
495 const SkPaint& paint) { 487 const SkPaint& paint) {
496 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)) ; 488 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)) ;
497 } 489 }
498 490
499 void SkDebugCanvas::onDrawPosTextH(const void* text, size_t byteLength, const Sk Scalar xpos[], 491 void SkDebugCanvas::onDrawPosTextH(const void* text, size_t byteLength, const Sk Scalar xpos[],
500 SkScalar constY, const SkPaint& paint) { 492 SkScalar constY, const SkPaint& paint) {
501 this->addDrawCommand( 493 this->addDrawCommand(
502 new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint)); 494 new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint));
503 } 495 }
504 496
505 void SkDebugCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { 497 void SkDebugCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
506 // NOTE(chudy): Messing up when renamed to DrawRect... Why? 498 // NOTE(chudy): Messing up when renamed to DrawRect... Why?
507 addDrawCommand(new SkDrawRectCommand(rect, paint)); 499 addDrawCommand(new SkDrawRectCommand(rect, paint));
508 } 500 }
509 501
510 void SkDebugCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { 502 void SkDebugCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
511 this->addDrawCommand(new SkDrawRRectCommand(rrect, paint)); 503 this->addDrawCommand(new SkDrawRRectCommand(rrect, paint));
512 } 504 }
513 505
514 void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, 506 void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
515 const SkPaint& paint) { 507 const SkPaint& paint) {
516 this->addDrawCommand(new SkDrawDRRectCommand(outer, inner, paint)); 508 this->addDrawCommand(new SkDrawDRRectCommand(outer, inner, paint));
517 } 509 }
518 510
519 void SkDebugCanvas::onDrawSprite(const SkBitmap& bitmap, int left, int top, cons t SkPaint* paint) { 511 void SkDebugCanvas::drawSprite(const SkBitmap& bitmap, int left, int top,
512 const SkPaint* paint = NULL) {
520 this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint)); 513 this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint));
521 } 514 }
522 515
523 void SkDebugCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, 516 void SkDebugCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
524 const SkPaint& paint) { 517 const SkPaint& paint) {
525 this->addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint)); 518 this->addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint));
526 } 519 }
527 520
528 void SkDebugCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, 521 void SkDebugCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
529 const SkMatrix* matrix, const SkPaint& pain t) { 522 const SkMatrix* matrix, const SkPaint& pain t) {
530 this->addDrawCommand( 523 this->addDrawCommand(
531 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint)); 524 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint));
532 } 525 }
533 526
534 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 527 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
535 const SkPaint& paint) { 528 const SkPaint& paint) {
536 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint)); 529 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint));
537 } 530 }
538 531
539 void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPo int vertices[], 532 void SkDebugCanvas::drawVertices(VertexMode vmode, int vertexCount,
540 const SkPoint texs[], const SkColor colors[], 533 const SkPoint vertices[], const SkPoint texs[], const SkColor colors[],
541 SkXfermode*, const uint16_t indices[], int in dexCount, 534 SkXfermode*, const uint16_t indices[], int indexCount,
542 const SkPaint& paint) { 535 const SkPaint& paint) {
543 this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices, 536 this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices,
544 texs, colors, NULL, indices, indexCount, paint)); 537 texs, colors, NULL, indices, indexCount, paint));
545 } 538 }
546 539
547 void SkDebugCanvas::willRestore() { 540 void SkDebugCanvas::willRestore() {
548 this->addDrawCommand(new SkRestoreCommand()); 541 this->addDrawCommand(new SkRestoreCommand());
549 this->INHERITED::willRestore(); 542 this->INHERITED::willRestore();
550 } 543 }
551 544
552 void SkDebugCanvas::willSave() { 545 void SkDebugCanvas::willSave() {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 682 }
690 683
691 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { 684 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) {
692 if (fCalledAddStackData) { 685 if (fCalledAddStackData) {
693 fClipStackData.appendf("<br>"); 686 fClipStackData.appendf("<br>");
694 addPathData(devPath, "pathOut"); 687 addPathData(devPath, "pathOut");
695 return true; 688 return true;
696 } 689 }
697 return false; 690 return false;
698 } 691 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.h ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698