[totem] backend: Use cairo_fill() to draw the black bg



commit 11fcbf6d9aea2d055ce5054493dc210e79f53404
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Dec 3 01:27:15 2010 +0000

    backend: Use cairo_fill() to draw the black bg
    
    Instead of using cairo_rectangle() and cairo_paint(). Seeing
    as we already have a black background set, and paiting is much
    slower than clearing (or should be).
    
    This fixes some flicker in the display with more recent versions
    of GTK+ 3.x.

 src/backend/bacon-video-widget-gst-0.10.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 0d19ac4..21e34da 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -738,8 +738,8 @@ bacon_video_widget_draw (GtkWidget *widget, cairo_t *cr)
   gtk_widget_get_allocation (widget, &allocation);
 
   cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
-  cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
-  cairo_paint (cr);
+  cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+  cairo_fill (cr);
 
   /* If there's only audio and no visualisation, draw the logo as well.
    * If we have a cover image to display, we display it regardless of whether we're
@@ -757,6 +757,7 @@ bacon_video_widget_draw (GtkWidget *widget, cairo_t *cr)
       gint s_width, s_height, d_width, d_height;
       gfloat ratio;
 
+
       s_width = gdk_pixbuf_get_width (pixbuf);
       s_height = gdk_pixbuf_get_height (pixbuf);
       d_width = allocation.width;
@@ -788,6 +789,7 @@ bacon_video_widget_draw (GtkWidget *widget, cairo_t *cr)
       else
         logo = g_object_ref (G_OBJECT (pixbuf));
 
+      cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
       gdk_cairo_set_source_pixbuf (cr, logo, (allocation.width - s_width) / 2, (allocation.height - s_height) / 2);
       cairo_paint (cr);
 



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