aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGeometryProcessor.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-01-13 15:02:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-13 15:02:10 -0800
commitabb52a1a70a81915c6196e0fb3e9bcb05e8be14d (patch)
tree418e114425f0c3d2179bab956076f4f0bcadcca7 /src/gpu/GrGeometryProcessor.h
parenta7f11918d92621507f35b228a290f05dcaf0f4b6 (diff)
Move most of the transform logic into the primitive processors
Diffstat (limited to 'src/gpu/GrGeometryProcessor.h')
-rw-r--r--src/gpu/GrGeometryProcessor.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index ad75d23768..074fffcfb0 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -66,7 +66,7 @@ private:
};
class GrGLCaps;
-class GrGLGeometryProcessor;
+class GrGLPrimitiveProcessor;
class GrOptDrawState;
struct GrInitInvariantOutput;
@@ -122,6 +122,11 @@ public:
virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const = 0;
/**
+ * Gets a transformKey from an array of coord transforms
+ */
+ uint32_t getTransformKey(const SkTArray<const GrCoordTransform*, true>&) const;
+
+ /**
* Sets a unique key on the GrProcessorKeyBuilder that is directly associated with this geometry
* processor's GL backend implementation.
*/
@@ -133,7 +138,8 @@ public:
/** Returns a new instance of the appropriate *GL* implementation class
for the given GrProcessor; caller is responsible for deleting
the object. */
- virtual GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const = 0;
+ virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
+ const GrGLCaps& caps) const = 0;
protected:
GrPrimitiveProcessor(const SkMatrix& viewMatrix, const SkMatrix& localMatrix)
@@ -171,6 +177,8 @@ protected:
}
private:
+ virtual bool hasExplicitLocalCoords() const = 0;
+
SkMatrix fViewMatrix;
SkMatrix fLocalMatrix;
@@ -261,7 +269,6 @@ public:
return this->onCanMakeEqual(mine, other, theirs);
}
-
// TODO we can remove color from the GrGeometryProcessor base class once we have bundles of
// primitive data
@@ -270,9 +277,6 @@ public:
// TODO this is a total hack until the gp can do deferred geometry
bool hasVertexColor() const { return fHasVertexColor; }
- // TODO this is a total hack until gp can setup and manage local coords
- bool hasLocalCoords() const { return fHasLocalCoords; }
-
void getInvariantOutputColor(GrInitInvariantOutput* out) const SK_OVERRIDE;
void getInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE;
@@ -332,9 +336,12 @@ private:
virtual bool onCanMakeEqual(const GrBatchTracker& mine,
const GrGeometryProcessor& that,
const GrBatchTracker& theirs) const = 0;
+
// TODO delete this when we have more advanced equality testing via bundles and the BT
virtual bool onIsEqual(const GrGeometryProcessor&) const = 0;
+ bool hasExplicitLocalCoords() const SK_OVERRIDE { return fHasLocalCoords; }
+
SkSTArray<kMaxVertexAttribs, GrAttribute, true> fAttribs;
size_t fVertexStride;
GrColor fColor;
@@ -375,12 +382,18 @@ public:
const GrGLCaps& caps,
GrProcessorKeyBuilder* b) const SK_OVERRIDE;
- GrGLGeometryProcessor* createGLInstance(const GrBatchTracker& bt) const SK_OVERRIDE;
+ virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt,
+ const GrGLCaps& caps) const SK_OVERRIDE;
-private:
+protected:
GrPathProcessor(GrColor color, const SkMatrix& viewMatrix, const SkMatrix& localMatrix);
+
+private:
+ bool hasExplicitLocalCoords() const SK_OVERRIDE { return false; }
+
GrColor fColor;
typedef GrPrimitiveProcessor INHERITED;
};
+
#endif