Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index 607d3c3cc7144788da553418b599084842bb7582..5fef15b706f38fcd73503e03a9453bc2fbfaa261 100755 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -313,13 +313,12 @@ GrTexture* GrContext::createResizedTexture(const GrSurfaceDesc& desc, |
GrTextureParams::kNone_FilterMode); |
drawState.addColorTextureProcessor(clampedTexture, SkMatrix::I(), params); |
- drawState.setGeometryProcessor( |
- GrDefaultGeoProcFactory::CreateAndSetAttribs( |
- &drawState, |
- GrDefaultGeoProcFactory::kPosition_GPType | |
- GrDefaultGeoProcFactory::kLocalCoord_GPType))->unref(); |
+ uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType | |
+ GrDefaultGeoProcFactory::kLocalCoord_GPType; |
+ const GrGeometryProcessor* gp = GrDefaultGeoProcFactory::Create(flags); |
+ drawState.setGeometryProcessor(gp)->unref(); |
- GrDrawTarget::AutoReleaseGeometry arg(fDrawBuffer, 4, drawState.getVertexStride(), 0); |
+ GrDrawTarget::AutoReleaseGeometry arg(fDrawBuffer, 4, gp->getVertexStride(), 0); |
if (arg.succeeded()) { |
SkPoint* verts = (SkPoint*) arg.vertices(); |
@@ -749,11 +748,11 @@ void GrContext::drawRect(const GrPaint& paint, |
// unitSquareVertexBuffer() |
static const int worstCaseVertCount = 10; |
- drawState.setDefaultVertexAttribs(); |
- drawState.setGeometryProcessor(GrDefaultGeoProcFactory::Create(false))->unref(); |
+ const GrGeometryProcessor* gp = GrDefaultGeoProcFactory::Create(); |
+ drawState.setGeometryProcessor(gp)->unref(); |
GrDrawTarget::AutoReleaseGeometry geo(target, |
worstCaseVertCount, |
- drawState.getVertexStride(), |
+ gp->getVertexStride(), |
0); |
if (!geo.succeeded()) { |
@@ -824,8 +823,7 @@ static void set_vertex_attributes(GrDrawState* drawState, |
*colorOffset = sizeof(SkPoint); |
flags |= GrDefaultGeoProcFactory::kColor_GPType; |
} |
- drawState->setGeometryProcessor(GrDefaultGeoProcFactory::CreateAndSetAttribs(drawState, |
- flags))->unref(); |
+ drawState->setGeometryProcessor(GrDefaultGeoProcFactory::Create(flags))->unref(); |
} |
void GrContext::drawVertices(const GrPaint& paint, |
@@ -850,7 +848,7 @@ void GrContext::drawVertices(const GrPaint& paint, |
int colorOffset = -1, texOffset = -1; |
set_vertex_attributes(&drawState, texCoords, colors, &colorOffset, &texOffset); |
- size_t vertexStride = drawState.getVertexStride(); |
+ size_t vertexStride = drawState.getGeometryProcessor()->getVertexStride(); |
if (!geo.set(target, vertexCount, vertexStride, indexCount)) { |
SkDebugf("Failed to get space for vertices!\n"); |
return; |
@@ -1542,9 +1540,6 @@ GrDrawTarget* GrContext::prepareToDraw(GrDrawState* ds, |
SkDebugf("Partial pixel coverage will be incorrectly blended.\n"); |
} |
#endif |
- // Clear any vertex attributes configured for the previous use of the |
- // GrDrawState which can effect which blend optimizations are in effect. |
- ds->setDefaultVertexAttribs(); |
} else { |
ds->reset(fViewMatrix); |
ds->setRenderTarget(fRenderTarget.get()); |