Index: tools/skiaserve/Request.cpp |
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp |
index bcaebde01f518e756c4da1a1f0be480601e4e047..4d256d56d87260af82172ad0cdeb87a408f9f278 100644 |
--- a/tools/skiaserve/Request.cpp |
+++ b/tools/skiaserve/Request.cpp |
@@ -138,36 +138,12 @@ |
return true; |
} |
-GrAuditTrail* Request::getAuditTrail(SkCanvas* canvas) { |
- GrAuditTrail* at = nullptr; |
-#if SK_SUPPORT_GPU |
- GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
- if (rt) { |
- GrContext* ctx = rt->getContext(); |
- if (ctx) { |
- at = ctx->getAuditTrail(); |
- } |
- } |
-#endif |
- return at; |
-} |
- |
-void Request::cleanupAuditTrail(SkCanvas* canvas) { |
- GrAuditTrail* at = this->getAuditTrail(canvas); |
- if (at) { |
- GrAuditTrail::AutoEnable ae(at); |
- at->fullReset(); |
- } |
-} |
- |
SkData* Request::getJsonOps(int n) { |
SkCanvas* canvas = this->getCanvas(); |
Json::Value root = fDebugCanvas->toJSON(fUrlDataManager, n, canvas); |
root["mode"] = Json::Value(fGPUEnabled ? "gpu" : "cpu"); |
SkDynamicMemoryWStream stream; |
stream.writeText(Json::FastWriter().write(root).c_str()); |
- |
- this->cleanupAuditTrail(canvas); |
return stream.copyToData(); |
} |
@@ -180,7 +156,11 @@ |
// a Json::Value and is only compiled in this file |
Json::Value parsedFromString; |
#if SK_SUPPORT_GPU |
- GrAuditTrail* at = this->getAuditTrail(canvas); |
+ GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget(); |
+ SkASSERT(rt); |
+ GrContext* ctx = rt->getContext(); |
+ SkASSERT(ctx); |
+ GrAuditTrail* at = ctx->getAuditTrail(); |
GrAuditTrail::AutoManageBatchList enable(at); |
fDebugCanvas->drawTo(canvas, n); |