Chromium Code Reviews| 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) { |
|
bsalomon
2015/07/27 16:19:24
??
joshualitt
2015/07/27 17:21:51
This really is just temporary. I have to do this
|
| + 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 { |
|
bsalomon
2015/07/27 16:19:24
Why a struct?
joshualitt
2015/07/27 17:21:51
For one, just to have consistency with Color and C
|
| + enum Type { |
| + kNone_Type, |
| + kUsePosition_Type, |
| + kHasExplicit_Type, |
|
bsalomon
2015/07/27 16:19:24
Is this where we'd add another option, something l
joshualitt
2015/07/27 17:21:51
Yea, exactly. I think we could either do a count
|
| + }; |
| + }; |
| + |
| + 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 |