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

Side by Side Diff: src/core/SkPictureStateTree.h

Issue 250733007: Revert of Refactor SkPictureStateTree::Iterator to avoid use of kClip_SaveFlag. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkPictureStateTree.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef SkPictureStateTree_DEFINED 9 #ifndef SkPictureStateTree_DEFINED
10 #define SkPictureStateTree_DEFINED 10 #define SkPictureStateTree_DEFINED
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 * due to a command pattern optimization in SkPicture. 68 * due to a command pattern optimization in SkPicture.
69 */ 69 */
70 void saveCollapsed(); 70 void saveCollapsed();
71 71
72 /** 72 /**
73 * Playback helper 73 * Playback helper
74 */ 74 */
75 class Iterator { 75 class Iterator {
76 public: 76 public:
77 /** Returns the next offset into the picture stream, or kDrawComplete if complete. */ 77 /** Returns the next offset into the picture stream, or kDrawComplete if complete. */
78 uint32_t nextDraw(); 78 uint32_t draw();
79 static const uint32_t kDrawComplete = SK_MaxU32; 79 static const uint32_t kDrawComplete = SK_MaxU32;
80 Iterator() : fPlaybackMatrix(), fValid(false) { } 80 Iterator() : fPlaybackMatrix(), fValid(false) { }
81 bool isValid() const { return fValid; } 81 bool isValid() const { return fValid; }
82
83 private: 82 private:
84 Iterator(const SkTDArray<void*>& draws, SkCanvas* canvas, Node* root); 83 Iterator(const SkTDArray<void*>& draws, SkCanvas* canvas, Node* root);
85
86 void setCurrentMatrix(const SkMatrix*);
87
88 // The draws this iterator is associated with 84 // The draws this iterator is associated with
89 const SkTDArray<void*>* fDraws; 85 const SkTDArray<void*>* fDraws;
90 86
91 // canvas this is playing into (so we can insert saves/restores as neces sary) 87 // canvas this is playing into (so we can insert saves/restores as neces sary)
92 SkCanvas* fCanvas; 88 SkCanvas* fCanvas;
93 89
94 // current state node 90 // current state node
95 Node* fCurrentNode; 91 Node* fCurrentNode;
96 92
97 // List of nodes whose state we need to apply to reach TargetNode 93 // List of nodes whose state we need to apply to reach TargetNode
98 SkTDArray<Node*> fNodes; 94 SkTDArray<Node*> fNodes;
99 95
100 // The matrix of the canvas we're playing back into 96 // The matrix of the canvas we're playing back into
101 const SkMatrix fPlaybackMatrix; 97 const SkMatrix fPlaybackMatrix;
102 98
103 // Cache of current matrix, so we can avoid redundantly setting it 99 // Cache of current matrix, so we can avoid redundantly setting it
104 const SkMatrix* fCurrentMatrix; 100 SkMatrix* fCurrentMatrix;
105 101
106 // current position in the array of draws 102 // current position in the array of draws
107 int fPlaybackIndex; 103 int fPlaybackIndex;
108 // Whether or not we need to do a save next iteration 104 // Whether or not we need to do a save next iteration
109 bool fSave; 105 bool fSave;
110 106
111 // Whether or not this is a valid iterator (the default public construct or sets this false) 107 // Whether or not this is a valid iterator (the default public construct or sets this false)
112 bool fValid; 108 bool fValid;
113 109
114 friend class SkPictureStateTree; 110 friend class SkPictureStateTree;
(...skipping 28 matching lines...) Expand all
143 }; 139 };
144 }; 140 };
145 141
146 Node fRoot; 142 Node fRoot;
147 SkMatrix fRootMatrix; 143 SkMatrix fRootMatrix;
148 144
149 typedef SkRefCnt INHERITED; 145 typedef SkRefCnt INHERITED;
150 }; 146 };
151 147
152 #endif 148 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkPictureStateTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698