From b53bdf16aa8fa2454697afaa0c3f03df7581f17c Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Thu, 16 Jan 2020 13:28:32 -0700 Subject: [PATCH] Fix single-pass tessellator wedges Change-Id: I5d7f4e2c0c3884e84633695967e6c4ed7c480d80 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264819 Reviewed-by: Greg Daniel Commit-Queue: Chris Dalton --- src/gpu/tessellate/GrTessellatePathOp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gpu/tessellate/GrTessellatePathOp.cpp b/src/gpu/tessellate/GrTessellatePathOp.cpp index c3f4ef68c8..1722f65a3d 100644 --- a/src/gpu/tessellate/GrTessellatePathOp.cpp +++ b/src/gpu/tessellate/GrTessellatePathOp.cpp @@ -27,7 +27,9 @@ void GrTessellatePathOp::onPrepare(GrOpFlushState* state) { int maxVertexCount = GrPathParser::MaxPossibleWedgeVertices(fPath); if (auto* wedgeData = (SkPoint*)state->makeVertexSpace( sizeof(SkPoint), maxVertexCount, &fWedgeBuffer, &fBaseWedgeVertex)) { - fWedgeVertexCount = GrPathParser::EmitCenterWedges(fPath, wedgeData); + if (!(fWedgeVertexCount = GrPathParser::EmitCenterWedges(fPath, wedgeData))) { + fWedgeBuffer.reset(); + } state->putBackVertices(maxVertexCount - fWedgeVertexCount, sizeof(SkPoint)); } }