OLD | NEW |
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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 } | 402 } |
403 | 403 |
404 void SkDebugCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeS
tyle edgeStyle) { | 404 void SkDebugCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeS
tyle edgeStyle) { |
405 this->addDrawCommand(new SkClipRRectCommand(rrect, op, kSoft_ClipEdgeStyle =
= edgeStyle)); | 405 this->addDrawCommand(new SkClipRRectCommand(rrect, op, kSoft_ClipEdgeStyle =
= edgeStyle)); |
406 } | 406 } |
407 | 407 |
408 void SkDebugCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { | 408 void SkDebugCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) { |
409 this->addDrawCommand(new SkClipRegionCommand(region, op)); | 409 this->addDrawCommand(new SkClipRegionCommand(region, op)); |
410 } | 410 } |
411 | 411 |
412 bool SkDebugCanvas::concat(const SkMatrix& matrix) { | 412 void SkDebugCanvas::didConcat(const SkMatrix& matrix) { |
413 addDrawCommand(new SkConcatCommand(matrix)); | 413 addDrawCommand(new SkConcatCommand(matrix)); |
414 return true; | 414 this->INHERITED::didConcat(matrix); |
415 } | 415 } |
416 | 416 |
417 void SkDebugCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left, | 417 void SkDebugCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left, |
418 SkScalar top, const SkPaint* paint = NULL) { | 418 SkScalar top, const SkPaint* paint = NULL) { |
419 addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); | 419 addDrawCommand(new SkDrawBitmapCommand(bitmap, left, top, paint)); |
420 } | 420 } |
421 | 421 |
422 void SkDebugCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, | 422 void SkDebugCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, |
423 const SkRect* src, const SkRect& dst, | 423 const SkRect* src, const SkRect& dst, |
424 const SkPaint* paint, | 424 const SkPaint* paint, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 528 |
529 void SkDebugCanvas::onPopCull() { | 529 void SkDebugCanvas::onPopCull() { |
530 this->addDrawCommand(new SkPopCullCommand()); | 530 this->addDrawCommand(new SkPopCullCommand()); |
531 } | 531 } |
532 | 532 |
533 void SkDebugCanvas::willRestore() { | 533 void SkDebugCanvas::willRestore() { |
534 this->addDrawCommand(new SkRestoreCommand()); | 534 this->addDrawCommand(new SkRestoreCommand()); |
535 this->INHERITED::willRestore(); | 535 this->INHERITED::willRestore(); |
536 } | 536 } |
537 | 537 |
538 bool SkDebugCanvas::rotate(SkScalar degrees) { | 538 void SkDebugCanvas::didRotate(SkScalar degrees) { |
539 addDrawCommand(new SkRotateCommand(degrees)); | 539 addDrawCommand(new SkRotateCommand(degrees)); |
540 return true; | 540 this->INHERITED::didRotate(degrees); |
541 } | 541 } |
542 | 542 |
543 void SkDebugCanvas::willSave(SaveFlags flags) { | 543 void SkDebugCanvas::willSave(SaveFlags flags) { |
544 this->addDrawCommand(new SkSaveCommand(flags)); | 544 this->addDrawCommand(new SkSaveCommand(flags)); |
545 this->INHERITED::willSave(flags); | 545 this->INHERITED::willSave(flags); |
546 } | 546 } |
547 | 547 |
548 SkCanvas::SaveLayerStrategy SkDebugCanvas::willSaveLayer(const SkRect* bounds, c
onst SkPaint* paint, | 548 SkCanvas::SaveLayerStrategy SkDebugCanvas::willSaveLayer(const SkRect* bounds, c
onst SkPaint* paint, |
549 SaveFlags flags) { | 549 SaveFlags flags) { |
550 this->addDrawCommand(new SkSaveLayerCommand(bounds, paint, flags)); | 550 this->addDrawCommand(new SkSaveLayerCommand(bounds, paint, flags)); |
551 this->INHERITED::willSaveLayer(bounds, paint, flags); | 551 this->INHERITED::willSaveLayer(bounds, paint, flags); |
552 // No need for a full layer. | 552 // No need for a full layer. |
553 return kNoLayer_SaveLayerStrategy; | 553 return kNoLayer_SaveLayerStrategy; |
554 } | 554 } |
555 | 555 |
556 bool SkDebugCanvas::scale(SkScalar sx, SkScalar sy) { | 556 void SkDebugCanvas::didScale(SkScalar sx, SkScalar sy) { |
557 addDrawCommand(new SkScaleCommand(sx, sy)); | 557 addDrawCommand(new SkScaleCommand(sx, sy)); |
558 return true; | 558 this->INHERITED::didScale(sx, sy); |
559 } | 559 } |
560 | 560 |
561 void SkDebugCanvas::setMatrix(const SkMatrix& matrix) { | 561 void SkDebugCanvas::didSetMatrix(const SkMatrix& matrix) { |
562 addDrawCommand(new SkSetMatrixCommand(matrix)); | 562 addDrawCommand(new SkSetMatrixCommand(matrix)); |
| 563 this->INHERITED::didSetMatrix(matrix); |
563 } | 564 } |
564 | 565 |
565 bool SkDebugCanvas::skew(SkScalar sx, SkScalar sy) { | 566 void SkDebugCanvas::didSkew(SkScalar sx, SkScalar sy) { |
566 addDrawCommand(new SkSkewCommand(sx, sy)); | 567 addDrawCommand(new SkSkewCommand(sx, sy)); |
567 return true; | 568 this->INHERITED::didSkew(sx, sy); |
568 } | 569 } |
569 | 570 |
570 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { | 571 void SkDebugCanvas::didTranslate(SkScalar dx, SkScalar dy) { |
571 addDrawCommand(new SkTranslateCommand(dx, dy)); | 572 addDrawCommand(new SkTranslateCommand(dx, dy)); |
572 return true; | 573 this->INHERITED::didTranslate(dx, dy); |
573 } | 574 } |
574 | 575 |
575 void SkDebugCanvas::toggleCommand(int index, bool toggle) { | 576 void SkDebugCanvas::toggleCommand(int index, bool toggle) { |
576 SkASSERT(index < fCommandVector.count()); | 577 SkASSERT(index < fCommandVector.count()); |
577 fCommandVector[index]->setVisible(toggle); | 578 fCommandVector[index]->setVisible(toggle); |
578 } | 579 } |
OLD | NEW |