aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bench/PathBench.cpp2
-rw-r--r--gyp/common_conditions.gypi1
-rw-r--r--src/core/SkGeometry.cpp5
-rw-r--r--tests/PathTest.cpp2
4 files changed, 10 insertions, 0 deletions
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp
index 3b3c52d0cb..ac324a9d32 100644
--- a/bench/PathBench.cpp
+++ b/bench/PathBench.cpp
@@ -729,7 +729,9 @@ protected:
add_corner_arc(path, r, xCorner, yCorner, 90);
add_corner_arc(path, r, xCorner, yCorner, 180);
+#ifdef SK_REDEFINE_ROOT2OVER2_TO_MAKE_ARCTOS_CONVEX
SkASSERT(path->isConvex());
+#endif
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index 70b4566f8a..ac2defb979 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -4,6 +4,7 @@
'defines': [
'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
# 'SK_SUPPORT_HINTING_SCALE_FACTOR',
+ 'SK_REDEFINE_ROOT2OVER2_TO_MAKE_ARCTOS_CONVEX',
],
'conditions' : [
['skia_gpu == 1',
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index d2aaeff6d9..95b6247801 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -1267,8 +1267,13 @@ static bool quad_pt2OffCurve(const SkPoint quad[3], SkScalar x, SkScalar y, SkPo
// Switch over to using cubics rather then quads
// Use a different method to create the mid-point (e.g., compute
// the two side points, average them, then move it out as needed
+#ifdef SK_REDEFINE_ROOT2OVER2_TO_MAKE_ARCTOS_CONVEX
#define SK_ScalarRoot2Over2_QuadCircle 0.7072f
#else
+ #define SK_ScalarRoot2Over2_QuadCircle SK_ScalarRoot2Over2
+#endif
+
+#else
#define SK_ScalarRoot2Over2_QuadCircle SK_FixedRoot2Over2
#endif
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 6c8a400de9..d035b34200 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -139,7 +139,9 @@ static void test_arb_round_rect_is_convex(skiatest::Reporter* reporter) {
make_arb_round_rect(&temp, r, r.width() / 10, r.height() / 15);
+#ifdef SK_REDEFINE_ROOT2OVER2_TO_MAKE_ARCTOS_CONVEX
REPORTER_ASSERT(reporter, temp.isConvex());
+#endif
}
}