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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 1437843002: Move GrBatchFlushState from GrDrawTarget to GrDrawingManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: readd white space Created 5 years, 1 month 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/GrDrawingManager.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawingManager.cpp
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index bfb586b8c1c9d2fd3d94f210e98349a714b7594e..74459daa48b0514fe51d599bedd960cf7c7a2bc2 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -58,6 +58,7 @@ void GrDrawingManager::reset() {
for (int i = 0; i < fDrawTargets.count(); ++i) {
fDrawTargets[i]->reset();
}
+ fFlushState.reset();
}
void GrDrawingManager::flush() {
@@ -65,11 +66,25 @@ void GrDrawingManager::flush() {
SkTTopoSort<GrDrawTarget, GrDrawTarget::TopoSortTraits>(&fDrawTargets);
SkASSERT(result);
+#if 0
for (int i = 0; i < fDrawTargets.count(); ++i) {
- //SkDEBUGCODE(fDrawTargets[i]->dump();)
- fDrawTargets[i]->flush();
+ SkDEBUGCODE(fDrawTargets[i]->dump();)
+ }
+#endif
+
+ for (int i = 0; i < fDrawTargets.count(); ++i) {
+ fDrawTargets[i]->prepareBatches(&fFlushState);
}
+ // Upload all data to the GPU
+ fFlushState.preIssueDraws();
+
+ for (int i = 0; i < fDrawTargets.count(); ++i) {
+ fDrawTargets[i]->drawBatches(&fFlushState);
+ }
+
+ SkASSERT(fFlushState.lastFlushedToken() == fFlushState.currentToken());
+
#ifndef ENABLE_MDB
// When MDB is disabled we keep reusing the same drawTarget
if (fDrawTargets.count()) {
@@ -77,6 +92,11 @@ void GrDrawingManager::flush() {
fDrawTargets[0]->resetFlag(GrDrawTarget::kWasOutput_Flag);
}
#endif
+
+ for (int i = 0; i < fDrawTargets.count(); ++i) {
+ fDrawTargets[i]->reset();
+ }
+ fFlushState.reset();
}
GrTextContext* GrDrawingManager::textContext(const SkSurfaceProps& props,
@@ -119,8 +139,7 @@ GrDrawTarget* GrDrawingManager::newDrawTarget(GrRenderTarget* rt) {
}
#endif
- GrDrawTarget* dt = new GrDrawTarget(rt, fContext->getGpu(), fContext->resourceProvider(),
- fOptions);
+ GrDrawTarget* dt = new GrDrawTarget(rt, fContext->getGpu(), fContext->resourceProvider());
*fDrawTargets.append() = dt;
« no previous file with comments | « src/gpu/GrDrawingManager.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698