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

Unified Diff: src/pathops/SkPathOpsCubic.h

Issue 2435063002: fix debug version of cubicpair detected by asan (Closed)
Patch Set: fix ifdef debug 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsCubic.h
diff --git a/src/pathops/SkPathOpsCubic.h b/src/pathops/SkPathOpsCubic.h
index f868fbe2c7d8895f44f0cbf78f92c97b3268bffe..61de48d19cd085748cf9f9c529b4643bd33fb122 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698