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

Unified Diff: tools/skiaserve/Request.cpp

Issue 1750653002: Fixup some of the batch info in skiaserve (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: tweaks 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skiaserve/Request.cpp
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 98b3b030c6953ad6841c3ba48915e600a940ff19..a893d0a1ddfe7fdc837da3776a0d9530285235ef 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -149,6 +149,9 @@ bool Request::initPictureFromStream(SkStream* stream) {
// pour picture into debug canvas
fDebugCanvas.reset(new SkDebugCanvas(kImageWidth, Request::kImageHeight));
fDebugCanvas->drawPicture(fPicture);
+
+ // for some reason we need to 'flush' the debug canvas by drawing all of the ops
+ fDebugCanvas->drawTo(this->getCanvas(), this->getLastOp());
return true;
}
@@ -194,13 +197,14 @@ SkData* Request::getJsonBatchList(int n) {
// a Json::Value and is only compiled in this file
Json::Value parsedFromString;
#if SK_SUPPORT_GPU
+ // we use the toJSON method on debug canvas, but then just ignore the results and pull
+ // the information we care about from the audit trail
+ fDebugCanvas->toJSON(fUrlDataManager, n, canvas);
+
GrAuditTrail* at = this->getAuditTrail(canvas);
GrAuditTrail::AutoManageBatchList enable(at);
-
- fDebugCanvas->drawTo(canvas, n);
-
Json::Reader reader;
- SkDEBUGCODE(bool parsingSuccessful = )reader.parse(at->toJson(true).c_str(),
+ SkDEBUGCODE(bool parsingSuccessful = )reader.parse(at->toJson().c_str(),
parsedFromString);
SkASSERT(parsingSuccessful);
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698