Dump batch bounds and scissor rect

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2108503004

Review-Url: https://codereview.chromium.org/2108503004
This commit is contained in:
robertphillips 2016-06-29 06:56:12 -07:00 committed by Commit bot
parent 29ed2ae2da
commit 44fbc79e06
7 changed files with 27 additions and 1 deletions

View File

@ -118,7 +118,12 @@ public:
virtual uint32_t renderTargetUniqueID() const = 0; virtual uint32_t renderTargetUniqueID() const = 0;
/** Used for spewing information about batches when debugging. */ /** Used for spewing information about batches when debugging. */
virtual SkString dumpInfo() const = 0; virtual SkString dumpInfo() const {
SkString string;
string.appendf("BatchBounds: [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n",
fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBottom);
return string;
}
/** Can remove this when multi-draw-buffer lands */ /** Can remove this when multi-draw-buffer lands */
virtual GrRenderTarget* renderTarget() const = 0; virtual GrRenderTarget* renderTarget() const = 0;

View File

@ -36,6 +36,7 @@ public:
string.printf("Color: 0x%08x, Rect [L: %d, T: %d, R: %d, B: %d], RT: %d", string.printf("Color: 0x%08x, Rect [L: %d, T: %d, R: %d, B: %d], RT: %d",
fColor, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fColor, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom,
fRenderTarget.get()->getUniqueID()); fRenderTarget.get()->getUniqueID());
string.append(INHERITED::dumpInfo());
return string; return string;
} }
@ -92,6 +93,7 @@ public:
string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p", string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p",
fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fInsideClip, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fInsideClip,
fRenderTarget.get()); fRenderTarget.get());
string.append(INHERITED::dumpInfo());
return string; return string;
} }

View File

@ -44,6 +44,7 @@ public:
"DPT:[X: %d, Y: %d]", "DPT:[X: %d, Y: %d]",
fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight,
fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY); fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY);
string.append(INHERITED::dumpInfo());
return string; return string;
} }

View File

@ -31,6 +31,7 @@ public:
SkString dumpInfo() const override { SkString dumpInfo() const override {
SkString string; SkString string;
string.printf("RT: %d", fRenderTarget.get()->getUniqueID()); string.printf("RT: %d", fRenderTarget.get()->getUniqueID());
string.append(INHERITED::dumpInfo());
return string; return string;
} }

View File

@ -100,6 +100,20 @@ public:
this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str()); this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str());
} }
string.appendf("XP: %s\n", this->pipeline()->getXferProcessor().name()); string.appendf("XP: %s\n", this->pipeline()->getXferProcessor().name());
bool scissorEnabled = this->pipeline()->getScissorState().enabled();
string.appendf("Scissor: ");
if (scissorEnabled) {
string.appendf("[L: %d, T: %d, R: %d, B: %d]\n",
this->pipeline()->getScissorState().rect().fLeft,
this->pipeline()->getScissorState().rect().fTop,
this->pipeline()->getScissorState().rect().fRight,
this->pipeline()->getScissorState().rect().fBottom);
} else {
string.appendf("<disabled>\n");
}
string.append(INHERITED::dumpInfo());
return string; return string;
} }

View File

@ -22,6 +22,7 @@ void GrDrawPathBatchBase::onPrepare(GrBatchFlushState*) {
SkString GrDrawPathBatch::dumpInfo() const { SkString GrDrawPathBatch::dumpInfo() const {
SkString string; SkString string;
string.printf("PATH: 0x%p", fPath.get()); string.printf("PATH: 0x%p", fPath.get());
string.append(INHERITED::dumpInfo());
return string; return string;
} }
@ -43,6 +44,7 @@ SkString GrDrawPathRangeBatch::dumpInfo() const {
} }
string.remove(string.size() - 2, 2); string.remove(string.size() - 2, 2);
string.append("]"); string.append("]");
string.append(INHERITED::dumpInfo());
return string; return string;
} }

View File

@ -39,6 +39,7 @@ public:
SkString dumpInfo() const override { SkString dumpInfo() const override {
SkString string; SkString string;
string.printf("PATH: 0x%p, AA:%d", fPath.get(), fUseHWAA); string.printf("PATH: 0x%p, AA:%d", fPath.get(), fUseHWAA);
string.append(INHERITED::dumpInfo());
return string; return string;
} }