aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-22 20:23:32 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-22 20:23:32 +0000
commit077348cfd0b4c424393ce83cb9ceded8afe60216 (patch)
tree82f34e3ed76f8d252a69569d5bbfd3be6b61255a
parentb862204352f1a6028e0bfafd25df1cbca114208b (diff)
Fix slow gm debug builds that are doing large path validation runs.
Add a new compile flag to allow path validation to be selectively enabled instead of being always on. Review URL: https://codereview.appspot.com/6734059 git-svn-id: http://skia.googlecode.com/svn/trunk@6036 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/config/SkUserConfig.h8
-rw-r--r--src/core/SkPath.cpp4
2 files changed, 11 insertions, 1 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h
index 93dda7090d..79fdc7a2a4 100644
--- a/include/config/SkUserConfig.h
+++ b/include/config/SkUserConfig.h
@@ -65,6 +65,14 @@
//#define SK_DEBUG
//#define SK_RELEASE
+/* Skia has certain debug-only code that is extremely intensive even for debug
+ builds. This code is useful for diagnosing specific issues, but is not
+ generally applicable, therefore it must be explicitly enabled to avoid
+ the performance impact. By default these flags are undefined, but can be
+ enabled by uncommenting them below.
+ */
+//#define SK_DEBUG_PATH
+
/* To assist debugging, Skia provides an instance counting utility in
include/core/SkInstCount.h. This flag turns on and off that utility to
allow instance count tracking in either debug or release builds. By
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index eb0e485ab3..9723db929a 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1942,6 +1942,7 @@ void SkPath::validate() const {
SkASSERT(this != NULL);
SkASSERT((fFillType & ~3) == 0);
+#ifdef SK_DEBUG_PATH
if (!fBoundsIsDirty) {
SkRect bounds;
@@ -1990,8 +1991,9 @@ void SkPath::validate() const {
}
}
SkASSERT(mask == fSegmentMask);
+#endif // SK_DEBUG_PATH
}
-#endif
+#endif // SK_DEBUG
///////////////////////////////////////////////////////////////////////////////