diff options
author | Robert Phillips <robertphillips@google.com> | 2018-03-16 08:48:24 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-16 13:30:01 +0000 |
commit | 874b5357daa72c9fcdc14fc425b63ebc2219c034 (patch) | |
tree | 3d5cdb7653674cdee37de3f6746be251c94feeb7 /src | |
parent | 91fba61f24943a6e12f69732d9308beb76f8a7c6 (diff) |
Prevent crash when flushing while DDL recording
Change-Id: I35e96d3c3020092b33d9b952394d40d4fd5a587b
Reviewed-on: https://skia-review.googlesource.com/114685
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrDrawingManager.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp index d4f7888e3a..8ebcc85455 100644 --- a/src/gpu/GrDrawingManager.cpp +++ b/src/gpu/GrDrawingManager.cpp @@ -123,6 +123,10 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*, if (fFlushing || this->wasAbandoned()) { return GrSemaphoresSubmitted::kNo; } + GrGpu* gpu = fContext->contextPriv().getGpu(); + if (!gpu) { + return GrSemaphoresSubmitted::kNo; // Can't flush while DDL recording + } fFlushing = true; for (int i = 0; i < fOpLists.count(); ++i) { @@ -155,8 +159,6 @@ GrSemaphoresSubmitted GrDrawingManager::internalFlush(GrSurfaceProxy*, SkASSERT(result); } - GrGpu* gpu = fContext->contextPriv().getGpu(); - GrOpFlushState flushState(gpu, fContext->contextPriv().resourceProvider(), &fTokenTracker); @@ -333,6 +335,11 @@ GrSemaphoresSubmitted GrDrawingManager::prepareSurfaceForExternalIO( } SkASSERT(proxy); + GrGpu* gpu = fContext->contextPriv().getGpu(); + if (!gpu) { + return GrSemaphoresSubmitted::kNo; // Can't flush while DDL recording + } + GrSemaphoresSubmitted result = GrSemaphoresSubmitted::kNo; if (proxy->priv().hasPendingIO() || numSemaphores) { result = this->flush(proxy, numSemaphores, backendSemaphores); @@ -342,10 +349,8 @@ GrSemaphoresSubmitted GrDrawingManager::prepareSurfaceForExternalIO( return result; } - GrGpu* gpu = fContext->contextPriv().getGpu(); GrSurface* surface = proxy->priv().peekSurface(); - - if (gpu && surface->asRenderTarget()) { + if (surface->asRenderTarget()) { gpu->resolveRenderTarget(surface->asRenderTarget()); } return result; |