Fix assert in lattice op triggered by GLProgramsTest
Change-Id: Ia495a8c7bc7dd0832da7ad48c6dbdf4c0dc67119
Reviewed-on: https://skia-review.googlesource.com/22729
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index d705c64..fce1f97 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -96,6 +96,10 @@
numRects += fPatches[i].fIter->numRectsToDraw();
}
+ if (!numRects) {
+ return;
+ }
+
sk_sp<const GrBuffer> indexBuffer(target->resourceProvider()->refQuadIndexBuffer());
PatternHelper helper(GrPrimitiveType::kTriangles);
void* vertices = helper.init(target, vertexStride, indexBuffer.get(), kVertsPerRect,