aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathUtils.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-01-05 10:22:28 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-05 10:22:28 -0800
commitaf18a09d13611526c4217656c98947f9067cb07a (patch)
treefe9d4ffaaad14f1addca75bbecac4043d56c5a20 /src/gpu/GrPathUtils.cpp
parent91b0a3587342c48a1a6e1c4687686688737359da (diff)
Add conic support to Default and AAConvex path redender.
This is achieved but chopping up conics into quads. With this change conics should be ready to be used on the gpu side of things BUG=skia:3258 Review URL: https://codereview.chromium.org/825443002
Diffstat (limited to 'src/gpu/GrPathUtils.cpp')
-rw-r--r--src/gpu/GrPathUtils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 81dc103e02..8e7a01d091 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -166,6 +166,14 @@ int GrPathUtils::worstCasePointCount(const SkPath& path, int* subpaths,
case SkPath::kLine_Verb:
pointCount += 1;
break;
+ case SkPath::kConic_Verb: {
+ SkScalar weight = iter.conicWeight();
+ SkAutoConicToQuads converter;
+ const SkPoint* quadPts = converter.computeQuads(pts, weight, 0.25f);
+ for (int i = 0; i < converter.countQuads(); ++i) {
+ pointCount += quadraticPointCount(quadPts + 2*i, tol);
+ }
+ }
case SkPath::kQuad_Verb:
pointCount += quadraticPointCount(pts, tol);
break;