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

Unified Diff: src/gpu/GrDefaultGeoProcFactory.h

Issue 1253393002: Cleanup Default Geo Proc API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 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 | « no previous file | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultGeoProcFactory.h
diff --git a/src/gpu/GrDefaultGeoProcFactory.h b/src/gpu/GrDefaultGeoProcFactory.h
index 00fd0bce6b5538b9072f9fa8f2f4f7f5c4cfcc06..86c59c40e1b0d64c7278956f8e7e1e0061c4cbfc 100644
--- a/src/gpu/GrDefaultGeoProcFactory.h
+++ b/src/gpu/GrDefaultGeoProcFactory.h
@@ -73,6 +73,56 @@ public:
kLastGPType = kCoverage_GPType
};
+ struct Color {
+ enum Type {
+ kNone_Type,
+ kUniform_Type,
+ kAttribute_Type,
+ };
+ Color(GrColor color) : fType(kUniform_Type), fColor(color) {}
+ Color(Type type) : fType(type), fColor(GrColor_ILLEGAL) {
+ SkASSERT(type != kUniform_Type);
+
+ // TODO This is temporary
+ if (kAttribute_Type == type) {
+ fColor = GrColor_WHITE;
+ }
+ }
+
+ Type fType;
+ GrColor fColor;
+ };
+
+ struct Coverage {
+ enum Type {
+ kNone_Type,
+ kSolid_Type,
+ kUniform_Type,
+ kAttribute_Type,
+ };
+ Coverage(uint8_t coverage) : fType(kUniform_Type), fCoverage(coverage) {}
+ Coverage(Type type) : fType(type), fCoverage(0xff) {
+ SkASSERT(type != kUniform_Type);
+ }
+
+ Type fType;
+ uint8_t fCoverage;
+ };
+
+ struct LocalCoords {
+ enum Type {
+ kNone_Type,
+ kUsePosition_Type,
+ kHasExplicit_Type,
+ };
+ };
+
+ static const GrGeometryProcessor* Create(const Color&,
+ const Coverage&,
+ LocalCoords::Type,
+ const SkMatrix& viewMatrix = SkMatrix::I(),
+ const SkMatrix& localMatrix = SkMatrix::I());
+
/*
* The following functions are used to create default GPs. If you just need to create
* attributes separately from creating the default GP, use the SetAttribs function followed
« no previous file with comments | « no previous file | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698