Bug 709560 - Set blend function when enabling gl blending. r=pcwalton

The missing blend function was causing the default of GL_ONE,
GL_ZERO to take effect, making it look like alpha blending wasn't
working. It would start working once the 9-patch shadow was rendered
since that code sets the correct blend function. Fix this by
ensuring we set the blend function wherever we use blending.
This commit is contained in:
Kartikaya Gupta 2011-12-19 17:40:01 -05:00
parent 610f764e15
commit d84f168de3
2 changed files with 2 additions and 0 deletions

View File

@ -213,6 +213,7 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
updateDroppedFrames(frameStartTime);
try {
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
mFrameRateLayer.draw(screenContext);
} finally {
gl.glDisable(GL10.GL_BLEND);

View File

@ -167,6 +167,7 @@ public class ScrollbarLayer extends TileLayer {
try {
GLES11.glEnable(GL10.GL_BLEND);
GLES11.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
Rect rect = RectUtils.round(mVertical ? getVerticalRect(context) : getHorizontalRect(context));
GLES11.glBindTexture(GL10.GL_TEXTURE_2D, getTextureID());