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

Unified Diff: src/gpu/GrContext.cpp

Issue 12379052: Remove constructors from GrVertexAttrib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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/GrAARectRenderer.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
===================================================================
--- src/gpu/GrContext.cpp (revision 7929)
+++ src/gpu/GrContext.cpp (working copy)
@@ -354,8 +354,8 @@
// position + texture coordinate
static const GrVertexAttrib kVertexAttribs[] = {
- GrVertexAttrib(kVec2f_GrVertexAttribType, 0),
- GrVertexAttrib(kVec2f_GrVertexAttribType, sizeof(GrPoint))
+ {kVec2f_GrVertexAttribType, 0},
+ {kVec2f_GrVertexAttribType, sizeof(GrPoint)}
};
static const GrAttribBindings kAttribBindings = GrDrawState::ExplicitTexCoordAttribBindingsBit(0);
drawState->setAttribBindings(kAttribBindings);
@@ -929,14 +929,16 @@
// set position attribute
drawState->setAttribIndex(GrDrawState::kPosition_AttribIndex, attribs.count());
- attribs.push_back(GrVertexAttrib(kVec2f_GrVertexAttribType, currentOffset));
+ GrVertexAttrib currAttrib = {kVec2f_GrVertexAttribType, currentOffset};
+ attribs.push_back(currAttrib);
bsalomon 2013/03/01 19:55:39 No need to change but just FYI, this would work:
currentOffset += sizeof(GrPoint);
// set up optional texture coordinate attributes
if (NULL != texCoords) {
bindings |= GrDrawState::ExplicitTexCoordAttribBindingsBit(0);
drawState->setAttribIndex(GrDrawState::kTexCoord_AttribIndex, attribs.count());
- attribs.push_back(GrVertexAttrib(kVec2f_GrVertexAttribType, currentOffset));
+ currAttrib.set(kVec2f_GrVertexAttribType, currentOffset);
+ attribs.push_back(currAttrib);
texOffset = currentOffset;
currentOffset += sizeof(GrPoint);
}
@@ -945,7 +947,8 @@
if (NULL != colors) {
bindings |= GrDrawState::kColor_AttribBindingsBit;
drawState->setAttribIndex(GrDrawState::kColor_AttribIndex, attribs.count());
- attribs.push_back(GrVertexAttrib(kVec4ub_GrVertexAttribType, currentOffset));
+ currAttrib.set(kVec4ub_GrVertexAttribType, currentOffset);
+ attribs.push_back(currAttrib);
colorOffset = currentOffset;
currentOffset += sizeof(GrColor);
}
@@ -1073,8 +1076,8 @@
// position + edge
static const GrVertexAttrib kVertexAttribs[] = {
- GrVertexAttrib(kVec2f_GrVertexAttribType, 0),
- GrVertexAttrib(kVec4f_GrVertexAttribType, sizeof(GrPoint))
+ {kVec2f_GrVertexAttribType, 0},
+ {kVec4f_GrVertexAttribType, sizeof(GrPoint)}
};
static const GrAttribBindings kAttributeBindings = GrDrawState::kEdge_AttribBindingsBit;
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698