From 02ec6b88ed4e6cf40cc257572b07c7277b7b6341 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Wed, 22 Aug 2012 17:26:40 -0700 Subject: add simple text to recovery UI - recovery takes a --locale argument, which will be passed by the main system - the locale is saved in cache, in case the --locale argument is missing (eg, when recovery is started from fastboot) - we include images that have prerendered text for many locales - we split the background states into four (installing update, erasing, no command, error) so that appropriate text can be shown. Change-Id: I731b8108e83d5ccc09a4aacfc1dbf7e86b397aaf --- minui/graphics.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'minui/graphics.c') diff --git a/minui/graphics.c b/minui/graphics.c index 81f13ad2c..88572a878 100644 --- a/minui/graphics.c +++ b/minui/graphics.c @@ -244,6 +244,22 @@ int gr_text(int x, int y, const char *s) return x; } +void gr_texticon(int x, int y, gr_surface icon) { + GGLContext* gl = gr_context; + + gl->bindTexture(gl, (GGLSurface*) icon); + 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); + + int w = gr_get_width(icon); + int h = gr_get_height(icon); + + gl->texCoord2i(gl, -x, -y); + gl->recti(gl, x, y, x+gr_get_width(icon), y+gr_get_height(icon)); +} + void gr_fill(int x, int y, int w, int h) { GGLContext *gl = gr_context; -- cgit v1.2.3