diff options
author | Robert Phillips <robertphillips@google.com> | 2018-07-25 12:37:14 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-25 17:13:16 +0000 |
commit | ba5c439809fb2be3b1db159b29aeffaa39f786df (patch) | |
tree | 1020b8b095c1ef7e366bbdc4b6195735b60ef97e /src/gpu/GrSurfaceProxy.cpp | |
parent | 73d7ffca4e12b4f227ebed447c84564285d36548 (diff) |
Fix GPU explicit resource allocation bug
The explicit resource allocator assumes that it has complete control
over the resources it hands out thus, they can have no pre-existing
pending IO.
Change-Id: I59d8d079d8b8514688c458a54424329b86922cb6
Reviewed-on: https://skia-review.googlesource.com/143300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index 81ad5840ed..9e79ead801 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -115,10 +115,10 @@ bool GrSurfaceProxyPriv::AttachStencilIfNeeded(GrResourceProvider* resourceProvi return true; } -sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl( - GrResourceProvider* resourceProvider, - int sampleCnt, bool needsStencil, - GrSurfaceDescFlags descFlags, GrMipMapped mipMapped) const { +sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(GrResourceProvider* resourceProvider, + int sampleCnt, bool needsStencil, + GrSurfaceDescFlags descFlags, + GrMipMapped mipMapped) const { SkASSERT(GrSurfaceProxy::LazyState::kNot == this->lazyInstantiationState()); SkASSERT(!fTarget); GrSurfaceDesc desc; @@ -132,7 +132,10 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl( desc.fSampleCnt = sampleCnt; GrResourceProvider::Flags resourceProviderFlags = GrResourceProvider::kNone_Flag; - if (fSurfaceFlags & GrInternalSurfaceFlags::kNoPendingIO) { + if (fSurfaceFlags & GrInternalSurfaceFlags::kNoPendingIO || + resourceProvider->explicitlyAllocateGPUResources()) { + // The explicit resource allocator requires that any resources it pulls out of the + // cache have no pending IO. resourceProviderFlags = GrResourceProvider::kNoPendingIO_Flag; } |