fixes for conics
authorreed <reed@google.com>
Tue, 6 Jan 2015 15:44:21 +0000 (07:44 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 6 Jan 2015 15:44:21 +0000 (07:44 -0800)
- use std tolerance in edgebuilder, since the path has not been scaled-up to its super-sample size (that happens in the builder methods.

- off-by-1 fix for pathops when using the output of the conicquadder

BUG=skia:

Review URL: https://codereview.chromium.org/837023002

src/core/SkEdgeBuilder.cpp
src/pathops/SkOpEdgeBuilder.cpp

index 51da3a1..8dcc47a 100644 (file)
@@ -172,7 +172,7 @@ int SkEdgeBuilder::build(const SkPath& path, const SkIRect* iclip,
     }
 
     SkAutoConicToQuads quadder;
-    const SkScalar conicTol = (SK_Scalar1 / 4) * (1 << shiftUp);
+    const SkScalar conicTol = SK_Scalar1 / 4;
 
     SkPath::Iter    iter(path, true);
     SkPoint         pts[4];
index 8503af3..803a5f4 100644 (file)
@@ -111,8 +111,8 @@ int SkOpEdgeBuilder::preFetch() {
                     for (int i = 0; i < nQuads; ++i) {
                        fPathVerbs.push_back(SkPath::kQuad_Verb);
                     }
-                    fPathPts.push_back_n(nQuads * 2, quadPts);
-                    curve[0] = quadPts[nQuads * 2 - 1];
+                    fPathPts.push_back_n(nQuads * 2, &quadPts[1]);
+                    curve[0] = pts[2];
                     lastCurve = true;
                 }
                 continue;