Fix crash in SampleCCPRGeometry

Fixes a crash introduced by 0e13db707f.

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>
This commit is contained in:
Chris Dalton 2020-10-30 12:26:20 -06:00 committed by Skia Commit-Bot
parent 869cdefdd1
commit a3df50000f

View File

@ -66,7 +66,6 @@ class CCPRGeometryView : public Sample {
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 @@ void CCPRGeometryView::onDrawContent(SkCanvas* canvas) {
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);
}