Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: src/core/SkPath.cpp

Issue 994533002: Remove SK_SUPPORT_LEGACY_ADDOVAL (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index b92b47f5c6b00f20315618c766b15aff89f0d609..dfbff97559d0e9a4c6cdd90be1daf222f03c2628 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1074,50 +1074,6 @@ void SkPath::addOval(const SkRect& oval, Direction dir) {
SkAutoPathBoundsUpdate apbu(this, oval);
-#ifdef SK_SUPPORT_LEGACY_ADDOVAL
- SkScalar cx = oval.centerX();
- SkScalar cy = oval.centerY();
- SkScalar rx = SkScalarHalf(oval.width());
- SkScalar ry = SkScalarHalf(oval.height());
-
- SkScalar sx = SkScalarMul(rx, SK_ScalarTanPIOver8);
- SkScalar sy = SkScalarMul(ry, SK_ScalarTanPIOver8);
- SkScalar mx = SkScalarMul(rx, SK_ScalarRoot2Over2);
- SkScalar my = SkScalarMul(ry, SK_ScalarRoot2Over2);
-
- /*
- To handle imprecision in computing the center and radii, we revert to
- the provided bounds when we can (i.e. use oval.fLeft instead of cx-rx)
- to ensure that we don't exceed the oval's bounds *ever*, since we want
- to use oval for our fast-bounds, rather than have to recompute it.
- */
- const SkScalar L = oval.fLeft; // cx - rx
- const SkScalar T = oval.fTop; // cy - ry
- const SkScalar R = oval.fRight; // cx + rx
- const SkScalar B = oval.fBottom; // cy + ry
-
- this->incReserve(17); // 8 quads + close
- this->moveTo(R, cy);
- if (dir == kCCW_Direction) {
- this->quadTo( R, cy - sy, cx + mx, cy - my);
- this->quadTo(cx + sx, T, cx , T);
- this->quadTo(cx - sx, T, cx - mx, cy - my);
- this->quadTo( L, cy - sy, L, cy );
- this->quadTo( L, cy + sy, cx - mx, cy + my);
- this->quadTo(cx - sx, B, cx , B);
- this->quadTo(cx + sx, B, cx + mx, cy + my);
- this->quadTo( R, cy + sy, R, cy );
- } else {
- this->quadTo( R, cy + sy, cx + mx, cy + my);
- this->quadTo(cx + sx, B, cx , B);
- this->quadTo(cx - sx, B, cx - mx, cy + my);
- this->quadTo( L, cy + sy, L, cy );
- this->quadTo( L, cy - sy, cx - mx, cy - my);
- this->quadTo(cx - sx, T, cx , T);
- this->quadTo(cx + sx, T, cx + mx, cy - my);
- this->quadTo( R, cy - sy, R, cy );
- }
-#else
const SkScalar L = oval.fLeft;
const SkScalar T = oval.fTop;
const SkScalar R = oval.fRight;
@@ -1139,7 +1095,6 @@ void SkPath::addOval(const SkRect& oval, Direction dir) {
this->conicTo(L, T, cx, T, weight);
this->conicTo(R, T, R, cy, weight);
}
-#endif
this->close();
SkPathRef::Editor ed(&fPathRef);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698