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

Unified Diff: include/gpu/GrProcessor.h

Issue 647183002: Revert of Opt state takes a GP instead of a GeometryStage (Closed) Base URL: https://skia.googlesource.com/skia.git@builder_cleanup
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrProcessorStage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrProcessor.h
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h
index a5c834168b48879b52b4def5de4e2b46c31829c9..c1755a895472a9973315de9bc575fc90fb928eca 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -124,6 +124,12 @@
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
@@ -152,6 +158,16 @@
template <typename T> const T& cast() const { return *static_cast<const T*>(this); }
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
@@ -182,7 +198,9 @@
* 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;
@@ -198,12 +216,6 @@
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; }
@@ -211,16 +223,6 @@
bool willUseInputColor() const { return fWillUseInputColor; }
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
@@ -236,7 +238,6 @@
void setWillNotUseInputColor() { fWillUseInputColor = false; }
private:
- SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms;
bool fWillReadDstColor;
bool fWillUseInputColor;
« no previous file with comments | « no previous file | include/gpu/GrProcessorStage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698