Chromium Code Reviews| Index: include/gpu/GrFragmentProcessor.h |
| diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h |
| index 8d2a4d42b1d1976f394679bc9f1bc7100e328338..f08d3656b7de5d9281cdf1f88defc7a73f0efc0e 100644 |
| --- a/include/gpu/GrFragmentProcessor.h |
| +++ b/include/gpu/GrFragmentProcessor.h |
| @@ -25,7 +25,9 @@ class GrFragmentProcessor : public GrProcessor { |
| public: |
| GrFragmentProcessor() |
| : INHERITED() |
| - , fUsesLocalCoords(false) {} |
| + , fUsesLocalCoords(false) |
| + , fNumTexturesExclChildren(0) |
| + , fNumTransformsExclChildren(0) {} |
| GrGLFragmentProcessor* createGLInstance() const; |
| @@ -40,6 +42,10 @@ public: |
| } |
| } |
| + int numTexturesExclChildren() const { return fNumTexturesExclChildren; } |
|
tomhudson
2015/08/18 19:36:11
nit: abbreviation in API smells bad - but I can un
bsalomon
2015/08/19 14:22:17
Nonrecursive?
I can't come up with anything I rea
|
| + |
| + int numTransformsExclChildren() const { return fNumTransformsExclChildren; } |
| + |
| int numTransforms() const { return fCoordTransforms.count(); } |
| /** Returns the coordinate transformation at index. index must be valid according to |
| @@ -84,6 +90,8 @@ public: |
| void computeInvariantOutput(GrInvariantOutput* inout) const; |
| protected: |
| + void addTextureAccess(const GrTextureAccess* textureAccess) override; |
| + |
| /** |
| * Fragment Processor subclasses call this from their constructor to register coordinate |
| * transformations. Coord transforms provide a mechanism for a processor to receive coordinates |
| @@ -105,7 +113,8 @@ protected: |
| /** |
| * FragmentProcessor subclasses call this from their constructor to register any child |
| - * FragmentProcessors they have. |
| + * FragmentProcessors they have. This must be called AFTER all texture accesses and coord |
| + * transforms have been added. |
| * This is for processors whose shader code will be composed of nested processors whose output |
| * colors will be combined somehow to produce its output color. Registering these child |
| * processors will allow the ProgramBuilder to automatically handle their transformed coords and |
| @@ -168,6 +177,9 @@ private: |
| */ |
| SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; |
| + int fNumTexturesExclChildren; |
| + int fNumTransformsExclChildren; |
| + |
| SkTArray<GrFragmentStage, false> fChildProcessors; |
| typedef GrProcessor INHERITED; |