aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-10-20 10:11:27 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-20 10:11:27 -0700
commit4209dcbbc61e4ceb8d62c0f56b66043034e63dfe (patch)
tree3971408eed3afb50c84b9451ac9557a06533773a
parent95f6b399e5e314c706ff78eaa7214966c789e851 (diff)
fix debug version of cubicpair detected by asan
-rw-r--r--src/pathops/SkPathOpsCubic.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h
index f868fbe2c7..61de48d19c 100644
--- a/src/pathops/SkPathOpsCubic.h
+++ b/src/pathops/SkPathOpsCubic.h
@@ -11,11 +11,7 @@
#include "SkPath.h"
#include "SkPathOpsPoint.h"
-struct SkDCubicPair {
- const SkDCubic& first() const { return (const SkDCubic&) pts[0]; }
- const SkDCubic& second() const { return (const SkDCubic&) pts[3]; }
- SkDPoint pts[7];
-};
+struct SkDCubicPair;
struct SkDCubic {
static const int kPointCount = 4;
@@ -157,4 +153,26 @@ inline int other_two(int one, int two) {
return 1 >> (3 - (one ^ two)) ^ 3;
}
+struct SkDCubicPair {
+ const SkDCubic first() const {
+#ifdef SK_DEBUG
+ SkDCubic result;
+ result.debugSet(&pts[0]);
+ return result;
+#else
+ return (const SkDCubic&) pts[0];
+#endif
+ }
+ const SkDCubic second() const {
+#ifdef SK_DEBUG
+ SkDCubic result;
+ result.debugSet(&pts[3]);
+ return result;
+#else
+ return (const SkDCubic&) pts[3];
+#endif
+ }
+ SkDPoint pts[7];
+};
+
#endif