aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoushik Dutta <koushd@gmail.com>2012-12-04 23:08:22 -0800
committerKoushik Dutta <koushd@gmail.com>2012-12-04 23:08:22 -0800
commit1712e1eb2335e18fd991b8bfdc01f17ba497b10c (patch)
treef404360d706659fafda7d053ab40667165fec19c
parentc908d3b8cc89a49ff71450484f4377344c4937b0 (diff)
downloadbootable_recovery-1712e1eb2335e18fd991b8bfdc01f17ba497b10c.zip
bootable_recovery-1712e1eb2335e18fd991b8bfdc01f17ba497b10c.tar.gz
bootable_recovery-1712e1eb2335e18fd991b8bfdc01f17ba497b10c.tar.bz2
merge graphics.c changes
Change-Id: Iec4068fce123fc22b42c27989889d5abb237d6f9
-rw-r--r--Android.mk2
-rw-r--r--minui/graphics.c21
2 files changed, 21 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
index e6cd432..04a4d23 100644
--- a/Android.mk
+++ b/Android.mk
@@ -37,7 +37,7 @@ RECOVERY_NAME := CWM-based Recovery
endif
endif
-RECOVERY_VERSION := $(RECOVERY_NAME) v6.0.1.9
+RECOVERY_VERSION := $(RECOVERY_NAME) v6.0.2.0
LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
diff --git a/minui/graphics.c b/minui/graphics.c
index 2aa6805..358b6d9 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -249,6 +249,25 @@ int gr_text(int x, int y, const char *s)
return x;
}
+void gr_texticon(int x, int y, gr_surface icon) {
+ if (gr_context == NULL || icon == NULL) {
+ return;
+ }
+ 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;
@@ -257,7 +276,7 @@ void gr_fill(int x, int y, int w, int h)
}
void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) {
- if (gr_context == NULL) {
+ if (gr_context == NULL || source == NULL) {
return;
}
GGLContext *gl = gr_context;