Dump batch bounds and scissor rect
authorrobertphillips <robertphillips@google.com>
Wed, 29 Jun 2016 13:56:12 +0000 (06:56 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 29 Jun 2016 13:56:12 +0000 (06:56 -0700)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2108503004

Review-Url: https://codereview.chromium.org/2108503004

src/gpu/batches/GrBatch.h
src/gpu/batches/GrClearBatch.h
src/gpu/batches/GrCopySurfaceBatch.h
src/gpu/batches/GrDiscardBatch.h
src/gpu/batches/GrDrawBatch.h
src/gpu/batches/GrDrawPathBatch.cpp
src/gpu/batches/GrStencilPathBatch.h

index b26cdde73c98603d0b1fbe93dcc34642ae87b558..b0906ab690dbc51b7fb9409f35a9d590d693e699 100644 (file)
@@ -118,7 +118,12 @@ public:
     virtual uint32_t renderTargetUniqueID() const = 0;
 
     /** Used for spewing information about batches when debugging. */
-    virtual SkString dumpInfo() const = 0;
+    virtual SkString dumpInfo() const {
+        SkString string;
+        string.appendf("BatchBounds: [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n",
+                       fBounds.fLeft, fBounds.fTop, fBounds.fRight, fBounds.fBottom);
+        return string;
+    }
 
     /** Can remove this when multi-draw-buffer lands */
     virtual GrRenderTarget* renderTarget() const = 0;
index f2249cedb2f126c1dfc3df1f16cc4b3ec9201bb3..79e10ca167ea881609d2c42c69c1f3fbcc78301a 100644 (file)
@@ -36,6 +36,7 @@ public:
         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()->getUniqueID());
+        string.append(INHERITED::dumpInfo());
         return string;
     }
 
@@ -92,6 +93,7 @@ public:
         string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p",
                       fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fInsideClip,
                       fRenderTarget.get());
+        string.append(INHERITED::dumpInfo());
         return string;
     }
 
index 900bcf3fda9d3e728e94f88f028f9f11b08553a5..e0da431587e65f8f491e4e70c0190b957e1b774f 100644 (file)
@@ -44,6 +44,7 @@ public:
                       "DPT:[X: %d, Y: %d]",
                       fDst.get(), fSrc.get(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight,
                       fSrcRect.fBottom, fDstPoint.fX, fDstPoint.fY);
+        string.append(INHERITED::dumpInfo());
         return string;
     }
 
index 3c19b682465797ad75babf65d5aa2b3fadbda0a6..a739f23b7dbbc4ad11ed4cc1ba401ec560238fca 100644 (file)
@@ -31,6 +31,7 @@ public:
     SkString dumpInfo() const override {
         SkString string;
         string.printf("RT: %d", fRenderTarget.get()->getUniqueID());
+        string.append(INHERITED::dumpInfo());
         return string;
     }
 
index bf93cf5a72115f2a2df4734e361d3cfdeacfcee8..038665038094977163ec74f815c6b3d5ee8a49dd 100644 (file)
@@ -100,6 +100,20 @@ public:
                            this->pipeline()->getCoverageFragmentProcessor(i).dumpInfo().c_str());
         }
         string.appendf("XP: %s\n", this->pipeline()->getXferProcessor().name());
+
+        bool scissorEnabled = this->pipeline()->getScissorState().enabled();
+        string.appendf("Scissor: ");
+        if (scissorEnabled) {
+            string.appendf("[L: %d, T: %d, R: %d, B: %d]\n",
+                           this->pipeline()->getScissorState().rect().fLeft,
+                           this->pipeline()->getScissorState().rect().fTop,
+                           this->pipeline()->getScissorState().rect().fRight,
+                           this->pipeline()->getScissorState().rect().fBottom);
+        } else {
+            string.appendf("<disabled>\n");
+        }
+        string.append(INHERITED::dumpInfo());
+
         return string;
     }
 
index 751ddda4eae9f47f8f0350dc67c9083485d5b968..b0f7d5e89c7790d4de85ce094133fae255f1031a 100644 (file)
@@ -22,6 +22,7 @@ void GrDrawPathBatchBase::onPrepare(GrBatchFlushState*) {
 SkString GrDrawPathBatch::dumpInfo() const {
     SkString string;
     string.printf("PATH: 0x%p", fPath.get());
+    string.append(INHERITED::dumpInfo());
     return string;
 }
 
@@ -43,6 +44,7 @@ SkString GrDrawPathRangeBatch::dumpInfo() const {
     }
     string.remove(string.size() - 2, 2);
     string.append("]");
+    string.append(INHERITED::dumpInfo());
     return string;
 }
 
index 05b55efafa37142f3927522bf132d9732d4e7601..42cd3e9f9326f4302a500c739bc75244ae62deab 100644 (file)
@@ -39,6 +39,7 @@ public:
     SkString dumpInfo() const override {
         SkString string;
         string.printf("PATH: 0x%p, AA:%d", fPath.get(), fUseHWAA);
+        string.append(INHERITED::dumpInfo());
         return string;
     }