From db8f44f497f2b67b2500bbfc7b11ce7a510c5e5c Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 15 Dec 2016 09:17:31 -0500 Subject: speculative pointer to member fix Move the body of simple functions out of line if they are used in pointer to member function expressions. This may fix a chromeos-reported bug. TBR=reed@google.com BUG=674047 Change-Id: Id2a080a6d047103a48ebe2319abdae444de413e3 Reviewed-on: https://skia-review.googlesource.com/6110 Reviewed-by: Cary Clark Commit-Queue: Cary Clark --- src/pathops/SkOpCoincidence.cpp | 20 ++++++++++++++++++++ src/pathops/SkOpCoincidence.h | 8 ++++---- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'src/pathops') diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp index 557da0a56e..1dd34ada93 100644 --- a/src/pathops/SkOpCoincidence.cpp +++ b/src/pathops/SkOpCoincidence.cpp @@ -16,6 +16,16 @@ bool SkCoincidentSpans::collapsed(const SkOpPtT* test) const { || (fOppPtTEnd == test && fOppPtTStart->contains(test)); } +// out of line since this function is referenced by address +const SkOpPtT* SkCoincidentSpans::coinPtTEnd() const { + return fCoinPtTEnd; +} + +// out of line since this function is referenced by address +const SkOpPtT* SkCoincidentSpans::coinPtTStart() const { + return fCoinPtTStart; +} + // sets the span's end to the ptT referenced by the previous-next void SkCoincidentSpans::correctOneEnd( const SkOpPtT* (SkCoincidentSpans::* getEnd)() const, @@ -125,6 +135,16 @@ bool SkCoincidentSpans::contains(const SkOpPtT* s, const SkOpPtT* e) const { } } +// out of line since this function is referenced by address +const SkOpPtT* SkCoincidentSpans::oppPtTStart() const { + return fOppPtTStart; +} + +// out of line since this function is referenced by address +const SkOpPtT* SkCoincidentSpans::oppPtTEnd() const { + return fOppPtTEnd; +} + // A coincident span is unordered if the pairs of points in the main and opposite curves' // t values do not ascend or descend. For instance, if a tightly arced quadratic is // coincident with another curve, it may intersect it out of order. diff --git a/src/pathops/SkOpCoincidence.h b/src/pathops/SkOpCoincidence.h index 142fe4536b..e3be828eed 100644 --- a/src/pathops/SkOpCoincidence.h +++ b/src/pathops/SkOpCoincidence.h @@ -17,8 +17,8 @@ class SkOpSpanBase; class SkCoincidentSpans { public: - const SkOpPtT* coinPtTEnd() const { return fCoinPtTEnd; } - const SkOpPtT* coinPtTStart() const { return fCoinPtTStart; } + const SkOpPtT* coinPtTEnd() const; + const SkOpPtT* coinPtTStart() const; // These return non-const pointers so that, as copies, they can be added // to a new span pair @@ -67,8 +67,8 @@ public: SkCoincidentSpans* next() { return fNext; } const SkCoincidentSpans* next() const { return fNext; } SkCoincidentSpans** nextPtr() { return &fNext; } - const SkOpPtT* oppPtTStart() const { return fOppPtTStart; } - const SkOpPtT* oppPtTEnd() const { return fOppPtTEnd; } + const SkOpPtT* oppPtTStart() const; + const SkOpPtT* oppPtTEnd() const; // These return non-const pointers so that, as copies, they can be added // to a new span pair SkOpPtT* oppPtTStartWritable() const { return const_cast(fOppPtTStart); } -- cgit v1.2.3