evas: and now, the last one to die today, Evas Xrender backend.

SVN revision: 58364
devs/devilhorns/wayland_egl
Cedric BAIL 12 years ago
parent 38771d0adb
commit b0e45e04bc
  1. 2
      legacy/evas/ChangeLog
  2. 10
      legacy/evas/Makefile.am
  3. 17
      legacy/evas/README.in
  4. 11
      legacy/evas/configure.ac
  5. 3
      legacy/evas/evas-xrender-x11.pc.in
  6. 3
      legacy/evas/evas-xrender-xcb.pc.in
  7. 41
      legacy/evas/evas.spec.in
  8. 5
      legacy/evas/src/lib/Makefile.am
  9. 6
      legacy/evas/src/lib/canvas/evas_main.c
  10. 4
      legacy/evas/src/lib/file/evas_module.c
  11. 3
      legacy/evas/src/modules/engines/Makefile.am
  12. 6
      legacy/evas/src/modules/engines/xrender_x11/.cvsignore
  13. 44
      legacy/evas/src/modules/engines/xrender_x11/Evas_Engine_XRender_X11.h
  14. 59
      legacy/evas/src/modules/engines/xrender_x11/Makefile.am
  15. 1328
      legacy/evas/src/modules/engines/xrender_x11/evas_engine.c
  16. 264
      legacy/evas/src/modules/engines/xrender_x11/evas_engine.h
  17. 208
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xcb_font.c
  18. 704
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xcb_image.c
  19. 841
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xcb_render.c
  20. 574
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xcb_ximage.c
  21. 192
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xlib_font.c
  22. 705
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xlib_image.c
  23. 744
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xlib_render.c
  24. 262
      legacy/evas/src/modules/engines/xrender_x11/evas_engine_xlib_ximage.c

@ -214,3 +214,5 @@
* Remove Evas Quartz backend.
* Remove Evas Cairo backend.
* Remove Evas Qtopia backend.
* Remove Evas Xrender backend.

@ -40,8 +40,6 @@ evas-software-buffer.pc.in \
evas-software-x11.pc.in \
evas-software-16-x11.pc.in \
evas-software-8-x11.pc.in \
evas-xrender-x11.pc.in \
evas-xrender-xcb.pc.in \
evas-software-gdi.pc.in \
evas-software-ddraw.pc.in \
evas-software-16-ddraw.pc.in \
@ -86,14 +84,6 @@ if BUILD_ENGINE_GL_SDL
pkgconfig_DATA += evas-opengl-sdl.pc
endif
if BUILD_ENGINE_XRENDER_X11
pkgconfig_DATA += evas-xrender-x11.pc
endif
if BUILD_ENGINE_XRENDER_XCB
pkgconfig_DATA += evas-xrender-xcb.pc
endif
if BUILD_ENGINE_SOFTWARE_GDI
pkgconfig_DATA += evas-software-gdi.pc
endif

@ -19,7 +19,6 @@ Must:
Recommended:
libX11
libXext
libXrender
fontconfig
libpng
libjpeg
@ -192,22 +191,6 @@ pixels, allowing the results of rendering to be directly read out or
used again for other purposes.
--enable-xrender-x11[=static]
this engine uses the xrender api to do drawing via (possibly)
accelerated 2d or 3d hardware means. as such xrender has never lived
up to its possible performance levels and has fallen into disrepair.
use this engine at your own risk. it is considered to be "bitrotting"
and be unmaintained.
--enable-xrender-xcb[=static]
this is the same as xrender-x11 but uses/exposes an xcb api. It is not
recommended to use this as it's experimental and will create problems
with both ecore_evas and enlightenment itself.
--enable-gl-x11[=static]
this is the opengl engine. it is intended for an x11 target (via xlib)

@ -94,11 +94,9 @@ want_evas_cserve="yes"
want_evas_engine_buffer="yes"
want_evas_engine_software_xlib="no"
want_evas_engine_xrender_x11="no"
want_evas_engine_gl_x11="no"
want_evas_engine_gl_sdl="no"
want_evas_engine_software_xcb="no"
want_evas_engine_xrender_xcb="no"
want_evas_engine_software_gdi="no"
want_evas_engine_software_ddraw="no"
want_evas_engine_direct3d="no"
@ -152,7 +150,6 @@ case "$host_os" in
want_evas_engine_fb="auto"
### no - not ready/usable/complete
# want_evas_engine_software_8_x11="auto"
# want_evas_engine_xrender_x11="auto"
# want_evas_engine_software_16_x11="auto"
;;
esac
@ -578,14 +575,10 @@ EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [yes], [Buffer])
EVAS_CHECK_ENGINE([software-xlib], [${want_evas_engine_software_xlib}], [yes], [Software Xlib])
EVAS_CHECK_ENGINE([xrender-x11], [${want_evas_engine_xrender_x11}], [yes], [XRender X11])
EVAS_CHECK_ENGINE([gl-x11], [${want_evas_engine_gl_x11}], [yes], [OpenGL X11])
EVAS_CHECK_ENGINE([software-xcb], [${want_evas_engine_software_xcb}], [no], [Software XCB])
EVAS_CHECK_ENGINE([xrender-xcb], [${want_evas_engine_xrender_xcb}], [no], [XRender XCB])
EVAS_CHECK_ENGINE([software-gdi], [${want_evas_engine_software_gdi}], [no], [Software GDI])
EVAS_CHECK_ENGINE([software-ddraw], [${want_evas_engine_software_ddraw}], [no], [Software DirectDraw])
@ -1523,8 +1516,6 @@ evas-software-buffer.pc
evas-software-x11.pc
evas-software-8-x11.pc
evas-software-16-x11.pc
evas-xrender-x11.pc
evas-xrender-xcb.pc
evas-software-gdi.pc
evas-software-ddraw.pc
evas-software-16-ddraw.pc
@ -1565,7 +1556,6 @@ src/modules/engines/directfb/Makefile
src/modules/engines/gl_common/Makefile
src/modules/engines/gl_x11/Makefile
src/modules/engines/gl_sdl/Makefile
src/modules/engines/xrender_x11/Makefile
src/modules/engines/software_sdl/Makefile
src/modules/engines/software_8/Makefile
src/modules/engines/software_8_x11/Makefile
@ -1638,7 +1628,6 @@ echo
echo "Engines:"
echo " Software Memory Buffer.....: $have_evas_engine_buffer"
echo " Software X11...............: $have_evas_engine_software_x11 (Xlib: $have_evas_engine_software_xlib) (XCB: $have_evas_engine_software_xcb)"
echo " XRender X11................: $have_evas_engine_xrender_x11 (XCB: $have_evas_engine_xrender_xcb)"
echo $ECHO_N " OpenGL X11.................: $have_evas_engine_gl_x11 $ECHO_C"
if test "x$have_evas_engine_gl_x11" = "xyes"; then
echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"

@ -1,3 +0,0 @@
Name: evas-xrender-x11
Description: Evas XRender X11 engine
Version: @VERSION@

@ -1,3 +0,0 @@
Name: evas-xrender-xcb
Description: Evas XRender XCB engine
Version: @VERSION@

@ -22,8 +22,6 @@
%bcond_with module_engine_software_16_x11
%bcond_with module_engine_software_sdl
%bcond_with module_engine_software_xcb
%bcond_with module_engine_xrender_x11
%bcond_with module_engine_xrender_xcb
%bcond_with module_loader_gif
%bcond_with module_loader_svg
@ -71,13 +69,11 @@
%define ac_with_module_engine_software-x11 --%{?with_module_engine_software_x11:en}%{!?with_module_engine_software_x11:dis}able-software-x11
%define ac_with_module_engine_buffer --%{?with_module_engine_buffer:en}%{!?with_module_engine_buffer:dis}able-buffer
%define ac_with_module_engine_fb --%{?with_module_engine_fb:en}%{!?with_module_engine_fb:dis}able-fb
%define ac_with_module_engine_xrender_x11 --%{?with_module_engine_xrender_x11:en}%{!?with_module_engine_xrender_x11:dis}able-xrender-x11
%define ac_with_module_engine_gl_x11 --%{?with_module_engine_gl_x11:en}%{!?with_module_engine_gl_x11:dis}able-gl-x11
%define ac_with_module_engine_directfb --%{?with_module_engine_directfb:en}%{!?with_module_engine_directfb:dis}able-directfb
%define ac_with_module_engine_software_16_x11 --%{?with_module_engine_software_16_x11:en}%{!?with_module_engine_software_16_x11:dis}able-software-16-x11
%define ac_with_module_engine_software_sdl --%{?with_module_engine_software_sdl:en}%{!?with_module_engine_software_sdl:dis}able-sdl
%define ac_with_module_engine_software_xcb --%{?with_module_engine_software_xcb:en}%{!?with_module_engine_software_xcb:dis}able-software-xcb
%define ac_with_module_engine_xrender_xcb --%{?with_module_engine_xrender_xcb:en}%{!?with_module_engine_xrender_xcb:dis}able-xrender-xcb
%{!?_rel:%{expand:%%global _rel 0.r%(svnversion | sed 's/[^0-9].*$//' || echo 0000)}}
@ -301,18 +297,6 @@ Requires: evas
Framebuffer rendering engine module for Evas
%endif
%if %{with module_engine_xrender_x11}
%package module_engine_xrender_x11
Summary: XRender rendering engine module for Evas
Group: System Environment/Libraries
#BuildSuggests: xorg-x11-devel, XFree86-devel, xrender-devel
BuildRequires: libXrender-devel
Requires: evas-module_engine_software_generic
Requires: evas
%description module_engine_xrender_x11
XRender rendering engine module for Evas
%endif
%if %{with module_engine_gl_x11}
%package module_engine_gl_x11
Summary: OpenGL under X11 rendering engine module for Evas
@ -366,17 +350,6 @@ Requires: evas
Software XCB X11 rendering engine module for Evas
%endif
%if %{with module_engine_xrender_xcb}
%package module_engine_xrender_xcb
Summary: Xrender XCB X11 rendering engine module for Evas
Group: System Environment/Libraries
BuildRequires: libxcb-devel
Requires: evas-module_engine_xrender_x11
Requires: evas
%description module_engine_xrender_xcb
Xrender XCB X11 rendering engine module for Evas
%endif
%prep
%setup -q
@ -399,13 +372,11 @@ Xrender XCB X11 rendering engine module for Evas
%{?ac_with_module_engine_software_x11} \
%{?ac_with_module_engine_buffer} \
%{?ac_with_module_engine_fb} \
%{?ac_with_module_engine_xrender_x11} \
%{?ac_with_module_engine_gl_x11} \
%{?ac_with_module_engine_directfb} \
%{?ac_with_module_engine_software_16_x11} \
%{?ac_with_module_engine_software_sdl} \
%{?ac_with_module_engine_software_xcb} \
%{?ac_with_module_engine_xrender_xcb} \
$RPM_CONFIGURE_OPTS
%{__make} %{?_smp_mflags} %{?mflags}
test -x `which doxygen` && /bin/sh gendoc || :
@ -561,12 +532,6 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
%{_libdir}/evas/modules/engines/fb/*/module.so
%endif
%if %{with module_engine_xrender_x11}
%files module_engine_xrender_x11
%defattr(-, root, root)
%{_libdir}/evas/modules/engines/xrender_x11/*/module.so
%endif
%if %{with module_engine_gl_x11}
%files module_engine_gl_x11
%defattr(-, root, root)
@ -598,10 +563,4 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
%{_libdir}/evas/modules/engines/software_xcb/*/module.so
%endif
%if %{with module_engine_xrender_xcb}
%files module_engine_xrender_xcb
%defattr(-, root, root)
%{_libdir}/evas/modules/engines/xrender_xcb/*/module.so
%endif
%changelog

@ -95,11 +95,6 @@ SUBDIRS += ../modules/engines/software_x11/
EVAS_STATIC_MODULE += ../modules/engines/software_x11/libevas_engine_software_x11.la
EVAS_STATIC_LIBADD += @evas_engine_software_xlib_libs@ @evas_engine_software_xcb_libs@
endif
if EVAS_STATIC_BUILD_XRENDER_X11
SUBDIRS += ../modules/engines/xrender_x11/
EVAS_STATIC_MODULE += ../modules/engines/xrender_x11/libevas_engine_xrender_x11.la
EVAS_STATIC_LIBADD += @evas_engine_xrender_x11_libs@ @evas_engine_xrender_xcb_libs@
endif
if EVAS_STATIC_BUILD_BMP
SUBDIRS += ../modules/loaders/bmp
EVAS_STATIC_MODULE += ../modules/loaders/bmp/libevas_loader_bmp.la

@ -825,12 +825,6 @@ evas_render_method_list(void)
#ifdef BUILD_ENGINE_SOFTWARE_X11
methods = eina_list_append(methods, "software_x11");
#endif
#ifdef BUILD_ENGINE_XRENDER_X11
methods = eina_list_append(methods, "xrender_x11");
#endif
#ifdef BUILD_ENGINE_XRENDER_XCB
methods = eina_list_append(methods, "xrender_xcb");
#endif
#ifdef BUILD_ENGINE_SOFTWARE_16_X11
methods = eina_list_append(methods, "software_16_x11");
#endif

@ -108,7 +108,6 @@ EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_gdi);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_generic);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_sdl);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, software_x11);
EVAS_EINA_STATIC_MODULE_DEFINE(engine, xrender_x11);
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, xpm);
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, bmp);
EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tiff);
@ -186,9 +185,6 @@ static const struct {
#ifdef EVAS_STATIC_BUILD_SOFTWARE_X11
EVAS_EINA_STATIC_MODULE_USE(engine, software_x11),
#endif
#ifdef EVAS_STATIC_BUILD_XRENDER_X11
EVAS_EINA_STATIC_MODULE_USE(engine, xrender_x11),
#endif
#ifdef EVAS_STATIC_BUILD_XPM
EVAS_EINA_STATIC_MODULE_USE(image_loader, xpm),
#endif

@ -58,7 +58,4 @@ endif
if !EVAS_STATIC_BUILD_SOFTWARE_X11
SUBDIRS += software_x11
endif
if !EVAS_STATIC_BUILD_XRENDER_X11
SUBDIRS += xrender_x11
endif

@ -1,6 +0,0 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

@ -1,44 +0,0 @@
#ifndef _EVAS_ENGINE_XRENDER_X11_H
#define _EVAS_ENGINE_XRENDER_X11_H
#include <X11/Xlib.h>
typedef enum
{
EVAS_ENGINE_INFO_XRENDER_BACKEND_XLIB,
EVAS_ENGINE_INFO_XRENDER_BACKEND_XCB
} Evas_Engine_Info_XRender_Backend;
typedef struct _Evas_Engine_Info_XRender_X11 Evas_Engine_Info_XRender_X11;
/*
* Xlib | XCB
* connection | Display * | xcb_connection_t *
* screen | NULL | xcb_screen_t *
* drawable | Drawable | xcb_drawable_t
* mask | Pixmap | xcb_pixmap_t
* visual | Visual * | xcb_visualtype_t *
* colormap | Colormap | xcb_colormap_t
*/
struct _Evas_Engine_Info_XRender_X11
{
/* PRIVATE - don't mess with this baby or evas will poke its tongue out */
/* at you and make nasty noises */
Evas_Engine_Info magic;
/* engine specific data & parameters it needs to set up */
struct {
Evas_Engine_Info_XRender_Backend backend;
void *connection;
void *screen;
unsigned int drawable;
unsigned int mask;
void *visual;
unsigned char destination_alpha : 1;
} info;
/* non-blocking or blocking mode */
Evas_Engine_Render_Mode render_mode;
};
#endif

@ -1,59 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib/include \
-I$(top_srcdir)/src/modules/engines \
@FREETYPE_CFLAGS@ \
@EINA_CFLAGS@ \
@evas_engine_xrender_x11_cflags@ \
@evas_engine_xrender_xcb_cflags@
if BUILD_ENGINE_XRENDER_X11
XRENDER_X11_SOURCES = \
evas_engine_xlib_font.c \
evas_engine_xlib_image.c \
evas_engine_xlib_render.c \
evas_engine_xlib_ximage.c \
evas_engine.c
if BUILD_ENGINE_XRENDER_XCB
XRENDER_X11_SOURCES += \
evas_engine_xcb_font.c \
evas_engine_xcb_image.c \
evas_engine_xcb_render.c \
evas_engine_xcb_ximage.c
endif
XRENDER_X11_LIBADD = @evas_engine_xrender_xcb_libs@ @evas_engine_xrender_x11_libs@
includes_HEADERS = Evas_Engine_XRender_X11.h
includesdir = $(includedir)/evas-@VMAJ@
if !EVAS_STATIC_BUILD_XRENDER_X11
pkgdir = $(libdir)/evas/modules/engines/xrender_x11/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la
module_la_SOURCES = $(XRENDER_X11_SOURCES)
module_la_LIBADD = $(top_builddir)/src/lib/libevas.la @EINA_LIBS@ $(XRENDER_X11_LIBADD)
module_la_LDFLAGS = -no-undefined -module -avoid-version
module_la_LIBTOOLFLAGS = --tag=disable-static
else
noinst_LTLIBRARIES = libevas_engine_xrender_x11.la
libevas_engine_xrender_x11_la_SOURCES = $(XRENDER_X11_SOURCES)
libevas_engine_xrender_x11_la_LIBADD = $(XRENDER_X11_LIBADD)
endif
endif
EXTRA_DIST = evas_engine.h

File diff suppressed because it is too large Load Diff

@ -1,264 +0,0 @@
#ifndef EVAS_ENGINE_H
#define EVAS_ENGINE_H
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xrender.h>
#include <X11/Xresource.h> // xres - dpi
#ifdef BUILD_ENGINE_XRENDER_XCB
# include <xcb/xcb.h>
# include <xcb/render.h>
# include <xcb/xcb_image.h>
#endif
extern int _evas_xrender_xcb_log_dom ;
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_xrender_xcb_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_xrender_xcb_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_xrender_xcb_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_xrender_xcb_log_dom, __VA_ARGS__)
#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_xrender_xcb_log_dom, __VA_ARGS__)
typedef struct _Ximage_Info Ximage_Info;
typedef struct _Ximage_Image Ximage_Image;
typedef struct _Xrender_Surface Xrender_Surface;
struct _Ximage_Info
{
struct {
void *connection;
void *screen;
unsigned int root;
unsigned int draw;
void *visual;
void *fmt32;
void *fmt24;
void *fmt8;
void *fmt4;
void *fmt1;
void *fmtdef;
} x11;
unsigned int depth;
unsigned int pool_mem;
Eina_List *pool;
unsigned char can_do_shm;
Xrender_Surface *mul;
unsigned char mul_r, mul_g, mul_b, mul_a;
int references;
};
struct _Ximage_Image
{
union {
struct {
XImage *xim;
XShmSegmentInfo *shm_info;
} xlib;
#ifdef BUILD_ENGINE_XRENDER_XCB
struct {
xcb_image_t *xim;
xcb_shm_segment_info_t *shm_info;
} xcb;
#endif
} x11;
Ximage_Info *xinf;
int width;
int height;
int depth;
int line_bytes;
unsigned char *data;
unsigned char available : 1;
};
struct _Xrender_Surface
{
union {
struct {
XRenderPictFormat *fmt;
Drawable draw;
Picture pic;
} xlib;
#ifdef BUILD_ENGINE_XRENDER_XCB
struct {
xcb_render_pictforminfo_t *fmt;
xcb_drawable_t draw;
xcb_render_picture_t pic;
} xcb;
#endif
} x11;
Ximage_Info *xinf;
int width;
int height;
int depth;
unsigned char alpha : 1;
unsigned char allocated : 1;
unsigned char bordered : 1;
};
/* ximage support calls (ximage vs xshmimage, cache etc.) */
Ximage_Info *_xr_xlib_image_info_get(Display *disp, Drawable draw, Visual *vis);
void _xr_xlib_image_info_free(Ximage_Info *xinf);
void _xr_xlib_image_info_pool_flush(Ximage_Info *xinf, unsigned int max_num, unsigned int max_mem);
Ximage_Image *_xr_xlib_image_new(Ximage_Info *xinf, int w, int h, int depth);
void _xr_xlib_image_free(Ximage_Image *xim);
void _xr_xlib_image_put(Ximage_Image *xim, Drawable draw, int x, int y, int w, int h);
#ifdef BUILD_ENGINE_XRENDER_XCB
Ximage_Info *_xr_xcb_image_info_get(xcb_connection_t *conn, xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *visual);
void _xr_xcb_image_info_free(Ximage_Info *xinf);
void _xr_xcb_image_info_pool_flush(Ximage_Info *xinf, unsigned int max_num, unsigned int max_mem);
Ximage_Image *_xr_xcb_image_new(Ximage_Info *xinf, int w, int h, int depth);
void _xr_xcb_image_free(Ximage_Image *xim);
void _xr_xcb_image_put(Ximage_Image *xim, xcb_drawable_t draw, int x, int y, int w, int h);
#endif
/* xrender support calls */
Xrender_Surface *_xr_xlib_render_surface_new(Ximage_Info *xinf, int w, int h, XRenderPictFormat *fmt, int alpha);
Xrender_Surface *_xr_xlib_render_surface_adopt(Ximage_Info *xinf, Drawable draw, int w, int h, int alpha);
Xrender_Surface *_xr_xlib_render_surface_format_adopt(Ximage_Info *xinf, Drawable draw, int w, int h, XRenderPictFormat *fmt, int alpha);
void _xr_xlib_render_surface_free(Xrender_Surface *rs);
void _xr_xlib_render_surface_repeat_set(Xrender_Surface *rs, int repeat);
void _xr_xlib_render_surface_solid_rectangle_set(Xrender_Surface *rs, int r, int g, int b, int a, int x, int y, int w, int h);
void _xr_xlib_render_surface_argb_pixels_fill(Xrender_Surface *rs, int sw, int sh, void *pixels, int x, int y, int w, int h, int ox, int oy);
void _xr_xlib_render_surface_rgb_pixels_fill(Xrender_Surface *rs, int sw, int sh, void *pixels, int x, int y, int w, int h, int ox, int oy);
void _xr_xlib_render_surface_clips_set(Xrender_Surface *rs, RGBA_Draw_Context *dc, int rx, int ry, int rw, int rh);
void _xr_xlib_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Draw_Context *dc, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int smooth);
void _xr_xlib_render_surface_copy(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
void _xr_xlib_render_surface_rectangle_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
void _xr_xlib_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
void _xr_xlib_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
#ifdef BUILD_ENGINE_XRENDER_XCB
Xrender_Surface *_xr_xcb_render_surface_new(Ximage_Info *xinf, int w, int h, xcb_render_pictforminfo_t *fmt, int alpha);
Xrender_Surface *_xr_xcb_render_surface_adopt(Ximage_Info *xinf, xcb_drawable_t draw, int w, int h, int alpha);
Xrender_Surface *_xr_xcb_render_surface_format_adopt(Ximage_Info *xinf, xcb_drawable_t draw, int w, int h, xcb_render_pictforminfo_t *fmt, int alpha);
void _xr_xcb_render_surface_free(Xrender_Surface *rs);
void _xr_xcb_render_surface_repeat_set(Xrender_Surface *rs, int repeat);
void _xr_xcb_render_surface_solid_rectangle_set(Xrender_Surface *rs, int r, int g, int b, int a, int x, int y, int w, int h);
void _xr_xcb_render_surface_argb_pixels_fill(Xrender_Surface *rs, int sw, int sh, void *pixels, int x, int y, int w, int h, int ox, int oy);
void _xr_xcb_render_surface_rgb_pixels_fill(Xrender_Surface *rs, int sw, int sh, void *pixels, int x, int y, int w, int h, int ox, int oy);
void _xr_xcb_render_surface_clips_set(Xrender_Surface *rs, RGBA_Draw_Context *dc, int rx, int ry, int rw, int rh);
void _xr_xcb_render_surface_composite(Xrender_Surface *srs, Xrender_Surface *drs, RGBA_Draw_Context *dc, int sx, int sy, int sw, int sh, int x, int y, int w, int h, int smooth);
void _xr_xcb_render_surface_copy(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
void _xr_xcb_render_surface_rectangle_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
void _xr_xcb_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
void _xr_xcb_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
#endif
typedef struct _XR_Image XR_Image;
struct _XR_Image
{
Ximage_Info *xinf;
const char *file;
const char *key;
char *fkey;
RGBA_Image *im;
void *data;
int w, h;
Xrender_Surface *surface;
int references;
char *format;
const char *comment;
Tilebuf *updates;
RGBA_Image_Loadopts load_opts;
int *load_error; /* points to Evas_Object's load_error field */
struct {
int space;
void *data;
unsigned char no_free : 1;
} cs;
unsigned char alpha : 1;
unsigned char dirty : 1;
unsigned char free_data : 1;
};
XR_Image *_xre_xlib_image_load(Ximage_Info *xinf, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
XR_Image *_xre_xlib_image_new_from_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
XR_Image *_xre_xlib_image_new_from_copied_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
XR_Image *_xre_xlib_image_new(Ximage_Info *xinf, int w, int h);
void _xre_xlib_image_resize(XR_Image *im, int w, int h);
void _xre_xlib_image_free(XR_Image *im);
void _xre_xlib_image_region_dirty(XR_Image *im, int x, int y, int w, int h);
void _xre_xlib_image_dirty(XR_Image *im);
XR_Image *_xre_xlib_image_copy(XR_Image *im);
void *_xre_xlib_image_data_get(XR_Image *im);
XR_Image *_xre_xlib_image_data_find(void *data);
void _xre_xlib_image_data_put(XR_Image *im, void *data);
void _xre_xlib_image_alpha_set(XR_Image *im, int alpha);
int _xre_xlib_image_alpha_get(XR_Image *im);
void _xre_xlib_image_border_set(XR_Image *im, int l, int r, int t, int b);
void _xre_xlib_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
void _xre_xlib_image_surface_gen(XR_Image *im);
void _xre_xlib_image_cache_set(int size);
int _xre_xlib_image_cache_get(void);
#ifdef BUILD_ENGINE_XRENDER_XCB
XR_Image *_xre_xcb_image_load(Ximage_Info *xinf, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
XR_Image *_xre_xcb_image_new_from_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
XR_Image *_xre_xcb_image_new_from_copied_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace);
XR_Image *_xre_xcb_image_new(Ximage_Info *xinf, int w, int h);
void _xre_xcb_image_resize(XR_Image *im, int w, int h);
void _xre_xcb_image_free(XR_Image *im);
void _xre_xcb_image_region_dirty(XR_Image *im, int x, int y, int w, int h);
void _xre_xcb_image_dirty(XR_Image *im);
XR_Image *_xre_xcb_image_copy(XR_Image *im);
void *_xre_xcb_image_data_get(XR_Image *im);
XR_Image *_xre_xcb_image_data_find(void *data);
void _xre_xcb_image_data_put(XR_Image *im, void *data);
void _xre_xcb_image_alpha_set(XR_Image *im, int alpha);
int _xre_xcb_image_alpha_get(XR_Image *im);
void _xre_xcb_image_border_set(XR_Image *im, int l, int r, int t, int b);
void _xre_xcb_image_border_get(XR_Image *im, int *l, int *r, int *t, int *b);
void _xre_xcb_image_surface_gen(XR_Image *im);
void _xre_xcb_image_cache_set(int size);
int _xre_xcb_image_cache_get(void);
#endif
typedef struct _XR_Font_Surface XR_Font_Surface;
struct _XR_Font_Surface
{
Ximage_Info *xinf;
RGBA_Font_Glyph *fg;
int w, h;
Drawable draw;
Picture pic;
};
XR_Font_Surface *_xre_xlib_font_surface_new(Ximage_Info *xinf, RGBA_Font_Glyph *fg);
void _xre_xlib_font_surface_free(XR_Font_Surface *fs);
void _xre_xlib_font_surface_draw(Ximage_Info *xinf, RGBA_Image *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
#ifdef BUILD_ENGINE_XRENDER_XCB
XR_Font_Surface *_xre_xcb_font_surface_new(Ximage_Info *xinf, RGBA_Font_Glyph *fg);
void _xre_xcb_font_surface_free(XR_Font_Surface *fs);
void _xre_xcb_font_surface_draw(Ximage_Info *xinf, RGBA_Image *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
#endif
#endif

@ -1,208 +0,0 @@
#include "evas_common.h"
#include "evas_private.h"
#include "evas_engine.h"
#include "Evas_Engine_XRender_X11.h"
static Eina_Hash *_xr_fg_pool = NULL;
XR_Font_Surface *
_xre_xcb_font_surface_new(Ximage_Info *xinf, RGBA_Font_Glyph *fg)
{
char buf[256];
char buf2[256];
uint32_t values[3];
XR_Font_Surface *fs;
DATA8 *data;
Ximage_Image *xim;
Eina_Hash *pool;
uint32_t mask;
int w;
int h;
int pitch;
data = fg->glyph_out->bitmap.buffer;
w = fg->glyph_out->bitmap.width;
h = fg->glyph_out->bitmap.rows;
pitch = fg->glyph_out->bitmap.pitch;
if (pitch < w) pitch = w;
if ((w <= 0) || (h <= 0)) return NULL;
if (fg->ext_dat)
{
fs = fg->ext_dat;
if ((fs->xinf->x11.connection == xinf->x11.connection) &&
(fs->xinf->x11.root == xinf->x11.root))
return fs;
snprintf(buf, sizeof(buf), "@%p@/@%x@", fs->xinf->x11.connection, fs->xinf->x11.root);
pool = eina_hash_find(_xr_fg_pool, buf);
if (pool)
{
snprintf(buf, sizeof(buf), "%p", fg);
fs = eina_hash_find(pool, buf);
if (fs) return fs;
}
}
fs = calloc(1, sizeof(XR_Font_Surface));
if (!fs) return NULL;
fs->xinf = xinf;
fs->fg = fg;
fs->xinf->references++;
fs->w = w;
fs->h = h;
snprintf(buf, sizeof(buf), "@%p@/@%x@", fs->xinf->x11.connection, fs->xinf->x11.root);
pool = eina_hash_find(_xr_fg_pool, buf);
if (!pool) pool = eina_hash_string_superfast_new(NULL);
snprintf(buf2, sizeof(buf2), "%p", fg);
eina_hash_add(pool, buf2, fs);
if (!_xr_fg_pool) _xr_fg_pool = eina_hash_string_superfast_new(NULL);
eina_hash_add(_xr_fg_pool, buf, pool);
fs->draw = xcb_generate_id(xinf->x11.connection);
xcb_create_pixmap(xinf->x11.connection, ((xcb_render_pictforminfo_t *)xinf->x11.fmt8)->depth, fs->draw, xinf->x11.root, w, h);
mask = XCB_RENDER_CP_REPEAT | XCB_RENDER_CP_DITHER | XCB_RENDER_CP_COMPONENT_ALPHA;
values[0] = 0;
values[1] = 0;
values[2] = 0;
fs->pic = xcb_generate_id(xinf->x11.connection);
xcb_render_create_picture(xinf->x11.connection, fs->pic, fs->draw, ((xcb_render_pictforminfo_t *)xinf->x11.fmt8)->id, mask, values);
xim = _xr_xcb_image_new(fs->xinf, w, h, ((xcb_render_pictforminfo_t *)xinf->x11.fmt8)->depth);
if ((fg->glyph_out->bitmap.num_grays == 256) &&
(fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
{
int x, y;
DATA8 *p1, *p2;
for (y = 0; y < h; y++)
{
p1 = data + (pitch * y);
p2 = ((DATA8 *)xim->data) + (xim->line_bytes * y);
for (x = 0; x < w; x++)
{
*p2 = *p1;
p1++;
p2++;
}
}
}
else
{
DATA8 *tmpbuf = NULL, *dp, *tp, bits;
int bi, bj, end;
const DATA8 bitrepl[2] = {0x0, 0xff};
tmpbuf = alloca(w);
{
int x, y;
DATA8 *p1, *p2;
for (y = 0; y < h; y++)
{
p1 = tmpbuf;
p2 = ((DATA8 *)xim->data) + (xim->line_bytes * y);
tp = tmpbuf;
dp = data + (y * fg->glyph_out->bitmap.pitch);
for (bi = 0; bi < w; bi += 8)
{
bits = *dp;
if ((w - bi) < 8) end = w - bi;
else end = 8;
for (bj = 0; bj < end; bj++)
{
*tp = bitrepl[(bits >> (7 - bj)) & 0x1];
tp++;
}
dp++;
}
for (x = 0; x < w; x++)
{
*p2 = *p1;
p1++;
p2++;
}
}
}
}
_xr_xcb_image_put(xim, fs->draw, 0, 0, w, h);
return fs;
}
static Eina_Bool
_xre_xcb_font_pool_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
char buf[256];
Eina_Hash *pool;
XR_Font_Surface *fs;
fs = fdata;
pool = data;
snprintf(buf, sizeof(buf), "@%p@/@%x@", fs->xinf->x11.connection, fs->xinf->x11.root);
eina_hash_del(pool, buf, fs);
if (!hash) hash = eina_hash_string_superfast_new(NULL);
eina_hash_modify(hash, key, pool);
return 1;
}
void
_xre_xcb_font_surface_free(XR_Font_Surface *fs)
{
if (!fs) return;
eina_hash_foreach(_xr_fg_pool, _xre_xcb_font_pool_cb, fs);
xcb_free_pixmap(fs->xinf->x11.connection, fs->draw);
xcb_render_free_picture(fs->xinf->x11.connection, fs->pic);
_xr_xcb_image_info_free(fs->xinf);
free(fs);
}
void
_xre_xcb_font_surface_draw(Ximage_Info *xinf __UNUSED__, RGBA_Image *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y)
{
XR_Font_Surface *fs;
Xrender_Surface *target_surface;
xcb_rectangle_t rect;
int r;
int g;
int b;
int a;
fs = fg->ext_dat;
if (!fs || !fs->xinf || !dc || !dc->col.col) return;
target_surface = (Xrender_Surface *)(surface->image.data);
a = (dc->col.col >> 24) & 0xff;
r = (dc->col.col >> 16) & 0xff;
g = (dc->col.col >> 8 ) & 0xff;
b = (dc->col.col ) & 0xff;
if ((fs->xinf->mul_r != r) || (fs->xinf->mul_g != g) ||
(fs->xinf->mul_b != b) || (fs->xinf->mul_a != a))
{
fs->xinf->mul_r = r;
fs->xinf->mul_g = g;
fs->xinf->mul_b = b;
fs->xinf->mul_a = a;
_xr_xcb_render_surface_solid_rectangle_set(fs->xinf->mul, r, g, b, a, 0, 0, 1, 1);
}
rect.x = x;
rect.y = y;
rect.width = fs->w;
rect.height = fs->h;
if (dc->clip.use)
{
RECTS_CLIP_TO_RECT(rect.x, rect.y, rect.width, rect.height,
dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
}
xcb_render_set_picture_clip_rectangles(target_surface->xinf->x11.connection,
target_surface->x11.xcb.pic, 0, 0, 1, &rect);
xcb_render_composite(fs->xinf->x11.connection, XCB_RENDER_PICT_OP_OVER,
fs->xinf->mul->x11.xcb.pic,
fs->pic,
target_surface->x11.xcb.pic,
0, 0,
0, 0,
x, y,
fs->w, fs->h);
}

@ -1,704 +0,0 @@
#include "evas_common.h"
#include "evas_private.h"
#include "evas_engine.h"
#include "Evas_Engine_XRender_X11.h"
static Eina_Hash *_xr_image_hash = NULL;
static int _xr_image_cache_size = 0;
static int _xr_image_cache_usage = 0;
static Eina_List *_xr_image_cache = NULL;
static Eina_Hash *_xr_image_dirty_hash = NULL;
static void
__xre_xcb_image_dirty_hash_add(XR_Image *im)
{
char buf[64];
if (!im->data) return;
snprintf(buf, sizeof(buf), "%p", im->data);
if (!_xr_image_dirty_hash) _xr_image_dirty_hash = eina_hash_string_superfast_new(NULL);
eina_hash_add(_xr_image_dirty_hash, buf, im);
}
static void
__xre_xcb_image_dirty_hash_del(XR_Image *im)
{
char buf[64];
if (!im->data) return;
snprintf(buf, sizeof(buf), "%p", im->data);
eina_hash_del(_xr_image_dirty_hash, buf, im);
}
static XR_Image *
__xre_xcb_image_dirty_hash_find(void *data)
{
char buf[64];
snprintf(buf, sizeof(buf), "%p", data);
return eina_hash_find(_xr_image_dirty_hash, buf);
}
static XR_Image *
__xre_xcb_image_find(char *fkey)
{
XR_Image *im;
im = eina_hash_find(_xr_image_hash, fkey);
if (!im)
{
Eina_List *l;
EINA_LIST_FOREACH(_xr_image_cache, l, im)
{
if (!strcmp(im->fkey, fkey))
{
_xr_image_cache = eina_list_remove_list(_xr_image_cache, l);
if (!_xr_image_hash) _xr_image_hash = eina_hash_string_superfast_new(NULL);
eina_hash_add(_xr_image_hash, im->fkey, im);
_xr_image_cache_usage -= (im->w * im->h * 4);
break;
}
im = NULL;
}
}
if (im) im->references++;
return im;
}
XR_Image *
_xre_xcb_image_load(Ximage_Info *xinf, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error)
{
char buf[4096];
XR_Image *im;
if (!file)
{
*error = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
if (!lo)
{
if (key)
snprintf(buf, sizeof(buf), "/@%p@%x@/%s//://%s", xinf->x11.connection, xinf->x11.root, file, key);
else
snprintf(buf, sizeof(buf), "/@%p@%x@/%s", xinf->x11.connection, xinf->x11.root, file);
}
else
{
if (key)
snprintf(buf, sizeof(buf), "//@/%i/%1.5f/%ix%i//@%p@%x@/%s//://%s", lo->scale_down_by, lo->dpi, lo->w, lo->h, xinf->x11.connection, xinf->x11.root, file, key);
else
snprintf(buf, sizeof(buf), "//@/%i/%1.5f/%ix%i//@%p@%x@/%s", lo->scale_down_by, lo->dpi, lo->w, lo->h, xinf->x11.connection, xinf->x11.root, file);
}
im = __xre_xcb_image_find(buf);
if (im)
{
*error = EVAS_LOAD_ERROR_NONE;
return im;
}
im = calloc(1, sizeof(XR_Image));
if (!im)
{
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
return NULL;
}
im->im = evas_common_load_image_from_file(file, key, lo, error);
if (!im->im)
{
free(im);
return NULL;
}
im->xinf = xinf;
im->xinf->references++;
im->cs.space = EVAS_COLORSPACE_ARGB8888;
im->fkey = strdup(buf);
im->file = (char *)eina_stringshare_add(file);
if (key) im->key = (char *)eina_stringshare_add(key);
im->w = im->im->cache_entry.w;
im->h = im->im->cache_entry.h;
im->references = 1;
if (lo) im->load_opts = *lo;
im->load_error = error; /* points to object's load_error */
if (im->im->info.comment) im->comment = (char *)eina_stringshare_add(im->im->info.comment);
/* if (im->im->info.format == 1) im->format = eina_stringshare_add("png"); */
if (im->im->cache_entry.flags.alpha) im->alpha = 1;
if (!_xr_image_hash) _xr_image_hash = eina_hash_string_superfast_new(NULL);
eina_hash_direct_add(_xr_image_hash, im->fkey, im);
return im;
}
XR_Image *
_xre_xcb_image_new_from_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace)
{
XR_Image *im;
im = calloc(1, sizeof(XR_Image));
if (!im) return NULL;
im->xinf = xinf;
im->xinf->references++;
im->cs.space = cspace;
im->w = w;
im->h = h;
im->references = 1;
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
im->data = data;
im->alpha = alpha;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
im->cs.data = data;
im->cs.no_free = 1;
break;
default:
abort();
break;
}
im->dirty = 1;
__xre_xcb_image_dirty_hash_add(im);
return im;
}
XR_Image *
_xre_xcb_image_new_from_copied_data(Ximage_Info *xinf, int w, int h, void *data, int alpha, int cspace)
{
XR_Image *im;
im = calloc(1, sizeof(XR_Image));
if (!im) return NULL;
im->cs.space = cspace;
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
im->data = malloc(w * h * 4);
if (!im->data)
{
free(im);
return NULL;
}
if (data)
{
Gfx_Func_Copy func;
func = evas_common_draw_func_copy_get(w * h, 0);
if (func) func(data, im->data, w * h);
evas_common_cpu_end_opt();
}
im->alpha = alpha;
im->free_data = 1;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
im->cs.no_free = 0;
im->cs.data = calloc(1, h * sizeof(unsigned char *) * 2);
if ((data) && (im->cs.data))
memcpy(im->cs.data, data, h * sizeof(unsigned char *) * 2);
break;
default:
abort();
break;
}
im->w = w;
im->h = h;
im->references = 1;
im->xinf = xinf;
im->xinf->references++;
im->dirty = 1;
__xre_xcb_image_dirty_hash_add(im);
return im;
}
XR_Image *
_xre_xcb_image_new(Ximage_Info *xinf, int w, int h)
{
XR_Image *im;
im = calloc(1, sizeof(XR_Image));
if (!im) return NULL;
im->data = malloc(w * h * 4);
if (!im->data)
{
free(im);
return NULL;
}
im->w = w;
im->h = h;
im->references = 1;
im->cs.space = EVAS_COLORSPACE_ARGB8888;
im->xinf = xinf;
im->xinf->references++;
im->free_data = 1;
im->alpha = 1;
im->dirty = 1;
__xre_xcb_image_dirty_hash_add(im);
return im;
}
static void
__xre_xcb_image_real_free(XR_Image *im)
{
if (im->cs.data)
{
if (!im->cs.no_free) free(im->cs.data);
}
if (im->file) eina_stringshare_del(im->file);
if (im->key) eina_stringshare_del(im->key);
if (im->fkey) free(im->fkey);
if (im->im) evas_cache_image_drop(&im->im->cache_entry);
if ((im->data) && (im->dirty)) __xre_xcb_image_dirty_hash_del(im);
if ((im->free_data) && (im->data)) free(im->data);
if (im->surface) _xr_xcb_render_surface_free(im->surface);
if (im->format) eina_stringshare_del(im->format);
if (im->comment) eina_stringshare_del(im->comment);
if (im->updates) evas_common_tilebuf_free(im->updates);
_xr_xcb_image_info_free(im->xinf);
free(im);
}
void
_xre_xcb_image_free(XR_Image *im)
{
im->references--;
if (im->references != 0) return;
if (!im->dirty)
{
if (im->fkey)
eina_hash_del(_xr_image_hash, im->fkey, im);
_xr_image_cache = eina_list_prepend(_xr_image_cache, im);
_xr_image_cache_usage += (im->w * im->h * 4);
_xre_xcb_image_cache_set(_xr_image_cache_size);
}
else
{
__xre_xcb_image_real_free(im);
}
}
void
_xre_xcb_image_region_dirty(XR_Image *im, int x, int y, int w, int h)
{
if (!im->updates)
{
im->updates = evas_common_tilebuf_new(im->w, im->h);
if (im->updates) evas_common_tilebuf_set_tile_size(im->updates, 8, 8);
}
if (im->updates)
evas_common_tilebuf_add_redraw(im->updates, x, y, w, h);
}
void
_xre_xcb_image_dirty(XR_Image *im)
{
if (im->dirty) return;
if (im->fkey)
eina_hash_del(_xr_image_hash, im->fkey, im);
im->dirty = 1;
__xre_xcb_image_dirty_hash_add(im);
}
XR_Image *
_xre_xcb_image_copy(XR_Image *im)
{
XR_Image *im2;
void *data = NULL;
if (im->data) data = im->data;
else if (im->cs.data) data = im->cs.data;
else
{
if (!im->im)
im->im = evas_common_load_image_from_file(im->file, im->key, &(im->load_opts), im->load_error);
if (im->im)
{
evas_cache_image_load_data(&im->im->cache_entry);
data = im->im->image.data;
}
}
if (!data) return NULL;
im2 = _xre_xcb_image_new_from_copied_data(im->xinf, im->w, im->h, data, im->alpha, im->cs.space);
return im2;
}
void
_xre_xcb_image_resize(XR_Image *im, int w, int h)
{
if ((w == im->w) && (h == im->h)) return;
if (im->surface)
{
Xrender_Surface *old_surface;
old_surface = im->surface;
im->surface = _xr_xcb_render_surface_new(old_surface->xinf, w + 2, h + 2, old_surface->x11.xcb.fmt, old_surface->alpha);
_xr_xcb_render_surface_free(old_surface);
}
switch (im->cs.space)
{
case EVAS_COLORSPACE_ARGB8888:
if (im->data)
{
if (im->free_data)
{
if (im->data) free(im->data);
im->data = malloc(w * h * 4);
}
}
else if (im->im)
{
evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL;
if (im->free_data)
{
if (im->data) free(im->data);
im->data = malloc(w * h * 4);
}
}
else
{
im->data = malloc(w * h * 4);
im->free_data = 1;
}
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
if (im->data)
{
if (im->free_data)
{
if (im->data) free(im->data);
}
im->data = NULL;
}
if (im->im)
{
evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL;
}
if (!im->cs.no_free)
{
if (im->cs.data) free(im->cs.data);
im->cs.data = calloc(1, h * sizeof(unsigned char *) * 2);
}
break;
default:
abort();
break;