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/GrGeometryProcessor.h | |
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/GrGeometryProcessor.h')
-rw-r--r-- | src/gpu/GrGeometryProcessor.h | 7 |
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(); } |