diff options
-rw-r--r-- | src/gpu/GrAARectRenderer.cpp | 16 | ||||
-rw-r--r-- | src/gpu/GrDrawState.h | 6 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp index 741b83d080..9bf61958dd 100644 --- a/src/gpu/GrAARectRenderer.cpp +++ b/src/gpu/GrAARectRenderer.cpp @@ -30,12 +30,6 @@ static void set_inset_fan(GrPoint* pts, size_t stride, 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 @@ void GrAARectRenderer::fillAARect(GrGpu* gpu, 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 @@ void GrAARectRenderer::strokeAARect(GrGpu* gpu, 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); diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h index 53c575d3af..b4d130648b 100644 --- a/src/gpu/GrDrawState.h +++ b/src/gpu/GrDrawState.h @@ -38,9 +38,9 @@ enum GrVertexAttribType { static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; struct GrVertexAttrib { - GrVertexAttrib() {} - GrVertexAttrib(GrVertexAttribType type, size_t offset) : - fType(type), fOffset(offset) {} + inline GrVertexAttrib() {} + inline GrVertexAttrib(GrVertexAttribType type, size_t offset) : + fType(type), fOffset(offset) {} bool operator==(const GrVertexAttrib& other) const { return fType == other.fType && fOffset == other.fOffset; }; |