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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 2248323003: Simplify adding attributes to GrGeometryProcessor (Closed) Base URL: https://chromium.googlesource.com/skia.git@xformhelper
Patch Set: Revert removal of fAttribNames Created 4 years, 4 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 | « src/gpu/GrGeometryProcessor.h ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index cb5113e90f67cea1a1a2b0d130fe29c992bd0ee1..4b216cda34708a42dbbb31ae792f73dd03b6e855 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -75,11 +75,10 @@ class CircleGeometryProcessor : public GrGeometryProcessor {
public:
CircleGeometryProcessor(bool stroke, const SkMatrix& localMatrix) : fLocalMatrix(localMatrix){
this->initClassID<CircleGeometryProcessor>();
- fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType,
- kHigh_GrSLPrecision));
- fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
- fInCircleEdge = &this->addVertexAttrib(Attribute("inCircleEdge",
- kVec4f_GrVertexAttribType));
+ fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType,
+ kHigh_GrSLPrecision);
+ fInColor = &this->addVertexAttrib("inColor", kVec4ub_GrVertexAttribType);
+ fInCircleEdge = &this->addVertexAttrib("inCircleEdge", kVec4f_GrVertexAttribType);
fStroke = stroke;
}
@@ -212,12 +211,10 @@ public:
EllipseGeometryProcessor(bool stroke, const SkMatrix& localMatrix)
: fLocalMatrix(localMatrix) {
this->initClassID<EllipseGeometryProcessor>();
- fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
- fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
- fInEllipseOffset = &this->addVertexAttrib(Attribute("inEllipseOffset",
- kVec2f_GrVertexAttribType));
- fInEllipseRadii = &this->addVertexAttrib(Attribute("inEllipseRadii",
- kVec4f_GrVertexAttribType));
+ fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType);
+ fInColor = &this->addVertexAttrib("inColor", kVec4ub_GrVertexAttribType);
+ fInEllipseOffset = &this->addVertexAttrib("inEllipseOffset", kVec2f_GrVertexAttribType);
+ fInEllipseRadii = &this->addVertexAttrib("inEllipseRadii", kVec4f_GrVertexAttribType);
fStroke = stroke;
}
@@ -361,13 +358,11 @@ public:
DIEllipseGeometryProcessor(const SkMatrix& viewMatrix, DIEllipseStyle style)
: fViewMatrix(viewMatrix) {
this->initClassID<DIEllipseGeometryProcessor>();
- fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType,
- kHigh_GrSLPrecision));
- fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
- fInEllipseOffsets0 = &this->addVertexAttrib(Attribute("inEllipseOffsets0",
- kVec2f_GrVertexAttribType));
- fInEllipseOffsets1 = &this->addVertexAttrib(Attribute("inEllipseOffsets1",
- kVec2f_GrVertexAttribType));
+ fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType,
+ kHigh_GrSLPrecision);
+ fInColor = &this->addVertexAttrib("inColor", kVec4ub_GrVertexAttribType);
+ fInEllipseOffsets0 = &this->addVertexAttrib("inEllipseOffsets0", kVec2f_GrVertexAttribType);
+ fInEllipseOffsets1 = &this->addVertexAttrib("inEllipseOffsets1", kVec2f_GrVertexAttribType);
fStyle = style;
}
« no previous file with comments | « src/gpu/GrGeometryProcessor.h ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698