| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrAuditTrail.h" | 8 #include "GrAuditTrail.h" |
| 9 #include "batches/GrBatch.h" | 9 #include "batches/GrBatch.h" |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 consumerBatch.fBounds = consumer->bounds(); | 81 consumerBatch.fBounds = consumer->bounds(); |
| 82 | 82 |
| 83 // remove the old node from our batchlist and clear the combinee's lookup | 83 // remove the old node from our batchlist and clear the combinee's lookup |
| 84 // NOTE: because we can't change the shape of the batchlist, we use a sentin
el | 84 // NOTE: because we can't change the shape of the batchlist, we use a sentin
el |
| 85 fBatchList[consumedIndex].reset(nullptr); | 85 fBatchList[consumedIndex].reset(nullptr); |
| 86 fIDLookup.remove(consumed->uniqueID()); | 86 fIDLookup.remove(consumed->uniqueID()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void GrAuditTrail::copyOutFromBatchList(BatchInfo* outBatchInfo, int batchListID
) { | 89 void GrAuditTrail::copyOutFromBatchList(BatchInfo* outBatchInfo, int batchListID
) { |
| 90 SkASSERT(batchListID < fBatchList.count()); | 90 SkASSERT(batchListID < fBatchList.count()); |
| 91 const BatchNode* bn = fBatchList[batchListID]; | 91 const BatchNode* bn = fBatchList[batchListID].get(); |
| 92 SkASSERT(bn); | 92 SkASSERT(bn); |
| 93 outBatchInfo->fBounds = bn->fBounds; | 93 outBatchInfo->fBounds = bn->fBounds; |
| 94 outBatchInfo->fRenderTargetUniqueID = bn->fRenderTargetUniqueID; | 94 outBatchInfo->fRenderTargetUniqueID = bn->fRenderTargetUniqueID; |
| 95 for (int j = 0; j < bn->fChildren.count(); j++) { | 95 for (int j = 0; j < bn->fChildren.count(); j++) { |
| 96 BatchInfo::Batch& outBatch = outBatchInfo->fBatches.push_back(); | 96 BatchInfo::Batch& outBatch = outBatchInfo->fBatches.push_back(); |
| 97 const Batch* currentBatch = bn->fChildren[j]; | 97 const Batch* currentBatch = bn->fChildren[j]; |
| 98 outBatch.fBounds = currentBatch->fBounds; | 98 outBatch.fBounds = currentBatch->fBounds; |
| 99 outBatch.fClientID = currentBatch->fClientID; | 99 outBatch.fClientID = currentBatch->fClientID; |
| 100 } | 100 } |
| 101 } | 101 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 SkString GrAuditTrail::BatchNode::toJson() const { | 290 SkString GrAuditTrail::BatchNode::toJson() const { |
| 291 SkString json; | 291 SkString json; |
| 292 json.append("{"); | 292 json.append("{"); |
| 293 json.appendf("\"RenderTarget\": \"%u\",", fRenderTargetUniqueID); | 293 json.appendf("\"RenderTarget\": \"%u\",", fRenderTargetUniqueID); |
| 294 skrect_to_json(&json, "Bounds", fBounds); | 294 skrect_to_json(&json, "Bounds", fBounds); |
| 295 JsonifyTArray(&json, "Batches", fChildren, true); | 295 JsonifyTArray(&json, "Batches", fChildren, true); |
| 296 json.append("}"); | 296 json.append("}"); |
| 297 return json; | 297 return json; |
| 298 } | 298 } |
| OLD | NEW |