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

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

Issue 817723005: 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::drawBitmap(const SkBitmap& bitmap, SkScalar left, 434 void SkDebugCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
435 SkScalar top, const SkPaint* paint = NULL) { 435 SkScalar top, const SkPaint* paint) {
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::drawBitmapRectToRect(const SkBitmap& bitmap, 439 void SkDebugCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
440 const SkRect* src, const SkRect& dst, 440 const SkPaint* paint, DrawBitmapRectFlags f lags) {
441 const SkPaint* paint,
442 SkCanvas::DrawBitmapRectFlags flags) {
443 this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, fl ags)); 441 this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, fl ags));
444 } 442 }
445 443
446 void SkDebugCanvas::drawBitmapNine(const SkBitmap& bitmap, 444 void SkDebugCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& cent er,
447 const SkIRect& center, const SkRect& dst, const SkPaint* paint) { 445 const SkRect& dst, const SkPaint* paint) {
448 this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint) ); 446 this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint) );
449 } 447 }
450 448
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
451 void SkDebugCanvas::beginCommentGroup(const char* description) { 459 void SkDebugCanvas::beginCommentGroup(const char* description) {
452 this->addDrawCommand(new SkBeginCommentGroupCommand(description)); 460 this->addDrawCommand(new SkBeginCommentGroupCommand(description));
453 } 461 }
454 462
455 void SkDebugCanvas::addComment(const char* kywd, const char* value) { 463 void SkDebugCanvas::addComment(const char* kywd, const char* value) {
456 this->addDrawCommand(new SkCommentCommand(kywd, value)); 464 this->addDrawCommand(new SkCommentCommand(kywd, value));
457 } 465 }
458 466
459 void SkDebugCanvas::endCommentGroup() { 467 void SkDebugCanvas::endCommentGroup() {
460 this->addDrawCommand(new SkEndCommentGroupCommand()); 468 this->addDrawCommand(new SkEndCommentGroupCommand());
461 } 469 }
462 470
463 void SkDebugCanvas::drawOval(const SkRect& oval, const SkPaint& paint) { 471 void SkDebugCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) {
464 this->addDrawCommand(new SkDrawOvalCommand(oval, paint)); 472 this->addDrawCommand(new SkDrawOvalCommand(oval, paint));
465 } 473 }
466 474
467 void SkDebugCanvas::drawPaint(const SkPaint& paint) { 475 void SkDebugCanvas::onDrawPaint(const SkPaint& paint) {
468 this->addDrawCommand(new SkDrawPaintCommand(paint)); 476 this->addDrawCommand(new SkDrawPaintCommand(paint));
469 } 477 }
470 478
471 void SkDebugCanvas::drawPath(const SkPath& path, const SkPaint& paint) { 479 void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
472 this->addDrawCommand(new SkDrawPathCommand(path, paint)); 480 this->addDrawCommand(new SkDrawPathCommand(path, paint));
473 } 481 }
474 482
475 void SkDebugCanvas::onDrawPicture(const SkPicture* picture, 483 void SkDebugCanvas::onDrawPicture(const SkPicture* picture,
476 const SkMatrix* matrix, 484 const SkMatrix* matrix,
477 const SkPaint* paint) { 485 const SkPaint* paint) {
478 this->addDrawCommand(new SkDrawPictureCommand(picture, matrix, paint)); 486 this->addDrawCommand(new SkDrawPictureCommand(picture, matrix, paint));
479 } 487 }
480 488
481 void SkDebugCanvas::drawPoints(PointMode mode, size_t count, 489 void SkDebugCanvas::onDrawPoints(PointMode mode, size_t count,
482 const SkPoint pts[], const SkPaint& paint) { 490 const SkPoint pts[], const SkPaint& paint) {
483 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint)); 491 this->addDrawCommand(new SkDrawPointsCommand(mode, count, pts, paint));
484 } 492 }
485 493
486 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP oint pos[], 494 void SkDebugCanvas::onDrawPosText(const void* text, size_t byteLength, const SkP oint pos[],
487 const SkPaint& paint) { 495 const SkPaint& paint) {
488 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)) ; 496 this->addDrawCommand(new SkDrawPosTextCommand(text, byteLength, pos, paint)) ;
489 } 497 }
490 498
491 void SkDebugCanvas::onDrawPosTextH(const void* text, size_t byteLength, const Sk Scalar xpos[], 499 void SkDebugCanvas::onDrawPosTextH(const void* text, size_t byteLength, const Sk Scalar xpos[],
492 SkScalar constY, const SkPaint& paint) { 500 SkScalar constY, const SkPaint& paint) {
493 this->addDrawCommand( 501 this->addDrawCommand(
494 new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint)); 502 new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint));
495 } 503 }
496 504
497 void SkDebugCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { 505 void SkDebugCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
498 // NOTE(chudy): Messing up when renamed to DrawRect... Why? 506 // NOTE(chudy): Messing up when renamed to DrawRect... Why?
499 addDrawCommand(new SkDrawRectCommand(rect, paint)); 507 addDrawCommand(new SkDrawRectCommand(rect, paint));
500 } 508 }
501 509
502 void SkDebugCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { 510 void SkDebugCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
503 this->addDrawCommand(new SkDrawRRectCommand(rrect, paint)); 511 this->addDrawCommand(new SkDrawRRectCommand(rrect, paint));
504 } 512 }
505 513
506 void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, 514 void SkDebugCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner,
507 const SkPaint& paint) { 515 const SkPaint& paint) {
508 this->addDrawCommand(new SkDrawDRRectCommand(outer, inner, paint)); 516 this->addDrawCommand(new SkDrawDRRectCommand(outer, inner, paint));
509 } 517 }
510 518
511 void SkDebugCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, 519 void SkDebugCanvas::onDrawSprite(const SkBitmap& bitmap, int left, int top, cons t SkPaint* paint) {
512 const SkPaint* paint = NULL) {
513 this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint)); 520 this->addDrawCommand(new SkDrawSpriteCommand(bitmap, left, top, paint));
514 } 521 }
515 522
516 void SkDebugCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, 523 void SkDebugCanvas::onDrawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
517 const SkPaint& paint) { 524 const SkPaint& paint) {
518 this->addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint)); 525 this->addDrawCommand(new SkDrawTextCommand(text, byteLength, x, y, paint));
519 } 526 }
520 527
521 void SkDebugCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, 528 void SkDebugCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path,
522 const SkMatrix* matrix, const SkPaint& pain t) { 529 const SkMatrix* matrix, const SkPaint& pain t) {
523 this->addDrawCommand( 530 this->addDrawCommand(
524 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint)); 531 new SkDrawTextOnPathCommand(text, byteLength, path, matrix, paint));
525 } 532 }
526 533
527 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 534 void SkDebugCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
528 const SkPaint& paint) { 535 const SkPaint& paint) {
529 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint)); 536 this->addDrawCommand(new SkDrawTextBlobCommand(blob, x, y, paint));
530 } 537 }
531 538
532 void SkDebugCanvas::drawVertices(VertexMode vmode, int vertexCount, 539 void SkDebugCanvas::onDrawVertices(VertexMode vmode, int vertexCount, const SkPo int vertices[],
533 const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], 540 const SkPoint texs[], const SkColor colors[],
534 SkXfermode*, const uint16_t indices[], int indexCount, 541 SkXfermode*, const uint16_t indices[], int in dexCount,
535 const SkPaint& paint) { 542 const SkPaint& paint) {
536 this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices, 543 this->addDrawCommand(new SkDrawVerticesCommand(vmode, vertexCount, vertices,
537 texs, colors, NULL, indices, indexCount, paint)); 544 texs, colors, NULL, indices, indexCount, paint));
538 } 545 }
539 546
540 void SkDebugCanvas::willRestore() { 547 void SkDebugCanvas::willRestore() {
541 this->addDrawCommand(new SkRestoreCommand()); 548 this->addDrawCommand(new SkRestoreCommand());
542 this->INHERITED::willRestore(); 549 this->INHERITED::willRestore();
543 } 550 }
544 551
545 void SkDebugCanvas::willSave() { 552 void SkDebugCanvas::willSave() {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 } 689 }
683 690
684 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { 691 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) {
685 if (fCalledAddStackData) { 692 if (fCalledAddStackData) {
686 fClipStackData.appendf("<br>"); 693 fClipStackData.appendf("<br>");
687 addPathData(devPath, "pathOut"); 694 addPathData(devPath, "pathOut");
688 return true; 695 return true;
689 } 696 }
690 return false; 697 return false;
691 } 698 }
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