Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: src/gpu/GrGeometryProcessor.h

Issue 1812223002: added support for glMinSampleShading (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: updated for Jim's change Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698