Skip batch iteration in GrDrawTarget::forwardCombine when the max look ahead is 0
authorbsalomon <bsalomon@google.com>
Mon, 29 Aug 2016 19:43:27 +0000 (12:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 29 Aug 2016 19:43:28 +0000 (12:43 -0700)
TBR=robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288373002

Review-Url: https://codereview.chromium.org/2288373002

src/gpu/GrDrawTarget.cpp

index 1889b87..dc2fd30 100644 (file)
@@ -571,6 +571,9 @@ GrBatch* GrDrawTarget::recordBatch(GrBatch* batch, const SkRect& clippedBounds)
 }
 
 void GrDrawTarget::forwardCombine() {
+    if (fMaxBatchLookahead <= 0) {
+        return;
+    }
     for (int i = 0; i < fRecordedBatches.count() - 2; ++i) {
         GrBatch* batch = fRecordedBatches[i].fBatch.get();
         const SkRect& batchBounds = fRecordedBatches[i].fClippedBounds;