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:
Seunghun Lee 2014-07-07 09:55:45 -04:00 committed by Chris Michael
parent 0667d4ce34
commit 2b21742a91
1 changed files with 28 additions and 5 deletions

View File

@ -743,11 +743,34 @@ e_pixmap_image_data_argb_convert(E_Pixmap *cp, void *pix, void *ipix, Eina_Recta
case E_PIXMAP_TYPE_WL:
if (cp->image_argb) return EINA_TRUE;
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
WRN("FIXME: Convert wayland non-argb image");
(void) pix;
(void) ipix;
(void) r;
(void) stride;
if (cp->resource)
{
/* TOOD: add more cases */
struct wl_shm_buffer *buffer;
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
break;
default: