[maemo-commits] [maemo-commits] r18894 - in projects/haf/trunk/sapwood: . server

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jul 20 16:55:32 EEST 2009
Author: herzi
Date: 2009-07-20 16:55:13 +0300 (Mon, 20 Jul 2009)
New Revision: 18894

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/server/sapwood-server.c
Log:
2009-01-08  Sven Herzberg  <sven at imendio.com>

	Do the GdkPixbuf rendering with cairo

	* server/sapwood-server.c (extract_pixmap_single): do the rendering
	with cairo; we will have to use this code anyway once we don't have a
	GdkPixmap anymore and use an RGBA cairo_xlib_surface_t



Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2009-07-20 13:55:08 UTC (rev 18893)
+++ projects/haf/trunk/sapwood/ChangeLog	2009-07-20 13:55:13 UTC (rev 18894)
@@ -46,6 +46,14 @@
 
 2009-01-08  Sven Herzberg  <sven at imendio.com>
 
+	Do the GdkPixbuf rendering with cairo
+
+	* server/sapwood-server.c (extract_pixmap_single): do the rendering
+	with cairo; we will have to use this code anyway once we don't have a
+	GdkPixmap anymore and use an RGBA cairo_xlib_surface_t
+
+2009-01-08  Sven Herzberg  <sven at imendio.com>
+
 	Test if the server can run the buttonbox demo
 
 	* demos/Makefile.am: added the buttonbox to the tests

Modified: projects/haf/trunk/sapwood/server/sapwood-server.c
===================================================================
--- projects/haf/trunk/sapwood/server/sapwood-server.c	2009-07-20 13:55:08 UTC (rev 18893)
+++ projects/haf/trunk/sapwood/server/sapwood-server.c	2009-07-20 13:55:13 UTC (rev 18894)
@@ -83,20 +83,20 @@
 		       PixbufOpenResponse *rep)
 {
   GdkPixmap    *pixmap;
-  static GdkGC *tmp_gc = NULL;
   gboolean      need_mask;
+  cairo_t      *cr;
 
   pixmap = gdk_pixmap_new (NULL, width, height, server_depth);
 
-  if (!tmp_gc)
-    tmp_gc = gdk_gc_new (pixmap);
+  cr = gdk_cairo_create (pixmap);
 
-  gdk_draw_pixbuf (pixmap, tmp_gc, pixbuf,
-		   x, y, 0, 0,
-		   width, height,
-		   GDK_RGB_DITHER_NORMAL,
-		   0, 0);
+  cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+  cairo_paint (cr);
 
+  gdk_cairo_set_source_pixbuf (cr, pixbuf, -x, -y);
+  cairo_paint (cr);
+  cairo_destroy (cr);
+
   need_mask = gdk_pixbuf_get_has_alpha (pixbuf);
   /* FIXME: if the mask would still be all ones, skip creating it altogether */
 

More information about the maemo-commits mailing list