aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-10-20 07:50:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-10-20 07:50:00 -0700
commit4beb5c117b355599e2fd26b8b3d19de99512cb69 (patch)
tree6b7dbe56a6d85706acae9db33df06e47f5984b41 /src/gpu/GrDrawTarget.cpp
parent4dfdbb19ba861bbd5e1a306bb23f32464ea5e2c5 (diff)
Add debugging helper to GrDrawTarget
This CL relies on https://codereview.chromium.org/1414773002/ (Add the machinery to GrDrawTarget to enable topological sorting) BUG=skia:4094 Review URL: https://codereview.chromium.org/1416753002
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp28
1 files changed, 28 insertions, 0 deletions
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,