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

Unified Diff: src/gpu/GrGeometryProcessor.h

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/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGeometryProcessor.h
diff --git a/src/gpu/GrGeometryProcessor.h b/src/gpu/GrGeometryProcessor.h
index 1dbf1539a22bbb86d31bd45ad964d47ab87b15fa..ebb48fc4668032b26daf69a635f39978d25dd6b8 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();
}
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698