From 6c694b6f0bd8c6ca4552d70ee3a538d51917337e Mon Sep 17 00:00:00 2001 From: Vojtech Bocek Date: Thu, 6 Feb 2014 20:36:25 +0100 Subject: Disable alpha blending for non-transparent bitmaps * The difference isn't as big as there are not many big non-transparent bitmaps in TWRP, on install screen on flo it is about 5-10ms better. Only place where the difference is noticable is keyboard, which is pretty big non-transparent bitmap, where it speeds up the render by ~40ms on flo. Signed-off-by: Vojtech Bocek Change-Id: I4c51ef957ae2a1829ada4eb566e9964f708efcf0 --- minuitwrp/graphics.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c index 99f584183..ddff571fe 100644 --- a/minuitwrp/graphics.c +++ b/minuitwrp/graphics.c @@ -483,13 +483,21 @@ void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) { } GGLContext *gl = gr_context; - gl->bindTexture(gl, (GGLSurface*) source); + GGLSurface *surface = (GGLSurface*)source; + + if(surface->format == GGL_PIXEL_FORMAT_RGBX_8888) + gl->disable(gl, GGL_BLEND); + + gl->bindTexture(gl, surface); gl->texEnvi(gl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE); gl->texGeni(gl, GGL_S, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE); gl->texGeni(gl, GGL_T, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE); gl->enable(gl, GGL_TEXTURE_2D); gl->texCoord2i(gl, sx - dx, sy - dy); gl->recti(gl, dx, dy, dx + w, dy + h); + + if(surface->format == GGL_PIXEL_FORMAT_RGBX_8888) + gl->enable(gl, GGL_BLEND); } unsigned int gr_get_width(gr_surface surface) { -- cgit v1.2.3