From f3a7bc7954fc6af9b97c2ae7e7be340110792884 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Tue, 5 Feb 2013 21:32:06 +0000 Subject: [PATCH] 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 --- src/gpu/GrTextContext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 @@ HAS_ATLAS: 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) { -- 2.7.4