aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPrimitiveProcessor.h
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-01-22 06:48:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 06:48:46 -0800
commit7df3f5e127f8016d17b637cc48a6a4718f1a6822 (patch)
tree224a919d0ed775835fb6dd40ddb2399214de081e /src/gpu/GrPrimitiveProcessor.h
parent7481e75830dfae1e9084ff62e3d8438879e31aaa (diff)
added support for PLS path rendering
Diffstat (limited to 'src/gpu/GrPrimitiveProcessor.h')
-rw-r--r--src/gpu/GrPrimitiveProcessor.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h
index 467200a86d..c1e946db20 100644
--- a/src/gpu/GrPrimitiveProcessor.h
+++ b/src/gpu/GrPrimitiveProcessor.h
@@ -47,6 +47,16 @@ class GrGLSLPrimitiveProcessor;
struct GrInitInvariantOutput;
+// Describes the state of pixel local storage with respect to the current draw.
+enum GrPixelLocalStorageState {
+ // The draw is actively updating PLS.
+ kDraw_GrPixelLocalStorageState,
+ // The draw is a "finish" operation which is reading from PLS and writing color.
+ kFinish_GrPixelLocalStorageState,
+ // The draw does not use PLS.
+ kDisabled_GrPixelLocalStorageState
+};
+
/*
* This class allows the GrPipeline to communicate information about the pipeline to a
* GrBatch which should be forwarded to the GrPrimitiveProcessor(s) created by the batch.
@@ -199,7 +209,7 @@ public:
the object. */
virtual GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps& caps) const = 0;
- bool isPathRendering() const { return fIsPathRendering; }
+ virtual bool isPathRendering() const { return false; }
/**
* No Local Coord Transformation is needed in the shader, instead transformed local coords will
@@ -207,11 +217,19 @@ public:
*/
virtual bool hasTransformedLocalCoords() const = 0;
+ virtual GrPixelLocalStorageState getPixelLocalStorageState() const {
+ return kDisabled_GrPixelLocalStorageState;
+ }
+
+ /**
+ * If non-null, overrides the dest color returned by GrGLSLFragmentShaderBuilder::dstColor().
+ */
+ virtual const char* getDestColorOverride() const { return nullptr; }
+
protected:
- GrPrimitiveProcessor(bool isPathRendering)
+ GrPrimitiveProcessor()
: fNumAttribs(0)
- , fVertexStride(0)
- , fIsPathRendering(isPathRendering) {}
+ , fVertexStride(0) {}
Attribute fAttribs[kMaxVertexAttribs];
int fNumAttribs;
@@ -221,8 +239,6 @@ private:
void notifyRefCntIsZero() const final {};
virtual bool hasExplicitLocalCoords() const = 0;
- bool fIsPathRendering;
-
typedef GrProcessor INHERITED;
};