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

Unified Diff: src/gpu/GrDefaultGeoProcFactory.cpp

Issue 791743003: Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: more windows fix Created 6 years 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/GrDefaultGeoProcFactory.h ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultGeoProcFactory.cpp
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index dca6c1c017a4d8b14aa8021f4c2d7b0e20aa8e2a..cb73959e7735c8c59fd033e6a9e1edc1d7b17665 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -21,8 +21,9 @@ typedef GrDefaultGeoProcFactory Flag;
class DefaultGeoProc : public GrGeometryProcessor {
public:
- static GrGeometryProcessor* Create(GrColor color, uint8_t coverage, uint32_t gpTypeFlags) {
- return SkNEW_ARGS(DefaultGeoProc, (color, coverage, gpTypeFlags));
+ static GrGeometryProcessor* Create(GrColor color, uint8_t coverage, uint32_t gpTypeFlags,
+ bool opaqueVertexColors) {
+ return SkNEW_ARGS(DefaultGeoProc, (color, coverage, gpTypeFlags, opaqueVertexColors));
}
virtual const char* name() const SK_OVERRIDE { return "DefaultGeometryProcessor"; }
@@ -95,8 +96,8 @@ public:
}
private:
- DefaultGeoProc(GrColor color, uint8_t coverage, uint32_t gpTypeFlags)
- : INHERITED(color, coverage)
+ DefaultGeoProc(GrColor color, uint8_t coverage, uint32_t gpTypeFlags, bool opaqueVertexColors)
+ : INHERITED(color, opaqueVertexColors, coverage)
, fInPosition(NULL)
, fInColor(NULL)
, fInLocalCoords(NULL)
@@ -128,11 +129,12 @@ private:
return gp.fFlags == this->fFlags;
}
- virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVERRIDE {
+ virtual void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRIDE {
if (fInCoverage) {
- inout->mulByUnknownAlpha();
+ out->setUnknownSingleComponent();
} else {
- inout->mulByKnownAlpha(255);
+ // uniform coverage
+ out->setKnownSingleComponent(this->coverage());
}
}
@@ -164,10 +166,13 @@ GrGeometryProcessor* DefaultGeoProc::TestCreate(SkRandom* random,
flags |= GrDefaultGeoProcFactory::kLocalCoord_GPType;
}
- return DefaultGeoProc::Create(GrRandomColor(random), GrRandomCoverage(random), flags);
+ return DefaultGeoProc::Create(GrRandomColor(random), GrRandomCoverage(random),
+ flags, random->nextBool());
}
-const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(GrColor color, uint32_t gpTypeFlags,
+const GrGeometryProcessor* GrDefaultGeoProcFactory::Create(GrColor color,
+ uint32_t gpTypeFlags,
+ bool opaqueVertexColors,
uint8_t coverage) {
- return DefaultGeoProc::Create(color, coverage, gpTypeFlags);
+ return DefaultGeoProc::Create(color, coverage, gpTypeFlags, opaqueVertexColors);
}
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.h ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698