diff options
author | Seunghun Lee <shiin.lee@samsung.com> | 2014-07-07 09:55:45 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2014-08-12 14:46:13 -0400 |
commit | 1967adfe2bce24c77c8c2d5cdf461ab40c85259b (patch) | |
tree | b245378643fa3098825c2cc2134a515103e2b8c4 | |
parent | 18cc4708e6c2f1d4d5dae4d671f8d1912f34c3f6 (diff) | |
download | enlightenment-1967adfe2bce24c77c8c2d5cdf461ab40c85259b.tar.gz |
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
-rw-r--r-- | src/bin/e_pixmap.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index a53c13822f..bf9c46c403 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -744,11 +744,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: |