summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-27 10:32:41 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-27 10:32:41 +0900
commitbd91ebbbd76069d364e903f5ec3d82d7c3403635 (patch)
tree0c18aa307577de335843e50c83fcd89879ec8793
parent3d5dbbfcd02fcef8c902573496ad1b668425f386 (diff)
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
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_image.c8
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_image.c16
2 files changed, 9 insertions, 15 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_image.c b/src/lib/ecore_x/xcb/ecore_xcb_image.c
index b6ac6ff..7c21781 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_image.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_image.c
@@ -245,7 +245,6 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
245 CHECK_XCB_CONN; 245 CHECK_XCB_CONN;
246 246
247 vis = (xcb_visualtype_t *)im->vis; 247 vis = (xcb_visualtype_t *)im->vis;
248 if (!im->xim) _ecore_xcb_image_shm_create(im);
249 248
250 if (((vis->_class == XCB_VISUAL_CLASS_TRUE_COLOR) || 249 if (((vis->_class == XCB_VISUAL_CLASS_TRUE_COLOR) ||
251 (vis->_class == XCB_VISUAL_CLASS_DIRECT_COLOR)) && 250 (vis->_class == XCB_VISUAL_CLASS_DIRECT_COLOR)) &&
@@ -254,10 +253,13 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
254 (vis->green_mask == 0x00ff00) && 253 (vis->green_mask == 0x00ff00) &&
255 (vis->blue_mask == 0x0000ff)) 254 (vis->blue_mask == 0x0000ff))
256 { 255 {
256 const xcb_setup_t *setup = xcb_get_setup(_ecore_xcb_conn);
257
258 if (!setup) return EINA_FALSE;
257#ifdef WORDS_BIGENDIAN 259#ifdef WORDS_BIGENDIAN
258 if (im->xim->byte_order == XCB_IMAGE_ORDER_MSB_FIRST) return EINA_TRUE; 260 if (setup->image_byte_order == XCB_IMAGE_ORDER_MSB_FIRST) return EINA_TRUE;
259#else 261#else
260 if (im->xim->byte_order == XCB_IMAGE_ORDER_LSB_FIRST) return EINA_TRUE; 262 if (setup->image_byte_order == XCB_IMAGE_ORDER_LSB_FIRST) return EINA_TRUE;
261#endif 263#endif
262 } 264 }
263 265
diff --git a/src/lib/ecore_x/xlib/ecore_x_image.c b/src/lib/ecore_x/xlib/ecore_x_image.c
index 35ee976..6ce8919 100644
--- a/src/lib/ecore_x/xlib/ecore_x_image.c
+++ b/src/lib/ecore_x/xlib/ecore_x_image.c
@@ -305,15 +305,13 @@ ecore_x_image_get(Ecore_X_Image *im,
305 LOGFN(__FILE__, __LINE__, __FUNCTION__); 305 LOGFN(__FILE__, __LINE__, __FUNCTION__);
306 if (im->shm) 306 if (im->shm)
307 { 307 {
308 308 if (!im->xim) _ecore_x_image_shm_create(im);
309 if (!im->xim)
310 _ecore_x_image_shm_create(im);
311 309
312 if (!im->xim) 310 if (!im->xim)
313 return EINA_FALSE; 311 return EINA_FALSE;
314 312
315 _ecore_x_image_err = 0; 313 _ecore_x_image_err = 0;
316 314
317 ecore_x_sync(); 315 ecore_x_sync();
318 // optimised path 316 // optimised path
319 ph = XSetErrorHandler((XErrorHandler)_ecore_x_image_error_handler); 317 ph = XSetErrorHandler((XErrorHandler)_ecore_x_image_error_handler);
@@ -449,12 +447,6 @@ EAPI Eina_Bool
449ecore_x_image_is_argb32_get(Ecore_X_Image *im) 447ecore_x_image_is_argb32_get(Ecore_X_Image *im)
450{ 448{
451 Visual *vis = im->vis; 449 Visual *vis = im->vis;
452 if (!im->xim)
453 {
454 if (im->shm) _ecore_x_image_shm_create(im);
455 else _ecore_x_image_create(im);
456 if (!im->xim) return EINA_FALSE;
457 }
458 if (((vis->class == TrueColor) || 450 if (((vis->class == TrueColor) ||
459 (vis->class == DirectColor)) && 451 (vis->class == DirectColor)) &&
460 (im->bpp == 4) && 452 (im->bpp == 4) &&
@@ -463,9 +455,9 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
463 (vis->blue_mask == 0x0000ff)) 455 (vis->blue_mask == 0x0000ff))
464 { 456 {
465#ifdef WORDS_BIGENDIAN 457#ifdef WORDS_BIGENDIAN
466 if (im->xim->bitmap_bit_order == MSBFirst) return EINA_TRUE; 458 if (BitmapBitOrder(_ecore_x_disp) == MSBFirst) return EINA_TRUE;
467#else 459#else
468 if (im->xim->bitmap_bit_order == LSBFirst) return EINA_TRUE; 460 if (BitmapBitOrder(_ecore_x_disp) == LSBFirst) return EINA_TRUE;
469#endif 461#endif
470 } 462 }
471 return EINA_FALSE; 463 return EINA_FALSE;