diff options
Diffstat (limited to 'tools/debugger')
-rw-r--r-- | tools/debugger/SkDebugCanvas.cpp | 11 | ||||
-rw-r--r-- | tools/debugger/SkDebugCanvas.h | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp index dc529a4d89..a58db14d7d 100644 --- a/tools/debugger/SkDebugCanvas.cpp +++ b/tools/debugger/SkDebugCanvas.cpp @@ -196,7 +196,7 @@ void SkDebugCanvas::markActiveCommands(int index) { } -void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) { +void SkDebugCanvas::drawTo(SkCanvas* canvas, int index, int m) { SkASSERT(!fCommandVector.isEmpty()); SkASSERT(index < fCommandVector.count()); @@ -228,7 +228,7 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) { #if SK_SUPPORT_GPU GrAuditTrail* at = nullptr; GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); - if (rt && fDrawGpuBatchBounds) { + if (rt && (fDrawGpuBatchBounds || m != -1)) { GrContext* ctx = rt->getContext(); if (ctx) { at = ctx->getAuditTrail(); @@ -344,7 +344,12 @@ void SkDebugCanvas::drawTo(SkCanvas* canvas, int index) { // get the bounding boxes to draw GrAuditTrail::AutoEnable ae(at); SkTArray<GrAuditTrail::BatchInfo> childrenBounds; - at->getBoundsByClientID(&childrenBounds, index); + if (m == -1) { + at->getBoundsByClientID(&childrenBounds, index); + } else { + // the client wants us to draw the mth batch + at->getBoundsByBatchListID(&childrenBounds.push_back(), m); + } SkPaint paint; paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeWidth(1); diff --git a/tools/debugger/SkDebugCanvas.h b/tools/debugger/SkDebugCanvas.h index d81d471970..7379698f20 100644 --- a/tools/debugger/SkDebugCanvas.h +++ b/tools/debugger/SkDebugCanvas.h @@ -68,8 +68,9 @@ public: Executes the draw calls up to the specified index. @param canvas The canvas being drawn to @param index The index of the final command being executed + @param m an optional Mth gpu batch to highlight, or -1 */ - void drawTo(SkCanvas* canvas, int index); + void drawTo(SkCanvas* canvas, int index, int m = -1); /** Returns the most recently calculated transformation matrix |