Index: src/gpu/GrGeometryProcessor.h |
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h |
index 05afd5329a20dd9694b44dea6d83db3009f07c5e..1dbf1539a22bbb86d31bd45ad964d47ab87b15fa 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; |
}; |