mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-24 07:27:39 -04:00
PictureFlow: Delay LCD Update until center slide is loaded
Eliminates flashing of slide right after launch or when changing sorting on the M3K using the volume buttons Change-Id: Icd317e0b0d5b939269dc8dafd30d0c0f9daa5fd9
This commit is contained in:
parent
3fcdadce24
commit
e3bf6f08e3
1 changed files with 12 additions and 3 deletions
|
|
@ -531,6 +531,7 @@ static int itilt;
|
||||||
static PFreal offsetX;
|
static PFreal offsetX;
|
||||||
static PFreal offsetY;
|
static PFreal offsetY;
|
||||||
static int number_of_slides;
|
static int number_of_slides;
|
||||||
|
static bool is_initial_slide = true;
|
||||||
|
|
||||||
static struct pf_slide_cache pf_sldcache;
|
static struct pf_slide_cache pf_sldcache;
|
||||||
|
|
||||||
|
|
@ -2903,12 +2904,18 @@ static inline struct dim *surface(const int slide_index)
|
||||||
{
|
{
|
||||||
int j = 0;
|
int j = 0;
|
||||||
do {
|
do {
|
||||||
if (pf_sldcache.cache[i].index == slide_index)
|
if (pf_sldcache.cache[i].index == slide_index) {
|
||||||
|
if (is_initial_slide && slide_index == center_index)
|
||||||
|
is_initial_slide = false;
|
||||||
return get_slide(pf_sldcache.cache[i].hid);
|
return get_slide(pf_sldcache.cache[i].hid);
|
||||||
|
}
|
||||||
i = pf_sldcache.cache[i].next;
|
i = pf_sldcache.cache[i].next;
|
||||||
j++;
|
j++;
|
||||||
} while (i != pf_sldcache.used && j < SLIDE_CACHE_SIZE);
|
} while (i != pf_sldcache.used && j < SLIDE_CACHE_SIZE);
|
||||||
}
|
}
|
||||||
|
if (is_initial_slide && slide_index == center_index)
|
||||||
|
return NULL;
|
||||||
|
else
|
||||||
return get_slide(empty_slide_hid);
|
return get_slide(empty_slide_hid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3245,6 +3252,7 @@ static bool sort_albums(int new_sorting, bool from_settings)
|
||||||
rb->buflib_init(&buf_ctx, (void *)pf_idx.buf, pf_idx.buf_sz);
|
rb->buflib_init(&buf_ctx, (void *)pf_idx.buf, pf_idx.buf_sz);
|
||||||
empty_slide_hid = read_pfraw(EMPTY_SLIDE, 0);
|
empty_slide_hid = read_pfraw(EMPTY_SLIDE, 0);
|
||||||
initialize_slide_cache();
|
initialize_slide_cache();
|
||||||
|
is_initial_slide = true;
|
||||||
create_pf_thread();
|
create_pf_thread();
|
||||||
|
|
||||||
/* Go to previously selected slide */
|
/* Go to previously selected slide */
|
||||||
|
|
@ -4455,6 +4463,7 @@ static int pictureflow_main(const char* selected_file)
|
||||||
|
|
||||||
|
|
||||||
/* Copy offscreen buffer to LCD and give time to other threads */
|
/* Copy offscreen buffer to LCD and give time to other threads */
|
||||||
|
if (is_initial_slide == false)
|
||||||
mylcd_update();
|
mylcd_update();
|
||||||
rb->yield();
|
rb->yield();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue