summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-01-31 07:24:19 +0100
committerThomas Martitz <kugel@rockbox.org>2013-12-14 23:11:31 +0100
commit50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679 (patch)
tree47b53d62c0880a3ea6b9e761efdf0628855d13e0 /apps
parent26801b3bd8f11fe680146086aa0a2fd12e7de289 (diff)
downloadrockbox-50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679.tar.gz
rockbox-50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679.zip
scroll_engine: Major rework to support pixel-based scrolling and scroll callbacks.
Much of the scrolling work is moved from lcd-bitmap-common to lcd-scroll.c, a small scroll callback routine remains. This callback can potentially be overridden by more extensive scrollers. The callback also gets fed with pixel-based scrolling information, which finally removes the strict line-based nature of the scroll engine. Along with this is the change from scroll_stop_viewport_line() to scroll_stop_viewport_rect() which works on a pixel-based rectangle instead of lines. The ultimate goal is to move most of the scroll work to apps, which can much better decide which line decorations to apply etc. This work is laying the ground work. Change-Id: I3b2885cf7d8696ddd9253d5a9a73318d3d42831a
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_render.c9
-rw-r--r--apps/screen_access.c4
-rw-r--r--apps/screen_access.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index 67f1f0f448..28483cbc49 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -779,7 +779,9 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps,
779 if (refresh_type && needs_update) 779 if (refresh_type && needs_update)
780 { 780 {
781 if (info.force_redraw) 781 if (info.force_redraw)
782 display->scroll_stop_viewport_line(&skin_viewport->vp, info.line_number); 782 display->scroll_stop_viewport_rect(&skin_viewport->vp,
783 0, info.line_number*display->getcharheight(),
784 skin_viewport->vp.width, display->getcharheight());
783 write_line(display, align, info.line_number, 785 write_line(display, align, info.line_number,
784 info.line_scrolls, info.text_style); 786 info.line_scrolls, info.text_style);
785 } 787 }
@@ -967,8 +969,11 @@ void skin_render_playlistviewer(struct playlistviewer* viewer,
967 /* only update if the line needs to be, and there is something to write */ 969 /* only update if the line needs to be, and there is something to write */
968 if (refresh_type && needs_update) 970 if (refresh_type && needs_update)
969 { 971 {
972 struct viewport *vp = SKINOFFSETTOPTR(skin_buffer, viewer->vp);
970 if (!info.force_redraw) 973 if (!info.force_redraw)
971 display->scroll_stop_viewport_line(&skin_viewport->vp, info.line_number); 974 display->scroll_stop_viewport_rect(vp,
975 0, info.line_number*display->getcharheight(),
976 vp->width, display->getcharheight());
972 write_line(display, align, info.line_number, 977 write_line(display, align, info.line_number,
973 info.line_scrolls, info.text_style); 978 info.line_scrolls, info.text_style);
974 } 979 }
diff --git a/apps/screen_access.c b/apps/screen_access.c
index 161e596aa2..f454e0adef 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -247,9 +247,9 @@ struct screen screens[NB_SCREENS] =
247 .scroll_delay=&lcd_scroll_delay, 247 .scroll_delay=&lcd_scroll_delay,
248 .clear_display=&lcd_clear_display, 248 .clear_display=&lcd_clear_display,
249 .clear_viewport=&lcd_clear_viewport, 249 .clear_viewport=&lcd_clear_viewport,
250 .scroll_stop_viewport_rect=&lcd_scroll_stop_viewport_rect,
250 .scroll_stop=&lcd_scroll_stop, 251 .scroll_stop=&lcd_scroll_stop,
251 .scroll_stop_viewport=&lcd_scroll_stop_viewport, 252 .scroll_stop_viewport=&lcd_scroll_stop_viewport,
252 .scroll_stop_viewport_line=&lcd_scroll_stop_viewport_line,
253 .update=&lcd_update, 253 .update=&lcd_update,
254 .update_viewport=&lcd_update_viewport, 254 .update_viewport=&lcd_update_viewport,
255 .backlight_on=&backlight_on, 255 .backlight_on=&backlight_on,
@@ -348,9 +348,9 @@ struct screen screens[NB_SCREENS] =
348 .scroll_delay=&lcd_remote_scroll_delay, 348 .scroll_delay=&lcd_remote_scroll_delay,
349 .clear_display=&lcd_remote_clear_display, 349 .clear_display=&lcd_remote_clear_display,
350 .clear_viewport=&lcd_remote_clear_viewport, 350 .clear_viewport=&lcd_remote_clear_viewport,
351 .scroll_stop_viewport_rect=&lcd_remote_scroll_stop_viewport_rect,
351 .scroll_stop=&lcd_remote_scroll_stop, 352 .scroll_stop=&lcd_remote_scroll_stop,
352 .scroll_stop_viewport=&lcd_remote_scroll_stop_viewport, 353 .scroll_stop_viewport=&lcd_remote_scroll_stop_viewport,
353 .scroll_stop_viewport_line=&lcd_remote_scroll_stop_viewport_line,
354 .update=&lcd_remote_update, 354 .update=&lcd_remote_update,
355 .update_viewport=&lcd_remote_update_viewport, 355 .update_viewport=&lcd_remote_update_viewport,
356 .backlight_on=&remote_backlight_on, 356 .backlight_on=&remote_backlight_on,
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 448437c637..90b63ea338 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -149,7 +149,7 @@ struct screen
149 void (*clear_viewport)(void); 149 void (*clear_viewport)(void);
150 void (*scroll_stop)(void); 150 void (*scroll_stop)(void);
151 void (*scroll_stop_viewport)(const struct viewport *vp); 151 void (*scroll_stop_viewport)(const struct viewport *vp);
152 void (*scroll_stop_viewport_line)(const struct viewport *vp, int line); 152 void (*scroll_stop_viewport_rect)(const struct viewport* vp, int x, int y, int width, int height);
153 void (*update)(void); 153 void (*update)(void);
154 void (*update_viewport)(void); 154 void (*update_viewport)(void);
155 void (*backlight_on)(void); 155 void (*backlight_on)(void);