[pinpoint] [PATCH] Fix overwriting of slides in speaker screen



The prev/current/next slide preview in the speaker screen overwrites
screens when moving forward/backward through the slides. The result
looks like all slides stacked with transparent background.

Apparently this happens only for text, full-scale background graphics
are rendered correctly (i.e. non-transparent).

This commit fixes this behaviour by drawing a black background before
rendering the prev/current/next slide preview.
---
 pp-cairo.c   |    8 ++++++++
 pp-clutter.c |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/pp-cairo.c b/pp-cairo.c
index 5ee7f21..4d36a8b 100644
--- a/pp-cairo.c
+++ b/pp-cairo.c
@@ -511,6 +511,14 @@ out:
 }
 
 void
+cairo_renderer_clear_page (CairoRenderer *renderer)
+{
+  cairo_set_source_rgb(renderer->ctx, 0.0, 0.0, 0.0);
+  cairo_paint(renderer->ctx);
+  cairo_show_page (renderer->ctx);
+}
+
+void
 cairo_renderer_render_page (CairoRenderer *renderer,
                             PinPointPoint *point)
 {
diff --git a/pp-clutter.c b/pp-clutter.c
index 03eb867..1d74337 100644
--- a/pp-clutter.c
+++ b/pp-clutter.c
@@ -50,6 +50,7 @@ void cairo_renderer_set_cr (PinPointRenderer *pp_renderer,
 
 void cairo_renderer_render_page (void          *renderer,
                                  PinPointPoint *point);
+void cairo_renderer_clear_page (void          *renderer);
 
 /* #define QUICK_ACCESS_LEFT - uncomment to move speed access from top to left,
  *                             useful on meego netbook
@@ -1871,6 +1872,7 @@ static gboolean update_speaker_screen (ClutterRenderer *renderer)
         cairo_renderer_set_cr (renderer->cairo_renderer,
                                cr, clutter_actor_get_width (renderer->speaker_prev),
                                clutter_actor_get_height (renderer->speaker_prev));
+        cairo_renderer_clear_page(renderer->cairo_renderer);
         if (pp_slidep->prev)
           cairo_renderer_render_page (renderer->cairo_renderer,
                                       pp_slidep->prev->data);
@@ -1885,6 +1887,7 @@ static gboolean update_speaker_screen (ClutterRenderer *renderer)
         cairo_renderer_set_cr (renderer->cairo_renderer,
                                cr, clutter_actor_get_width (renderer->speaker_current),
                                clutter_actor_get_height (renderer->speaker_current));
+        cairo_renderer_clear_page(renderer->cairo_renderer);
         cairo_renderer_render_page (renderer->cairo_renderer,
                                     pp_slidep->data);
         cairo_renderer_unset_cr (renderer->cairo_renderer);
@@ -1895,6 +1898,7 @@ static gboolean update_speaker_screen (ClutterRenderer *renderer)
         cairo_renderer_set_cr (renderer->cairo_renderer,
                                cr, clutter_actor_get_width (renderer->speaker_next),
                                clutter_actor_get_height (renderer->speaker_next));
+        cairo_renderer_clear_page(renderer->cairo_renderer);
         if (pp_slidep->next)
           cairo_renderer_render_page (renderer->cairo_renderer,
                                       pp_slidep->next->data);
-- 
1.7.7


Excuses if this is an inappropriate way to fix this issue. I have zero
experience with either clutter or cairo. The above patch just happens
to workforme ;-)


Regards,

Klaus
---
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]