diff options
author | Robert Phillips <robertphillips@google.com> | 2018-07-26 08:03:04 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-26 13:37:26 +0000 |
commit | 01a9128a6f8e8a18cce11de2891f4b2052035f53 (patch) | |
tree | 4bd0d5d457c03a70641d0278366c7ca1fb4cba47 /src/gpu/GrDrawingManager.cpp | |
parent | b64db38b854bd8f6d564b7741ebf4795d130d168 (diff) |
Maybe fix numStencilBits TSAN crash
Bug: skia:7390
Change-Id: Ied9c92147324ddb1245df796cd201df35657bbe0
Reviewed-on: https://skia-review.googlesource.com/143304
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.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index 8b0fb22f6b..645b3d17a0 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -103,6 +103,13 @@ void GrDrawingManager::freeGpuResources() { fSoftwarePathRenderer = nullptr; } +static void end_oplist_flush_if_not_unique(const sk_sp<GrOpList>& opList) { + if (!opList->unique()) { + // TODO: Eventually this should be guaranteed unique: http://skbug.com/7111 + opList->endFlush(); + } +} + // MDB TODO: make use of the 'proxy' parameter. GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*, GrResourceCache::FlushType type, @@ -210,6 +217,11 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*, &error)) { if (GrResourceAllocator::AssignError::kFailedProxyInstantiation == error) { for (int i = startIndex; i < stopIndex; ++i) { + if (fOpLists[i] && !fOpLists[i]->isFullyInstantiated()) { + // If the backing surface wasn't allocated drop the entire opList. + end_oplist_flush_if_not_unique(fOpLists[i]); // http://skbug.com/7111 + fOpLists[i] = nullptr; + } if (fOpLists[i]) { fOpLists[i]->purgeOpsWithUninstantiatedProxies(); } @@ -259,13 +271,6 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*, return result; } -static void end_oplist_flush_if_not_unique(const sk_sp<GrOpList>& opList) { - if (!opList->unique()) { - // TODO: Eventually this should be guaranteed unique: http://skbug.com/7111 - opList->endFlush(); - } -} - bool GrDrawingManager::executeOpLists(int startIndex, int stopIndex, GrOpFlushState* flushState) { SkASSERT(startIndex <= stopIndex && stopIndex <= fOpLists.count()); @@ -286,7 +291,7 @@ bool GrDrawingManager::executeOpLists(int startIndex, int stopIndex, GrOpFlushSt } if (resourceProvider->explicitlyAllocateGPUResources()) { - if (!fOpLists[i]->isInstantiated()) { + if (!fOpLists[i]->isFullyInstantiated()) { // If the backing surface wasn't allocated drop the draw of the entire opList. end_oplist_flush_if_not_unique(fOpLists[i]); // http://skbug.com/7111 fOpLists[i] = nullptr; |