Make global static variable kVertexAttribs in GrAARectRenderer local to functions.
Chrome was choking on this static variable because it's global and initialized
using a constructor. Moved it inside the two functions that use it, so it's no
longer global.
In addition, made the constructors for GrVertexAttrib inline so hopefully they
will be optimized away.
git-svn-id: http://skia.googlecode.com/svn/trunk@7930 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 741b83d..9bf6195 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -30,12 +30,6 @@
r.fRight - dx, r.fBottom - dy, stride);
}
-// position + color/coverage
-static const GrVertexAttrib kVertexAttribs[] = {
- GrVertexAttrib(kVec2f_GrVertexAttribType, 0),
- GrVertexAttrib(kVec4ub_GrVertexAttribType, sizeof(GrPoint))
-};
-
};
void GrAARectRenderer::reset() {
@@ -134,6 +128,11 @@
bool useVertexCoverage) {
GrDrawState* drawState = target->drawState();
+ // position + color/coverage
+ static const GrVertexAttrib kVertexAttribs[] = {
+ GrVertexAttrib(kVec2f_GrVertexAttribType, 0),
+ GrVertexAttrib(kVec4ub_GrVertexAttribType, sizeof(GrPoint))
+ };
GrAttribBindings bindings;
GrDrawState::AttribIndex attribIndex;
aa_rect_attributes(useVertexCoverage, &bindings, &attribIndex);
@@ -213,6 +212,11 @@
return;
}
+ // position + color/coverage
+ static const GrVertexAttrib kVertexAttribs[] = {
+ GrVertexAttrib(kVec2f_GrVertexAttribType, 0),
+ GrVertexAttrib(kVec4ub_GrVertexAttribType, sizeof(GrPoint))
+ };
GrAttribBindings bindings;
GrDrawState::AttribIndex attribIndex;
aa_rect_attributes(useVertexCoverage, &bindings, &attribIndex);