diff options
author | 2015-11-16 09:06:59 -0800 | |
---|---|---|
committer | 2015-11-16 09:06:59 -0800 | |
commit | e004bfc0a5e28cc083158f1a75e981ffd58a8134 (patch) | |
tree | 77ac623a0e5b6264d4933ae53da831e7220bfbf7 /src/gpu/batches | |
parent | a7a21cffe1d56d52bac9accd05001e9c970e76f3 (diff) |
Increase the amount of debug information printed out by batches
Untangling MDB bugs requires more information. In particular the render targets.
BUG=skia:4094
TBR=bsalomon@google.com
Review URL: https://codereview.chromium.org/1443763002
Diffstat (limited to 'src/gpu/batches')
-rw-r--r-- | src/gpu/batches/GrAAFillRectBatch.cpp | 16 | ||||
-rw-r--r-- | src/gpu/batches/GrClearBatch.h | 4 | ||||
-rw-r--r-- | src/gpu/batches/GrDiscardBatch.h | 2 | ||||
-rw-r--r-- | src/gpu/batches/GrDrawBatch.h | 9 | ||||
-rw-r--r-- | src/gpu/batches/GrNonAAFillRectBatch.cpp | 16 | ||||
-rw-r--r-- | src/gpu/batches/GrTInstanceBatch.h | 9 |
6 files changed, 51 insertions, 5 deletions
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp index 964610788d..1b3f139a02 100644 --- a/src/gpu/batches/GrAAFillRectBatch.cpp +++ b/src/gpu/batches/GrAAFillRectBatch.cpp @@ -217,6 +217,14 @@ public: static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; } + static SkString DumpInfo(const Geometry& geo) { + SkString str; + str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + geo.fColor, + geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); + return str; + } + static bool CanCombine(const Geometry& mine, const Geometry& theirs, const GrPipelineOptimizations& opts) { // We apply the viewmatrix to the rect points on the cpu. However, if the pipeline uses @@ -258,6 +266,14 @@ public: static const char* Name() { return "AAFillRectBatchLocalMatrix"; } + static SkString DumpInfo(const Geometry& geo) { + SkString str; + str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + geo.fColor, + geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); + return str; + } + static bool CanCombine(const Geometry& mine, const Geometry& theirs, const GrPipelineOptimizations&) { return true; diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearBatch.h index b973dab557..944485ca7e 100644 --- a/src/gpu/batches/GrClearBatch.h +++ b/src/gpu/batches/GrClearBatch.h @@ -31,9 +31,9 @@ public: SkString dumpInfo() const override { SkString string; - string.printf("Color: 0x%08x, Rect [L: %d, T: %d, R: %d, B: %d], RT: 0x%p", + 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()); + fRenderTarget.get()->getUniqueID()); return string; } diff --git a/src/gpu/batches/GrDiscardBatch.h b/src/gpu/batches/GrDiscardBatch.h index c13e7327d7..aa443cf603 100644 --- a/src/gpu/batches/GrDiscardBatch.h +++ b/src/gpu/batches/GrDiscardBatch.h @@ -29,7 +29,7 @@ public: SkString dumpInfo() const override { SkString string; - string.printf("RT: 0x%p", fRenderTarget.get()); + string.printf("RT: %d", fRenderTarget.get()->getUniqueID()); return string; } diff --git a/src/gpu/batches/GrDrawBatch.h b/src/gpu/batches/GrDrawBatch.h index 93326efad2..b5def697c7 100644 --- a/src/gpu/batches/GrDrawBatch.h +++ b/src/gpu/batches/GrDrawBatch.h @@ -63,13 +63,18 @@ public: SkString dumpInfo() const override { SkString string; + string.appendf("RT: %d\n", this->renderTargetUniqueID()); string.append("ColorStages:\n"); for (int i = 0; i < this->pipeline()->numColorFragmentProcessors(); i++) { - string.appendf("\t\t%s\n", this->pipeline()->getColorFragmentProcessor(i).name()); + string.appendf("\t\t%s\n\t\t%s\n", + this->pipeline()->getColorFragmentProcessor(i).name(), + this->pipeline()->getColorFragmentProcessor(i).dumpInfo().c_str()); } string.append("CoverageStages:\n"); for (int i = 0; i < this->pipeline()->numCoverageFragmentProcessors(); i++) { - string.appendf("\t%s\n", this->pipeline()->getCoverageFragmentProcessor(i).name()); + string.appendf("\t\t%s\n\t\t%s\n", + this->pipeline()->getCoverageFragmentProcessor(i).name(), + this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str()); } string.appendf("XP: %s\n", this->pipeline()->getXferProcessor()->name()); return string; diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp index 545bfdc973..3ad869bc9a 100644 --- a/src/gpu/batches/GrNonAAFillRectBatch.cpp +++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp @@ -124,6 +124,14 @@ public: static const char* Name() { return "NonAAFillRectBatch"; } + static SkString DumpInfo(const Geometry& geo) { + SkString str; + str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + geo.fColor, + geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); + return str; + } + static bool CanCombine(const Geometry& mine, const Geometry& theirs, const GrPipelineOptimizations& opts) { return true; @@ -160,6 +168,14 @@ public: static const char* Name() { return "NonAAFillRectBatchPerspective"; } + static SkString DumpInfo(const Geometry& geo) { + SkString str; + str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + geo.fColor, + geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); + return str; + } + static bool CanCombine(const Geometry& mine, const Geometry& theirs, const GrPipelineOptimizations& opts) { // We could batch across perspective vm changes if we really wanted to diff --git a/src/gpu/batches/GrTInstanceBatch.h b/src/gpu/batches/GrTInstanceBatch.h index b4bc0c084f..86d85b616f 100644 --- a/src/gpu/batches/GrTInstanceBatch.h +++ b/src/gpu/batches/GrTInstanceBatch.h @@ -50,6 +50,15 @@ public: const char* name() const override { return Impl::Name(); } + SkString dumpInfo() const override { + SkString str; + for (int i = 0; i < fGeoData.count(); ++i) { + str.append(Impl::DumpInfo(fGeoData[i])); + } + str.append(INHERITED::dumpInfo()); + return str; + } + void getInvariantOutputColor(GrInitInvariantOutput* out) const override { // When this is called on a batch, there is only one geometry bundle out->setKnownFourComponents(fGeoData[0].fColor); |