From 62563deb6b4dbb0b1db7f29f35e07dcef043af31 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Tue, 17 Oct 2017 19:14:05 +0000 Subject: Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans." This reverts commit fa2d604a7ded95a3ace905519b476129cd0fffcb. Reason for revert: Original change's description: > Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans. > > Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip. > > I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case. > > > Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca > Reviewed-on: https://skia-review.googlesource.com/60081 > Commit-Queue: Brian Salomon > Reviewed-by: Robert Phillips TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/60683 Reviewed-by: Brian Salomon Commit-Queue: Brian Salomon --- tests/OnFlushCallbackTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/OnFlushCallbackTest.cpp') diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp index 52bed86e48..370165121d 100644 --- a/tests/OnFlushCallbackTest.cpp +++ b/tests/OnFlushCallbackTest.cpp @@ -128,14 +128,13 @@ private: indices[0] = 0; indices[1] = 1; indices[2] = 2; - indices[3] = 2; - indices[4] = 1; + indices[3] = 0; + indices[4] = 2; indices[5] = 3; // Setup positions SkPoint* position = (SkPoint*) vertices; - position->setRectTriStrip(fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, - vertexStride); + position->setRectFan(fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, vertexStride); // Setup vertex colors GrColor* color = (GrColor*)((intptr_t)vertices + kColorOffset); -- cgit v1.2.3