aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e14e8929b0..e167bd20bb 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -223,7 +223,13 @@ GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc&
return nullptr;
}
this->handleDirtyContext();
- return this->onWrapBackendRenderTarget(desc, ownership);
+ auto res = this->onWrapBackendRenderTarget(desc, ownership);
+ if (desc.fStencilBits) {
+ // Our algorithms that use the stencil buffer assume it is
+ // initially cleared.
+ this->clearStencil(res);
+ }
+ return res;
}
GrRenderTarget* GrGpu::wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc& desc) {