OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrFragmentProcessor_DEFINED | 8 #ifndef GrFragmentProcessor_DEFINED |
9 #define GrFragmentProcessor_DEFINED | 9 #define GrFragmentProcessor_DEFINED |
10 | 10 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 * getFactory()). The processor subclass should not compare its coord transf
orms as that will | 145 * getFactory()). The processor subclass should not compare its coord transf
orms as that will |
146 * be performed automatically in the non-virtual isEqual(). | 146 * be performed automatically in the non-virtual isEqual(). |
147 */ | 147 */ |
148 virtual bool onIsEqual(const GrFragmentProcessor&) const = 0; | 148 virtual bool onIsEqual(const GrFragmentProcessor&) const = 0; |
149 | 149 |
150 bool hasSameTransforms(const GrFragmentProcessor&) const; | 150 bool hasSameTransforms(const GrFragmentProcessor&) const; |
151 | 151 |
152 bool fUsesLocalCoords; | 152 bool fUsesLocalCoords; |
153 | 153 |
154 /** | 154 /** |
155 * This stores the transforms of this proc, followed by all the transforms o
f this proc's | 155 * fCoordTransforms stores the transforms of this proc, followed by all the
transforms of this |
156 * children. In other words, each proc stores all the transforms of its subt
ree. | 156 * proc's children. In other words, each proc stores all the transforms of i
ts subtree as if |
| 157 * they were collected using preorder traversal. |
| 158 * |
| 159 * Example: |
| 160 * Suppose we have frag proc A, who has two children B and D. B has a child
C, and D has |
| 161 * two children E and F. Suppose procs A, B, C, D, E, F have 1, 2, 1, 1, 3,
2 transforms |
| 162 * respectively. The following shows what the fCoordTransforms array of each
proc would contain: |
| 163 * |
| 164 * (A) |
| 165 * [a1,b1,b2,c1,d1,e1,e2,e3,f1,f2] |
| 166 * / \ |
| 167 * / \ |
| 168 * (B) (D) |
| 169 * [b1,b2,c1] [d1,e1,e2,e3,f1,f2] |
| 170 * / / \ |
| 171 * / / \ |
| 172 * (C) (E) (F) |
| 173 * [c1] [e1,e2,e3] [f1,f2] |
| 174 * |
157 * The same goes for fTextureAccesses with textures. | 175 * The same goes for fTextureAccesses with textures. |
158 */ | 176 */ |
159 SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; | 177 SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; |
160 | 178 |
161 SkTArray<GrFragmentStage, false> fChildProcessors; | 179 SkTArray<GrFragmentStage, false> fChildProcessors; |
162 | 180 |
163 typedef GrProcessor INHERITED; | 181 typedef GrProcessor INHERITED; |
164 }; | 182 }; |
165 | 183 |
166 #endif | 184 #endif |
OLD | NEW |