| 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 } | 523 } |
| 524 | 524 |
| 525 void SkDebugCanvas::onPushCull(const SkRect& cullRect) { | 525 void SkDebugCanvas::onPushCull(const SkRect& cullRect) { |
| 526 this->addDrawCommand(new SkPushCullCommand(cullRect)); | 526 this->addDrawCommand(new SkPushCullCommand(cullRect)); |
| 527 } | 527 } |
| 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::restore() { | 533 void SkDebugCanvas::onRestore() { |
| 534 addDrawCommand(new SkRestoreCommand()); | 534 this->addDrawCommand(new SkRestoreCommand()); |
| 535 this->INHERITED::onRestore(); |
| 535 } | 536 } |
| 536 | 537 |
| 537 bool SkDebugCanvas::rotate(SkScalar degrees) { | 538 bool SkDebugCanvas::rotate(SkScalar degrees) { |
| 538 addDrawCommand(new SkRotateCommand(degrees)); | 539 addDrawCommand(new SkRotateCommand(degrees)); |
| 539 return true; | 540 return true; |
| 540 } | 541 } |
| 541 | 542 |
| 542 int SkDebugCanvas::save(SaveFlags flags) { | 543 void SkDebugCanvas::onSave(SaveFlags flags) { |
| 543 addDrawCommand(new SkSaveCommand(flags)); | 544 this->addDrawCommand(new SkSaveCommand(flags)); |
| 544 return true; | 545 this->INHERITED::onSave(flags); |
| 545 } | 546 } |
| 546 | 547 |
| 547 int SkDebugCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, | 548 bool SkDebugCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint, |
| 548 SaveFlags flags) { | 549 SaveFlags flags) { |
| 549 addDrawCommand(new SkSaveLayerCommand(bounds, paint, flags)); | 550 this->addDrawCommand(new SkSaveLayerCommand(bounds, paint, flags)); |
| 550 return true; | 551 this->INHERITED::onSaveLayer(bounds, paint, flags); |
| 552 // No need for a full layer. |
| 553 return false; |
| 551 } | 554 } |
| 552 | 555 |
| 553 bool SkDebugCanvas::scale(SkScalar sx, SkScalar sy) { | 556 bool SkDebugCanvas::scale(SkScalar sx, SkScalar sy) { |
| 554 addDrawCommand(new SkScaleCommand(sx, sy)); | 557 addDrawCommand(new SkScaleCommand(sx, sy)); |
| 555 return true; | 558 return true; |
| 556 } | 559 } |
| 557 | 560 |
| 558 void SkDebugCanvas::setMatrix(const SkMatrix& matrix) { | 561 void SkDebugCanvas::setMatrix(const SkMatrix& matrix) { |
| 559 addDrawCommand(new SkSetMatrixCommand(matrix)); | 562 addDrawCommand(new SkSetMatrixCommand(matrix)); |
| 560 } | 563 } |
| 561 | 564 |
| 562 bool SkDebugCanvas::skew(SkScalar sx, SkScalar sy) { | 565 bool SkDebugCanvas::skew(SkScalar sx, SkScalar sy) { |
| 563 addDrawCommand(new SkSkewCommand(sx, sy)); | 566 addDrawCommand(new SkSkewCommand(sx, sy)); |
| 564 return true; | 567 return true; |
| 565 } | 568 } |
| 566 | 569 |
| 567 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { | 570 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { |
| 568 addDrawCommand(new SkTranslateCommand(dx, dy)); | 571 addDrawCommand(new SkTranslateCommand(dx, dy)); |
| 569 return true; | 572 return true; |
| 570 } | 573 } |
| 571 | 574 |
| 572 void SkDebugCanvas::toggleCommand(int index, bool toggle) { | 575 void SkDebugCanvas::toggleCommand(int index, bool toggle) { |
| 573 SkASSERT(index < fCommandVector.count()); | 576 SkASSERT(index < fCommandVector.count()); |
| 574 fCommandVector[index]->setVisible(toggle); | 577 fCommandVector[index]->setVisible(toggle); |
| 575 } | 578 } |
| OLD | NEW |