aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-04-28 16:13:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-28 20:32:15 +0000
commitcccafe8cfd2366b60585c0b65531282abb7a1404 (patch)
tree6740007d65f65712ed413f3b8fee4037d38cf36d /src/gpu
parent5b6d4a35467032fcac463f5e119c5170badc7521 (diff)
Rewrite SkVertices specified with triangle fans as indexed triangles
Change-Id: Ifaacc426bc657b324f6a885a8ef70b347b048226 Reviewed-on: https://skia-review.googlesource.com/124349 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGpuDevice.cpp4
-rw-r--r--src/gpu/SkGr.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7600a8f1c6..864c993c38 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1534,9 +1534,11 @@ void SkGpuDevice::wireframeVertices(SkVertices::VertexMode vmode, int vertexCoun
triangleCount = n / 3;
break;
case SkVertices::kTriangleStrip_VertexMode:
- case SkVertices::kTriangleFan_VertexMode:
triangleCount = n - 2;
break;
+ case SkVertices::kTriangleFan_VertexMode:
+ SK_ABORT("Unexpected triangle fan.");
+ break;
}
VertState state(vertexCount, indices, indexCount);
diff --git a/src/gpu/SkGr.h b/src/gpu/SkGr.h
index fc0aa63d4a..d8d227f53f 100644
--- a/src/gpu/SkGr.h
+++ b/src/gpu/SkGr.h
@@ -164,7 +164,7 @@ static inline GrPrimitiveType SkVertexModeToGrPrimitiveType(SkVertices::VertexMo
case SkVertices::kTriangleStrip_VertexMode:
return GrPrimitiveType::kTriangleStrip;
case SkVertices::kTriangleFan_VertexMode:
- return GrPrimitiveType::kTriangleFan;
+ break;
}
SK_ABORT("Invalid mode");
return GrPrimitiveType::kPoints;