diff options
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r-- | src/gpu/GrGpu.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index f8ac850bf7..ceb0dee78e 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -197,10 +197,13 @@ sk_sp<GrTexture> GrGpu::wrapBackendTexture(const GrBackendTexture& backendTex, if (!tex) { return nullptr; } - // TODO: defer this and attach dynamically - GrRenderTarget* tgt = tex->asRenderTarget(); - if (tgt && !fContext->resourceProvider()->attachStencilAttachment(tgt)) { - return nullptr; + + if (!this->caps()->avoidStencilBuffers()) { + // TODO: defer this and attach dynamically + GrRenderTarget* tgt = tex->asRenderTarget(); + if (tgt && !fContext->resourceProvider()->attachStencilAttachment(tgt)) { + return nullptr; + } } return tex; } |