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

Side by Side Diff: src/gpu/GrDrawTarget.cpp

Issue 2179903008: Don't call finish on GrDrawTarget if we drew no batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 "GrDrawTarget.h" 8 #include "GrDrawTarget.h"
9 9
10 #include "GrAuditTrail.h" 10 #include "GrAuditTrail.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 fRecordedBatches[i].fBatch->prepare(flushState); 209 fRecordedBatches[i].fBatch->prepare(flushState);
210 } 210 }
211 } 211 }
212 212
213 if (fInstancedRendering) { 213 if (fInstancedRendering) {
214 fInstancedRendering->beginFlush(flushState->resourceProvider()); 214 fInstancedRendering->beginFlush(flushState->resourceProvider());
215 } 215 }
216 } 216 }
217 217
218 void GrDrawTarget::drawBatches(GrBatchFlushState* flushState) { 218 void GrDrawTarget::drawBatches(GrBatchFlushState* flushState) {
219 if (0 == fRecordedBatches.count()) {
220 return;
221 }
219 // Draw all the generated geometry. 222 // Draw all the generated geometry.
220 SkRandom random; 223 SkRandom random;
221 GrRenderTarget* currentRT = nullptr; 224 GrRenderTarget* currentRT = nullptr;
222 SkAutoTDelete<GrGpuCommandBuffer> commandBuffer; 225 SkAutoTDelete<GrGpuCommandBuffer> commandBuffer;
223 SkRect bounds = SkRect::MakeEmpty(); 226 SkRect bounds = SkRect::MakeEmpty();
224 for (int i = 0; i < fRecordedBatches.count(); ++i) { 227 for (int i = 0; i < fRecordedBatches.count(); ++i) {
225 if (!fRecordedBatches[i].fBatch) { 228 if (!fRecordedBatches[i].fBatch) {
226 continue; 229 continue;
227 } 230 }
228 if (fRecordedBatches[i].fBatch->renderTarget() != currentRT) { 231 if (fRecordedBatches[i].fBatch->renderTarget() != currentRT) {
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 } 596 }
594 } 597 }
595 598
596 /////////////////////////////////////////////////////////////////////////////// 599 ///////////////////////////////////////////////////////////////////////////////
597 600
598 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { 601 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) {
599 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); 602 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt);
600 this->recordBatch(batch, batch->bounds()); 603 this->recordBatch(batch, batch->bounds());
601 batch->unref(); 604 batch->unref();
602 } 605 }
OLDNEW
« 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