Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 1416753002: Add debugging helper to GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@mdb-adddeps
Patch Set: Renamed GrDrawTarget::print to dump Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 7f84f8efd11888334cc9d6578d9a82624cf5dd7c..f42ee111ce351b1b6e26190581849dcca1cbd579 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,
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698