aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGeometryProcessor.h
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-03-25 09:26:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-25 09:26:03 -0700
commit28ef445d2e55ada7a45fd74e9248b4f22b16e061 (patch)
tree1059a795d12552e4b7207b83143b7d99c320cca1 /src/gpu/GrGeometryProcessor.h
parent5443f1b6bab26e0ee010d8b255f9ab6498a096ea (diff)
added support for glMinSampleShading
Diffstat (limited to 'src/gpu/GrGeometryProcessor.h')
-rw-r--r--src/gpu/GrGeometryProcessor.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index 05afd5329a..1dbf1539a2 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -21,7 +21,8 @@ class GrGeometryProcessor : public GrPrimitiveProcessor {
public:
GrGeometryProcessor()
: fWillUseGeoShader(false)
- , fLocalCoordsType(kUnused_LocalCoordsType) {}
+ , fLocalCoordsType(kUnused_LocalCoordsType)
+ , fSampleShading(0.0) {}
bool willUseGeoShader() const override { return fWillUseGeoShader; }
@@ -33,6 +34,15 @@ public:
return kHasExplicit_LocalCoordsType == fLocalCoordsType;
}
+ /**
+ * Returns the minimum fraction of samples for which the fragment shader will be run. For
+ * instance, if sampleShading is 0.5 in MSAA16 mode, the fragment shader will run a minimum of
+ * 8 times per pixel. The default value is zero.
+ */
+ float getSampleShading() const override {
+ return fSampleShading;
+ }
+
protected:
/**
* Subclasses call this from their constructor to register vertex attributes. Attributes
@@ -74,9 +84,14 @@ protected:
fLocalCoordsType = kHasTransformed_LocalCoordsType;
}
+ void setSampleShading(float sampleShading) {
+ fSampleShading = sampleShading;
+ }
+
private:
bool fWillUseGeoShader;
LocalCoordsType fLocalCoordsType;
+ float fSampleShading;
typedef GrPrimitiveProcessor INHERITED;
};