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

Unified Diff: tools/debugger/SkDebugCanvas.cpp

Issue 1755563003: add /img/n/m endpoint to skiaserve (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: tweak Created 4 years, 10 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 | « tools/debugger/SkDebugCanvas.h ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/debugger/SkDebugCanvas.cpp
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index 713ac39cfa394d4b52d0558c6fccc7b84adb782b..5180d712a042abc089626fdc08bd27285659e237 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();
@@ -339,7 +339,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);
« no previous file with comments | « tools/debugger/SkDebugCanvas.h ('k') | tools/skiaserve/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698