use plugin buffer for greylib overlay in test_greylib_bitmap_scale
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19765 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
09484db740
commit
de4f8c9f64
1 changed files with 5 additions and 4 deletions
|
@ -34,7 +34,6 @@ PLUGIN_HEADER
|
||||||
GREY_INFO_STRUCT
|
GREY_INFO_STRUCT
|
||||||
static unsigned char grey_bm_buf[LCD_WIDTH * LCD_HEIGHT +
|
static unsigned char grey_bm_buf[LCD_WIDTH * LCD_HEIGHT +
|
||||||
BM_SCALED_SIZE(LCD_WIDTH,0,FORMAT_NATIVE,0)];
|
BM_SCALED_SIZE(LCD_WIDTH,0,FORMAT_NATIVE,0)];
|
||||||
static unsigned char grey_display_buf[2*LCD_WIDTH * LCD_HEIGHT];
|
|
||||||
|
|
||||||
static const struct plugin_api* rb; /* global api struct pointer */
|
static const struct plugin_api* rb; /* global api struct pointer */
|
||||||
|
|
||||||
|
@ -43,6 +42,8 @@ MEM_FUNCTION_WRAPPERS(rb)
|
||||||
/* this is the plugin entry point */
|
/* this is the plugin entry point */
|
||||||
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
|
||||||
{
|
{
|
||||||
|
void * plugin_buf;
|
||||||
|
size_t plugin_buf_len;
|
||||||
static char filename[MAX_PATH];
|
static char filename[MAX_PATH];
|
||||||
struct bitmap grey_bm = {
|
struct bitmap grey_bm = {
|
||||||
.width = LCD_WIDTH,
|
.width = LCD_WIDTH,
|
||||||
|
@ -72,9 +73,9 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
||||||
return PLUGIN_ERROR;
|
return PLUGIN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
long buf_taken;
|
plugin_buf = rb->plugin_get_buffer(&plugin_buf_len);
|
||||||
if(!grey_init(rb, &grey_display_buf[0], sizeof(grey_display_buf), 0,
|
if(!grey_init(rb, plugin_buf, plugin_buf_len, 0, LCD_WIDTH, LCD_HEIGHT,
|
||||||
LCD_WIDTH, LCD_HEIGHT, &buf_taken))
|
NULL))
|
||||||
{
|
{
|
||||||
rb->splash(HZ*2,"grey init failed");
|
rb->splash(HZ*2,"grey init failed");
|
||||||
return PLUGIN_ERROR;
|
return PLUGIN_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue