aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceAllocator.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-07-26 08:03:04 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-26 13:37:26 +0000
commit01a9128a6f8e8a18cce11de2891f4b2052035f53 (patch)
tree4bd0d5d457c03a70641d0278366c7ca1fb4cba47 /src/gpu/GrResourceAllocator.cpp
parentb64db38b854bd8f6d564b7741ebf4795d130d168 (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/GrResourceAllocator.cpp')
-rw-r--r--src/gpu/GrResourceAllocator.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gpu/GrResourceAllocator.cpp b/src/gpu/GrResourceAllocator.cpp
index d253ca2c1a..199acefe7a 100644
--- a/src/gpu/GrResourceAllocator.cpp
+++ b/src/gpu/GrResourceAllocator.cpp
@@ -180,7 +180,10 @@ sk_sp<GrSurface> GrResourceAllocator::findSurfaceFor(const GrSurfaceProxy* proxy
surface->resourcePriv().makeBudgeted();
}
- GrSurfaceProxyPriv::AttachStencilIfNeeded(fResourceProvider, surface.get(), needsStencil);
+ if (!GrSurfaceProxyPriv::AttachStencilIfNeeded(fResourceProvider, surface.get(),
+ needsStencil)) {
+ return nullptr;
+ }
return surface;
}
@@ -248,9 +251,11 @@ bool GrResourceAllocator::assign(int* startIndex, int* stopIndex,
: false;
if (cur->proxy()->priv().isInstantiated()) {
- GrSurfaceProxyPriv::AttachStencilIfNeeded(fResourceProvider,
- cur->proxy()->priv().peekSurface(),
- needsStencil);
+ if (!GrSurfaceProxyPriv::AttachStencilIfNeeded(fResourceProvider,
+ cur->proxy()->priv().peekSurface(),
+ needsStencil)) {
+ *outError = AssignError::kFailedProxyInstantiation;
+ }
fActiveIntvls.insertByIncreasingEnd(cur);