Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Unified Diff: src/gpu/GrGpu.cpp

Issue 2342873004: Clear stencil buffer before using it for drawing (Closed)
Patch Set: Adding more comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index e14e8929b04bbc84de2fa52f14298befac2733c2..e167bd20bb053606deca1674146e44fdd6230444 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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698