Print out failing PathRef test on ChromeOS

This is intended to provide additional information for a flaky assertion failure on ChromeOS Daisy.

BUG=skia:3282

Review URL: https://codereview.chromium.org/821683002
This commit is contained in:
robertphillips 2015-01-05 09:20:04 -08:00 committed by Commit bot
parent 50b9307e96
commit f1cdead599

View File

@ -452,6 +452,21 @@ void SkPathRef::validate() const {
if (!fBoundsIsDirty && !fBounds.isEmpty()) { if (!fBoundsIsDirty && !fBounds.isEmpty()) {
bool isFinite = true; bool isFinite = true;
for (int i = 0; i < fPointCnt; ++i) { for (int i = 0; i < fPointCnt; ++i) {
#ifdef SK_DEBUG
if (fPoints[i].isFinite() &&
(fPoints[i].fX < fBounds.fLeft || fPoints[i].fX > fBounds.fRight ||
fPoints[i].fY < fBounds.fTop || fPoints[i].fY > fBounds.fBottom)) {
SkDebugf("bounds: %f %f %f %f\n",
fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBottom);
for (int j = 0; j < fPointCnt; ++j) {
if (i == j) {
SkDebugf("*");
}
SkDebugf("%f %f\n", fPoints[j].fX, fPoints[j].fY);
}
}
#endif
SkASSERT(!fPoints[i].isFinite() || SkASSERT(!fPoints[i].isFinite() ||
(fPoints[i].fX >= fBounds.fLeft && fPoints[i].fX <= fBounds.fRight && (fPoints[i].fX >= fBounds.fLeft && fPoints[i].fX <= fBounds.fRight &&
fPoints[i].fY >= fBounds.fTop && fPoints[i].fY <= fBounds.fBottom)); fPoints[i].fY >= fBounds.fTop && fPoints[i].fY <= fBounds.fBottom));