diff options
-rw-r--r-- | bench/PathBench.cpp | 20 | ||||
-rw-r--r-- | src/core/SkEdge.cpp | 15 |
2 files changed, 3 insertions, 32 deletions
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp index 449d30558e..4ca4401163 100644 --- a/bench/PathBench.cpp +++ b/bench/PathBench.cpp @@ -173,23 +173,6 @@ private: typedef PathBench INHERITED; }; -class NonAACirclePathBench: public CirclePathBench { -public: - NonAACirclePathBench(Flags flags) : INHERITED(flags) {} - - void appendName(SkString* name) override { - name->append("nonaacircle"); - } - - void setupPaint(SkPaint* paint) override { - CirclePathBench::setupPaint(paint); - paint->setAntiAlias(false); - } - -private: - typedef CirclePathBench INHERITED; -}; - // Test max speedup of Analytic AA for concave paths class AAAConcavePathBench : public PathBench { public: @@ -1107,9 +1090,6 @@ DEF_BENCH( return new CirclePathBench(FLAGS01); ) DEF_BENCH( return new CirclePathBench(FLAGS10); ) DEF_BENCH( return new CirclePathBench(FLAGS11); ) -DEF_BENCH( return new NonAACirclePathBench(FLAGS00); ) -DEF_BENCH( return new NonAACirclePathBench(FLAGS10); ) - DEF_BENCH( return new AAAConcavePathBench(FLAGS00); ) DEF_BENCH( return new AAAConcavePathBench(FLAGS10); ) DEF_BENCH( return new AAAConvexPathBench(FLAGS00); ) diff --git a/src/core/SkEdge.cpp b/src/core/SkEdge.cpp index f8e8d98b5d..216604b551 100644 --- a/src/core/SkEdge.cpp +++ b/src/core/SkEdge.cpp @@ -157,22 +157,16 @@ static inline SkFDot6 cheap_distance(SkFDot6 dx, SkFDot6 dy) return dx; } -static inline int diff_to_shift(SkFDot6 dx, SkFDot6 dy, int shiftAA = 2) +static inline int diff_to_shift(SkFDot6 dx, SkFDot6 dy) { // cheap calc of distance from center of p0-p2 to the center of the curve SkFDot6 dist = cheap_distance(dx, dy); // shift down dist (it is currently in dot6) - // down by 3 should give us 1/8 pixel accuracy (assuming our dist is accurate...) + // down by 5 should give us 1/2 pixel accuracy (assuming our dist is accurate...) // this is chosen by heuristic: make it as big as possible (to minimize segments) // ... but small enough so that our curves still look smooth - // When shift > 0, we're using AA and everything is scaled up so we can - // lower the accuracy. -#ifdef SK_SUPPORT_LEGACY_QUAD_SHIFT dist = (dist + (1 << 4)) >> 5; -#else - dist = (dist + (1 << 4)) >> (3 + shiftAA); -#endif // each subdivision (shift value) cuts this dist (error) by 1/4 return (32 - SkCLZ(dist)) >> 1; @@ -220,10 +214,7 @@ bool SkQuadraticEdge::setQuadraticWithoutUpdate(const SkPoint pts[3], int shift) { SkFDot6 dx = (SkLeftShift(x1, 1) - x0 - x2) >> 2; SkFDot6 dy = (SkLeftShift(y1, 1) - y0 - y2) >> 2; - // This is a little confusing: - // before this line, shift is the scale up factor for AA; - // after this line, shift is the fCurveShift. - shift = diff_to_shift(dx, dy, shift); + shift = diff_to_shift(dx, dy); SkASSERT(shift >= 0); } // need at least 1 subdivision for our bias trick |