Esempio n. 1
0
/**
 * Check that the X server supports the RENDER extension.
 */
static bool CheckRender(vout_display_t *vd, xcb_connection_t *conn)
{
    xcb_render_query_version_reply_t *r;
    xcb_render_query_version_cookie_t ck;
    bool ok = false;

    ck = xcb_render_query_version(conn, 0, 11);
    r = xcb_render_query_version_reply(conn, ck, NULL);

    if (r == NULL)
        msg_Err(vd, "RENDER extension not available");
    else if (r->major_version > 0)
        msg_Dbg(vd, "RENDER extension v%"PRIu32".%"PRIu32" unknown",
                r->major_version, r->minor_version);
    else if (r->major_version == 0 && r->minor_version < 6)
        msg_Dbg(vd, "RENDER extension v%"PRIu32".%"PRIu32" too old",
                r->major_version, r->minor_version);
    else {
        msg_Dbg(vd, "using RENDER extension v%"PRIu32".%"PRIu32,
                r->major_version, r->minor_version);
        ok = true;
    }
    free(r);
    return ok;
}
Esempio n. 2
0
void
_ecore_xcb_render_finalize(void)
{
#ifdef ECORE_XCB_RENDER
   const xcb_query_extension_reply_t *ext_reply;
#endif

   LOGFN(__FILE__, __LINE__, __FUNCTION__);

#ifdef ECORE_XCB_RENDER
   ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_render_id);
   if ((ext_reply) && (ext_reply->present))
     {
        xcb_render_query_version_cookie_t cookie;
        xcb_render_query_version_reply_t *reply;

        cookie =
          xcb_render_query_version_unchecked(_ecore_xcb_conn,
                                             XCB_RENDER_MAJOR_VERSION,
                                             XCB_RENDER_MINOR_VERSION);
        reply = xcb_render_query_version_reply(_ecore_xcb_conn, cookie, NULL);
        if (reply)
          {
//        if ((reply->major_version >= XCB_RENDER_MAJOR_VERSION) &&
               if (reply->minor_version >= XCB_RENDER_MINOR_VERSION)
                 {
                    char *v = NULL;

                    _render_avail = EINA_TRUE;
                    _ecore_xcb_xdefaults_init();
                    if ((reply->major_version > 0) || (reply->minor_version >= 5))
                      {
                         _render_argb = EINA_TRUE;
                         v = getenv("XCURSOR_CORE");
                         if (!v)
                           v = _ecore_xcb_xdefaults_string_get("Xcursor", "core");
                         if ((v) && (_ecore_xcb_render_parse_boolean(v)))
                           _render_argb = EINA_FALSE;
                      }
                    if ((_render_argb) &&
                        ((reply->major_version > 0) || (reply->minor_version >= 8)))
                      {
                         _render_anim = EINA_TRUE;
                         v = getenv("XCURSOR_ANIM");
                         if (!v)
                           v = _ecore_xcb_xdefaults_string_get("Xcursor", "anim");
                         if ((v) && (_ecore_xcb_render_parse_boolean(v)))
                           _render_anim = EINA_FALSE;
                      }
                    _ecore_xcb_xdefaults_shutdown();
                 }
          }
        free(reply);
     }
#endif
}
Esempio n. 3
0
File: cache.c Progetto: aosm/X11libs
static connection_cache *
find_or_create_display (xcb_connection_t *c)
{
    connection_cache *info;
    xcb_render_query_version_cookie_t version_cookie;
    xcb_render_query_pict_formats_cookie_t formats_cookie;
    int present;

    /*
     * look for display in list
     */
    for (info = connections.head; info; info = info->next)
        if (info->c == c) {
            connections.cur = info;     /* cache most recently used */
	    return info;
        }

    /*
     * don't already have this display: add it.
     */
    info = malloc (sizeof (connection_cache));
    if (!info)
	return NULL;
    info->c = c;

    version_cookie = xcb_render_query_version(c, 0, 10);
    formats_cookie = xcb_render_query_pict_formats(c);
    xcb_flush(c);
    present = has_required_depths (c);
    info->version = xcb_render_query_version_reply(c, version_cookie, 0);
    info->formats = xcb_render_query_pict_formats_reply(c, formats_cookie, 0);

    if (!present || !info->version || !info->formats)
    {
	free(info->version);
	info->version = 0;
	free(info->formats);
	info->formats = 0;
    }
    /* Check for the lack of sub-pixel data */
    else if (info->version->major_version == 0 && info->version->minor_version < 6)
	info->formats->num_subpixel = 0;

    /*
     * now, chain it onto the list
     */
    info->next = connections.head;
    connections.head = info;
    connections.cur = info;

    return info;
}