[Xcb-commit] 2 commits - aux image

Bart Massey bart at kemper.freedesktop.org
Mon Dec 17 09:12:48 PST 2007


 aux/xcb_aux.c              |    2 -
 image/test_xcb_image_shm.c |   56 ++++++++++++++++++---------------------------
 2 files changed, 24 insertions(+), 34 deletions(-)

New commits:
commit 2064491e3efeac970ba37378940ac6cb06fa7dd4
Author: Bart Massey <bart at cs.pdx.edu>
Date:   Mon Dec 17 09:10:59 2007 -0800

    re-fixed my stupid visual_class typo; thanks to Thomas Hunger for the report

diff --git a/aux/xcb_aux.c b/aux/xcb_aux.c
index 3602afa..b1b7f38 100644
--- a/aux/xcb_aux.c
+++ b/aux/xcb_aux.c
@@ -107,7 +107,7 @@ xcb_aux_find_visual_by_attrs (xcb_screen_t *screen,
 	    continue;
 	for (j = xcb_depth_visuals_iterator(i.data);
 	     j.rem; xcb_visualtype_next(&j))
-	    if (class == -1 || j.data->visual_class == class)
+	    if (class == -1 || j.data->_class == class)
 		return j.data;
     }
     return 0;
commit 01b1136debac31fd7cf0e7f3a5ecd068d8abe263
Author: Bart Massey <bart at cs.pdx.edu>
Date:   Sat Dec 8 19:03:49 2007 -0800

    fixed check for SHM in test_xcb_image_shm

diff --git a/image/test_xcb_image_shm.c b/image/test_xcb_image_shm.c
index d22825c..7e0bc59 100644
--- a/image/test_xcb_image_shm.c
+++ b/image/test_xcb_image_shm.c
@@ -31,6 +31,7 @@ main (int argc, char *argv[])
   int              depth;
   int              screen_nbr;
   xcb_generic_event_t *e;
+  uint8_t format;
   
   /* Open the connexion to the X server and get the first screen */
   c = xcb_connect (NULL, &screen_nbr);
@@ -61,42 +62,37 @@ main (int argc, char *argv[])
   rep = xcb_shm_query_version_reply (c,
 				 xcb_shm_query_version (c),
 				 NULL);
-  if (rep)
-    {
-      uint8_t format;
-      
-      if (!rep->shared_pixmaps ||
-	  rep->major_version < 1 ||
-	  (rep->major_version == 1 && rep->minor_version == 0))
-	{
+  if (!rep || !rep->shared_pixmaps ||
+      rep->major_version < 1 ||
+      (rep->major_version == 1 && rep->minor_version == 0))
+      {
 	  printf ("No or insufficient shm support...\n");
 	  exit (0);
-	}
-      format = rep->pixmap_format;
-      img = xcb_image_create_native (c, W_W, W_H, format, depth,
+      }
+  format = rep->pixmap_format;
+  img = xcb_image_create_native (c, W_W, W_H, format, depth,
 				     0, ~0, 0);
 
-      if (!img)
-	{
+  if (!img)
+      {
 	  printf ("Can't create image...\n");
 	  exit (0);
-	}
+      }
 
-      printf ("Create image summary:\n");
-      printf (" * format..........: %d\n", img->format);
-      printf (" * byte order......: %d\n", img->byte_order);
-      printf (" * bitmap unit.....: %d\n", img->bpp);
-      printf (" * bitmap order....: %d\n", img->bit_order);
-      printf (" * bitmap pad......: %d\n", img->scanline_pad);
+  printf ("Create image summary:\n");
+  printf (" * format..........: %d\n", img->format);
+  printf (" * byte order......: %d\n", img->byte_order);
+  printf (" * bitmap unit.....: %d\n", img->bpp);
+  printf (" * bitmap order....: %d\n", img->bit_order);
+  printf (" * bitmap pad......: %d\n", img->scanline_pad);
 
-      shminfo.shmid = shmget (IPC_PRIVATE, img->size, IPC_CREAT|0777);
-      shminfo.shmaddr = shmat(shminfo.shmid, 0, 0);
-      img->data = shminfo.shmaddr;
+  shminfo.shmid = shmget (IPC_PRIVATE, img->size, IPC_CREAT|0777);
+  shminfo.shmaddr = shmat(shminfo.shmid, 0, 0);
+  img->data = shminfo.shmaddr;
 
-      shminfo.shmseg = xcb_generate_id (c);
-      xcb_shm_attach(c, shminfo.shmseg, shminfo.shmid, 0);
-      shmctl(shminfo.shmid, IPC_RMID, 0);
-    }
+  shminfo.shmseg = xcb_generate_id (c);
+  xcb_shm_attach(c, shminfo.shmseg, shminfo.shmid, 0);
+  shmctl(shminfo.shmid, IPC_RMID, 0);
 
   /* Draw in the image */
   printf ("put the pixel\n");
@@ -134,12 +130,6 @@ main (int argc, char *argv[])
   points[1].x = 1;
   points[1].y = 1;
   xcb_poly_line(c, XCB_COORD_MODE_ORIGIN, rect, fgcolor, 2, points);
-/*   points[0].x = 10; */
-/*   points[0].y = 10; */
-/*   points[1].x = 10; */
-/*   points[1].y = 40; */
-/*   xcb_poly_line(c, XCB_COORD_MODE_ORIGIN, rect, fgcolor, 2, points); */
-
 
   xcb_flush (c); 
 


More information about the xcb-commit mailing list