diff options
Diffstat (limited to 'src/gpu/GrOpList.cpp')
-rw-r--r-- | src/gpu/GrOpList.cpp | 22 |
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"; |