aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAuditTrail.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2016-03-02 08:32:37 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-02 08:32:37 -0800
commit46b301d2222b60dd5ab495b917dea163e8be94ef (patch)
treeee476586e0a78df4bae5223ae9ec459d97241d9f /src/gpu/GrAuditTrail.cpp
parent89bd99bed85083c736390f3e340fd30be350d461 (diff)
add /img/n/m endpoint to skiaserve
Diffstat (limited to 'src/gpu/GrAuditTrail.cpp')
-rw-r--r--src/gpu/GrAuditTrail.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gpu/GrAuditTrail.cpp b/src/gpu/GrAuditTrail.cpp
index cf5c510536..752074de9c 100644
--- a/src/gpu/GrAuditTrail.cpp
+++ b/src/gpu/GrAuditTrail.cpp
@@ -71,6 +71,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) {
@@ -87,24 +100,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();