diff options
author | Greg Daniel <egdaniel@google.com> | 2017-10-04 12:26:35 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-04 12:26:43 +0000 |
commit | f8bc0018bef9b3dc6362ac195111d01be66ed5fb (patch) | |
tree | 06b4e9030a2909311ea33a410845ad41e2c291a2 /src | |
parent | 78bdee200c26520eb065728ae7c094b76ecaae66 (diff) |
Revert "When flushing, reset flush state before op lists"
This reverts commit 78bdee200c26520eb065728ae7c094b76ecaae66.
Reason for revert: breaking PathRendererCacheTests.cpp unit test
Original change's description:
> When flushing, reset flush state before op lists
>
> When we reset the flush state after executing the ops in a flush, we reset
> the stored pipelines which may be holding refs to resources in their processors.
>
> We want the resources that we wrote to in the op list to be freed last for caching
> LRU purposes. Thus we make sure to free all the pipeline resources first before
> resetting and freeing the op lists
>
> Bug: skia:
> Change-Id: I5b02e9b7532007b5854e906bf4d64e901e7e7e53
> Reviewed-on: https://skia-review.googlesource.com/54760
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: If74a158e90316553a401386c8c7a6b3c2b29a7df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/55080
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrDrawingManager.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index 48540e00df..5deacbb5ca 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -211,26 +211,16 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*, if (fOpLists[i]->execute(&fFlushState)) { flushed = true; } - } - - SkASSERT(fFlushState.nextDrawToken() == fFlushState.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 - // are the last to be purged by the resource cache. - fFlushState.reset(); - - for (int i = 0; i < fOpLists.count(); ++i) { - if (!fOpLists[i]) { - continue; - } fOpLists[i]->reset(); } fOpLists.reset(); + SkASSERT(fFlushState.nextDrawToken() == fFlushState.nextTokenToFlush()); + GrSemaphoresSubmitted result = fContext->getGpu()->finishFlush(numSemaphores, backendSemaphores); + fFlushState.reset(); // We always have to notify the cache when it requested a flush so it can reset its state. if (flushed || type == GrResourceCache::FlushType::kCacheRequested) { fContext->getResourceCache()->notifyFlushOccurred(type); |