Chromium Code Reviews| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 /** | 176 /** |
| 177 * Subclass implements this to support isEqual(). It will only be called if it is known that | 177 * Subclass implements this to support isEqual(). It will only be called if it is known that |
| 178 * the two processors are of the same subclass (i.e. they return the same ob ject from | 178 * the two processors are of the same subclass (i.e. they return the same ob ject from |
| 179 * getFactory()). The processor subclass should not compare its coord transf orms as that will | 179 * getFactory()). The processor subclass should not compare its coord transf orms as that will |
| 180 * be performed automatically in the non-virtual isEqual(). | 180 * be performed automatically in the non-virtual isEqual(). |
| 181 */ | 181 */ |
| 182 virtual bool onIsEqual(const GrFragmentProcessor&) const = 0; | 182 virtual bool onIsEqual(const GrFragmentProcessor&) const = 0; |
| 183 | 183 |
| 184 bool hasSameTransforms(const GrFragmentProcessor&) const; | 184 bool hasSameTransforms(const GrFragmentProcessor&) const; |
| 185 | 185 |
| 186 bool fUsesLocalCoords; | 186 bool fUsesLocalCoords; |
| 187 | 187 |
| 188 /** | 188 /** |
| 189 * fCoordTransforms stores the transforms of this proc, followed by all the transforms of this | 189 * fCoordTransforms stores the transforms of this proc, followed by all the transforms of this |
| 190 * proc's children. In other words, each proc stores all the transforms of i ts subtree as if | 190 * proc's children. In other words, each proc stores all the transforms of i ts subtree as if |
| 191 * they were collected using preorder traversal. | 191 * they were collected using preorder traversal. |
| 192 * | 192 * |
| 193 * Example: | 193 * Example: |
| 194 * Suppose we have frag proc A, who has two children B and D. B has a child C, and D has | 194 * Suppose we have frag proc A, who has two children B and D. B has a child C, and D has |
| 195 * two children E and F. Suppose procs A, B, C, D, E, F have 1, 2, 1, 1, 3, 2 transforms | 195 * two children E and F. Suppose procs A, B, C, D, E, F have 1, 2, 1, 1, 3, 2 transforms |
| 196 * respectively. The following shows what the fCoordTransforms array of each proc would contain: | 196 * respectively. The following shows what the fCoordTransforms array of each proc would contain: |
| 197 * | 197 * |
| 198 * (A) | 198 * (A) |
| 199 * [a1,b1,b2,c1,d1,e1,e2,e3,f1,f2] | 199 * [a1,b1,b2,c1,d1,e1,e2,e3,f1,f2] |
| 200 * / \ | 200 * / \ |
| 201 * / \ | 201 * / \ |
| 202 * (B) (D) | 202 * (B) (D) |
| 203 * [b1,b2,c1] [d1,e1,e2,e3,f1,f2] | 203 * [b1,b2,c1] [d1,e1,e2,e3,f1,f2] |
| 204 * / / \ | 204 * / / \ |
| 205 * / / \ | 205 * / / \ |
| 206 * (C) (E) (F) | 206 * (C) (E) (F) |
| 207 * [c1] [e1,e2,e3] [f1,f2] | 207 * [c1] [e1,e2,e3] [f1,f2] |
| 208 * | 208 * |
| 209 * The same goes for fTextureAccesses with textures. | 209 * The same goes for fTextureAccesses with textures. |
| 210 */ | 210 */ |
| 211 SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; | 211 SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; |
| 212 | 212 int fNumTexturesExclChildren; |
| 213 int fNumTexturesExclChildren; | 213 int fNumTransformsExclChildren; |
| 214 int fNumTransformsExclChildren; | 214 SkSTArray<2, const GrFragmentProcessor*, true> fChildProcessors; |
| 215 | |
| 216 // TODO: These must convert their processors to pending-execution refs when the parent is | |
|
bsalomon
2015/11/19 15:39:13
This has basically been done.
| |
| 217 // converted (do this automatically in GrProgramElement?). | |
| 218 SkTArray<const GrFragmentProcessor*, true> fChildProcessors; | |
| 219 | 215 |
| 220 typedef GrProcessor INHERITED; | 216 typedef GrProcessor INHERITED; |
| 221 }; | 217 }; |
| 222 | 218 |
| 223 #endif | 219 #endif |
| OLD | NEW |