summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_render.c')
-rw-r--r--apps/gui/skin_engine/skin_render.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index 51c58fc196..00981f5b67 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -349,6 +349,8 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch,
{
struct gui_wps *gwps = info->gwps;
struct wps_data *data = gwps->data;
+ struct viewport *last_vp;
+
/* Tags here are ones which need to be "turned off" or cleared
* if they are in a conditional branch which isnt being used */
if (branch->type == LINE_ALTERNATOR)
@@ -420,22 +422,23 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch,
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
if (skin_viewport->output_to_backdrop_buffer)
{
- void *backdrop = skin_backdrop_get_buffer(data->backdrop_id);
- gwps->display->set_framebuffer(backdrop);
+ skin_backdrop_set_buffer(data->backdrop_id, skin_viewport);
skin_backdrop_show(-1);
}
#endif
- gwps->display->set_viewport(&skin_viewport->vp);
+ last_vp = gwps->display->set_viewport(&skin_viewport->vp);
gwps->display->clear_viewport();
- gwps->display->set_viewport(&info->skin_vp->vp);
+ gwps->display->set_viewport_ex(&info->skin_vp->vp, 0);
skin_viewport->hidden_flags |= VP_DRAW_HIDDEN;
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
if (skin_viewport->output_to_backdrop_buffer)
{
- gwps->display->set_framebuffer(NULL);
+ gwps->display->set_viewport_ex(last_vp, 0);
skin_backdrop_show(data->backdrop_id);
}
+#else
+ (void)last_vp;
#endif
}
}
@@ -792,6 +795,7 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps,
void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
{
+ const int vp_is_appearing = (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE);
struct wps_data *data = gwps->data;
struct screen *display = gwps->display;
@@ -801,7 +805,20 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
int old_refresh_mode = refresh_mode;
skin_buffer = get_skin_buffer(gwps->data);
-
+
+ struct viewport* first_vp;
+ /* should already be the default buffer */
+ first_vp = display->set_viewport(NULL);
+
+ /* Framebuffer is likely dirty */
+ if ((refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL)
+ {
+ if ((first_vp->flags & VP_FLAG_VP_SET_CLEAN) == VP_FLAG_VP_DIRTY &&
+ get_current_activity() == ACTIVITY_WPS) /* only clear if in WPS */
+ {
+ display->clear_viewport();
+ }
+ }
viewport = SKINOFFSETTOPTR(skin_buffer, data->tree);
skin_viewport = SKINOFFSETTOPTR(skin_buffer, viewport->data);
@@ -822,12 +839,12 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)
if (skin_viewport->output_to_backdrop_buffer)
{
- display->set_framebuffer(skin_backdrop_get_buffer(data->backdrop_id));
+ skin_backdrop_set_buffer(data->backdrop_id, skin_viewport);
skin_backdrop_show(-1);
}
else
{
- display->set_framebuffer(NULL);
+ skin_backdrop_set_buffer(-1, skin_viewport);
skin_backdrop_show(data->backdrop_id);
}
#endif
@@ -842,15 +859,14 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
skin_viewport->hidden_flags |= VP_DRAW_WASHIDDEN;
continue;
}
- else if (((skin_viewport->hidden_flags&
- (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE))
- == (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE)))
+ else if ((skin_viewport->hidden_flags & vp_is_appearing) == vp_is_appearing)
{
vp_refresh_mode = SKIN_REFRESH_ALL;
skin_viewport->hidden_flags = VP_DRAW_HIDEABLE;
}
- display->set_viewport(&skin_viewport->vp);
+ display->set_viewport_ex(&skin_viewport->vp, VP_FLAG_VP_SET_CLEAN);
+
if ((vp_refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL)
{
display->clear_viewport();
@@ -862,7 +878,6 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
refresh_mode = old_refresh_mode;
}
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
- display->set_framebuffer(NULL);
skin_backdrop_show(data->backdrop_id);
#endif
@@ -872,8 +887,8 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
* to redraw itself */
send_event(GUI_EVENT_NEED_UI_UPDATE, NULL);
}
- /* Restore the default viewport */
- display->set_viewport(NULL);
+ /* Restore the first viewport */
+ display->set_viewport_ex(first_vp, VP_FLAG_VP_SET_CLEAN);
display->update();
}