efl - ecore-x - work around e's badness in makeing an x image for all wins
so e is being stupid and creating an ecore-x image forevery single window if in x11 mode if it needs it or not. this results in having ti allocate an actual x image and shm segments. work around this and get bit order from somewhere else than the x image itself thus avoiding the allocation until a real get or put is done. @fix
This commit is contained in:
parent
3d5dbbfcd0
commit
bd91ebbbd7
|
@ -245,7 +245,6 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
|
||||||
CHECK_XCB_CONN;
|
CHECK_XCB_CONN;
|
||||||
|
|
||||||
vis = (xcb_visualtype_t *)im->vis;
|
vis = (xcb_visualtype_t *)im->vis;
|
||||||
if (!im->xim) _ecore_xcb_image_shm_create(im);
|
|
||||||
|
|
||||||
if (((vis->_class == XCB_VISUAL_CLASS_TRUE_COLOR) ||
|
if (((vis->_class == XCB_VISUAL_CLASS_TRUE_COLOR) ||
|
||||||
(vis->_class == XCB_VISUAL_CLASS_DIRECT_COLOR)) &&
|
(vis->_class == XCB_VISUAL_CLASS_DIRECT_COLOR)) &&
|
||||||
|
@ -254,10 +253,13 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
|
||||||
(vis->green_mask == 0x00ff00) &&
|
(vis->green_mask == 0x00ff00) &&
|
||||||
(vis->blue_mask == 0x0000ff))
|
(vis->blue_mask == 0x0000ff))
|
||||||
{
|
{
|
||||||
|
const xcb_setup_t *setup = xcb_get_setup(_ecore_xcb_conn);
|
||||||
|
|
||||||
|
if (!setup) return EINA_FALSE;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
if (im->xim->byte_order == XCB_IMAGE_ORDER_MSB_FIRST) return EINA_TRUE;
|
if (setup->image_byte_order == XCB_IMAGE_ORDER_MSB_FIRST) return EINA_TRUE;
|
||||||
#else
|
#else
|
||||||
if (im->xim->byte_order == XCB_IMAGE_ORDER_LSB_FIRST) return EINA_TRUE;
|
if (setup->image_byte_order == XCB_IMAGE_ORDER_LSB_FIRST) return EINA_TRUE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,15 +305,13 @@ ecore_x_image_get(Ecore_X_Image *im,
|
||||||
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
||||||
if (im->shm)
|
if (im->shm)
|
||||||
{
|
{
|
||||||
|
if (!im->xim) _ecore_x_image_shm_create(im);
|
||||||
if (!im->xim)
|
|
||||||
_ecore_x_image_shm_create(im);
|
|
||||||
|
|
||||||
if (!im->xim)
|
if (!im->xim)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
||||||
_ecore_x_image_err = 0;
|
_ecore_x_image_err = 0;
|
||||||
|
|
||||||
ecore_x_sync();
|
ecore_x_sync();
|
||||||
// optimised path
|
// optimised path
|
||||||
ph = XSetErrorHandler((XErrorHandler)_ecore_x_image_error_handler);
|
ph = XSetErrorHandler((XErrorHandler)_ecore_x_image_error_handler);
|
||||||
|
@ -449,12 +447,6 @@ EAPI Eina_Bool
|
||||||
ecore_x_image_is_argb32_get(Ecore_X_Image *im)
|
ecore_x_image_is_argb32_get(Ecore_X_Image *im)
|
||||||
{
|
{
|
||||||
Visual *vis = im->vis;
|
Visual *vis = im->vis;
|
||||||
if (!im->xim)
|
|
||||||
{
|
|
||||||
if (im->shm) _ecore_x_image_shm_create(im);
|
|
||||||
else _ecore_x_image_create(im);
|
|
||||||
if (!im->xim) return EINA_FALSE;
|
|
||||||
}
|
|
||||||
if (((vis->class == TrueColor) ||
|
if (((vis->class == TrueColor) ||
|
||||||
(vis->class == DirectColor)) &&
|
(vis->class == DirectColor)) &&
|
||||||
(im->bpp == 4) &&
|
(im->bpp == 4) &&
|
||||||
|
@ -463,9 +455,9 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
|
||||||
(vis->blue_mask == 0x0000ff))
|
(vis->blue_mask == 0x0000ff))
|
||||||
{
|
{
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
if (im->xim->bitmap_bit_order == MSBFirst) return EINA_TRUE;
|
if (BitmapBitOrder(_ecore_x_disp) == MSBFirst) return EINA_TRUE;
|
||||||
#else
|
#else
|
||||||
if (im->xim->bitmap_bit_order == LSBFirst) return EINA_TRUE;
|
if (BitmapBitOrder(_ecore_x_disp) == LSBFirst) return EINA_TRUE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
|
|
Loading…
Reference in New Issue