aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2014-12-04 17:01:03 +0000
committerBen Murdoch <benm@google.com>2014-12-04 17:01:03 +0000
commitfa77c3307d38ba6cccb3c668cab743cce36e823e (patch)
tree47e8a39dce8dcc12425fcb78cecc3e1cd6c98eb7
parentfe85239cf2c444e64e1af6aa450e56c11359eb58 (diff)
parent2e74f758f8379338f75898f28128ade1dfcf3702 (diff)
downloadskia-fa77c3307d38ba6cccb3c668cab743cce36e823e.tar.gz
Merge third_party/skia from https://chromium.googlesource.com/skia.git at 2e74f758f8379338f75898f28128ade1dfcf3702
This commit was generated by merge_from_chromium.py. Change-Id: I90e2592d15e8830e9081052b7bd9ccacd9fc6f6f
-rw-r--r--src/core/SkPath.cpp2
-rw-r--r--tests/PathTest.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 5288b85db..25fd058d2 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -2242,7 +2242,7 @@ struct Convexicator {
++fPtCount;
} else {
SkVector vec = pt - fCurrPt;
- if (vec.fX || vec.fY) {
+ if (!SkScalarNearlyZero(vec.lengthSqd(), SK_ScalarNearlyZero*SK_ScalarNearlyZero)) {
fLastPt = fCurrPt;
fCurrPt = pt;
if (++fPtCount == 2) {
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index bc3a3d7bd..6ba5f2d59 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -1206,6 +1206,20 @@ static void test_convexity2(skiatest::Reporter* reporter) {
degenerateConcave.lineTo(41.446522f, 376.25f);
check_convexity(reporter, degenerateConcave, SkPath::kConcave_Convexity);
check_direction(reporter, degenerateConcave, SkPath::kUnknown_Direction);
+
+ // http://crbug.com/433683
+ SkPath badFirstVector;
+ badFirstVector.moveTo(501.087708f, 319.610352f);
+ badFirstVector.lineTo(501.087708f, 319.610352f);
+ badFirstVector.cubicTo(501.087677f, 319.610321f, 449.271606f, 258.078674f, 395.084564f, 198.711182f);
+ badFirstVector.cubicTo(358.967072f, 159.140717f, 321.910553f, 120.650436f, 298.442322f, 101.955399f);
+ badFirstVector.lineTo(301.557678f, 98.044601f);
+ badFirstVector.cubicTo(325.283844f, 116.945084f, 362.615204f, 155.720825f, 398.777557f, 195.340454f);
+ badFirstVector.cubicTo(453.031860f, 254.781662f, 504.912262f, 316.389618f, 504.912292f, 316.389648f);
+ badFirstVector.lineTo(504.912292f, 316.389648f);
+ badFirstVector.lineTo(501.087708f, 319.610352f);
+ badFirstVector.close();
+ check_convexity(reporter, badFirstVector, SkPath::kConcave_Convexity);
}
static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p,