aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGeometryProcessor.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-08-17 11:33:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-17 11:33:39 -0700
commit6cb807bf99ac0f8f166e1790f91bcb3afbfb5458 (patch)
tree8bb54651a6a9b1a6c018c52fcf285fd995276599 /src/gpu/GrGeometryProcessor.h
parent9da5dbdda3aec9875cdaa05c1815b4d8c17cb130 (diff)
Simplify adding attributes to GrGeometryProcessor
Diffstat (limited to 'src/gpu/GrGeometryProcessor.h')
-rw-r--r--src/gpu/GrGeometryProcessor.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index 1dbf1539a2..ebb48fc466 100644
--- a/src/gpu/GrGeometryProcessor.h
+++ b/src/gpu/GrGeometryProcessor.h
@@ -53,9 +53,10 @@ protected:
* The processor key should reflect the vertex attributes, or there lack thereof in the
* GrGeometryProcessor.
*/
- const Attribute& addVertexAttrib(const Attribute& attribute) {
- fVertexStride += attribute.fOffset;
- fAttribs.push_back(attribute);
+ const Attribute& addVertexAttrib(const char* name, GrVertexAttribType type,
+ GrSLPrecision precision = kDefault_GrSLPrecision) {
+ fAttribs.emplace_back(name, type, precision);
+ fVertexStride += fAttribs.back().fOffset;
return fAttribs.back();
}