diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-04-03 23:01:03 +0200 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-04-16 10:13:50 -0400 |
commit | e3bf6f08e391213e8b3c49dab923a25f77983063 (patch) | |
tree | b75789eb9181a4ec728c7224994cc43b0349796e /apps | |
parent | 3fcdadce240d2227c1864f2a42a6ae0db1bb372c (diff) | |
download | rockbox-e3bf6f08e391213e8b3c49dab923a25f77983063.tar.gz rockbox-e3bf6f08e391213e8b3c49dab923a25f77983063.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index ae1ec2b224..97b71ee9d0 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -531,6 +531,7 @@ static int itilt; | |||
531 | static PFreal offsetX; | 531 | static PFreal offsetX; |
532 | static PFreal offsetY; | 532 | static PFreal offsetY; |
533 | static int number_of_slides; | 533 | static int number_of_slides; |
534 | static bool is_initial_slide = true; | ||
534 | 535 | ||
535 | static struct pf_slide_cache pf_sldcache; | 536 | static struct pf_slide_cache pf_sldcache; |
536 | 537 | ||
@@ -2903,13 +2904,19 @@ static inline struct dim *surface(const int slide_index) | |||
2903 | { | 2904 | { |
2904 | int j = 0; | 2905 | int j = 0; |
2905 | do { | 2906 | do { |
2906 | if (pf_sldcache.cache[i].index == slide_index) | 2907 | if (pf_sldcache.cache[i].index == slide_index) { |
2908 | if (is_initial_slide && slide_index == center_index) | ||
2909 | is_initial_slide = false; | ||
2907 | return get_slide(pf_sldcache.cache[i].hid); | 2910 | return get_slide(pf_sldcache.cache[i].hid); |
2911 | } | ||
2908 | i = pf_sldcache.cache[i].next; | 2912 | i = pf_sldcache.cache[i].next; |
2909 | j++; | 2913 | j++; |
2910 | } while (i != pf_sldcache.used && j < SLIDE_CACHE_SIZE); | 2914 | } while (i != pf_sldcache.used && j < SLIDE_CACHE_SIZE); |
2911 | } | 2915 | } |
2912 | return get_slide(empty_slide_hid); | 2916 | if (is_initial_slide && slide_index == center_index) |
2917 | return NULL; | ||
2918 | else | ||
2919 | return get_slide(empty_slide_hid); | ||
2913 | } | 2920 | } |
2914 | 2921 | ||
2915 | /** | 2922 | /** |
@@ -3245,6 +3252,7 @@ static bool sort_albums(int new_sorting, bool from_settings) | |||
3245 | rb->buflib_init(&buf_ctx, (void *)pf_idx.buf, pf_idx.buf_sz); | 3252 | rb->buflib_init(&buf_ctx, (void *)pf_idx.buf, pf_idx.buf_sz); |
3246 | empty_slide_hid = read_pfraw(EMPTY_SLIDE, 0); | 3253 | empty_slide_hid = read_pfraw(EMPTY_SLIDE, 0); |
3247 | initialize_slide_cache(); | 3254 | initialize_slide_cache(); |
3255 | is_initial_slide = true; | ||
3248 | create_pf_thread(); | 3256 | create_pf_thread(); |
3249 | 3257 | ||
3250 | /* Go to previously selected slide */ | 3258 | /* Go to previously selected slide */ |
@@ -4455,7 +4463,8 @@ static int pictureflow_main(const char* selected_file) | |||
4455 | 4463 | ||
4456 | 4464 | ||
4457 | /* Copy offscreen buffer to LCD and give time to other threads */ | 4465 | /* Copy offscreen buffer to LCD and give time to other threads */ |
4458 | mylcd_update(); | 4466 | if (is_initial_slide == false) |
4467 | mylcd_update(); | ||
4459 | rb->yield(); | 4468 | rb->yield(); |
4460 | 4469 | ||
4461 | /*/ Handle buttons */ | 4470 | /*/ Handle buttons */ |