forked from enlightenment/enlightenment
Added conversion for image format to ARGB from XRGB for wayland. evas_object_image_data_set will be used instead of evas_object_image_data_copy_set.
Summary: this patch will provide to launch the application based on XRGB8888 like weston-simple-shm. Test Plan: launch weston-simple-shm Reviewers: devilhorns, zmike, raster CC: cedric Differential Revision: https://phab.enlightenment.org/D1137
This commit is contained in:
parent
0667d4ce34
commit
2b21742a91
|
@ -743,11 +743,34 @@ e_pixmap_image_data_argb_convert(E_Pixmap *cp, void *pix, void *ipix, Eina_Recta
|
||||||
case E_PIXMAP_TYPE_WL:
|
case E_PIXMAP_TYPE_WL:
|
||||||
if (cp->image_argb) return EINA_TRUE;
|
if (cp->image_argb) return EINA_TRUE;
|
||||||
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
|
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
|
||||||
WRN("FIXME: Convert wayland non-argb image");
|
if (cp->resource)
|
||||||
(void) pix;
|
{
|
||||||
(void) ipix;
|
/* TOOD: add more cases */
|
||||||
(void) r;
|
struct wl_shm_buffer *buffer;
|
||||||
(void) stride;
|
uint32_t format;
|
||||||
|
int i, x, y;
|
||||||
|
unsigned int *src, *dst;
|
||||||
|
|
||||||
|
if (!(buffer = wl_shm_buffer_get(cp->resource)))
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
format = wl_shm_buffer_get_format(buffer);
|
||||||
|
if (format == WL_SHM_FORMAT_XRGB8888)
|
||||||
|
{
|
||||||
|
dst = (unsigned int *)pix;
|
||||||
|
src = (unsigned int *)ipix;
|
||||||
|
|
||||||
|
for (y = 0; y < r->h; y++)
|
||||||
|
{
|
||||||
|
i = (r->y + y) * stride / 4 + r->x;
|
||||||
|
for (x = 0; x < r->w; x++)
|
||||||
|
dst[i+x] = 0xff000000 | src[i+x];
|
||||||
|
}
|
||||||
|
pix = (void *)dst;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue