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