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" |
11 | 11 |
12 SK_DEFINE_INST_COUNT(SkPictureStateTree) | |
13 | |
14 SkPictureStateTree::SkPictureStateTree() | 12 SkPictureStateTree::SkPictureStateTree() |
15 : fAlloc(2048) | 13 : fAlloc(2048) |
16 , fRoot(NULL) | 14 , fRoot(NULL) |
17 , fLastRestoredNode(NULL) | 15 , fLastRestoredNode(NULL) |
18 , fStateStack(sizeof(Draw), 16) { | 16 , fStateStack(sizeof(Draw), 16) { |
19 SkMatrix* identity = static_cast<SkMatrix*>(fAlloc.allocThrow(sizeof(SkMatri
x))); | 17 SkMatrix* identity = static_cast<SkMatrix*>(fAlloc.allocThrow(sizeof(SkMatri
x))); |
20 identity->reset(); | 18 identity->reset(); |
21 fRoot = static_cast<Node*>(fAlloc.allocThrow(sizeof(Node))); | 19 fRoot = static_cast<Node*>(fAlloc.allocThrow(sizeof(Node))); |
22 fRoot->fParent = NULL; | 20 fRoot->fParent = NULL; |
23 fRoot->fMatrix = identity; | 21 fRoot->fMatrix = identity; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 if (fCurrentMatrix != draw->fMatrix) { | 180 if (fCurrentMatrix != draw->fMatrix) { |
183 SkMatrix tmp = *draw->fMatrix; | 181 SkMatrix tmp = *draw->fMatrix; |
184 tmp.postConcat(fPlaybackMatrix); | 182 tmp.postConcat(fPlaybackMatrix); |
185 fCanvas->setMatrix(tmp); | 183 fCanvas->setMatrix(tmp); |
186 fCurrentMatrix = draw->fMatrix; | 184 fCurrentMatrix = draw->fMatrix; |
187 } | 185 } |
188 | 186 |
189 ++fPlaybackIndex; | 187 ++fPlaybackIndex; |
190 return draw->fOffset; | 188 return draw->fOffset; |
191 } | 189 } |
OLD | NEW |