minuitwrp: Respect TARGET_RECOVERY_PIXEL_FORMAT config.

Respect TARGET_RECOVERY_PIXEL_FORMAT config in screenshot, graphics.
This fixes other wrong theme color in minuitwrp on Xiaomi MIX 2S.

Change-Id: Ieb8480c411e2f0c72cc50ffca66943ab025e2b7e
This commit is contained in:
notsyncing
2019-01-16 16:43:30 +08:00
committed by Simon Shi
parent 4d7b0e0350
commit 8e4e8ec2f9
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -157,7 +157,11 @@ gr_surface gr_render_circle(int radius, unsigned char r, unsigned char g, unsign
surface->height = diameter;
surface->stride = diameter;
surface->data = (GGLubyte*)data;
#if defined(RECOVERY_BGRA)
surface->format = GGL_PIXEL_FORMAT_BGRA_8888;
#else
surface->format = GGL_PIXEL_FORMAT_RGBA_8888;
#endif
for(ry = -radius; ry <= radius; ++ry)
for(rx = -radius; rx <= radius; ++rx)
+5
View File
@@ -52,7 +52,12 @@ int gr_save_screenshot(const char *dest)
surface.height = gr_mem_surface.height;
surface.stride = gr_mem_surface.stride;
surface.data = img_data;
#if defined(RECOVERY_BGRA)
surface.format = GGL_PIXEL_FORMAT_BGRA_8888;
#else
surface.format = GGL_PIXEL_FORMAT_RGBA_8888;
#endif
gglInit(&gl);
gl->colorBuffer(gl, &surface);