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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 1386683002: Revert of Incrementally flush GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index de22d0d3c0296676a60f79068f28589b107486e3..e7c1c8b5c14a93733bfca40cd8a7b99a82f7b4dd 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -35,9 +35,8 @@
GrDrawTarget::GrDrawTarget(GrGpu* gpu, GrResourceProvider* resourceProvider)
: fGpu(SkRef(gpu))
, fResourceProvider(resourceProvider)
- , fFlushState(fGpu, fResourceProvider, 0)
, fFlushing(false)
- , fFirstUnpreparedBatch(0) {
+ , fLastFlushToken(0) {
// TODO: Stop extracting the context (currently needed by GrClipMaskManager)
fContext = fGpu->getContext();
fClipMaskManager.reset(new GrClipMaskManager(this));
@@ -118,26 +117,28 @@
}
fFlushing = true;
+ GrBatchFlushState flushState(fGpu, fResourceProvider, fLastFlushToken);
+
// Loop over all batches and generate geometry
- for (; fFirstUnpreparedBatch < fBatches.count(); ++fFirstUnpreparedBatch) {
- fBatches[fFirstUnpreparedBatch]->prepare(&fFlushState);
+ for (int i = 0; i < fBatches.count(); ++i) {
+ fBatches[i]->prepare(&flushState);
}
// Upload all data to the GPU
- fFlushState.preIssueDraws();
+ flushState.preIssueDraws();
// Draw all the generated geometry.
for (int i = 0; i < fBatches.count(); ++i) {
- fBatches[i]->draw(&fFlushState);
- }
-
+ fBatches[i]->draw(&flushState);
+ }
+
+ fLastFlushToken = flushState.lastFlushedToken();
+
+ fFlushing = false;
this->reset();
-
- fFlushing = false;
}
void GrDrawTarget::reset() {
- fFirstUnpreparedBatch = 0;
fBatches.reset();
}
@@ -433,10 +434,6 @@
GrBATCH_INFO("\t\tFirstBatch\n");
}
fBatches.push_back().reset(SkRef(batch));
- if (fBatches.count() > kMaxLookback) {
- SkASSERT(fBatches.count() - kMaxLookback - fFirstUnpreparedBatch == 1);
- fBatches[fFirstUnpreparedBatch++]->prepare(&fFlushState);
- }
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698