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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 14328009: Vertex Attrib configurations now handled as pointers vs. SkSTArrays (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Added "extern const" & removed comment Created 7 years, 8 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/GrDrawState.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
===================================================================
--- src/gpu/GrDrawState.cpp (revision 8777)
+++ src/gpu/GrDrawState.cpp (working copy)
@@ -68,15 +68,17 @@
}
size_t GrDrawState::getVertexSize() const {
- return vertex_size(fCommon.fVertexAttribs.begin(), fCommon.fVertexAttribs.count());
+ return vertex_size(fCommon.fVAPtr, fCommon.fVACount);
}
////////////////////////////////////////////////////////////////////////////////
void GrDrawState::setVertexAttribs(const GrVertexAttrib* attribs, int count) {
GrAssert(count <= kMaxVertexAttribCnt);
- fCommon.fVertexAttribs.reset(attribs, count);
+ fCommon.fVAPtr = attribs;
+ fCommon.fVACount = count;
+
// Set all the indices to -1
memset(fCommon.fFixedFunctionVertexAttribIndices,
0xff,
@@ -109,7 +111,10 @@
void GrDrawState::setDefaultVertexAttribs() {
static const GrVertexAttrib kPositionAttrib =
{kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding};
- fCommon.fVertexAttribs.reset(&kPositionAttrib, 1);
+
+ fCommon.fVAPtr = &kPositionAttrib;
+ fCommon.fVACount = 1;
+
// set all the fixed function indices to -1 except position.
memset(fCommon.fFixedFunctionVertexAttribIndices,
0xff,
@@ -136,13 +141,13 @@
int numAttributes = stage.getVertexAttribIndexCount();
for (int i = 0; i < numAttributes; ++i) {
int attribIndex = attributeIndices[i];
- if (attribIndex >= fCommon.fVertexAttribs.count() ||
- kEffect_GrVertexAttribBinding != fCommon.fVertexAttribs[attribIndex].fBinding) {
+ if (attribIndex >= fCommon.fVACount ||
+ kEffect_GrVertexAttribBinding != fCommon.fVAPtr[attribIndex].fBinding) {
return false;
}
GrSLType effectSLType = (*effect)->vertexAttribType(i);
- GrVertexAttribType attribType = fCommon.fVertexAttribs[attribIndex].fType;
+ GrVertexAttribType attribType = fCommon.fVAPtr[attribIndex].fType;
int slVecCount = GrSLTypeVectorCount(effectSLType);
int attribVecCount = GrVertexAttribTypeVectorCount(attribType);
if (slVecCount != attribVecCount ||
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698