summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-12-14 19:36:25 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-01-09 14:36:14 +0000
commitfbdcfca085f65c402c9c660d6d5d097f357f43a1 (patch)
treea887b7aa06f072ccc2410aa2b4579c1bc1d39dcf /apps
parent3adeae2026d016ab608b19e3e6e1c5a8a05b99be (diff)
downloadrockbox-fbdcfca085f65c402c9c660d6d5d097f357f43a1.tar.gz
rockbox-fbdcfca085f65c402c9c660d6d5d097f357f43a1.zip
ImageViewer: Improve smoothness of animated gif playback
Don't disable grayscale overlay, don't show "resize" messages between frames and and don't clear display unless actually necessary Change-Id: I9f501d8280ce0c8f26f4345088d805d1b84cf143
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/imageviewer/gif/gif.c2
-rw-r--r--apps/plugins/imageviewer/imageviewer.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/apps/plugins/imageviewer/gif/gif.c b/apps/plugins/imageviewer/gif/gif.c
index 31fd11d9a6..32c87c88d9 100644
--- a/apps/plugins/imageviewer/gif/gif.c
+++ b/apps/plugins/imageviewer/gif/gif.c
@@ -210,7 +210,7 @@ static int get_image(struct image_info *info, int frame, int ds)
210 /* assign image buffer */ 210 /* assign image buffer */
211 if (ds > 1) 211 if (ds > 1)
212 { 212 {
213 if (!iv->running_slideshow) 213 if (!iv->running_slideshow && (info->frames_count == 1))
214 { 214 {
215 rb->lcd_putsf(0, 3, "resizing %d*%d", info->width, info->height); 215 rb->lcd_putsf(0, 3, "resizing %d*%d", info->width, info->height);
216 rb->lcd_update(); 216 rb->lcd_update();
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index a2b3bb680a..0dd140d1ab 100644
--- a/apps/plugins/imageviewer/imageviewer.c
+++ b/apps/plugins/imageviewer/imageviewer.c
@@ -915,7 +915,8 @@ static int load_and_show(char* filename, struct image_info *info)
915 rb->lcd_update(); 915 rb->lcd_update();
916 } 916 }
917 917
918 mylcd_ub_clear_display(); 918 if (frame == 0)
919 mylcd_ub_clear_display();
919 imgdec->draw_image_rect(info, 0, 0, 920 imgdec->draw_image_rect(info, 0, 0,
920 info->width-info->x, info->height-info->y); 921 info->width-info->x, info->height-info->y);
921 mylcd_ub_update(); 922 mylcd_ub_update();
@@ -956,6 +957,7 @@ static int load_and_show(char* filename, struct image_info *info)
956 get_view(info, &cx, &cy); 957 get_view(info, &cx, &cy);
957 cx /= zoom; /* prepare the position in the new image */ 958 cx /= zoom; /* prepare the position in the new image */
958 cy /= zoom; 959 cy /= zoom;
960 mylcd_ub_clear_display();
959 } 961 }
960 else 962 else
961 continue; 963 continue;
@@ -969,12 +971,14 @@ static int load_and_show(char* filename, struct image_info *info)
969 } 971 }
970 972
971#ifdef USEGSLIB 973#ifdef USEGSLIB
972 grey_show(false); /* switch off overlay */ 974 if (info->frames_count <= 1)
975 grey_show(false); /* switch off overlay */
973#endif 976#endif
974 rb->lcd_clear_display(); 977 rb->lcd_clear_display();
975 } 978 }
976 while (status > PLUGIN_OTHER); 979 while (status > PLUGIN_OTHER);
977#ifdef USEGSLIB 980#ifdef USEGSLIB
981 grey_show(false); /* switch off overlay */
978 rb->lcd_update(); 982 rb->lcd_update();
979#endif 983#endif
980 return status; 984 return status;