aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleCCPRGeometry.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-08-28 10:24:22 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-28 16:53:27 +0000
commit419a94da028b33425a0feeb44d0d022a5d3d3704 (patch)
tree2a61554a992ae19c2f7620697c2baa026a237011 /samplecode/SampleCCPRGeometry.cpp
parent7dda8dfb9d90f633af9a457b1c430f7cbf5536c5 (diff)
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 <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'samplecode/SampleCCPRGeometry.cpp')
-rw-r--r--samplecode/SampleCCPRGeometry.cpp11
1 files changed, 5 insertions, 6 deletions
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 {