aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn25
-rw-r--r--src/pathops/SkPathOpsTSect.h3
-rw-r--r--tests/skia_test.cpp2
3 files changed, 29 insertions, 1 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 19670169d8..00f70d9c35 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1134,6 +1134,31 @@ if (skia_enable_tools) {
testonly = true
}
+ pathops_tests_sources = exec_script("gyp/find.py",
+ [
+ "PathOps*.cpp",
+ rebase_path("tests"),
+ ],
+ "list lines",
+ [])
+
+ executable("pathops_unittest") {
+ sources =
+ pathops_tests_sources -
+ [ rebase_path("tests/PathOpsSkpClipTest.cpp") ] + # alternate main
+ [
+ rebase_path("tests/skia_test.cpp"),
+ rebase_path("tests/Test.cpp"),
+ ]
+ deps = [
+ ":flags",
+ ":gpu_tool_utils",
+ ":skia",
+ ":tool_utils",
+ ]
+ testonly = true
+ }
+
executable("dump_record") {
sources = [
"tools/DumpRecord.cpp",
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h
index fbfb8c138f..f3402daa67 100644
--- a/src/pathops/SkPathOpsTSect.h
+++ b/src/pathops/SkPathOpsTSect.h
@@ -992,6 +992,9 @@ SkTSpan<TCurve, OppCurve>* SkTSect<TCurve, OppCurve>::boundsMax() const {
template<typename TCurve, typename OppCurve>
bool SkTSect<TCurve, OppCurve>::coincidentCheck(SkTSect<OppCurve, TCurve>* sect2) {
SkTSpan<TCurve, OppCurve>* first = fHead;
+ if (!first) {
+ return false;
+ }
SkTSpan<TCurve, OppCurve>* last, * next;
do {
int consecutive = this->countConsecutiveSpans(first, &last);
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 462735a71c..93b6c698b2 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -171,7 +171,7 @@ int test_main() {
if (FLAGS_dumpOp) {
header.appendf(" -d");
}
-#if SK_DEBUG
+#ifdef SK_DEBUG
if (FLAGS_runFail) {
header.appendf(" -f");
}