Fix crash in SampleCCPRGeometry
Fixes a crash introduced by 0e13db707ff3b384aaeb79cddc735967662f0ddf.
Change-Id: If250c57804705f35d11c1914efe5de2e6d5edb38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330936
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/samplecode/SampleCCPRGeometry.cpp b/samplecode/SampleCCPRGeometry.cpp
index 7e6c394..d9938c9 100644
--- a/samplecode/SampleCCPRGeometry.cpp
+++ b/samplecode/SampleCCPRGeometry.cpp
@@ -66,7 +66,6 @@
void updateGpuData();
PrimitiveType fPrimitiveType = PrimitiveType::kCubics;
- SkCubicType fCubicType;
SkPoint fPoints[4] = {
{100.05f, 100.05f}, {400.75f, 100.05f}, {400.75f, 300.95f}, {100.05f, 300.95f}};
@@ -187,7 +186,7 @@
caption.appendf("PrimitiveType_%s",
GrCCCoverageProcessor::PrimitiveTypeName(fPrimitiveType));
if (PrimitiveType::kCubics == fPrimitiveType) {
- caption.appendf(" (%s)", SkCubicTypeName(fCubicType));
+ caption.appendf(" (%s)", SkCubicTypeName(SkClassifyCubic(fPoints)));
} else if (PrimitiveType::kConics == fPrimitiveType) {
caption.appendf(" (w=%f)", fConicWeight);
}