From 783a4da10ba08187a5029d74cfa1507ac1b13307 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Thu, 19 Nov 2015 14:00:02 -0800 Subject: [PATCH] Add more batch information printouts Review URL: https://codereview.chromium.org/1457373003 --- src/gpu/GrAtlasTextContext.cpp | 16 +++++++++++++++ src/gpu/batches/GrAAFillRectBatch.cpp | 10 ++++++---- src/gpu/batches/GrNinePatch.cpp | 20 ++++++++++++++++++- src/gpu/batches/GrNonAAFillRectBatch.cpp | 10 ++++++---- src/gpu/batches/GrTInstanceBatch.h | 2 +- .../effects/GrXfermodeFragmentProcessor.cpp | 9 +++++++++ 6 files changed, 57 insertions(+), 10 deletions(-) diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp index 37fe092496..09190c495b 100644 --- a/src/gpu/GrAtlasTextContext.cpp +++ b/src/gpu/GrAtlasTextContext.cpp @@ -1335,6 +1335,22 @@ public: const char* name() const override { return "TextBatch"; } + SkString dumpInfo() const override { + SkString str; + + for (int i = 0; i < fGeoCount; ++i) { + str.appendf("%d: Color: 0x%08x Trans: %.2f,%.2f Runs: %d\n", + i, + fGeoData[i].fColor, + fGeoData[i].fTransX, + fGeoData[i].fTransY, + fGeoData[i].fBlob->fRunCount); + } + + str.append(INHERITED::dumpInfo()); + return str; + } + void getInvariantOutputColor(GrInitInvariantOutput* out) const override { if (kColorBitmapMask_MaskType == fMaskType) { out->setUnknownFourComponents(); diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp index 1b3f139a02..e2b088c541 100644 --- a/src/gpu/batches/GrAAFillRectBatch.cpp +++ b/src/gpu/batches/GrAAFillRectBatch.cpp @@ -217,9 +217,10 @@ public: static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; } - static SkString DumpInfo(const Geometry& geo) { + static SkString DumpInfo(const Geometry& geo, int index) { SkString str; - str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + index, geo.fColor, geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); return str; @@ -266,9 +267,10 @@ public: static const char* Name() { return "AAFillRectBatchLocalMatrix"; } - static SkString DumpInfo(const Geometry& geo) { + static SkString DumpInfo(const Geometry& geo, int index) { SkString str; - str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + index, geo.fColor, geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); return str; diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp index 4c6310ccd4..999e1fd156 100644 --- a/src/gpu/batches/GrNinePatch.cpp +++ b/src/gpu/batches/GrNinePatch.cpp @@ -54,7 +54,25 @@ public: geo.fViewMatrix.mapRect(&fBounds, geo.fDst); } - const char* name() const override { return "GrNonAANinePatchBatch"; } + const char* name() const override { return "NonAANinePatchBatch"; } + + SkString dumpInfo() const override { + SkString str; + + for (int i = 0; i < fGeoData.count(); ++i) { + str.appendf("%d: Color: 0x%08x Center [L: %d, T: %d, R: %d, B: %d], " + "Dst [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + i, + fGeoData[i].fColor, + fGeoData[i].fCenter.fLeft, fGeoData[i].fCenter.fTop, + fGeoData[i].fCenter.fRight, fGeoData[i].fCenter.fBottom, + fGeoData[i].fDst.fLeft, fGeoData[i].fDst.fTop, + fGeoData[i].fDst.fRight, fGeoData[i].fDst.fBottom); + } + + str.append(INHERITED::dumpInfo()); + return str; + } void getInvariantOutputColor(GrInitInvariantOutput* out) const override { out->setUnknownFourComponents(); diff --git a/src/gpu/batches/GrNonAAFillRectBatch.cpp b/src/gpu/batches/GrNonAAFillRectBatch.cpp index 3ad869bc9a..5f37741b46 100644 --- a/src/gpu/batches/GrNonAAFillRectBatch.cpp +++ b/src/gpu/batches/GrNonAAFillRectBatch.cpp @@ -124,9 +124,10 @@ public: static const char* Name() { return "NonAAFillRectBatch"; } - static SkString DumpInfo(const Geometry& geo) { + static SkString DumpInfo(const Geometry& geo, int index) { SkString str; - str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + index, geo.fColor, geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); return str; @@ -168,9 +169,10 @@ public: static const char* Name() { return "NonAAFillRectBatchPerspective"; } - static SkString DumpInfo(const Geometry& geo) { + static SkString DumpInfo(const Geometry& geo, int index) { SkString str; - str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n", + index, geo.fColor, geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect.fBottom); return str; diff --git a/src/gpu/batches/GrTInstanceBatch.h b/src/gpu/batches/GrTInstanceBatch.h index 86d85b616f..5dc5988e58 100644 --- a/src/gpu/batches/GrTInstanceBatch.h +++ b/src/gpu/batches/GrTInstanceBatch.h @@ -53,7 +53,7 @@ public: SkString dumpInfo() const override { SkString str; for (int i = 0; i < fGeoData.count(); ++i) { - str.append(Impl::DumpInfo(fGeoData[i])); + str.append(Impl::DumpInfo(fGeoData[i], i)); } str.append(INHERITED::dumpInfo()); return str; diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp index 3706c994b8..6ff4d32f06 100644 --- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp +++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp @@ -154,6 +154,15 @@ public: const char* name() const override { return "ComposeOne"; } + SkString dumpInfo() const override { + SkString str; + + for (int i = 0; i < this->numChildProcessors(); ++i) { + str.append(this->childProcessor(i).dumpInfo()); + } + return str; + } + void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { GR_STATIC_ASSERT((SkXfermode::kLastMode & SK_MaxU16) == SkXfermode::kLastMode); b->add32(fMode | (fChild << 16)); -- 2.34.1