From 419a94da028b33425a0feeb44d0d022a5d3d3704 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 28 Aug 2017 10:24:22 -0600 Subject: Add a GrCCPRGeometry file Enough ccpr-specific geometry code is in flight that it feels like it should have its own file. Bug: skia: Change-Id: I99ef620a7dc35178cf774b3a4ec6159d46f401c7 Reviewed-on: https://skia-review.googlesource.com/39162 Commit-Queue: Chris Dalton Reviewed-by: Brian Salomon --- samplecode/SampleCCPRGeometry.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'samplecode/SampleCCPRGeometry.cpp') diff --git a/samplecode/SampleCCPRGeometry.cpp b/samplecode/SampleCCPRGeometry.cpp index 9749e45a29..b4bf2bd288 100644 --- a/samplecode/SampleCCPRGeometry.cpp +++ b/samplecode/SampleCCPRGeometry.cpp @@ -10,7 +10,6 @@ #if SK_SUPPORT_GPU #include "GrContextPriv.h" -#include "GrPathUtils.h" #include "GrRenderTargetContext.h" #include "GrRenderTargetContextPriv.h" #include "GrResourceProvider.h" @@ -22,6 +21,7 @@ #include "SkPath.h" #include "SkView.h" #include "ccpr/GrCCPRCoverageProcessor.h" +#include "ccpr/GrCCPRGeometry.h" #include "gl/GrGLGpu.cpp" #include "ops/GrDrawOp.h" @@ -202,10 +202,9 @@ void CCPRGeometryView::updateGpuData() { fGpuInstances.push_back().fCubicData = {controlPointsIdx + i * 4, i}; } } else if (is_curve(fMode)) { - SkPoint P[3] = {fPoints[0], fPoints[1], fPoints[3]}; SkPoint chopped[5]; - fGpuPoints.push_back(P[0]); - if (GrPathUtils::chopMonotonicQuads(P, chopped)) { + fGpuPoints.push_back(fPoints[0]); + if (GrCCPRChopMonotonicQuadratics(fPoints[0], fPoints[1], fPoints[3], chopped)) { // Endpoints. fGpuPoints.push_back(chopped[2]); fGpuPoints.push_back(chopped[4]); @@ -215,8 +214,8 @@ void CCPRGeometryView::updateGpuData() { fGpuInstances.push_back().fQuadraticData = {3, 0}; fGpuInstances.push_back().fQuadraticData = {4, 1}; } else { - fGpuPoints.push_back(P[2]); - fGpuPoints.push_back(P[1]); + fGpuPoints.push_back(fPoints[3]); + fGpuPoints.push_back(fPoints[1]); fGpuInstances.push_back().fQuadraticData = {2, 0}; } } else { -- cgit v1.2.3