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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 if (fCommandVector[i]->isVisible()) { | 200 if (fCommandVector[i]->isVisible()) { |
201 fCommandVector[i]->execute(canvas); | 201 fCommandVector[i]->execute(canvas); |
202 fCommandVector[i]->trackSaveState(&fOutstandingSaveCount); | 202 fCommandVector[i]->trackSaveState(&fOutstandingSaveCount); |
203 } | 203 } |
204 } | 204 } |
205 fMatrix = canvas->getTotalMatrix(); | 205 fMatrix = canvas->getTotalMatrix(); |
206 fClip = canvas->getTotalClip().getBounds(); | 206 fClip = canvas->getTotalClip().getBounds(); |
207 fIndex = index; | 207 fIndex = index; |
208 } | 208 } |
209 | 209 |
| 210 void SkDebugCanvas::deleteDrawCommandAt(int index) { |
| 211 SkASSERT(index < fCommandVector.count()); |
| 212 delete fCommandVector[index]; |
| 213 fCommandVector.remove(index); |
| 214 } |
| 215 |
210 SkDrawCommand* SkDebugCanvas::getDrawCommandAt(int index) { | 216 SkDrawCommand* SkDebugCanvas::getDrawCommandAt(int index) { |
211 SkASSERT(index < fCommandVector.count()); | 217 SkASSERT(index < fCommandVector.count()); |
212 return fCommandVector[index]; | 218 return fCommandVector[index]; |
213 } | 219 } |
214 | 220 |
| 221 void SkDebugCanvas::setDrawCommandAt(int index, SkDrawCommand* command) { |
| 222 SkASSERT(index < fCommandVector.count()); |
| 223 delete fCommandVector[index]; |
| 224 fCommandVector[index] = command; |
| 225 } |
| 226 |
215 SkTDArray<SkString*>* SkDebugCanvas::getCommandInfo(int index) { | 227 SkTDArray<SkString*>* SkDebugCanvas::getCommandInfo(int index) { |
216 SkASSERT(index < fCommandVector.count()); | 228 SkASSERT(index < fCommandVector.count()); |
217 return fCommandVector[index]->Info(); | 229 return fCommandVector[index]->Info(); |
218 } | 230 } |
219 | 231 |
220 bool SkDebugCanvas::getDrawCommandVisibilityAt(int index) { | 232 bool SkDebugCanvas::getDrawCommandVisibilityAt(int index) { |
221 SkASSERT(index < fCommandVector.count()); | 233 SkASSERT(index < fCommandVector.count()); |
222 return fCommandVector[index]->isVisible(); | 234 return fCommandVector[index]->isVisible(); |
223 } | 235 } |
224 | 236 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 490 |
479 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { | 491 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { |
480 addDrawCommand(new Translate(dx, dy)); | 492 addDrawCommand(new Translate(dx, dy)); |
481 return true; | 493 return true; |
482 } | 494 } |
483 | 495 |
484 void SkDebugCanvas::toggleCommand(int index, bool toggle) { | 496 void SkDebugCanvas::toggleCommand(int index, bool toggle) { |
485 SkASSERT(index < fCommandVector.count()); | 497 SkASSERT(index < fCommandVector.count()); |
486 fCommandVector[index]->setVisible(toggle); | 498 fCommandVector[index]->setVisible(toggle); |
487 } | 499 } |
OLD | NEW |