diff options
author | Cary Clark <caryclark@google.com> | 2016-12-15 09:17:31 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-15 14:49:46 +0000 |
commit | db8f44f497f2b67b2500bbfc7b11ce7a510c5e5c (patch) | |
tree | bd99891e750d01c40a04d92daeb9fb67b25f09b3 /src/pathops | |
parent | fc527d27641bb693a0a7703ba9d35100f7500fd7 (diff) |
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 <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/pathops')
-rw-r--r-- | src/pathops/SkOpCoincidence.cpp | 20 | ||||
-rw-r--r-- | src/pathops/SkOpCoincidence.h | 8 |
2 files changed, 24 insertions, 4 deletions
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<SkOpPtT*>(fOppPtTStart); } |