diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-01-07 14:06:26 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-07 14:13:41 +0100 |
commit | 2ef9aa51f34263955bfa1528f6a4fd074b69ec91 (patch) | |
tree | 8e1031f6d06923bb8025ffc2968f8070a6475bbb /apps | |
parent | 5aa5a923f3cc48a189f690fa47eafac389e8fbe4 (diff) | |
download | rockbox-2ef9aa51f34263955bfa1528f6a4fd074b69ec91.tar.gz rockbox-2ef9aa51f34263955bfa1528f6a4fd074b69ec91.zip |
test_gfx: Add benchmark for put_line().
Change-Id: I94cd5cec5ce169a4ddb60fcb3c09e2ffb50a3401
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/test_gfx.c | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/apps/plugins/test_gfx.c b/apps/plugins/test_gfx.c index 1dfab8c3b4..51d8f40cd7 100644 --- a/apps/plugins/test_gfx.c +++ b/apps/plugins/test_gfx.c @@ -399,6 +399,60 @@ static void time_text(void) /* tests mono_bitmap performance */ count1, count2, count3, count4); } +static void time_put_line(void) /* tests put_line performance */ +{ + long time_start, time_end; + int count1, count2, count3, count4; + struct screen *display = rb->screens[SCREEN_MAIN]; + const char fmt[] = "$iRockbox!"; + + rb->lcd_setfont(FONT_SYSFIXED); + count1 = count2 = count3 = count4 = 0; + + struct line_desc desc = LINE_DESC_DEFINIT; + rb->sleep(0); /* sync to tick */ + time_start = *rb->current_tick; + while((time_end = *rb->current_tick) - time_start < DURATION) + { + unsigned rnd = rand_table[count1++ & 0x3ff]; + display->put_line((rnd >> 8) & 0x3f, rnd & 0x3f, &desc, fmt, Icon_Audio); + } + + desc.style = STYLE_INVERT; + rb->sleep(0); /* sync to tick */ + time_start = *rb->current_tick; + while((time_end = *rb->current_tick) - time_start < DURATION) + { + unsigned rnd = rand_table[count2++ & 0x3ff]; + display->put_line((rnd >> 8) & 0x3f, rnd & 0x3f, &desc, fmt, Icon_Audio); + } + + desc.style = STYLE_COLORBAR; + rb->sleep(0); /* sync to tick */ + time_start = *rb->current_tick; + while((time_end = *rb->current_tick) - time_start < DURATION) + { + unsigned rnd = rand_table[count3++ & 0x3ff]; + display->put_line((rnd >> 8) & 0x3f, rnd & 0x3f, &desc, fmt, Icon_Audio); + } + + desc.style = STYLE_GRADIENT; + rb->sleep(0); /* sync to tick */ + time_start = *rb->current_tick; + while((time_end = *rb->current_tick) - time_start < DURATION) + { + unsigned rnd = rand_table[count4++ & 0x3ff]; + display->put_line((rnd >> 8) & 0x3f, rnd & 0x3f, &desc, fmt, Icon_Audio); + } + + rb->fdprintf(log_fd, "\nput_line (lines (icon+text)/s): \n" + " default: %d\n" + " inverted: %d\n" + " colorbar: %d\n" + " gradient: %d\n", + count1, count2, count3, count4); +} + /* plugin entry point */ enum plugin_status plugin_start(const void* parameter) { @@ -444,7 +498,7 @@ enum plugin_status plugin_start(const void* parameter) backlight_ignore_timeout(); rb->splashf(0, "LCD driver performance test, please wait %d sec", - 6*4*DURATION/HZ); + 7*4*DURATION/HZ); init_rand_table(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ @@ -457,6 +511,7 @@ enum plugin_status plugin_start(const void* parameter) time_vline(); time_fillrect(); time_text(); + time_put_line(); #ifdef HAVE_ADJUSTABLE_CPU_FREQ if (*rb->cpu_frequency != cpu_freq) |