Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: src/core/SkPictureStateTree.cpp

Issue 378343002: Refactor SkPicturePlayback for SkPictureReplacementPlayback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move StepIterator to be next to SkipIterTo Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureStateTree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/core/SkPictureStateTree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698