update software xcb engine to match xlib engine improvements during startup

SVN revision: 28493
This commit is contained in:
doursse 2007-02-27 15:17:18 +00:00 committed by doursse
parent 77ebfa2b43
commit a8129d063b
2 changed files with 31 additions and 5 deletions

View File

@ -154,6 +154,7 @@ evas_software_xcb_outbuf_setup_x(int w,
else else
pm = PAL_MODE_MONO; pm = PAL_MODE_MONO;
} }
/* FIXME: only alloc once per display+cmap */
buf->priv.pal = buf->priv.pal =
evas_software_xcb_x_color_allocate(conn, evas_software_xcb_x_color_allocate(conn,
cmap, cmap,
@ -771,14 +772,19 @@ evas_software_xcb_outbuf_perf_new_x(xcb_connection_t *conn,
{ {
/* create an "empty" perf struct with just the system & display info */ /* create an "empty" perf struct with just the system & display info */
Outbuf_Perf *perf; Outbuf_Perf *perf;
#if 0
xcb_drawable_t root; xcb_drawable_t root;
struct utsname un; struct utsname un;
FILE *f; FILE *f;
#endif
perf = calloc(1, sizeof(Outbuf_Perf)); perf = calloc(1, sizeof(Outbuf_Perf));
perf->x.conn = conn; perf->x.conn = conn;
perf->min_shm_image_pixel_count = 200 * 200; /* default hard-coded */
#if 0
/* FIXME: should use the default screen */ /* FIXME: should use the default screen */
root = xcb_setup_roots_iterator ((xcb_setup_t *)xcb_get_setup (conn)).data->root; root = xcb_setup_roots_iterator ((xcb_setup_t *)xcb_get_setup (conn)).data->root;
if (draw) if (draw)
@ -814,8 +820,6 @@ evas_software_xcb_outbuf_perf_new_x(xcb_connection_t *conn,
perf->x.screen_count = xcb_setup_roots_iterator((xcb_setup_t *)xcb_get_setup(conn)).rem; perf->x.screen_count = xcb_setup_roots_iterator((xcb_setup_t *)xcb_get_setup(conn)).rem;
perf->x.depth = x_depth; perf->x.depth = x_depth;
perf->min_shm_image_pixel_count = 200 * 200; /* default hard-coded */
if (!uname(&un)) if (!uname(&un))
{ {
perf->os.name = strdup(un.sysname); perf->os.name = strdup(un.sysname);
@ -879,9 +883,8 @@ evas_software_xcb_outbuf_perf_new_x(xcb_connection_t *conn,
} }
if (!perf->cpu.info) if (!perf->cpu.info)
perf->cpu.info = strdup(""); perf->cpu.info = strdup("");
#endif
return perf; return perf;
vis = NULL;
cmap = 0;
} }
char * char *
@ -889,6 +892,8 @@ evas_software_xcb_outbuf_perf_serialize_info_x(Outbuf_Perf *perf)
{ {
/* get a seriazed string that is a unique identifier for your */ /* get a seriazed string that is a unique identifier for your */
/* hardware/x/connection setup. */ /* hardware/x/connection setup. */
return NULL;
#if 0
char buf[32768]; char buf[32768];
int sum1, sum2, i; int sum1, sum2, i;
char *p; char *p;
@ -912,12 +917,15 @@ evas_software_xcb_outbuf_perf_serialize_info_x(Outbuf_Perf *perf)
} }
snprintf(buf, sizeof(buf), "%08x%08x", sum1, sum2); snprintf(buf, sizeof(buf), "%08x%08x", sum1, sum2);
return strdup(buf); return strdup(buf);
#endif
} }
void void
evas_software_xcb_outbuf_perf_store_x(Outbuf_Perf *perf) evas_software_xcb_outbuf_perf_store_x(Outbuf_Perf *perf)
{ {
/* write performance results to x root property */ /* write performance results to x root property */
return;
#if 0
xcb_intern_atom_cookie_t cookie_atom; xcb_intern_atom_cookie_t cookie_atom;
xcb_get_input_focus_cookie_t cookie_focus; xcb_get_input_focus_cookie_t cookie_focus;
xcb_intern_atom_reply_t *reply_atom; xcb_intern_atom_reply_t *reply_atom;
@ -951,6 +959,7 @@ evas_software_xcb_outbuf_perf_store_x(Outbuf_Perf *perf)
free(reply_focus); free(reply_focus);
free(str); free(str);
free (reply_atom); free (reply_atom);
#endif
} }
Outbuf_Perf * Outbuf_Perf *
@ -961,15 +970,19 @@ evas_software_xcb_outbuf_perf_restore_x(xcb_connection_t *conn,
int x_depth) int x_depth)
{ {
/* read performance results from root window */ /* read performance results from root window */
#if 0
xcb_intern_atom_reply_t *type_rep; xcb_intern_atom_reply_t *type_rep;
xcb_get_property_cookie_t cookie; xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *prop_rep; xcb_get_property_reply_t *prop_rep;
char *type_str; char *type_str;
xcb_atom_t type, format; xcb_atom_t type, format;
#endif
Outbuf_Perf *perf; Outbuf_Perf *perf;
perf = evas_software_xcb_outbuf_perf_new_x(conn, draw, vis, cmap, x_depth); 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_str = "__EVAS_PERF_ENGINE_SOFTWARE";
type_rep = xcb_intern_atom_reply(conn, type_rep = xcb_intern_atom_reply(conn,
xcb_intern_atom_unchecked(conn, xcb_intern_atom_unchecked(conn,
@ -1007,18 +1020,21 @@ evas_software_xcb_outbuf_perf_restore_x(xcb_connection_t *conn,
free(prop_rep); free(prop_rep);
return perf; return perf;
#endif
} }
void void
evas_software_xcb_outbuf_perf_free(Outbuf_Perf *perf) evas_software_xcb_outbuf_perf_free(Outbuf_Perf *perf)
{ {
/* free the perf struct */ /* free the perf struct */
#if 0
free(perf->x.display); free(perf->x.display);
free(perf->x.vendor); free(perf->x.vendor);
free(perf->os.name); free(perf->os.name);
free(perf->os.version); free(perf->os.version);
free(perf->os.machine); free(perf->os.machine);
free(perf->cpu.info); free(perf->cpu.info);
#endif
free(perf); free(perf);
} }

View File

@ -62,10 +62,14 @@ evas_software_xcb_x_write_mask_line(Outbuf *buf,
int int
evas_software_xcb_x_can_do_shm(xcb_connection_t *c) 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_get_geometry_reply_t *geom;
xcb_drawable_t drawable; xcb_drawable_t drawable;
int depth; int depth;
if (c == cached_c) return cached_result;
cached_c = c;
/* FIXME: get the corect screen */ /* FIXME: get the corect screen */
drawable = xcb_setup_roots_iterator (xcb_get_setup(c)).data->root; drawable = xcb_setup_roots_iterator (xcb_get_setup(c)).data->root;
geom = xcb_get_geometry_reply (c, xcb_get_geometry_unchecked(c, drawable), 0); geom = xcb_get_geometry_reply (c, xcb_get_geometry_unchecked(c, drawable), 0);
@ -85,10 +89,16 @@ evas_software_xcb_x_can_do_shm(xcb_connection_t *c)
16, 16,
2, 2,
NULL); NULL);
if (!xcbob) return 0; if (!xcbob)
{
cached_result = 0;
return 0;
}
evas_software_xcb_x_output_buffer_free(xcbob, 1); evas_software_xcb_x_output_buffer_free(xcbob, 1);
cached_result = 1;
return 1; return 1;
} }
cached_result = 0;
return 0; return 0;
} }