aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-06-29 06:56:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-29 06:56:12 -0700
commit44fbc79e069c28103a44387d11c62e049ef2967d (patch)
tree331cfe06edcbfe640651d488ec546669c4aca3af /src/gpu
parent29ed2ae2daa843c8ef955df34b26e672c67b14f3 (diff)
Dump batch bounds and scissor rect
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/batches/GrBatch.h7
-rw-r--r--src/gpu/batches/GrClearBatch.h2
-rw-r--r--src/gpu/batches/GrCopySurfaceBatch.h1
-rw-r--r--src/gpu/batches/GrDiscardBatch.h1
-rw-r--r--src/gpu/batches/GrDrawBatch.h14
-rw-r--r--src/gpu/batches/GrDrawPathBatch.cpp2
-rw-r--r--src/gpu/batches/GrStencilPathBatch.h1
7 files changed, 27 insertions, 1 deletions
diff --git a/src/gpu/batches/GrBatch.h b/src/gpu/batches/GrBatch.h
index b26cdde73c..b0906ab690 100644
--- a/src/gpu/batches/GrBatch.h
+++ b/src/gpu/batches/GrBatch.h
@@ -118,7 +118,12 @@ public:
virtual uint32_t renderTargetUniqueID() const = 0;
/** 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 */
virtual GrRenderTarget* renderTarget() const = 0;
diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearBatch.h
index f2249cedb2..79e10ca167 100644
--- a/src/gpu/batches/GrClearBatch.h
+++ b/src/gpu/batches/GrClearBatch.h
@@ -36,6 +36,7 @@ public:
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,
fRenderTarget.get()->getUniqueID());
+ string.append(INHERITED::dumpInfo());
return string;
}
@@ -92,6 +93,7 @@ public:
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,
fRenderTarget.get());
+ string.append(INHERITED::dumpInfo());
return string;
}
diff --git a/src/gpu/batches/GrCopySurfaceBatch.h b/src/gpu/batches/GrCopySurfaceBatch.h
index 900bcf3fda..e0da431587 100644
--- a/src/gpu/batches/GrCopySurfaceBatch.h
+++ b/src/gpu/batches/GrCopySurfaceBatch.h
@@ -44,6 +44,7 @@ public:
"DPT:[X: %d, Y: %d]",
fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight,
fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY);
+ string.append(INHERITED::dumpInfo());
return string;
}
diff --git a/src/gpu/batches/GrDiscardBatch.h b/src/gpu/batches/GrDiscardBatch.h
index 3c19b68246..a739f23b7d 100644
--- a/src/gpu/batches/GrDiscardBatch.h
+++ b/src/gpu/batches/GrDiscardBatch.h
@@ -31,6 +31,7 @@ public:
SkString dumpInfo() const override {
SkString string;
string.printf("RT: %d", fRenderTarget.get()->getUniqueID());
+ string.append(INHERITED::dumpInfo());
return string;
}
diff --git a/src/gpu/batches/GrDrawBatch.h b/src/gpu/batches/GrDrawBatch.h
index bf93cf5a72..0386650380 100644
--- a/src/gpu/batches/GrDrawBatch.h
+++ b/src/gpu/batches/GrDrawBatch.h
@@ -100,6 +100,20 @@ public:
this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str());
}
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;
}
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp
index 751ddda4ea..b0f7d5e89c 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -22,6 +22,7 @@ void GrDrawPathBatchBase::onPrepare(GrBatchFlushState*) {
SkString GrDrawPathBatch::dumpInfo() const {
SkString string;
string.printf("PATH: 0x%p", fPath.get());
+ string.append(INHERITED::dumpInfo());
return string;
}
@@ -43,6 +44,7 @@ SkString GrDrawPathRangeBatch::dumpInfo() const {
}
string.remove(string.size() - 2, 2);
string.append("]");
+ string.append(INHERITED::dumpInfo());
return string;
}
diff --git a/src/gpu/batches/GrStencilPathBatch.h b/src/gpu/batches/GrStencilPathBatch.h
index 05b55efafa..42cd3e9f93 100644
--- a/src/gpu/batches/GrStencilPathBatch.h
+++ b/src/gpu/batches/GrStencilPathBatch.h
@@ -39,6 +39,7 @@ public:
SkString dumpInfo() const override {
SkString string;
string.printf("PATH: 0x%p, AA:%d", fPath.get(), fUseHWAA);
+ string.append(INHERITED::dumpInfo());
return string;
}