aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
authorGravatar stani <stani@google.com>2016-09-16 11:03:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-16 11:03:44 -0700
commitc326a383e1069497884905f9dd3e720e17d8fcb5 (patch)
tree20a72ba8af60af22bf569a41e21c69011d782c0b /src/gpu/GrGpu.cpp
parentc71a9b7f53938b4f33f36f48e867b8b72cc1cc61 (diff)
Clear stencil buffer before using it for drawing
Clear stencil buffer before using it for drawing. This is resolving an issue with a failing android CTS test in drawArc. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2342873004 Review-Url: https://codereview.chromium.org/2342873004
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) {