aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawingManager.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-18 12:59:22 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-18 18:31:58 +0000
commit40a29d7705d970be03ff94f9fa062db75dccbd0f (patch)
tree67908df5424d112ea27a012de435819586f23793 /src/gpu/GrDrawingManager.cpp
parent3af7f6e2ce32c0909159145b23378d119e900bbe (diff)
Move GrOpFlushState out of GrDrawingManager and onto the stack
Change-Id: If1b3481af7637bfed8a73d75be41c6422319951f Reviewed-on: https://skia-review.googlesource.com/96540 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrDrawingManager.cpp')
-rw-r--r--src/gpu/GrDrawingManager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index e60468b0d1..3f6c77379a 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -121,6 +121,10 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
SkASSERT(result);
#endif
+ GrOpFlushState flushState(fContext->getGpu(),
+ fContext->contextPriv().resourceProvider(),
+ &fTokenTracker);
+
GrOnFlushResourceProvider onFlushProvider(this);
// TODO: AFAICT the only reason fFlushState is on GrDrawingManager rather than on the
// stack here is to preserve the flush tokens.
@@ -150,7 +154,7 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
});
#endif
onFlushOpList->makeClosed(*fContext->caps());
- onFlushOpList->prepare(&fFlushState);
+ onFlushOpList->prepare(&flushState);
fOnFlushCBOpLists.push_back(std::move(onFlushOpList));
}
renderTargetContexts.reset();
@@ -181,7 +185,7 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
while (alloc.assign(&startIndex, &stopIndex))
#endif
{
- if (this->executeOpLists(startIndex, stopIndex, &fFlushState)) {
+ if (this->executeOpLists(startIndex, stopIndex, &flushState)) {
flushed = true;
}
}
@@ -197,7 +201,7 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
fContext->contextPriv().getResourceCache()->notifyFlushOccurred(type);
}
for (GrOnFlushCallbackObject* onFlushCBObject : fOnFlushCBObjects) {
- onFlushCBObject->postFlush(fFlushState.nextTokenToFlush(), fFlushingOpListIDs.begin(),
+ onFlushCBObject->postFlush(fTokenTracker.nextTokenToFlush(), fFlushingOpListIDs.begin(),
fFlushingOpListIDs.count());
}
fFlushingOpListIDs.reset();
@@ -257,7 +261,7 @@ bool GrDrawingManager::executeOpLists(int startIndex, int stopIndex, GrOpFlushSt
}
SkASSERT(!flushState->commandBuffer());
- SkASSERT(flushState->nextDrawToken() == flushState->nextTokenToFlush());
+ SkASSERT(fTokenTracker.nextDrawToken() == fTokenTracker.nextTokenToFlush());
// We reset the flush state before the OpLists so that the last resources to be freed are those
// that are written to in the OpLists. This helps to make sure the most recently used resources