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

Unified Diff: src/pathops/SkPathOpsTSect.h

Issue 1097293002: fix valgrind uninitialized var error (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/SkPathOpsTSect.h
diff --git a/src/pathops/SkPathOpsTSect.h b/src/pathops/SkPathOpsTSect.h
index ffd69951d3f5fc5af6d9aa33dd1fe30e27929d6b..4cf5978d9511aed3fb9ec6306552f16cdb302fe2 100644
--- a/src/pathops/SkPathOpsTSect.h
+++ b/src/pathops/SkPathOpsTSect.h
@@ -16,17 +16,7 @@ template<typename TCurve, typename OppCurve>
class SkTCoincident {
public:
SkTCoincident() {
- this->clear();
- }
-
- void clear() {
- fPerpT = -1;
- fCoincident = false;
- }
-
- void debugInit() {
- this->clear();
- fPerpPt.fX = fPerpPt.fY = SK_ScalarNaN;
+ this->init();
}
void dump() const;
@@ -36,8 +26,9 @@ public:
}
void init() {
- this->clear();
- SkDEBUGCODE(fPerpPt.fX = fPerpPt.fY = SK_ScalarNaN);
+ fPerpT = -1;
+ fCoincident = false;
+ fPerpPt.fX = fPerpPt.fY = SK_ScalarNaN;
}
void markCoincident() {
@@ -85,8 +76,8 @@ public:
dummy.debugInit();
init(dummy);
initBounds(dummy);
- fCoinStart.debugInit();
- fCoinEnd.debugInit();
+ fCoinStart.init();
+ fCoinEnd.init();
}
const SkTSect<OppCurve, TCurve>* debugOpp() const;
@@ -329,7 +320,7 @@ void SkTCoincident<TCurve, OppCurve>::setPerp(const TCurve& c1, double t,
int used = i.intersectRay(c2, perp);
// only keep closest
if (used == 0 || used == 3) {
- this->clear();
+ this->init();
return;
}
fPerpT = i[0][0];
@@ -993,7 +984,7 @@ void SkTSect<TCurve, OppCurve>::computePerpendiculars(SkTSect<OppCurve, TCurve>*
if (work->fCoinStart.isCoincident()) {
double perpT = work->fCoinStart.perpT();
if (sect2->coincidentHasT(perpT)) {
- work->fCoinStart.clear();
+ work->fCoinStart.init();
} else {
sect2->addForPerp(work, perpT);
}
@@ -1002,7 +993,7 @@ void SkTSect<TCurve, OppCurve>::computePerpendiculars(SkTSect<OppCurve, TCurve>*
if (work->fCoinEnd.isCoincident()) {
double perpT = work->fCoinEnd.perpT();
if (sect2->coincidentHasT(perpT)) {
- work->fCoinEnd.clear();
+ work->fCoinEnd.init();
} else {
sect2->addForPerp(work, perpT);
}
« 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