Index: src/gpu/GrPrimitiveProcessor.h |
diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h |
index e5c8517250cec51790a50b85a087f75a6db483b5..e8bb449888460c33dce1cbeb07f5cf7e570eeb15 100644 |
--- a/src/gpu/GrPrimitiveProcessor.h |
+++ b/src/gpu/GrPrimitiveProcessor.h |
@@ -151,12 +151,6 @@ public: |
// we put these calls on the base class to prevent having to cast |
virtual bool willUseGeoShader() const = 0; |
- /* |
- * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond platform specific |
- * attribute limits. This number can almost certainly be raised if required. |
- */ |
- static const int kMaxVertexAttribs = 8; |
- |
struct Attribute { |
Attribute() |
: fName(nullptr) |
@@ -174,11 +168,8 @@ public: |
GrSLPrecision fPrecision; |
}; |
- int numAttribs() const { return fNumAttribs; } |
- const Attribute& getAttrib(int index) const { |
- SkASSERT(index < fNumAttribs); |
- return fAttribs[index]; |
- } |
+ int numAttribs() const { return fAttribs.count(); } |
+ const Attribute& getAttrib(int index) const { return fAttribs[index]; } |
// Returns the vertex stride of the GP. A common use case is to request geometry from a |
// drawtarget based off of the stride, and to populate this memory using an implicit array of |
@@ -227,12 +218,10 @@ public: |
virtual const char* getDestColorOverride() const { return nullptr; } |
protected: |
- GrPrimitiveProcessor() |
- : fNumAttribs(0) |
- , fVertexStride(0) {} |
+ GrPrimitiveProcessor() : fVertexStride(0) {} |
- Attribute fAttribs[kMaxVertexAttribs]; |
- int fNumAttribs; |
+ enum { kPreallocAttribCnt = 8 }; |
+ SkSTArray<kPreallocAttribCnt, Attribute> fAttribs; |
size_t fVertexStride; |
private: |