am 730c0f65: Merge "Fix stencil mask usage in HWUI" into mnc-dev

* commit '730c0f6591b1c99699e9d0ecf36d696f7d87629f':
  Fix stencil mask usage in HWUI
This commit is contained in:
Chris Craik
2015-07-30 19:37:15 +00:00
committed by Android Git Automerger

View File

@ -60,8 +60,14 @@ GLenum Stencil::getLayerStencilFormat() {
} }
void Stencil::clear() { void Stencil::clear() {
glStencilMask(0xff);
glClearStencil(0); glClearStencil(0);
glClear(GL_STENCIL_BUFFER_BIT); glClear(GL_STENCIL_BUFFER_BIT);
if (mState == kTest) {
// reset to test state, with immutable stencil
glStencilMask(0);
}
} }
void Stencil::enableTest(int incrementThreshold) { void Stencil::enableTest(int incrementThreshold) {
@ -104,17 +110,17 @@ void Stencil::enableDebugTest(GLint value, bool greater) {
// We only want to test, let's keep everything // We only want to test, let's keep everything
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
mState = kTest; mState = kTest;
glStencilMask(0);
} }
void Stencil::enableDebugWrite() { void Stencil::enableDebugWrite() {
if (mState != kWrite) { enable();
enable(); glStencilFunc(GL_ALWAYS, 0x1, 0xffffffff);
glStencilFunc(GL_ALWAYS, 0x1, 0xffffffff); // The test always passes so the first two values are meaningless
// The test always passes so the first two values are meaningless glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); mState = kWrite;
mState = kWrite; glStencilMask(0xff);
}
} }
void Stencil::enable() { void Stencil::enable() {