Assume LayerScreenshot has pre-multiplied alpha

Bug: 7300129
Change-Id: Ie9114adc4b5c9a8cc3c65bfe6d9478b2cba4e0d8
This commit is contained in:
Jesse Hall 2012-10-10 21:37:22 -07:00
parent f0c89b28be
commit b763d5fffa

View File

@ -118,21 +118,21 @@ void LayerScreenshot::onDraw(const sp<const DisplayDevice>& hw, const Region& cl
if (s.alpha == 0xFF) { if (s.alpha == 0xFF) {
glDisable(GL_BLEND); glDisable(GL_BLEND);
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
} else { } else {
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(alpha, alpha, alpha, alpha);
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
} }
LayerMesh mesh; LayerMesh mesh;
computeGeometry(hw, &mesh); computeGeometry(hw, &mesh);
glColor4f(0, 0, 0, alpha);
glDisable(GL_TEXTURE_EXTERNAL_OES); glDisable(GL_TEXTURE_EXTERNAL_OES);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, mTextureName); glBindTexture(GL_TEXTURE_2D, mTextureName);
glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glMatrixMode(GL_TEXTURE); glMatrixMode(GL_TEXTURE);
glLoadIdentity(); glLoadIdentity();
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);