Index: include/gpu/GrProcessor.h |
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h |
index c1755a895472a9973315de9bc575fc90fb928eca..a5c834168b48879b52b4def5de4e2b46c31829c9 100644 |
--- a/include/gpu/GrProcessor.h |
+++ b/include/gpu/GrProcessor.h |
@@ -124,12 +124,6 @@ public: |
in generated shader code. */ |
const char* name() const; |
- int numTransforms() const { return fCoordTransforms.count(); } |
- |
- /** Returns the coordinate transformation at index. index must be valid according to |
- numTransforms(). */ |
- const GrCoordTransform& coordTransform(int index) const { return *fCoordTransforms[index]; } |
- |
int numTextures() const { return fTextureAccesses.count(); } |
/** Returns the access pattern for the texture at index. index must be valid according to |
@@ -159,16 +153,6 @@ public: |
protected: |
/** |
- * Subclasses call this from their constructor to register coordinate transformations. The |
- * effect subclass manages the lifetime of the transformations (this function only stores a |
- * pointer). The GrCoordTransform is typically a member field of the GrProcessor subclass. When |
- * the matrix has perspective, the transformed coordinates will have 3 components. Otherwise |
- * they'll have 2. This must only be called from the constructor because GrProcessors are |
- * immutable. |
- */ |
- void addCoordTransform(const GrCoordTransform* coordTransform); |
- |
- /** |
* Subclasses call this from their constructor to register GrTextureAccesses. The effect |
* subclass manages the lifetime of the accesses (this function only stores a pointer). The |
* GrTextureAccess is typically a member field of the GrProcessor subclass. This must only be |
@@ -198,9 +182,7 @@ private: |
* Subclass implements this to support getConstantColorComponents(...). |
*/ |
virtual void onComputeInvariantOutput(InvariantOutput* inout) const = 0; |
- friend class GrGeometryProcessor; // to set fRequiresVertexShader and build fVertexAttribTypes. |
- SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; |
SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses; |
bool fWillReadFragmentPosition; |
@@ -216,6 +198,12 @@ public: |
virtual const GrBackendFragmentProcessorFactory& getFactory() const = 0; |
+ int numTransforms() const { return fCoordTransforms.count(); } |
+ |
+ /** Returns the coordinate transformation at index. index must be valid according to |
+ numTransforms(). */ |
+ const GrCoordTransform& coordTransform(int index) const { return *fCoordTransforms[index]; } |
+ |
/** Will this effect read the destination pixel value? */ |
bool willReadDstColor() const { return fWillReadDstColor; } |
@@ -224,6 +212,16 @@ public: |
protected: |
/** |
+ * Fragment Processor subclasses call this from their constructor to register coordinate |
+ * transformations. The processor subclass manages the lifetime of the transformations (this |
+ * function only stores a pointer). The GrCoordTransform is typically a member field of the |
+ * GrProcessor subclass. When the matrix has perspective, the transformed coordinates will have |
+ * 3 components. Otherwise they'll have 2. This must only be called from the constructor because |
+ * GrProcessors are immutable. |
+ */ |
+ void addCoordTransform(const GrCoordTransform*); |
+ |
+ /** |
* If the effect subclass will read the destination pixel value then it must call this function |
* from its constructor. Otherwise, when its generated backend-specific effect class attempts |
* to generate code that reads the destination pixel it will fail. |
@@ -238,6 +236,7 @@ protected: |
void setWillNotUseInputColor() { fWillUseInputColor = false; } |
private: |
+ SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms; |
bool fWillReadDstColor; |
bool fWillUseInputColor; |