diff options
author | 2016-08-17 11:33:39 -0700 | |
---|---|---|
committer | 2016-08-17 11:33:39 -0700 | |
commit | 6cb807bf99ac0f8f166e1790f91bcb3afbfb5458 (patch) | |
tree | 8bb54651a6a9b1a6c018c52fcf285fd995276599 /src/gpu/batches | |
parent | 9da5dbdda3aec9875cdaa05c1815b4d8c17cb130 (diff) |
Simplify adding attributes to GrGeometryProcessor
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248323003
Review-Url: https://codereview.chromium.org/2248323003
Diffstat (limited to 'src/gpu/batches')
-rw-r--r-- | src/gpu/batches/GrAAConvexPathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/batches/GrAnalyticRectBatch.cpp | 11 | ||||
-rw-r--r-- | src/gpu/batches/GrMSAAPathRenderer.cpp | 9 | ||||
-rw-r--r-- | src/gpu/batches/GrPLSPathRenderer.cpp | 43 |
4 files changed, 32 insertions, 35 deletions
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp index 1ce0083cf2..a24a0c5945 100644 --- a/src/gpu/batches/GrAAConvexPathRenderer.cpp +++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp @@ -653,8 +653,8 @@ private: , fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID<QuadEdgeEffect>(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType)); - fInQuadEdge = &this->addVertexAttrib(Attribute("inQuadEdge", kVec4f_GrVertexAttribType)); + fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType); + fInQuadEdge = &this->addVertexAttrib("inQuadEdge", kVec4f_GrVertexAttribType); } const Attribute* fInPosition; diff --git a/src/gpu/batches/GrAnalyticRectBatch.cpp b/src/gpu/batches/GrAnalyticRectBatch.cpp index 4d75d91a50..7be0ad33be 100644 --- a/src/gpu/batches/GrAnalyticRectBatch.cpp +++ b/src/gpu/batches/GrAnalyticRectBatch.cpp @@ -55,12 +55,11 @@ class RectGeometryProcessor : public GrGeometryProcessor { public: RectGeometryProcessor(const SkMatrix& localMatrix) : fLocalMatrix(localMatrix) { this->initClassID<RectGeometryProcessor>(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType)); - fInRectEdge = &this->addVertexAttrib(Attribute("inRectEdge", kVec4f_GrVertexAttribType)); - fInWidthHeight = &this->addVertexAttrib(Attribute("inWidthHeight", - kVec2f_GrVertexAttribType)); + fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInColor = &this->addVertexAttrib("inColor", kVec4ub_GrVertexAttribType); + fInRectEdge = &this->addVertexAttrib("inRectEdge", kVec4f_GrVertexAttribType); + fInWidthHeight = &this->addVertexAttrib("inWidthHeight", kVec2f_GrVertexAttribType); } bool implementsDistanceVector() const override { return true; }; diff --git a/src/gpu/batches/GrMSAAPathRenderer.cpp b/src/gpu/batches/GrMSAAPathRenderer.cpp index 324a976513..05a23a1e05 100644 --- a/src/gpu/batches/GrMSAAPathRenderer.cpp +++ b/src/gpu/batches/GrMSAAPathRenderer.cpp @@ -195,11 +195,10 @@ private: MSAAQuadProcessor(const SkMatrix& viewMatrix) : fViewMatrix(viewMatrix) { this->initClassID<MSAAQuadProcessor>(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInUV = &this->addVertexAttrib(Attribute("inUV", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType)); + fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInUV = &this->addVertexAttrib("inUV", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision); + fInColor = &this->addVertexAttrib("inColor", kVec4ub_GrVertexAttribType); this->setSampleShading(1.0f); } diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp index fa0bd90ca9..81009a6a3c 100644 --- a/src/gpu/batches/GrPLSPathRenderer.cpp +++ b/src/gpu/batches/GrPLSPathRenderer.cpp @@ -421,16 +421,16 @@ private: : fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID<PLSAATriangleEffect>(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInVertex1 = &this->addVertexAttrib(Attribute("inVertex1", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInVertex2 = &this->addVertexAttrib(Attribute("inVertex2", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInVertex3 = &this->addVertexAttrib(Attribute("inVertex3", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInWindings = &this->addVertexAttrib(Attribute("inWindings", kInt_GrVertexAttribType, - kLow_GrSLPrecision)); + fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInVertex1 = &this->addVertexAttrib("inVertex1", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInVertex2 = &this->addVertexAttrib("inVertex2", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInVertex3 = &this->addVertexAttrib("inVertex3", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInWindings = &this->addVertexAttrib("inWindings", kInt_GrVertexAttribType, + kLow_GrSLPrecision); this->setWillReadFragmentPosition(); } @@ -611,16 +611,15 @@ private: : fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID<PLSQuadEdgeEffect>(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInUV = &this->addVertexAttrib(Attribute("inUV", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInEndpoint1 = &this->addVertexAttrib(Attribute("inEndpoint1", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInEndpoint2 = &this->addVertexAttrib(Attribute("inEndpoint2", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); - fInWindings = &this->addVertexAttrib(Attribute("inWindings", kInt_GrVertexAttribType, - kLow_GrSLPrecision)); + fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInUV = &this->addVertexAttrib("inUV", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision); + fInEndpoint1 = &this->addVertexAttrib("inEndpoint1", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInEndpoint2 = &this->addVertexAttrib("inEndpoint2", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); + fInWindings = &this->addVertexAttrib("inWindings", kInt_GrVertexAttribType, + kLow_GrSLPrecision); this->setWillReadFragmentPosition(); } @@ -762,8 +761,8 @@ private: , fLocalMatrix(localMatrix) , fUsesLocalCoords(usesLocalCoords) { this->initClassID<PLSFinishEffect>(); - fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType, - kHigh_GrSLPrecision)); + fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType, + kHigh_GrSLPrecision); } const Attribute* fInPosition; |