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

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

Issue 1835283002: Simplify GrDrawBatch uploads and token uage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 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 | « src/gpu/GrDefaultGeoProcFactory.h ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | 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 2015 Google Inc. 2 * Copyright 2015 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 "GrDrawContext.h" 8 #include "GrDrawContext.h"
9 #include "GrDrawingManager.h" 9 #include "GrDrawingManager.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 fDrawTargets[i]->prepareBatches(&fFlushState); 77 fDrawTargets[i]->prepareBatches(&fFlushState);
78 } 78 }
79 79
80 // Upload all data to the GPU 80 // Upload all data to the GPU
81 fFlushState.preIssueDraws(); 81 fFlushState.preIssueDraws();
82 82
83 for (int i = 0; i < fDrawTargets.count(); ++i) { 83 for (int i = 0; i < fDrawTargets.count(); ++i) {
84 fDrawTargets[i]->drawBatches(&fFlushState); 84 fDrawTargets[i]->drawBatches(&fFlushState);
85 } 85 }
86 86
87 SkASSERT(fFlushState.lastFlushedToken() == fFlushState.currentToken()); 87 SkASSERT(fFlushState.nextDrawToken() == fFlushState.nextTokenToFlush());
88 88
89 for (int i = 0; i < fDrawTargets.count(); ++i) { 89 for (int i = 0; i < fDrawTargets.count(); ++i) {
90 fDrawTargets[i]->reset(); 90 fDrawTargets[i]->reset();
91 #ifdef ENABLE_MDB 91 #ifdef ENABLE_MDB
92 fDrawTargets[i]->unref(); 92 fDrawTargets[i]->unref();
93 #endif 93 #endif
94 } 94 }
95 95
96 #ifndef ENABLE_MDB 96 #ifndef ENABLE_MDB
97 // When MDB is disabled we keep reusing the same drawTarget 97 // When MDB is disabled we keep reusing the same drawTarget
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt achment(rt); 176 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt achment(rt);
177 if (sb) { 177 if (sb) {
178 return new GrPathRenderingDrawContext(fContext, this, rt, surfacePro ps, 178 return new GrPathRenderingDrawContext(fContext, this, rt, surfacePro ps,
179 fContext->getAuditTrail(), fSi ngleOwner); 179 fContext->getAuditTrail(), fSi ngleOwner);
180 } 180 }
181 } 181 }
182 182
183 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi tTrail(), 183 return new GrDrawContext(fContext, this, rt, surfaceProps, fContext->getAudi tTrail(),
184 fSingleOwner); 184 fSingleOwner);
185 } 185 }
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultGeoProcFactory.h ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698