[cairo-commit] glitzinfo glitzinfo.c,1.8,1.9

David Reveman commit at pdx.freedesktop.org
Mon Nov 22 07:02:27 PST 2004


Committed by: davidr

Update of /cvs/cairo/glitzinfo
In directory gabe:/tmp/cvs-serv1079

Modified Files:
	glitzinfo.c 
Log Message:
Track changes to glitz

Index: glitzinfo.c
===================================================================
RCS file: /cvs/cairo/glitzinfo/glitzinfo.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- glitzinfo.c	4 Oct 2004 11:42:01 -0000	1.8
+++ glitzinfo.c	22 Nov 2004 15:02:25 -0000	1.9
@@ -56,6 +56,8 @@
           (features & GLITZ_FEATURE_TEXTURE_ENV_DOT3_MASK)? "Yes": "No");
   printf ("blend color: %s\n",
           (features & GLITZ_FEATURE_BLEND_COLOR_MASK)? "Yes": "No");
+  printf ("packed pixels: %s\n",
+          (features & GLITZ_FEATURE_PACKED_PIXELS_MASK)? "Yes": "No");
   printf ("fragment program: %s\n",
           (features & GLITZ_FEATURE_FRAGMENT_PROGRAM_MASK)? "Yes": "No");
   printf ("vertex buffer object: %s\n",
@@ -67,8 +69,6 @@
           "No");
   printf ("full-scene anti-aliasing: %s\n",
           (features & GLITZ_FEATURE_MULTISAMPLE_MASK)? "Yes": "No");
-  printf ("offscreen full-scene anti-aliasing: %s\n",
-          (features & GLITZ_FEATURE_OFFSCREEN_MULTISAMPLE_MASK)? "Yes": "No");
   printf ("full-scene anti-aliasing filter hint: %s\n",
           (features & GLITZ_FEATURE_MULTISAMPLE_FILTER_HINT_MASK)? "Yes":
           "No");
@@ -76,10 +76,11 @@
 
 int
 main (int argc, char **argv) {
-  glitz_format_t templ;
+  glitz_drawable_format_t templ;
   unsigned long mask;
+  glitz_drawable_format_t *dformats;
   glitz_format_t *formats;
-  glitz_surface_t *surface;
+  glitz_drawable_t *drawable;
   int i;
 
 #ifdef GLITZ_GLX_BACKEND
@@ -98,16 +99,16 @@
 
   glitz_glx_init (NULL);
 
-  templ.draw.onscreen = 1;
-  mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+  templ.types.window = 1;
+  mask = GLITZ_FORMAT_WINDOW_MASK;
   
-  formats = glitz_glx_find_format (display, screen, mask, &templ, 0);
-  if (!formats) {
-    fprintf (stderr, "Error: couldn't find onscreen format\n");
+  dformats = glitz_glx_find_drawable_format (display, screen, mask, &templ, 0);
+  if (!dformats) {
+    fprintf (stderr, "Error: couldn't find drawable format\n");
     return 1;
   }
 
-  vinfo = glitz_glx_get_visual_info_from_format (display, screen, formats);  
+  vinfo = glitz_glx_get_visual_info_from_format (display, screen, dformats);
   if (!vinfo) {
     fprintf (stderr, "Error: no visual info from format\n");
     return 1;
@@ -123,10 +124,10 @@
 
   XFree (vinfo);
   
-  surface = glitz_glx_surface_create_for_window (display, screen,
-                                                 formats, win, 1, 1);
-  if (!surface) {
-    fprintf (stderr, "Error: couldn't create glitz surface for window\n");
+  drawable = glitz_glx_create_drawable_for_window (display, screen,
+                                                   dformats, win, 1, 1);
+  if (!drawable) {
+    fprintf (stderr, "Error: couldn't create glitz drawable for window\n");
     return 1;
   }
   
@@ -137,14 +138,14 @@
   WindowRef window;
   Rect bounds;
 
-  templ.draw.onscreen = 1;
-  mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+  templ.types.window = 1;
+  mask = GLITZ_FORMAT_WINDOW_MASK;
 
   glitz_agl_init ();
   
-  formats = glitz_agl_find_format (mask, &templ, 0);
-  if (!formats) {
-    fprintf (stderr, "Error: couldn't find onscreen format\n");
+  dformats = glitz_agl_find_drawable_format (mask, &templ, 0);
+  if (!dformats) {
+    fprintf (stderr, "Error: couldn't find drawable format\n");
     return 1;
   }
 
@@ -152,51 +153,65 @@
   CreateNewWindow (kDocumentWindowClass, kWindowStandardDocumentAttributes,
                    &bounds, &window);
   
-  surface = glitz_agl_surface_create_for_window (formats, window, 1, 1);
-  if (!surface) {
-    fprintf (stderr, "Error: couldn't create glitz surface for window\n");
+  drawable = glitz_agl_create_drawable_for_window (dformats, window, 1, 1);
+  if (!drawable) {
+    fprintf (stderr, "Error: couldn't create glitz drawable for window\n");
     return 1;
   }
 #endif
 
-  print_features (glitz_surface_get_features (surface));
-  
-  printf ("\nid\tr/g/b/a    \tdepth\tstencil"
-          "\tonscreen offscreen db ms/samples\n");
+  print_features (glitz_drawable_get_features (drawable));
+
+  printf ("\nDrawable formats:\n");
+  printf ("id\tr/g/b/a    \tdepth\tstencil\twindow\tpbuffer\tdb\tsamples\n");
   printf ("-------------------------------------"
           "-----------------------------------\n");
 
   i = 0;
   do {
+    dformats = glitz_find_similar_drawable_format (drawable, 0, NULL, i++);
+    
+    if (dformats) {
+      printf ("0x%x\t%d/%d/%d/%d    \t%d\t%d\t%c\t%c\t%c\t%d\n",
+              (int) dformats->id,
+              dformats->color.red_size,
+              dformats->color.green_size,
+              dformats->color.blue_size,
+              dformats->color.alpha_size,
+              dformats->depth_size,
+              dformats->stencil_size,
+              (dformats->types.window) ? 'y': '.',
+              (dformats->types.pbuffer) ? 'y': '.',
+              (dformats->doublebuffer) ? 'y': '.',
+              dformats->samples);
+    }
+  } while (dformats);
 
-#ifdef GLITZ_GLX_BACKEND
-    formats = glitz_glx_find_format (display, screen, 0, NULL, i++);
-#endif
+  printf ("\nSurface formats:\n");
+  printf ("id\ttype\tr/g/b/a\n");
+  printf ("------------------------\n");
 
-#ifdef GLITZ_AGL_BACKEND
-    formats = glitz_agl_find_format (0, NULL, i++);
-#endif
+  i = 0;
+  do {
+    formats = glitz_find_format (drawable, 0, NULL, i++);
     
     if (formats) {
-      printf ("0x%x\t%d/%d/%d/%d    \t%d\t%d\t%s        %s       %c  ",
-              (int) formats->id,
-              formats->red_size, formats->green_size, formats->blue_size,
-              formats->alpha_size,
-              formats->depth_size,
-              formats->stencil_size,
-              (formats->draw.onscreen) ? "rw": ". ",
-              (formats->draw.offscreen) ? "rw":
-              (formats->read.offscreen) ? "r ": ". ",
-              (formats->doublebuffer) ? 'y': '.');
-      if (formats->multisample.supported)
-        printf ("y/%d\n", formats->multisample.samples);
-      else
-        printf (".\n");
+      printf ("0x%x\t", (int) formats->id);
+
+      switch (formats->type) {
+      case GLITZ_FORMAT_TYPE_COLOR:
+        printf ("color\t%d/%d/%d/%d",
+                formats->color.red_size,
+                formats->color.green_size,
+                formats->color.blue_size,
+                formats->color.alpha_size);
+      }
+
+      printf ("\n");
     }
-    
   } while (formats);
 
-  glitz_surface_destroy (surface);
+  glitz_drawable_destroy (drawable);
 
 #ifdef GLITZ_GLX_BACKEND
   glitz_glx_fini ();




More information about the cairo-commit mailing list