Index: src/core/SkPictureStateTree.cpp |
diff --git a/src/core/SkPictureStateTree.cpp b/src/core/SkPictureStateTree.cpp |
index fdd86464a9e005e53256450fa5439a0f2ccceff9..d2f0e6efcd40299b7425fe6f2afd89804825c13a 100644 |
--- a/src/core/SkPictureStateTree.cpp |
+++ b/src/core/SkPictureStateTree.cpp |
@@ -73,9 +73,10 @@ void SkPictureStateTree::appendClip(size_t offset) { |
this->appendNode(offset); |
} |
-SkPictureStateTree::Iterator SkPictureStateTree::getIterator(const SkTDArray<void*>& draws, |
- SkCanvas* canvas) { |
- return Iterator(draws, canvas, &fRoot); |
+void SkPictureStateTree::initIterator(SkPictureStateTree::Iterator* iter, |
+ const SkTDArray<void*>& draws, |
+ SkCanvas* canvas) { |
+ iter->init(draws, canvas, &fRoot); |
} |
void SkPictureStateTree::appendNode(size_t offset) { |
@@ -88,15 +89,16 @@ void SkPictureStateTree::appendNode(size_t offset) { |
fCurrentState.fNode = n; |
} |
-SkPictureStateTree::Iterator::Iterator(const SkTDArray<void*>& draws, SkCanvas* canvas, Node* root) |
- : fDraws(&draws) |
- , fCanvas(canvas) |
- , fCurrentNode(root) |
- , fPlaybackMatrix(canvas->getTotalMatrix()) |
- , fCurrentMatrix(NULL) |
- , fPlaybackIndex(0) |
- , fSave(false) |
- , fValid(true) { |
+void SkPictureStateTree::Iterator::init(const SkTDArray<void*>& draws, SkCanvas* canvas, Node* root) { |
+ SkASSERT(!fValid); |
+ fDraws = &draws; |
+ fCanvas = canvas; |
+ fCurrentNode = root; |
+ fPlaybackMatrix = canvas->getTotalMatrix(); |
+ fCurrentMatrix = NULL; |
+ fPlaybackIndex = 0; |
+ fSave = false; |
+ fValid = true; |
} |
void SkPictureStateTree::Iterator::setCurrentMatrix(const SkMatrix* matrix) { |