From 39e51cc66e0f9d2afc82515958c1719fdac43332 Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Mon, 18 Jan 2010 16:36:06 +0000 Subject: [PATCH] Fractals: Use overlay (do not clear the screen and paint the same region) when changing precision git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24275 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/fractals/fractal.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/apps/plugins/fractals/fractal.c b/apps/plugins/fractals/fractal.c index 5023b2c450..ff768a9516 100644 --- a/apps/plugins/fractals/fractal.c +++ b/apps/plugins/fractals/fractal.c @@ -46,9 +46,10 @@ static unsigned char *gbuf; static size_t gbuf_size = 0; #endif -#define REDRAW_NONE 0 -#define REDRAW_PARTIAL 1 -#define REDRAW_FULL 2 +#define REDRAW_NONE 0 +#define REDRAW_PARTIAL 1 +#define REDRAW_FULL 2 +#define REDRAW_FULL_OVERLAY 3 PLUGIN_HEADER @@ -139,11 +140,17 @@ enum plugin_status plugin_start(const void* parameter) #ifdef HAVE_ADJUSTABLE_CPU_FREQ rb->cpu_boost(true); #endif - if (redraw == REDRAW_FULL) + switch (redraw) { - MYLCD(clear_display)(); - MYLCD_UPDATE(); - rects_queue_init(); + case REDRAW_FULL: + MYLCD(clear_display)(); + MYLCD_UPDATE(); + /* fall-through */ + case REDRAW_FULL_OVERLAY: + rects_queue_init(); + break; + default: + break; } /* paint all rects */ @@ -229,7 +236,7 @@ enum plugin_status plugin_start(const void* parameter) break; #endif if (ops->precision(-1)) - redraw = REDRAW_FULL; + redraw = REDRAW_FULL_OVERLAY; break; @@ -239,7 +246,7 @@ enum plugin_status plugin_start(const void* parameter) break; #endif if (ops->precision(+1)) - redraw = REDRAW_FULL; + redraw = REDRAW_FULL_OVERLAY; break;