Commits

Jeff Sparkes committed 0b8178f

Use cairo clear operator.

* redisplay-gtk.c (XLIKE_clear_region): Use cairo clear operator.
Fix unused parameters.

Comments (0)

Files changed (2)

src/ChangeLog.GTK

+2012-05-10  Jeff Sparkes  <jsparkes@gmail.com>
+
+	* redisplay-gtk.c (XLIKE_clear_region): Use cairo clear operator.
+	Fix unused parameters.
+
 2012-05-08  Jeff Sparkes  <jsparkes@gmail.com>
 
 	* redisplay.c (vars_of_redisplay): Document that Gtk supports

src/redisplay-gtk.c

 XLIKE_clear_region (Lisp_Object UNUSED (locale), struct frame* f,
 		    face_index UNUSED (findex),
 		    int x, int y, int width, int height,
-		    Lisp_Object fcolor, Lisp_Object bcolor,
+		    Lisp_Object UNUSED (fcolor), Lisp_Object UNUSED (bcolor),
 		    Lisp_Object background_pixmap,
-		    Lisp_Object background_placement)
+		    Lisp_Object UNUSED (background_placement))
 {
   GtkWidget *widget = FRAME_GTK_TEXT_WIDGET (f);
   cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
 
-  if (!NILP (bcolor))
-    {
-      cr_set_foreground (cr, bcolor);
-      gtk_fill_rectangle (cr, x, y, width, height);
-    }
-  else
-    {
-      /* XXX lookup default style background colour? -jsparkes */
-    }
-
   if (!UNBOUNDP (background_pixmap))
     {
       /* XXX Implement me! */
       XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
       */
     }
+  else
+    {
+      cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+      gtk_fill_rectangle (cr, x, y, width, height);
+    }
   cairo_destroy (cr);
 }