Fix bench crash (calling method on NULL object).
Review URL: https://codereview.appspot.com/7305048
git-svn-id: http://skia.googlecode.com/svn/trunk@7603 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 2a26dae..684b7f7 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -212,11 +212,13 @@
if (flush) {
this->flushGlyphs();
fContext->flush();
+ // flushGlyphs() will reset fDrawTarget to NULL.
+ fDrawTarget = fContext->getTextTarget(fPaint);
+ fDrawTarget->drawState()->setVertexLayout(fVertexLayout);
}
fMaxVertices = kDefaultRequestedVerts;
// ignore return, no point in flushing again.
- fDrawTarget->geometryHints(&fMaxVertices,
- NULL);
+ fDrawTarget->geometryHints(&fMaxVertices, NULL);
int maxQuadVertices = 4 * fContext->getQuadIndexBuffer()->maxQuads();
if (fMaxVertices < kMinRequestedVerts) {