From 50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 31 Jan 2013 07:24:19 +0100 Subject: 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 --- apps/gui/skin_engine/skin_render.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/gui/skin_engine') 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, if (refresh_type && needs_update) { if (info.force_redraw) - display->scroll_stop_viewport_line(&skin_viewport->vp, info.line_number); + display->scroll_stop_viewport_rect(&skin_viewport->vp, + 0, info.line_number*display->getcharheight(), + skin_viewport->vp.width, display->getcharheight()); write_line(display, align, info.line_number, info.line_scrolls, info.text_style); } @@ -967,8 +969,11 @@ void skin_render_playlistviewer(struct playlistviewer* viewer, /* only update if the line needs to be, and there is something to write */ if (refresh_type && needs_update) { + struct viewport *vp = SKINOFFSETTOPTR(skin_buffer, viewer->vp); if (!info.force_redraw) - display->scroll_stop_viewport_line(&skin_viewport->vp, info.line_number); + display->scroll_stop_viewport_rect(vp, + 0, info.line_number*display->getcharheight(), + vp->width, display->getcharheight()); write_line(display, align, info.line_number, info.line_scrolls, info.text_style); } -- cgit v1.2.3