aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/batches
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-16 08:00:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 08:00:05 -0800
commit18fab30d7c4858ef2521e0380573aac5a21b2ed9 (patch)
tree1f67cd782482fcd9013bd14a036c3b7ef295e195 /src/gpu/batches
parentb8fea97a7a493897fcff33aa2932d875c572f163 (diff)
Modify interface to GrPathUtils::convertCubicToQuads
Diffstat (limited to 'src/gpu/batches')
-rw-r--r--src/gpu/batches/GrAAConvexPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrAAHairLinePathRenderer.cpp9
-rw-r--r--src/gpu/batches/GrPLSPathRenderer.cpp3
3 files changed, 5 insertions, 9 deletions
diff --git a/src/gpu/batches/GrAAConvexPathRenderer.cpp b/src/gpu/batches/GrAAConvexPathRenderer.cpp
index 4fd3c6fe00..f02ebfb2f5 100644
--- a/src/gpu/batches/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/batches/GrAAConvexPathRenderer.cpp
@@ -254,7 +254,7 @@ static inline void add_cubic_segments(const SkPoint pts[4],
SkPathPriv::FirstDirection dir,
SegmentArray* segments) {
SkSTArray<15, SkPoint, true> quads;
- GrPathUtils::convertCubicToQuads(pts, SK_Scalar1, true, dir, &quads);
+ GrPathUtils::convertCubicToQuadsConstrainToTangents(pts, SK_Scalar1, dir, &quads);
int count = quads.count();
for (int q = 0; q < count; q += 3) {
add_quad_segment(&quads[q], segments);
diff --git a/src/gpu/batches/GrAAHairLinePathRenderer.cpp b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
index 97a779ee3d..87e1940640 100644
--- a/src/gpu/batches/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/batches/GrAAHairLinePathRenderer.cpp
@@ -345,17 +345,14 @@ static int gather_lines_and_quads(const SkPath& path,
bounds.roundOut(&ibounds);
if (SkIRect::Intersects(devClipBounds, ibounds)) {
PREALLOC_PTARRAY(32) q;
- // we don't need a direction if we aren't constraining the subdivision
- const SkPathPriv::FirstDirection kDummyDir = SkPathPriv::kCCW_FirstDirection;
// We convert cubics to quadratics (for now).
// In perspective have to do conversion in src space.
if (persp) {
SkScalar tolScale =
- GrPathUtils::scaleToleranceToSrc(SK_Scalar1, m,
- path.getBounds());
- GrPathUtils::convertCubicToQuads(pathPts, tolScale, false, kDummyDir, &q);
+ GrPathUtils::scaleToleranceToSrc(SK_Scalar1, m, path.getBounds());
+ GrPathUtils::convertCubicToQuads(pathPts, tolScale, &q);
} else {
- GrPathUtils::convertCubicToQuads(devPts, SK_Scalar1, false, kDummyDir, &q);
+ GrPathUtils::convertCubicToQuads(devPts, SK_Scalar1, &q);
}
for (int i = 0; i < q.count(); i += 3) {
SkPoint* qInDevSpace;
diff --git a/src/gpu/batches/GrPLSPathRenderer.cpp b/src/gpu/batches/GrPLSPathRenderer.cpp
index faadd6d49b..6ca773d7b2 100644
--- a/src/gpu/batches/GrPLSPathRenderer.cpp
+++ b/src/gpu/batches/GrPLSPathRenderer.cpp
@@ -145,7 +145,6 @@ static bool get_geometry(const SkPath& path, const SkMatrix& m, PLSVertices& tri
SkPath linesOnlyPath;
linesOnlyPath.setFillType(path.getFillType());
SkSTArray<15, SkPoint, true> quadPoints;
- SkPathPriv::FirstDirection dir = SkPathPriv::FirstDirection::kUnknown_FirstDirection;
SkPath::Iter iter(path, true);
bool done = false;
while (!done) {
@@ -175,7 +174,7 @@ static bool get_geometry(const SkPath& path, const SkMatrix& m, PLSVertices& tri
case SkPath::kCubic_Verb: {
m.mapPoints(pts, 4);
SkSTArray<15, SkPoint, true> quads;
- GrPathUtils::convertCubicToQuads(pts, kCubicTolerance, false, dir, &quads);
+ GrPathUtils::convertCubicToQuads(pts, kCubicTolerance, &quads);
int count = quads.count();
for (int q = 0; q < count; q += 3) {
linesOnlyPath.lineTo(quads[q + 2]);