| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 canvas->clipRect(r, SkRegion::kReplace_Op); | 321 canvas->clipRect(r, SkRegion::kReplace_Op); |
| 322 | 322 |
| 323 // visualize existing clips | 323 // visualize existing clips |
| 324 SkDebugClipVisitor visitor(canvas); | 324 SkDebugClipVisitor visitor(canvas); |
| 325 | 325 |
| 326 canvas->replayClips(&visitor); | 326 canvas->replayClips(&visitor); |
| 327 | 327 |
| 328 canvas->restore(); | 328 canvas->restore(); |
| 329 } | 329 } |
| 330 fMatrix = canvas->getTotalMatrix(); | 330 fMatrix = canvas->getTotalMatrix(); |
| 331 fClip = canvas->getTotalClip().getBounds(); | 331 if (!canvas->getClipDeviceBounds(&fClip)) { |
| 332 fClip.setEmpty(); |
| 333 } |
| 332 fIndex = index; | 334 fIndex = index; |
| 333 } | 335 } |
| 334 | 336 |
| 335 void SkDebugCanvas::deleteDrawCommandAt(int index) { | 337 void SkDebugCanvas::deleteDrawCommandAt(int index) { |
| 336 SkASSERT(index < fCommandVector.count()); | 338 SkASSERT(index < fCommandVector.count()); |
| 337 delete fCommandVector[index]; | 339 delete fCommandVector[index]; |
| 338 fCommandVector.remove(index); | 340 fCommandVector.remove(index); |
| 339 } | 341 } |
| 340 | 342 |
| 341 SkDrawCommand* SkDebugCanvas::getDrawCommandAt(int index) { | 343 SkDrawCommand* SkDebugCanvas::getDrawCommandAt(int index) { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 566 |
| 565 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { | 567 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { |
| 566 addDrawCommand(new SkTranslateCommand(dx, dy)); | 568 addDrawCommand(new SkTranslateCommand(dx, dy)); |
| 567 return true; | 569 return true; |
| 568 } | 570 } |
| 569 | 571 |
| 570 void SkDebugCanvas::toggleCommand(int index, bool toggle) { | 572 void SkDebugCanvas::toggleCommand(int index, bool toggle) { |
| 571 SkASSERT(index < fCommandVector.count()); | 573 SkASSERT(index < fCommandVector.count()); |
| 572 fCommandVector[index]->setVisible(toggle); | 574 fCommandVector[index]->setVisible(toggle); |
| 573 } | 575 } |
| OLD | NEW |