Revert "Don't execute onFlush op lists until after GPU data is uploaded"

This reverts commit 374a4e49e4.

Reason for revert: lots of failures across the board.  Here's one:

../../../src/gpu/GrDrawingManager.cpp:203: fatal error: "assert(onFlushOpList->unique())"


Original change's description:
> Don't execute onFlush op lists until after GPU data is uploaded
> 
> Bug: skia:
> Change-Id: I2ea15f67466761ebd24b9d4a8eb51cd2d452be3c
> Reviewed-on: https://skia-review.googlesource.com/54942
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=robertphillips@google.com,csmartdalton@google.com

Change-Id: I3f9de3708dd925c93aefc1e6fe8a48833de9171b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/55600
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2017-10-05 01:19:42 +00:00 committed by Skia Commit-Bot
parent e5ccb29e1e
commit b93fdfd6fd

View File

@ -137,8 +137,6 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
GrOnFlushResourceProvider onFlushProvider(this);
// Prepare any onFlush op lists (e.g. atlases).
SkSTArray<8, sk_sp<GrOpList>> onFlushOpLists;
if (!fOnFlushCBObjects.empty()) {
// MDB TODO: pre-MDB '1' is the correct pre-allocated size. Post-MDB it will need
// to be larger.
@ -146,19 +144,27 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
for (int i = 0; i < fOpLists.count(); ++i) {
opListIds[i] = fOpLists[i]->uniqueID();
}
SkSTArray<4, sk_sp<GrRenderTargetContext>> renderTargetContexts;
SkSTArray<1, sk_sp<GrRenderTargetContext>> renderTargetContexts;
for (GrOnFlushCallbackObject* onFlushCBObject : fOnFlushCBObjects) {
onFlushCBObject->preFlush(&onFlushProvider,
opListIds.get(), opListIds.count(),
&renderTargetContexts);
for (const sk_sp<GrRenderTargetContext>& rtc : renderTargetContexts) {
sk_sp<GrOpList> onFlushOpList = sk_ref_sp(rtc->getOpList());
if (!onFlushOpList) {
if (!renderTargetContexts.count()) {
continue; // This is fine. No atlases of this type are required for this flush
}
for (int j = 0; j < renderTargetContexts.count(); ++j) {
GrOpList* opList = renderTargetContexts[j]->getOpList();
if (!opList) {
continue; // Odd - but not a big deal
}
onFlushOpList->makeClosed(*fContext->caps());
onFlushOpList->prepare(&fFlushState);
onFlushOpLists.push_back(std::move(onFlushOpList));
SkASSERT(opList->unique());
opList->makeClosed(*fContext->caps());
opList->prepare(&fFlushState);
if (!opList->execute(&fFlushState)) {
continue; // This is bad
}
}
renderTargetContexts.reset();
}
@ -195,17 +201,6 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
// Upload all data to the GPU
fFlushState.preIssueDraws();
// Execute the onFlush op lists first, if any.
for (sk_sp<GrOpList>& onFlushOpList : onFlushOpLists) {
if (!onFlushOpList->execute(&fFlushState)) {
SkDebugf("WARNING: onFlushOpList failed to execute.\n");
}
SkASSERT(onFlushOpList->unique());
onFlushOpList = nullptr;
}
onFlushOpLists.reset();
// Execute the normal op lists.
for (int i = 0; i < fOpLists.count(); ++i) {
if (!fOpLists[i]) {
continue;
@ -232,7 +227,6 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*,
// https://bugs.chromium.org/p/skia/issues/detail?id=7111
fOpLists[i]->endFlush();
}
fOpLists[i] = nullptr;
}
fOpLists.reset();