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

Unified Diff: src/pathops/SkPathOpsSimplify.cpp

Issue 2441763003: formalize host debugging (Closed)
Patch Set: merge with ToT Created 4 years, 2 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 | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsSimplify.cpp
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index f9f8f5c71ea6d042fa7e1a471ba813c6188a1b82..d587c3bbbb9244a1f1c3d00c26e5b31e134a747f 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -158,6 +158,11 @@ bool SimplifyDebug(const SkPath& path, SkPath* result
SkOpGlobalState globalState(contourList, &allocator
SkDEBUGPARAMS(skipAssert) SkDEBUGPARAMS(testName));
SkOpCoincidence coincidence(&globalState);
+#ifdef SK_DEBUG
+ if (SkPathOpsDebug::gDumpOp) {
+ SkPathOpsDebug::DumpSimplify(path, testName);
+ }
+#endif
SkScalar scaleFactor = ScaleFactor(path);
SkPath scaledPath;
const SkPath* workingPath;
@@ -218,5 +223,15 @@ bool SimplifyDebug(const SkPath& path, SkPath* result
}
bool Simplify(const SkPath& path, SkPath* result) {
+#ifdef SK_DEBUG
+ if (SkPathOpsDebug::gVerifyOp) {
+ if (!SimplifyDebug(path, result SkDEBUGPARAMS(false) SkDEBUGPARAMS(nullptr))) {
+ SkPathOpsDebug::ReportSimplifyFail(path);
+ return false;
+ }
+ SkPathOpsDebug::VerifySimplify(path, *result);
+ return true;
+ }
+#endif
return SimplifyDebug(path, result SkDEBUGPARAMS(true) SkDEBUGPARAMS(nullptr));
}
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698