aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrContext.cpp1
-rw-r--r--src/gpu/GrDrawTarget.cpp28
-rw-r--r--src/gpu/GrDrawTarget.h6
3 files changed, 35 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index f05d8e6614..5d998f8a10 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -100,6 +100,7 @@ void GrDrawingManager::flush() {
SkASSERT(result);
for (int i = 0; i < fDrawTargets.count(); ++i) {
+ //SkDEBUGCODE(fDrawTargets[i]->dump();)
fDrawTargets[i]->flush();
}
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 7f84f8efd1..f42ee111ce 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -42,6 +42,11 @@ GrDrawTarget::GrDrawTarget(GrGpu* gpu, GrResourceProvider* resourceProvider)
// TODO: Stop extracting the context (currently needed by GrClipMaskManager)
fContext = fGpu->getContext();
fClipMaskManager.reset(new GrClipMaskManager(this));
+
+#ifdef SK_DEBUG
+ static int debugID = 0;
+ fDebugID = debugID++;
+#endif
}
GrDrawTarget::~GrDrawTarget() {
@@ -79,6 +84,29 @@ void GrDrawTarget::addDependency(GrSurface* dependedOn) {
}
}
+#ifdef SK_DEBUG
+void GrDrawTarget::dump() const {
+ SkDebugf("--------------------------------------------------------------\n");
+ SkDebugf("node: %d\n");
+ SkDebugf("relies On (%d): ", fDependencies.count());
+ for (int i = 0; i < fDependencies.count(); ++i) {
+ SkDebugf("%d, ", fDependencies[i]->fDebugID);
+ }
+ SkDebugf("\n");
+ SkDebugf("batches (%d):\n", fBatches.count());
+ for (int i = 0; i < fBatches.count(); ++i) {
+#if 0
+ SkDebugf("*******************************\n");
+#endif
+ SkDebugf("%d: %s\n", i, fBatches[i]->name());
+#if 0
+ SkString str = fBatches[i]->dumpInfo();
+ SkDebugf("%s\n", str.c_str());
+#endif
+ }
+}
+#endif
+
bool GrDrawTarget::setupDstReadIfNecessary(const GrPipelineBuilder& pipelineBuilder,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 925c03e741..ec94da1f0e 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -70,6 +70,11 @@ public:
return fDependencies.find(dependedOn) >= 0;
}
+ /*
+ * Dump out the drawTarget dependency DAG
+ */
+ SkDEBUGCODE(void dump() const;)
+
/**
* Empties the draw buffer of any queued up draws.
*/
@@ -304,6 +309,7 @@ private:
bool fFlushing;
int fFirstUnpreparedBatch;
+ SkDEBUGCODE(int fDebugID;)
uint32_t fFlags;
// 'this' drawTarget relies on the output of the drawTargets in 'fDependencies'