diff options
author | Brian Salomon <bsalomon@google.com> | 2017-07-12 15:21:43 -0400 |
---|---|---|
committer | Brian Salomon <bsalomon@google.com> | 2017-07-12 19:47:56 +0000 |
commit | 0db1b53a849ae145a32cd1315c9f4f03430e90cb (patch) | |
tree | 78804265d6c0bf0cb9269cbd790c5d9e4e02f227 /src/gpu/ops/GrLatticeOp.cpp | |
parent | 5b8e2b899e96b30c0e5f73b1887f75b18a7d0a79 (diff) |
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>
Diffstat (limited to 'src/gpu/ops/GrLatticeOp.cpp')
-rw-r--r-- | src/gpu/ops/GrLatticeOp.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp index d705c64f94..fce1f972dd 100644 --- a/src/gpu/ops/GrLatticeOp.cpp +++ b/src/gpu/ops/GrLatticeOp.cpp @@ -96,6 +96,10 @@ private: 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, |