diff options
Diffstat (limited to 'src/gpu/GrGeometryProcessor.h')
-rw-r--r-- | src/gpu/GrGeometryProcessor.h | 17 |
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; }; |