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 #include "SkPictureStateTree.h" | 9 #include "SkPictureStateTree.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 fCurrentNode = fCurrentNode->fParent; | 118 fCurrentNode = fCurrentNode->fParent; |
119 } | 119 } |
120 return kDrawComplete; | 120 return kDrawComplete; |
121 } | 121 } |
122 | 122 |
123 Draw* draw = static_cast<Draw*>((*fDraws)[fPlaybackIndex]); | 123 Draw* draw = static_cast<Draw*>((*fDraws)[fPlaybackIndex]); |
124 Node* targetNode = draw->fNode; | 124 Node* targetNode = draw->fNode; |
125 | 125 |
126 if (fSave) { | 126 if (fSave) { |
127 fCanvas->save(); | 127 // FIXME: the save below depends on soon-to-be-deprecated |
| 128 // SaveFlags behavior: it relies on matrix changes persisting |
| 129 // after restore. |
| 130 fCanvas->save(SkCanvas::kClip_SaveFlag); |
128 fSave = false; | 131 fSave = false; |
129 } | 132 } |
130 | 133 |
131 if (fCurrentNode != targetNode) { | 134 if (fCurrentNode != targetNode) { |
132 // If we're not at the target and we don't have a list of nodes to get t
here, we need to | 135 // If we're not at the target and we don't have a list of nodes to get t
here, we need to |
133 // figure out the path from our current node, to the target | 136 // figure out the path from our current node, to the target |
134 if (fNodes.count() == 0) { | 137 if (fNodes.count() == 0) { |
135 // Trace back up to a common ancestor, restoring to get our current
state to match that | 138 // Trace back up to a common ancestor, restoring to get our current
state to match that |
136 // of the ancestor, and saving a list of nodes whose state we need t
o apply to get to | 139 // of the ancestor, and saving a list of nodes whose state we need t
o apply to get to |
137 // the target (we can restore up to the ancestor immediately, but we
'll need to return | 140 // the target (we can restore up to the ancestor immediately, but we
'll need to return |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 if (fCurrentMatrix != draw->fMatrix) { | 197 if (fCurrentMatrix != draw->fMatrix) { |
195 SkMatrix tmp = *draw->fMatrix; | 198 SkMatrix tmp = *draw->fMatrix; |
196 tmp.postConcat(fPlaybackMatrix); | 199 tmp.postConcat(fPlaybackMatrix); |
197 fCanvas->setMatrix(tmp); | 200 fCanvas->setMatrix(tmp); |
198 fCurrentMatrix = draw->fMatrix; | 201 fCurrentMatrix = draw->fMatrix; |
199 } | 202 } |
200 | 203 |
201 ++fPlaybackIndex; | 204 ++fPlaybackIndex; |
202 return draw->fOffset; | 205 return draw->fOffset; |
203 } | 206 } |
OLD | NEW |