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

Unified Diff: src/gpu/GrAuditTrail.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 | « include/private/GrAuditTrail.h ('k') | tools/debugger/SkDebugCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAuditTrail.cpp
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp
index d46387315eba1f0dbbeaab7f28a6700a2593653e..568b8789c38c303c61a88f325c059576ef599b37 100644
--- a/src/gpu/GrAuditTrail.cpp
+++ b/src/gpu/GrAuditTrail.cpp
@@ -67,6 +67,19 @@ void GrAuditTrail::batchingResultNew(GrBatch* batch) {
fBatchList.emplace_back(batchNode);
}
+void GrAuditTrail::copyOutFromBatchList(BatchInfo* outBatchInfo, int batchListID) {
+ SkASSERT(batchListID < fBatchList.count());
+ const BatchNode* bn = fBatchList[batchListID];
+ outBatchInfo->fBounds = bn->fBounds;
+ outBatchInfo->fRenderTargetUniqueID = bn->fRenderTargetUniqueID;
+ for (int j = 0; j < bn->fChildren.count(); j++) {
+ BatchInfo::Batch& outBatch = outBatchInfo->fBatches.push_back();
+ const Batch* currentBatch = bn->fChildren[j];
+ outBatch.fBounds = currentBatch->fBounds;
+ outBatch.fClientID = currentBatch->fClientID;
+ }
+}
+
void GrAuditTrail::getBoundsByClientID(SkTArray<BatchInfo>* outInfo, int clientID) {
Batches** batchesLookup = fClientIDLookup.find(clientID);
if (batchesLookup) {
@@ -83,24 +96,19 @@ void GrAuditTrail::getBoundsByClientID(SkTArray<BatchInfo>* outInfo, int clientI
if (kGrAuditTrailInvalidID == currentBatchListID ||
batch->fBatchListID != currentBatchListID) {
BatchInfo& outBatchInfo = outInfo->push_back();
- currentBatchListID = batch->fBatchListID;
// copy out all of the batches so the client can display them even if
// they have a different clientID
- const BatchNode* bn = fBatchList[currentBatchListID];
- outBatchInfo.fBounds = bn->fBounds;
- outBatchInfo.fRenderTargetUniqueID = bn->fRenderTargetUniqueID;
- for (int j = 0; j < bn->fChildren.count(); j++) {
- BatchInfo::Batch& outBatch = outBatchInfo.fBatches.push_back();
- const Batch* currentBatch = bn->fChildren[j];
- outBatch.fBounds = currentBatch->fBounds;
- outBatch.fClientID = currentBatch->fClientID;
- }
+ this->copyOutFromBatchList(&outBatchInfo, batch->fBatchListID);
}
}
}
}
+void GrAuditTrail::getBoundsByBatchListID(BatchInfo* outInfo, int batchListID) {
+ this->copyOutFromBatchList(outInfo, batchListID);
+}
+
void GrAuditTrail::fullReset() {
SkASSERT(fEnabled);
fBatchList.reset();
« no previous file with comments | « include/private/GrAuditTrail.h ('k') | tools/debugger/SkDebugCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698