aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrOpList.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/GrOpList.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/GrOpList.cpp')
-rw-r--r--src/gpu/GrOpList.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp
index c724ea9ba4..c9b61bedab 100644
--- a/src/gpu/GrOpList.cpp
+++ b/src/gpu/GrOpList.cpp
@@ -10,6 +10,7 @@
#include "GrContext.h"
#include "GrDeferredProxyUploader.h"
#include "GrMemoryPool.h"
+#include "GrRenderTargetPriv.h"
#include "GrSurfaceProxy.h"
#include "GrTextureProxyPriv.h"
@@ -138,6 +139,27 @@ bool GrOpList::isInstantiated() const {
return fTarget.get()->priv().isInstantiated();
}
+bool GrOpList::isFullyInstantiated() const {
+ if (!this->isInstantiated()) {
+ return false;
+ }
+
+ GrSurfaceProxy* proxy = fTarget.get();
+ bool needsStencil = proxy->asRenderTargetProxy()
+ ? proxy->asRenderTargetProxy()->needsStencil()
+ : false;
+
+ if (needsStencil) {
+ GrRenderTarget* rt = proxy->priv().peekRenderTarget();
+
+ if (!rt->renderTargetPriv().getStencilAttachment()) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
#ifdef SK_DEBUG
static const char* op_to_name(GrLoadOp op) {
return GrLoadOp::kLoad == op ? "load" : GrLoadOp::kClear == op ? "clear" : "discard";