Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/software_xcb


Modified Files:
        evas_outbuf.c evas_xcb_buffer.c 


Log Message:
update software xcb engine to match xlib engine improvements during startup

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_outbuf.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- evas_outbuf.c       27 Feb 2007 13:39:44 -0000      1.13
+++ evas_outbuf.c       27 Feb 2007 15:17:18 -0000      1.14
@@ -154,6 +154,7 @@
                     else
                        pm = PAL_MODE_MONO;
                  }
+                /* FIXME: only alloc once per display+cmap */
                buf->priv.pal =
                   evas_software_xcb_x_color_allocate(conn,
                                                      cmap,
@@ -771,14 +772,19 @@
 {
    /* create an "empty" perf struct with just the system & display info */
    Outbuf_Perf   *perf;
+#if 0
    xcb_drawable_t root;
    struct utsname un;
    FILE          *f;
+#endif
 
    perf = calloc(1, sizeof(Outbuf_Perf));
 
    perf->x.conn = conn;
 
+   perf->min_shm_image_pixel_count = 200 * 200;        /* default hard-coded */
+
+#if 0
    /* FIXME: should use the default screen */
    root = xcb_setup_roots_iterator ((xcb_setup_t *)xcb_get_setup 
(conn)).data->root;
    if (draw)
@@ -814,8 +820,6 @@
    perf->x.screen_count = xcb_setup_roots_iterator((xcb_setup_t 
*)xcb_get_setup(conn)).rem;
    perf->x.depth        = x_depth;
 
-   perf->min_shm_image_pixel_count = 200 * 200;        /* default hard-coded */
-
    if (!uname(&un))
      {
        perf->os.name = strdup(un.sysname);
@@ -879,9 +883,8 @@
      }
    if (!perf->cpu.info)
       perf->cpu.info = strdup("");
+#endif
    return perf;
-   vis = NULL;
-   cmap = 0;
 }
 
 char *
@@ -889,6 +892,8 @@
 {
    /* get a seriazed string that is a unique identifier for your */
    /* hardware/x/connection setup. */
+   return NULL;
+#if 0
    char  buf[32768];
    int   sum1, sum2, i;
    char *p;
@@ -912,12 +917,15 @@
      }
    snprintf(buf, sizeof(buf), "%08x%08x", sum1, sum2);
    return strdup(buf);
+#endif
 }
 
 void
 evas_software_xcb_outbuf_perf_store_x(Outbuf_Perf *perf)
 {
    /* write performance results to x root property */
+   return;
+#if 0
    xcb_intern_atom_cookie_t     cookie_atom;
    xcb_get_input_focus_cookie_t cookie_focus;
    xcb_intern_atom_reply_t     *reply_atom;
@@ -951,6 +959,7 @@
    free(reply_focus);
    free(str);
    free (reply_atom);
+#endif
 }
 
 Outbuf_Perf *
@@ -961,15 +970,19 @@
                                        int               x_depth)
 {
    /* read performance results from root window */
+#if 0
    xcb_intern_atom_reply_t  *type_rep;
    xcb_get_property_cookie_t cookie;
    xcb_get_property_reply_t *prop_rep;
    char                     *type_str;
    xcb_atom_t                type, format;
+#endif
    Outbuf_Perf              *perf;
 
    perf = evas_software_xcb_outbuf_perf_new_x(conn, draw, vis, cmap, x_depth);
+   return perf;
 
+#if 0
    type_str = "__EVAS_PERF_ENGINE_SOFTWARE";
    type_rep = xcb_intern_atom_reply(conn,
                                     xcb_intern_atom_unchecked(conn,
@@ -1007,18 +1020,21 @@
      free(prop_rep);
 
    return perf;
+#endif
 }
 
 void
 evas_software_xcb_outbuf_perf_free(Outbuf_Perf *perf)
 {
    /* free the perf struct */
+#if 0
    free(perf->x.display);
    free(perf->x.vendor);
    free(perf->os.name);
    free(perf->os.version);
    free(perf->os.machine);
    free(perf->cpu.info);
+#endif
    free(perf);
 }
 
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_xcb_buffer.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- evas_xcb_buffer.c   10 Oct 2006 19:32:36 -0000      1.9
+++ evas_xcb_buffer.c   27 Feb 2007 15:17:18 -0000      1.10
@@ -62,10 +62,14 @@
 int
 evas_software_xcb_x_can_do_shm(xcb_connection_t *c)
 {
+   static xcb_connection_t  *cached_c = NULL;
+   static int                cached_result = 0;
    xcb_get_geometry_reply_t *geom;
    xcb_drawable_t            drawable;
    int                       depth;
 
+   if (c == cached_c) return cached_result;
+   cached_c = c;
    /* FIXME: get the corect screen */
    drawable = xcb_setup_roots_iterator (xcb_get_setup(c)).data->root;
    geom = xcb_get_geometry_reply (c, xcb_get_geometry_unchecked(c, drawable), 
0);
@@ -85,10 +89,16 @@
                                                      16,
                                                      2,
                                                      NULL);
-       if (!xcbob) return 0;
+       if (!xcbob)
+         {
+            cached_result = 0;
+            return 0;
+         }
        evas_software_xcb_x_output_buffer_free(xcbob, 1);
+       cached_result = 1;
        return 1;
      }
+   cached_result = 0;
    return 0;
 }
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to