aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrAAHairLinePathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2017-03-23 13:38:45 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-23 21:05:45 +0000
commitcc26127920069cbd83e92cca3c69bb56cb165bcc (patch)
tree4454582e03d9b0701fbd4a23042a27cfeaea868b /src/gpu/ops/GrAAHairLinePathRenderer.cpp
parentf160ad4d76e9e7ec21c48f92ba05c16ffec566b4 (diff)
Find cubic KLM functionals directly
- Updates GrPathUtils to computes the KLM functionals directly instead of deriving them from their explicit values at the control points. - Updates the utility to return these functionals as a matrix rather than an array of scalar values. - Adds a benchmark for chopCubicAtLoopIntersection. BUG=skia: Change-Id: I97a9b5cf610d33e15c9af96b9d9a8eb4a94b1ca7 Reviewed-on: https://skia-review.googlesource.com/9951 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/ops/GrAAHairLinePathRenderer.cpp')
-rw-r--r--src/gpu/ops/GrAAHairLinePathRenderer.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index e373b97d05..ec2610400f 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -409,9 +409,7 @@ struct BezierVertex {
SkPoint fPos;
union {
struct {
- SkScalar fK;
- SkScalar fL;
- SkScalar fM;
+ SkScalar fKLM[3];
} fConic;
SkVector fQuadCoord;
struct {
@@ -526,15 +524,13 @@ static void bloat_quad(const SkPoint qpts[3], const SkMatrix* toDevice,
// k, l, m are calculated in function GrPathUtils::getConicKLM
static void set_conic_coeffs(const SkPoint p[3], BezierVertex verts[kQuadNumVertices],
const SkScalar weight) {
- SkScalar klm[9];
+ SkMatrix klm;
- GrPathUtils::getConicKLM(p, weight, klm);
+ GrPathUtils::getConicKLM(p, weight, &klm);
for (int i = 0; i < kQuadNumVertices; ++i) {
- const SkPoint pnt = verts[i].fPos;
- verts[i].fConic.fK = pnt.fX * klm[0] + pnt.fY * klm[1] + klm[2];
- verts[i].fConic.fL = pnt.fX * klm[3] + pnt.fY * klm[4] + klm[5];
- verts[i].fConic.fM = pnt.fX * klm[6] + pnt.fY * klm[7] + klm[8];
+ const SkScalar pt3[3] = {verts[i].fPos.x(), verts[i].fPos.y(), 1.f};
+ klm.mapHomogeneousPoints(verts[i].fConic.fKLM, pt3, 1);
}
}