From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- .../software_x11/Evas_Engine_Software_X11.h | 52 + .../src/modules/engines/software_x11/Makefile.am | 85 ++ .../src/modules/engines/software_x11/Makefile.in | 948 ++++++++++++++++ .../src/modules/engines/software_x11/evas_engine.c | 929 ++++++++++++++++ .../src/modules/engines/software_x11/evas_engine.h | 137 +++ .../modules/engines/software_x11/evas_xcb_buffer.c | 498 +++++++++ .../modules/engines/software_x11/evas_xcb_buffer.h | 30 + .../modules/engines/software_x11/evas_xcb_color.c | 424 ++++++++ .../modules/engines/software_x11/evas_xcb_color.h | 10 + .../modules/engines/software_x11/evas_xcb_main.c | 8 + .../modules/engines/software_x11/evas_xcb_outbuf.c | 1092 +++++++++++++++++++ .../modules/engines/software_x11/evas_xcb_outbuf.h | 30 + .../engines/software_x11/evas_xcb_xdefaults.c | 108 ++ .../engines/software_x11/evas_xcb_xdefaults.h | 11 + .../engines/software_x11/evas_xlib_buffer.c | 428 ++++++++ .../engines/software_x11/evas_xlib_buffer.h | 45 + .../modules/engines/software_x11/evas_xlib_color.c | 368 +++++++ .../modules/engines/software_x11/evas_xlib_color.h | 16 + .../modules/engines/software_x11/evas_xlib_main.c | 7 + .../engines/software_x11/evas_xlib_outbuf.c | 1135 ++++++++++++++++++++ .../engines/software_x11/evas_xlib_outbuf.h | 92 ++ 21 files changed, 6453 insertions(+) create mode 100644 libraries/evas/src/modules/engines/software_x11/Evas_Engine_Software_X11.h create mode 100644 libraries/evas/src/modules/engines/software_x11/Makefile.am create mode 100644 libraries/evas/src/modules/engines/software_x11/Makefile.in create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_engine.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_engine.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_color.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_color.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_main.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_color.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_color.h create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_main.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c create mode 100644 libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.h (limited to 'libraries/evas/src/modules/engines/software_x11') diff --git a/libraries/evas/src/modules/engines/software_x11/Evas_Engine_Software_X11.h b/libraries/evas/src/modules/engines/software_x11/Evas_Engine_Software_X11.h new file mode 100644 index 0000000..e42c10a --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/Evas_Engine_Software_X11.h @@ -0,0 +1,52 @@ +#ifndef _EVAS_ENGINE_SOFTWARE_X11_H +# define _EVAS_ENGINE_SOFTWARE_X11_H + +typedef enum +{ + EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB, + EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB +} Evas_Engine_Info_Software_X11_Backend; + +typedef struct _Evas_Engine_Info_Software_X11 Evas_Engine_Info_Software_X11; + +struct _Evas_Engine_Info_Software_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_Software_X11_Backend backend; + + void *connection, *screen; + unsigned int drawable, mask; + void *visual; + unsigned int colormap; + int depth, rotation; + + Eina_Bool alloc_grayscale : 1; + Eina_Bool debug : 1; + Eina_Bool shape_dither : 1; + Eina_Bool destination_alpha : 1; + Eina_Bool track_mask_changes : 1; + + int alloc_colors_max; + } info; + + /* engine specific function calls to query stuff about the destination */ + struct + { + void *(*best_visual_get) (int backend, void *connection, int screen); + unsigned int (*best_colormap_get) (int backend, void *connection, int screen); + int (*best_depth_get) (int backend, void *connection, int screen); + } func; + + unsigned char mask_changed : 1; + + /* non-blocking or blocking mode */ + Evas_Engine_Render_Mode render_mode; +}; + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/Makefile.am b/libraries/evas/src/modules/engines/software_x11/Makefile.am new file mode 100644 index 0000000..5a2e345 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/Makefile.am @@ -0,0 +1,85 @@ + +MAINTAINERCLEANFILES = Makefile.in + +if BUILD_ENGINE_SOFTWARE_X11 + +SOFTWARE_X11_SOURCES = evas_engine.c + +if BUILD_ENGINE_SOFTWARE_XLIB + +AM_CPPFLAGS = \ +-I. \ +-I$(top_srcdir)/src/lib \ +-I$(top_srcdir)/src/lib/include \ +-I$(top_srcdir)/src/modules/engines \ +@FREETYPE_CFLAGS@ \ +@PIXMAN_CFLAGS@ \ +@EINA_CFLAGS@ \ +@evas_engine_software_xlib_cflags@ + +SOFTWARE_X11_SOURCES += \ +evas_xlib_outbuf.c \ +evas_xlib_buffer.c \ +evas_xlib_color.c \ +evas_xlib_main.c + +SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @EINA_LIBS@ @evas_engine_software_xlib_libs@ + +endif + +if BUILD_ENGINE_SOFTWARE_XCB + +AM_CPPFLAGS = \ +-I. \ +-I$(top_srcdir)/src/lib \ +-I$(top_srcdir)/src/lib/include \ +-I$(top_srcdir)/src/modules/engines \ +@FREETYPE_CFLAGS@ \ +@PIXMAN_CFLAGS@ \ +@EINA_CFLAGS@ \ +@evas_engine_software_xcb_cflags@ + +SOFTWARE_X11_SOURCES += \ +evas_xcb_xdefaults.c \ +evas_xcb_outbuf.c \ +evas_xcb_buffer.c \ +evas_xcb_color.c \ +evas_xcb_main.c + +SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @PIXMAN_LIBS@ @EINA_LIBS@ @evas_engine_software_xcb_libs@ + +endif + +includes_HEADERS = Evas_Engine_Software_X11.h +includesdir = $(includedir)/evas-@VMAJ@ + +if !EVAS_STATIC_BUILD_SOFTWARE_X11 + +pkgdir = $(libdir)/evas/modules/engines/software_x11/$(MODULE_ARCH) +pkg_LTLIBRARIES = module.la + +module_la_SOURCES = $(SOFTWARE_X11_SOURCES) +module_la_LIBADD = $(top_builddir)/src/lib/libevas.la $(SOFTWARE_X11_LIBADD) +module_la_LDFLAGS = -no-undefined -module -avoid-version +module_la_LIBTOOLFLAGS = --tag=disable-static + +else + +noinst_LTLIBRARIES = libevas_engine_software_x11.la + +libevas_engine_software_x11_la_SOURCES = $(SOFTWARE_X11_SOURCES) +libevas_engine_software_x11_la_LIBADD = $(SOFTWARE_X11_LIBADD) + +endif +endif + +EXTRA_DIST = \ +evas_engine.h \ +evas_xlib_outbuf.h \ +evas_xlib_buffer.h \ +evas_xlib_color.h \ +evas_xcb_outbuf.h \ +evas_xcb_buffer.h \ +evas_xcb_color.h \ +evas_xcb_xdefaults.h + diff --git a/libraries/evas/src/modules/engines/software_x11/Makefile.in b/libraries/evas/src/modules/engines/software_x11/Makefile.in new file mode 100644 index 0000000..f5c73af --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/Makefile.in @@ -0,0 +1,948 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@am__append_1 = \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_outbuf.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_buffer.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_color.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_main.c + +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@am__append_2 = \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_xdefaults.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_outbuf.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_buffer.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_color.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_main.c + +subdir = src/modules/engines/software_x11 +DIST_COMMON = $(am__includes_HEADERS_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ + $(top_srcdir)/m4/efl_coverage.m4 \ + $(top_srcdir)/m4/efl_doxygen.m4 \ + $(top_srcdir)/m4/efl_fnmatch.m4 \ + $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ + $(top_srcdir)/m4/evas_check_engine.m4 \ + $(top_srcdir)/m4/evas_check_loader.m4 \ + $(top_srcdir)/m4/evas_converter.m4 \ + $(top_srcdir)/m4/evas_dither.m4 \ + $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)" +LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkg_LTLIBRARIES) +am__DEPENDENCIES_1 = +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@libevas_engine_software_x11_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am__libevas_engine_software_x11_la_SOURCES_DIST = evas_engine.c \ + evas_xlib_outbuf.c evas_xlib_buffer.c evas_xlib_color.c \ + evas_xlib_main.c evas_xcb_xdefaults.c evas_xcb_outbuf.c \ + evas_xcb_buffer.c evas_xcb_color.c evas_xcb_main.c +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@am__objects_1 = evas_xlib_outbuf.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ evas_xlib_buffer.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ evas_xlib_color.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ evas_xlib_main.lo +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@am__objects_2 = evas_xcb_xdefaults.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_outbuf.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_buffer.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_color.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_main.lo +@BUILD_ENGINE_SOFTWARE_X11_TRUE@am__objects_3 = evas_engine.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_1) \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_2) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am_libevas_engine_software_x11_la_OBJECTS = $(am__objects_3) +libevas_engine_software_x11_la_OBJECTS = \ + $(am_libevas_engine_software_x11_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am_libevas_engine_software_x11_la_rpath = +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_DEPENDENCIES = $(top_builddir)/src/lib/libevas.la \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@ $(am__DEPENDENCIES_1) +am__module_la_SOURCES_DIST = evas_engine.c evas_xlib_outbuf.c \ + evas_xlib_buffer.c evas_xlib_color.c evas_xlib_main.c \ + evas_xcb_xdefaults.c evas_xcb_outbuf.c evas_xcb_buffer.c \ + evas_xcb_color.c evas_xcb_main.c +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@am__objects_4 = module_la-evas_xlib_outbuf.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ module_la-evas_xlib_buffer.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ module_la-evas_xlib_color.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ module_la-evas_xlib_main.lo +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@am__objects_5 = module_la-evas_xcb_xdefaults.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_outbuf.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_buffer.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_color.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_main.lo +@BUILD_ENGINE_SOFTWARE_X11_TRUE@am__objects_6 = \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ module_la-evas_engine.lo \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_4) \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_5) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@am_module_la_OBJECTS = $(am__objects_6) +module_la_OBJECTS = $(am_module_la_OBJECTS) +module_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(module_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@am_module_la_rpath = -rpath \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@ $(pkgdir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libevas_engine_software_x11_la_SOURCES) \ + $(module_la_SOURCES) +DIST_SOURCES = $(am__libevas_engine_software_x11_la_SOURCES_DIST) \ + $(am__module_la_SOURCES_DIST) +am__includes_HEADERS_DIST = Evas_Engine_Software_X11.h +HEADERS = $(includes_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ +DIRECTFB_LIBS = @DIRECTFB_LIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ +ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ +EDB_CFLAGS = @EDB_CFLAGS@ +EDB_LIBS = @EDB_LIBS@ +EDJE_CFLAGS = @EDJE_CFLAGS@ +EDJE_LIBS = @EDJE_LIBS@ +EET_CFLAGS = @EET_CFLAGS@ +EET_LIBS = @EET_LIBS@ +EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ +EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ +EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ +EGREP = @EGREP@ +EINA_CFLAGS = @EINA_CFLAGS@ +EINA_LIBS = @EINA_LIBS@ +EVAS_CFLAGS = @EVAS_CFLAGS@ +EVAS_LIBS = @EVAS_LIBS@ +EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ +EVIL_CFLAGS = @EVIL_CFLAGS@ +EVIL_LIBS = @EVIL_LIBS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GL_EET_CFLAGS = @GL_EET_CFLAGS@ +GL_EET_LIBS = @GL_EET_LIBS@ +GREP = @GREP@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ +LINEBREAK_LIBS = @LINEBREAK_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULE_ARCH = @MODULE_ARCH@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SHM_OPEN_LINK = @SHM_OPEN_LINK@ +STRIP = @STRIP@ +SVG_CFLAGS = @SVG_CFLAGS@ +SVG_LIBS = @SVG_LIBS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VMAJ = @VMAJ@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ +XCB_CFLAGS = @XCB_CFLAGS@ +XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ +XCB_GL_LIBS = @XCB_GL_LIBS@ +XCB_LIBS = @XCB_LIBS@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +altivec_cflags = @altivec_cflags@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +dlopen_libs = @dlopen_libs@ +docdir = @docdir@ +dvidir = @dvidir@ +edje_cc = @edje_cc@ +efl_doxygen = @efl_doxygen@ +efl_have_doxygen = @efl_have_doxygen@ +evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ +evas_engine_buffer_libs = @evas_engine_buffer_libs@ +evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ +evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ +evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ +evas_engine_directfb_libs = @evas_engine_directfb_libs@ +evas_engine_fb_cflags = @evas_engine_fb_cflags@ +evas_engine_fb_libs = @evas_engine_fb_libs@ +evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ +evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ +evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ +evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ +evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ +evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ +evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ +evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ +evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ +evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ +evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ +evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ +evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ +evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ +evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ +evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ +evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ +evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ +evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ +evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ +evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ +evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ +evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ +evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ +evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ +evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ +evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ +evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ +evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ +evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ +evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ +evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ +evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ +evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ +evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ +evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ +evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ +evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ +evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ +evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ +evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ +evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ +evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ +evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ +evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ +evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ +evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ +evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ +evas_image_loader_png_libs = @evas_image_loader_png_libs@ +evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ +evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ +evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ +evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ +evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ +evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ +evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ +evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ +evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ +evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ +evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ +evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ +exec_prefix = @exec_prefix@ +have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ +have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ +have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ +have_evas_engine_software_x11 = @have_evas_engine_software_x11@ +have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ +have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ +have_lcov = @have_lcov@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +lt_enable_auto_import = @lt_enable_auto_import@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfig_requires_private = @pkgconfig_requires_private@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pthread_cflags = @pthread_cflags@ +pthread_libs = @pthread_libs@ +release_info = @release_info@ +requirement_evas = @requirement_evas@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +version_info = @version_info@ +MAINTAINERCLEANFILES = Makefile.in +@BUILD_ENGINE_SOFTWARE_X11_TRUE@SOFTWARE_X11_SOURCES = evas_engine.c \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__append_1) \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__append_2) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@AM_CPPFLAGS = \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I. \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I$(top_srcdir)/src/lib \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I$(top_srcdir)/src/lib/include \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I$(top_srcdir)/src/modules/engines \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@FREETYPE_CFLAGS@ \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@PIXMAN_CFLAGS@ \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@EINA_CFLAGS@ \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@evas_engine_software_xcb_cflags@ + +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@AM_CPPFLAGS = \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I. \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I$(top_srcdir)/src/lib \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I$(top_srcdir)/src/lib/include \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I$(top_srcdir)/src/modules/engines \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@FREETYPE_CFLAGS@ \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@PIXMAN_CFLAGS@ \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@EINA_CFLAGS@ \ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@evas_engine_software_xlib_cflags@ + +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @PIXMAN_LIBS@ @EINA_LIBS@ @evas_engine_software_xcb_libs@ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @EINA_LIBS@ @evas_engine_software_xlib_libs@ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@includes_HEADERS = Evas_Engine_Software_X11.h +@BUILD_ENGINE_SOFTWARE_X11_TRUE@includesdir = $(includedir)/evas-@VMAJ@ +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@pkgdir = $(libdir)/evas/modules/engines/software_x11/$(MODULE_ARCH) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@pkg_LTLIBRARIES = module.la +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_SOURCES = $(SOFTWARE_X11_SOURCES) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_LIBADD = $(top_builddir)/src/lib/libevas.la $(SOFTWARE_X11_LIBADD) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_LDFLAGS = -no-undefined -module -avoid-version +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@noinst_LTLIBRARIES = libevas_engine_software_x11.la +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@libevas_engine_software_x11_la_SOURCES = $(SOFTWARE_X11_SOURCES) +@BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@libevas_engine_software_x11_la_LIBADD = $(SOFTWARE_X11_LIBADD) +EXTRA_DIST = \ +evas_engine.h \ +evas_xlib_outbuf.h \ +evas_xlib_buffer.h \ +evas_xlib_color.h \ +evas_xcb_outbuf.h \ +evas_xcb_buffer.h \ +evas_xcb_color.h \ +evas_xcb_xdefaults.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/engines/software_x11/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/modules/engines/software_x11/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)" + @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \ + } + +uninstall-pkgLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ + done + +clean-pkgLTLIBRARIES: + -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES) + @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libevas_engine_software_x11.la: $(libevas_engine_software_x11_la_OBJECTS) $(libevas_engine_software_x11_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libevas_engine_software_x11_la_rpath) $(libevas_engine_software_x11_la_OBJECTS) $(libevas_engine_software_x11_la_LIBADD) $(LIBS) +module.la: $(module_la_OBJECTS) $(module_la_DEPENDENCIES) + $(AM_V_CCLD)$(module_la_LINK) $(am_module_la_rpath) $(module_la_OBJECTS) $(module_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_engine.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_outbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_xdefaults.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_outbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_engine.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_outbuf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_xdefaults.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_outbuf.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +module_la-evas_engine.lo: evas_engine.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_engine.lo -MD -MP -MF $(DEPDIR)/module_la-evas_engine.Tpo -c -o module_la-evas_engine.lo `test -f 'evas_engine.c' || echo '$(srcdir)/'`evas_engine.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_engine.Tpo $(DEPDIR)/module_la-evas_engine.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_engine.c' object='module_la-evas_engine.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_engine.lo `test -f 'evas_engine.c' || echo '$(srcdir)/'`evas_engine.c + +module_la-evas_xlib_outbuf.lo: evas_xlib_outbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xlib_outbuf.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xlib_outbuf.Tpo -c -o module_la-evas_xlib_outbuf.lo `test -f 'evas_xlib_outbuf.c' || echo '$(srcdir)/'`evas_xlib_outbuf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_outbuf.Tpo $(DEPDIR)/module_la-evas_xlib_outbuf.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_outbuf.c' object='module_la-evas_xlib_outbuf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xlib_outbuf.lo `test -f 'evas_xlib_outbuf.c' || echo '$(srcdir)/'`evas_xlib_outbuf.c + +module_la-evas_xlib_buffer.lo: evas_xlib_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xlib_buffer.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xlib_buffer.Tpo -c -o module_la-evas_xlib_buffer.lo `test -f 'evas_xlib_buffer.c' || echo '$(srcdir)/'`evas_xlib_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_buffer.Tpo $(DEPDIR)/module_la-evas_xlib_buffer.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_buffer.c' object='module_la-evas_xlib_buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xlib_buffer.lo `test -f 'evas_xlib_buffer.c' || echo '$(srcdir)/'`evas_xlib_buffer.c + +module_la-evas_xlib_color.lo: evas_xlib_color.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xlib_color.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xlib_color.Tpo -c -o module_la-evas_xlib_color.lo `test -f 'evas_xlib_color.c' || echo '$(srcdir)/'`evas_xlib_color.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_color.Tpo $(DEPDIR)/module_la-evas_xlib_color.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_color.c' object='module_la-evas_xlib_color.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xlib_color.lo `test -f 'evas_xlib_color.c' || echo '$(srcdir)/'`evas_xlib_color.c + +module_la-evas_xlib_main.lo: evas_xlib_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xlib_main.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xlib_main.Tpo -c -o module_la-evas_xlib_main.lo `test -f 'evas_xlib_main.c' || echo '$(srcdir)/'`evas_xlib_main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_main.Tpo $(DEPDIR)/module_la-evas_xlib_main.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_main.c' object='module_la-evas_xlib_main.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xlib_main.lo `test -f 'evas_xlib_main.c' || echo '$(srcdir)/'`evas_xlib_main.c + +module_la-evas_xcb_xdefaults.lo: evas_xcb_xdefaults.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xcb_xdefaults.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xcb_xdefaults.Tpo -c -o module_la-evas_xcb_xdefaults.lo `test -f 'evas_xcb_xdefaults.c' || echo '$(srcdir)/'`evas_xcb_xdefaults.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_xdefaults.Tpo $(DEPDIR)/module_la-evas_xcb_xdefaults.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_xdefaults.c' object='module_la-evas_xcb_xdefaults.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xcb_xdefaults.lo `test -f 'evas_xcb_xdefaults.c' || echo '$(srcdir)/'`evas_xcb_xdefaults.c + +module_la-evas_xcb_outbuf.lo: evas_xcb_outbuf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xcb_outbuf.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xcb_outbuf.Tpo -c -o module_la-evas_xcb_outbuf.lo `test -f 'evas_xcb_outbuf.c' || echo '$(srcdir)/'`evas_xcb_outbuf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_outbuf.Tpo $(DEPDIR)/module_la-evas_xcb_outbuf.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_outbuf.c' object='module_la-evas_xcb_outbuf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xcb_outbuf.lo `test -f 'evas_xcb_outbuf.c' || echo '$(srcdir)/'`evas_xcb_outbuf.c + +module_la-evas_xcb_buffer.lo: evas_xcb_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xcb_buffer.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xcb_buffer.Tpo -c -o module_la-evas_xcb_buffer.lo `test -f 'evas_xcb_buffer.c' || echo '$(srcdir)/'`evas_xcb_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_buffer.Tpo $(DEPDIR)/module_la-evas_xcb_buffer.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_buffer.c' object='module_la-evas_xcb_buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xcb_buffer.lo `test -f 'evas_xcb_buffer.c' || echo '$(srcdir)/'`evas_xcb_buffer.c + +module_la-evas_xcb_color.lo: evas_xcb_color.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xcb_color.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xcb_color.Tpo -c -o module_la-evas_xcb_color.lo `test -f 'evas_xcb_color.c' || echo '$(srcdir)/'`evas_xcb_color.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_color.Tpo $(DEPDIR)/module_la-evas_xcb_color.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_color.c' object='module_la-evas_xcb_color.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xcb_color.lo `test -f 'evas_xcb_color.c' || echo '$(srcdir)/'`evas_xcb_color.c + +module_la-evas_xcb_main.lo: evas_xcb_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_xcb_main.lo -MD -MP -MF $(DEPDIR)/module_la-evas_xcb_main.Tpo -c -o module_la-evas_xcb_main.lo `test -f 'evas_xcb_main.c' || echo '$(srcdir)/'`evas_xcb_main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_main.Tpo $(DEPDIR)/module_la-evas_xcb_main.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_main.c' object='module_la-evas_xcb_main.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_xcb_main.lo `test -f 'evas_xcb_main.c' || echo '$(srcdir)/'`evas_xcb_main.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-includesHEADERS: $(includes_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)" + @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \ + done + +uninstall-includesHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(includesdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-pkgLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includesHEADERS install-pkgLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-includesHEADERS uninstall-pkgLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES clean-pkgLTLIBRARIES \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-includesHEADERS install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgLTLIBRARIES \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-includesHEADERS \ + uninstall-pkgLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libraries/evas/src/modules/engines/software_x11/evas_engine.c b/libraries/evas/src/modules/engines/software_x11/evas_engine.c new file mode 100644 index 0000000..0a2d2a3 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_engine.c @@ -0,0 +1,929 @@ +#include "evas_common.h" +#include "evas_private.h" + +#include "Evas_Engine_Software_X11.h" +#include "evas_engine.h" + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB +# include "evas_xlib_outbuf.h" +# include "evas_xlib_color.h" +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB +# include "evas_xcb_outbuf.h" +# include "evas_xcb_color.h" +# include "evas_xcb_xdefaults.h" +#endif + +int _evas_engine_soft_x11_log_dom = -1; + +/* function tables - filled in later (func and parent func) */ +static Evas_Func func, pfunc; + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB +/* +struct xrdb_user +{ + time_t last_stat; + time_t last_mtime; + XrmDatabase db; +}; +static struct xrdb_user xrdb_user = {0, 0, NULL}; + +static Eina_Bool +xrdb_user_query(const char *name, const char *cls, char **type, XrmValue *val) +{ + time_t last, now; + + last = xrdb_user.last_stat; + now = time(NULL); + + xrdb_user.last_stat = now; + if (last != now) // don't stat() more than once every second + { + struct stat st; + const char *home; + char tmp[PATH_MAX]; + + if (!(home = getenv("HOME"))) + goto failed; + + snprintf(tmp, sizeof(tmp), "%s/.Xdefaults", home); + if (stat(tmp, &st) != 0) goto failed; + if (xrdb_user.last_mtime != st.st_mtime) + { + if (xrdb_user.db) XrmDestroyDatabase(xrdb_user.db); + xrdb_user.db = XrmGetFileDatabase(tmp); + if (!xrdb_user.db) goto failed; + xrdb_user.last_mtime = st.st_mtime; + } + } + + if (!xrdb_user.db) return EINA_FALSE; + return XrmGetResource(xrdb_user.db, name, cls, type, val); + + failed: + if (xrdb_user.db) + { + XrmDestroyDatabase(xrdb_user.db); + xrdb_user.db = NULL; + } + xrdb_user.last_mtime = 0; + return EINA_FALSE; +} +*/ +#endif + +/* engine struct data */ +typedef struct _Render_Engine Render_Engine; + +struct _Render_Engine +{ + Tilebuf *tb; + Outbuf *ob; + Tilebuf_Rect *rects; + Eina_Inlist *cur_rect; + unsigned char end : 1; +/* +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + XrmDatabase xrdb; +#endif + struct + { + int dpi; + } xr; + */ +#ifdef EVAS_FRAME_QUEUING + Evas_Engine_Render_Mode render_mode; +#endif + + void (*outbuf_free)(Outbuf *ob); + void (*outbuf_reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth); + int (*outbuf_get_rot)(Outbuf *ob); + RGBA_Image *(*outbuf_new_region_for_update)(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); + void (*outbuf_push_updated_region)(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); + void (*outbuf_free_region_for_update)(Outbuf *ob, RGBA_Image *update); + void (*outbuf_flush)(Outbuf *ob); + void (*outbuf_idle_flush)(Outbuf *ob); + Eina_Bool (*outbuf_alpha_get)(Outbuf *ob); +#ifdef EVAS_FRAME_QUEUING + void (*outbuf_set_priv)(Outbuf *ob, void *cur, void *prev); +#endif +}; + +/* prototypes we will use here */ +static void *_best_visual_get(int backend, void *connection, int screen); +static unsigned int _best_colormap_get(int backend, void *connection, int screen); +static int _best_depth_get(int backend, void *connection, int screen); + +static void *eng_info(Evas *e); +static void eng_info_free(Evas *e, void *info); +static int eng_setup(Evas *e, void *info); +static void eng_output_free(void *data); +static void eng_output_resize(void *data, int w, int h); +static void eng_output_tile_size_set(void *data, int w, int h); +static void eng_output_redraws_rect_add(void *data, int x, int y, int w, int h); +static void eng_output_redraws_rect_del(void *data, int x, int y, int w, int h); +static void eng_output_redraws_clear(void *data); +static void *eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch); +static void eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h); +static void eng_output_flush(void *data); +static void eng_output_idle_flush(void *data); + +/* internal engine routines */ + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB +static void * +_output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw, + Visual *vis, Colormap cmap, int depth, int debug, + int grayscale, int max_colors, Pixmap mask, + int shape_dither, int destination_alpha) +{ + Render_Engine *re; +// int status; +// char *type = NULL; +// XrmValue val; + + if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; + + evas_software_xlib_x_init(); + evas_software_xlib_x_color_init(); + evas_software_xlib_outbuf_init(); +/* + re->xr.dpi = 75000; // dpy * 1000 + + status = xrdb_user_query("Xft.dpi", "Xft.Dpi", &type, &val); + if ((!status) || (!type)) + { + if (!re->xrdb) re->xrdb = XrmGetDatabase(disp); + if (re->xrdb) + status = XrmGetResource(re->xrdb, + "Xft.dpi", "Xft.Dpi", &type, &val); + } + + if ((status) && (type)) + { + if (!strcmp(type, "String")) + { + const char *str, *dp; + + str = val.addr; + dp = strchr(str, '.'); + if (!dp) dp = strchr(str, ','); + + if (dp) + { + int subdpi, len, i; + char *buf; + + buf = alloca(dp - str + 1); + strncpy(buf, str, dp - str); + buf[dp - str] = 0; + len = strlen(dp + 1); + subdpi = atoi(dp + 1); + + if (len < 3) + { + for (i = len; i < 3; i++) + subdpi *= 10; + } + else if (len > 3) + { + for (i = len; i > 3; i--) + subdpi /= 10; + } + re->xr.dpi = atoi(buf) * 1000; + } + else + re->xr.dpi = atoi(str) * 1000; + evas_common_font_dpi_set(re->xr.dpi / 1000); + } + } + */ + re->ob = + evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp, + draw, vis, cmap, depth, grayscale, + max_colors, mask, shape_dither, + destination_alpha); + if (!re->ob) + { + free(re); + return NULL; + } + + /* for updates return 1 big buffer, but only use portions of it, also cache + * it and keepit around until an idle_flush */ + + /* disable for now - i am hunting down why some expedite tests are slower, + * as well as shaped stuff is broken and probable non-32bpp is broken as + * convert funcs dont do the right thing + * + */ +// re->ob->onebuf = 1; + + evas_software_xlib_outbuf_debug_set(re->ob, debug); + re->tb = evas_common_tilebuf_new(w, h); + if (!re->tb) + { + evas_software_xlib_outbuf_free(re->ob); + free(re); + return NULL; + } + + /* in preliminary tests 16x16 gave highest framerates */ + evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); + return re; +} +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB +static void * +_output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, + xcb_visualtype_t *vis, xcb_colormap_t cmap, int depth, + int debug, int grayscale, int max_colors, xcb_drawable_t mask, + int shape_dither, int destination_alpha) +{ + Render_Engine *re; +// int v = 0; + + if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; + + evas_software_xcb_init(); + evas_software_xcb_color_init(); + evas_software_xcb_outbuf_init(); +/* + // FIXME: re->xrdb + _evas_xcb_xdefaults_init(); + v = _evas_xcb_xdefaults_int_get("Xft", "dpi"); + _evas_xcb_xdefaults_shutdown(); + if (v) re->xr.dpi = (v * 1000); + else re->xr.dpi = 75000; // dpy * 1000 + + evas_common_font_dpi_set(re->xr.dpi / 1000); + */ + re->ob = + evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn, + screen, draw, vis, cmap, depth, + grayscale, max_colors, mask, + shape_dither, destination_alpha); + if (!re->ob) + { + free(re); + return NULL; + } + + /* for updates return 1 big buffer, but only use portions of it, also cache + * it and keepit around until an idle_flush */ + + /* disable for now - i am hunting down why some expedite tests are slower, + * as well as shaped stuff is broken and probable non-32bpp is broken as + * convert funcs dont do the right thing + * + */ +// re->ob->onebuf = 1; + + evas_software_xcb_outbuf_debug_set(re->ob, debug); + + re->tb = evas_common_tilebuf_new(w, h); + if (!re->tb) + { + evas_software_xcb_outbuf_free(re->ob); + free(re); + return NULL; + } + + /* in preliminary tests 16x16 gave highest framerates */ + evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); + return re; +} +#endif + +static void * +_best_visual_get(int backend, void *connection, int screen) +{ + if (!connection) return NULL; + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) + return DefaultVisual((Display *)connection, screen); +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB + if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) + { + xcb_screen_iterator_t iter_screen; + xcb_depth_iterator_t iter_depth; + xcb_screen_t *s = NULL; + + iter_screen = + xcb_setup_roots_iterator(xcb_get_setup((xcb_connection_t *)connection)); + for (; iter_screen.rem; --screen, xcb_screen_next(&iter_screen)) + if (screen == 0) + { + s = iter_screen.data; + break; + } + + iter_depth = xcb_screen_allowed_depths_iterator(s); + for (; iter_depth.rem; xcb_depth_next(&iter_depth)) + { + xcb_visualtype_iterator_t iter_vis; + + iter_vis = xcb_depth_visuals_iterator(iter_depth.data); + for (; iter_vis.rem; xcb_visualtype_next(&iter_vis)) + { + if (s->root_visual == iter_vis.data->visual_id) + return iter_vis.data; + } + } + } +#endif + + return NULL; +} + +static unsigned int +_best_colormap_get(int backend, void *connection, int screen) +{ + if (!connection) return 0; + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) + return DefaultColormap((Display *)connection, screen); +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB + if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) + { + xcb_screen_iterator_t iter_screen; + xcb_screen_t *s = NULL; + + iter_screen = + xcb_setup_roots_iterator(xcb_get_setup((xcb_connection_t *)connection)); + for (; iter_screen.rem; --screen, xcb_screen_next(&iter_screen)) + if (screen == 0) + { + s = iter_screen.data; + break; + } + + return s->default_colormap; + } +#endif + + return 0; +} + +static int +_best_depth_get(int backend, void *connection, int screen) +{ + if (!connection) return 0; + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) + return DefaultDepth((Display *)connection, screen); +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB + if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) + { + xcb_screen_iterator_t iter_screen; + xcb_screen_t *s = NULL; + + iter_screen = + xcb_setup_roots_iterator(xcb_get_setup((xcb_connection_t *)connection)); + for (; iter_screen.rem; --screen, xcb_screen_next(&iter_screen)) + if (screen == 0) + { + s = iter_screen.data; + break; + } + + return s->root_depth; + } +#endif + + return 0; +} + +/* engine api this module provides */ +static void * +eng_info(Evas *e __UNUSED__) +{ + Evas_Engine_Info_Software_X11 *info; + + if (!(info = calloc(1, sizeof(Evas_Engine_Info_Software_X11)))) + return NULL; + + info->magic.magic = rand(); + info->info.debug = 0; + info->info.alloc_grayscale = 0; + info->info.alloc_colors_max = 216; + info->func.best_visual_get = _best_visual_get; + info->func.best_colormap_get = _best_colormap_get; + info->func.best_depth_get = _best_depth_get; + info->render_mode = EVAS_RENDER_MODE_BLOCKING; + return info; +} + +static void +eng_info_free(Evas *e __UNUSED__, void *info) +{ + Evas_Engine_Info_Software_X11 *in; + + in = (Evas_Engine_Info_Software_X11 *)info; + free(in); +} + +static int +eng_setup(Evas *e, void *in) +{ + Evas_Engine_Info_Software_X11 *info; + Render_Engine *re = NULL; + + info = (Evas_Engine_Info_Software_X11 *)in; + if (!e->engine.data.output) + { + /* if we haven't initialized - init (automatic abort if already done) */ + evas_common_cpu_init(); + evas_common_blend_init(); + evas_common_image_init(); + evas_common_convert_init(); + evas_common_scale_init(); + evas_common_rectangle_init(); + evas_common_polygon_init(); + evas_common_line_init(); + evas_common_font_init(); + evas_common_draw_init(); + evas_common_tilebuf_init(); + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) + { + re = _output_xlib_setup(e->output.w, e->output.h, + info->info.rotation, info->info.connection, + info->info.drawable, info->info.visual, + info->info.colormap, + info->info.depth, info->info.debug, + info->info.alloc_grayscale, + info->info.alloc_colors_max, + info->info.mask, info->info.shape_dither, + info->info.destination_alpha); + + re->outbuf_free = evas_software_xlib_outbuf_free; + re->outbuf_reconfigure = evas_software_xlib_outbuf_reconfigure; + re->outbuf_get_rot = evas_software_xlib_outbuf_get_rot; + re->outbuf_new_region_for_update = + evas_software_xlib_outbuf_new_region_for_update; + re->outbuf_push_updated_region = + evas_software_xlib_outbuf_push_updated_region; + re->outbuf_free_region_for_update = + evas_software_xlib_outbuf_free_region_for_update; + re->outbuf_flush = evas_software_xlib_outbuf_flush; + re->outbuf_idle_flush = evas_software_xlib_outbuf_idle_flush; + re->outbuf_alpha_get = evas_software_xlib_outbuf_alpha_get; +# ifdef EVAS_FRAME_QUEUING + re->outbuf_set_priv = evas_software_xlib_outbuf_set_priv; + re->render_mode = info->render_mode; +# endif + } +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB + if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) + { + re = _output_xcb_setup(e->output.w, e->output.h, + info->info.rotation, info->info.connection, + info->info.screen, info->info.drawable, + info->info.visual, info->info.colormap, + info->info.depth, info->info.debug, + info->info.alloc_grayscale, + info->info.alloc_colors_max, + info->info.mask, info->info.shape_dither, + info->info.destination_alpha); + + re->outbuf_free = evas_software_xcb_outbuf_free; + re->outbuf_reconfigure = evas_software_xcb_outbuf_reconfigure; + re->outbuf_get_rot = evas_software_xcb_outbuf_rotation_get; + re->outbuf_new_region_for_update = + evas_software_xcb_outbuf_new_region_for_update; + re->outbuf_push_updated_region = + evas_software_xcb_outbuf_push_updated_region; + re->outbuf_free_region_for_update = + evas_software_xcb_outbuf_free_region_for_update; + re->outbuf_flush = evas_software_xcb_outbuf_flush; + re->outbuf_idle_flush = evas_software_xcb_outbuf_idle_flush; + re->outbuf_alpha_get = evas_software_xcb_outbuf_alpha_get; +# ifdef EVAS_FRAME_QUEUING + re->outbuf_set_priv = evas_software_xcb_outbuf_priv_set; + re->render_mode = info->render_mode; +# endif + } +#endif + + e->engine.data.output = re; + } + else + { + int ponebuf = 0; + +#ifdef EVAS_FRAME_QUEUING + evas_common_frameq_flush(); +#endif + re = e->engine.data.output; + ponebuf = re->ob->onebuf; + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) + { + evas_software_xlib_outbuf_free(re->ob); + re->ob = + evas_software_xlib_outbuf_setup_x(e->output.w, e->output.h, + info->info.rotation, + OUTBUF_DEPTH_INHERIT, + info->info.connection, + info->info.drawable, + info->info.visual, + info->info.colormap, + info->info.depth, + info->info.alloc_grayscale, + info->info.alloc_colors_max, + info->info.mask, + info->info.shape_dither, + info->info.destination_alpha); + + evas_software_xlib_outbuf_debug_set(re->ob, info->info.debug); +# ifdef EVAS_FRAME_QUEUING + re->render_mode = info->render_mode; +# endif + } +#endif + +#ifdef BUILD_ENGINE_SOFTWARE_XCB + if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) + { + evas_software_xcb_outbuf_free(re->ob); + re->ob = + evas_software_xcb_outbuf_setup(e->output.w, e->output.h, + info->info.rotation, + OUTBUF_DEPTH_INHERIT, + info->info.connection, + info->info.screen, + info->info.drawable, + info->info.visual, + info->info.colormap, + info->info.depth, + info->info.alloc_grayscale, + info->info.alloc_colors_max, + info->info.mask, + info->info.shape_dither, + info->info.destination_alpha); + + evas_software_xcb_outbuf_debug_set(re->ob, info->info.debug); +#ifdef EVAS_FRAME_QUEUING + re->render_mode = info->render_mode; +#endif + } +#endif + re->ob->onebuf = ponebuf; + } + if (!e->engine.data.output) return 0; + if (!e->engine.data.context) + { + e->engine.data.context = + e->engine.func->context_new(e->engine.data.output); + } + + re = e->engine.data.output; + + return 1; +} + +static void +eng_output_free(void *data) +{ + Render_Engine *re; + +#ifdef BUILD_ENGINE_SOFTWARE_XLIB +// NOTE: XrmGetDatabase() result is shared per connection, do not free it. +// if (re->xrdb) XrmDestroyDatabase(re->xrdb); +#endif + + if ((re = (Render_Engine *)data)) + { + re->outbuf_free(re->ob); + evas_common_tilebuf_free(re->tb); + if (re->rects) evas_common_tilebuf_free_render_rects(re->rects); + free(re); + } + + evas_common_font_shutdown(); + evas_common_image_shutdown(); +} + +static void +eng_output_resize(void *data, int w, int h) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + re->outbuf_reconfigure(re->ob, w, h, re->outbuf_get_rot(re->ob), + OUTBUF_DEPTH_INHERIT); + evas_common_tilebuf_free(re->tb); + re->tb = evas_common_tilebuf_new(w, h); + if (re->tb) + evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); +} + +static void +eng_output_tile_size_set(void *data, int w, int h) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + evas_common_tilebuf_set_tile_size(re->tb, w, h); +} + +static void +eng_output_redraws_rect_add(void *data, int x, int y, int w, int h) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); +} + +static void +eng_output_redraws_rect_del(void *data, int x, int y, int w, int h) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + evas_common_tilebuf_del_redraw(re->tb, x, y, w, h); +} + +static void +eng_output_redraws_clear(void *data) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + evas_common_tilebuf_clear(re->tb); +} + +static void * +eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch) +{ + Render_Engine *re; + RGBA_Image *surface; + Tilebuf_Rect *rect; + int ux, uy, uw, uh; + + re = (Render_Engine *)data; + if (re->end) + { + re->end = 0; + return NULL; + } + if (!re->rects) + { + re->rects = evas_common_tilebuf_get_render_rects(re->tb); + re->cur_rect = EINA_INLIST_GET(re->rects); + } + if (!re->cur_rect) return NULL; + rect = (Tilebuf_Rect *)re->cur_rect; + ux = rect->x; uy = rect->y; uw = rect->w; uh = rect->h; + re->cur_rect = re->cur_rect->next; + if (!re->cur_rect) + { + evas_common_tilebuf_free_render_rects(re->rects); + re->rects = NULL; + re->end = 1; + } + + surface = + re->outbuf_new_region_for_update(re->ob, ux, uy, uw, uh, cx, cy, cw, ch); + + *x = ux; *y = uy; *w = uw; *h = uh; + return surface; +} + +static void +eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h) +{ + Render_Engine *re; +#ifdef EVAS_FRAME_QUEUING + Evas_Surface *e_surface; +#endif + + re = (Render_Engine *)data; +#if defined(BUILD_PIPE_RENDER) && !defined(EVAS_FRAME_QUEUING) + evas_common_pipe_map_begin(surface); +#endif /* BUILD_PIPE_RENDER && !EVAS_FRAME_QUEUING*/ + +#ifdef EVAS_FRAME_QUEUING + if (re->render_mode == EVAS_RENDER_MODE_NONBLOCKING) + { + /* create a new frame if this is the first surface of this frame */ + evas_common_frameq_prepare_frame(); + /* add surface into the frame */ + e_surface = evas_common_frameq_new_surface(surface, x, y, w, h); + evas_common_frameq_add_surface(e_surface); + return; + } +#endif + + re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); + re->outbuf_free_region_for_update(re->ob, surface); + evas_common_cpu_end_opt(); +} + +#ifdef EVAS_FRAME_QUEUING +static void * +eng_image_map_surface_new(void *data , int w, int h, int alpha) +{ + void *surface; + DATA32 *pixels; + Render_Engine *re; + Evas_Surface *e_surface; + + re = (Render_Engine *)data; + + surface = + evas_cache_image_copied_data(evas_common_image_cache_get(), w, h, NULL, + alpha, EVAS_COLORSPACE_ARGB8888); + pixels = evas_cache_image_pixels(surface); + + if (re->render_mode == EVAS_RENDER_MODE_NONBLOCKING) + { + /* create a new frame if this is the first surface of this frame */ + evas_common_frameq_prepare_frame(); + + /* add surface into the frame */ + e_surface = evas_common_frameq_new_surface(surface, 0, 0, w, h); + + /* this surface is not going to be pushed to screen */ + e_surface->dontpush = 1; + evas_common_frameq_add_surface(e_surface); + } + return surface; +} + +static void +eng_output_frameq_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); + re->outbuf_free_region_for_update(re->ob, surface); + evas_common_cpu_end_opt(); +} + +static void +eng_output_frameq_flush(void *data) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + re->outbuf_flush(re->ob); +} + +static void +eng_output_frameq_set_priv(void *data, void *cur, void *prev) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + re->outbuf_set_priv(re->ob, cur, prev); +} +#endif + +static void +eng_output_flush(void *data) +{ + Render_Engine *re; + + re = (Render_Engine *)data; +#ifdef EVAS_FRAME_QUEUING + if (re->render_mode == EVAS_RENDER_MODE_NONBLOCKING) + { + evas_common_frameq_set_frame_data(data, + eng_output_frameq_redraws_next_update_push, + eng_output_frameq_flush, + eng_output_frameq_set_priv); + evas_common_frameq_ready_frame(); + evas_common_frameq_begin(); + } + else +#endif + re->outbuf_flush(re->ob); +} + +static void +eng_output_idle_flush(void *data) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + re->outbuf_idle_flush(re->ob); +} + +static Eina_Bool +eng_canvas_alpha_get(void *data, void *context __UNUSED__) +{ + Render_Engine *re; + + re = (Render_Engine *)data; + return (re->ob->priv.destination_alpha) || (re->outbuf_alpha_get(re->ob)); +} + + +/* module advertising code */ +static int +module_open(Evas_Module *em) +{ +#ifdef BUILD_ENGINE_SOFTWARE_XLIB + static Eina_Bool xrm_inited = EINA_FALSE; + + if (!xrm_inited) + { + xrm_inited = EINA_TRUE; + XrmInitialize(); + } +#endif + + if (!em) return 0; + + /* get whatever engine module we inherit from */ + if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0; + + _evas_engine_soft_x11_log_dom = + eina_log_domain_register("evas-software_x11", EVAS_DEFAULT_LOG_COLOR); + + if (_evas_engine_soft_x11_log_dom < 0) + { + EINA_LOG_ERR("Can not create a module log domain."); + return 0; + } + + /* store it for later use */ + func = pfunc; + + /* now to override methods */ +#define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) + ORD(info); + ORD(info_free); + ORD(setup); + ORD(canvas_alpha_get); + ORD(output_free); + ORD(output_resize); + ORD(output_tile_size_set); + ORD(output_redraws_rect_add); + ORD(output_redraws_rect_del); + ORD(output_redraws_clear); + ORD(output_redraws_next_update_get); + ORD(output_redraws_next_update_push); + ORD(output_flush); + ORD(output_idle_flush); +#ifdef EVAS_FRAME_QUEUING + ORD(image_map_surface_new); +#endif + + /* now advertise out own api */ + em->functions = (void *)(&func); + return 1; +} + +static void +module_close(Evas_Module *em __UNUSED__) +{ + eina_log_domain_unregister(_evas_engine_soft_x11_log_dom); +#ifdef BUILD_ENGINE_SOFTWARE_XLIB +/* + if (xrdb_user.db) + { + XrmDestroyDatabase(xrdb_user.db); + xrdb_user.last_stat = 0; + xrdb_user.last_mtime = 0; + xrdb_user.db = NULL; + } + */ +#endif +} + +static Evas_Module_Api evas_modapi = +{ + EVAS_MODULE_API_VERSION, "software_x11", "none", + { + module_open, + module_close + } +}; + +EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, software_x11); + +#ifndef EVAS_STATIC_BUILD_SOFTWARE_X11 +EVAS_EINA_MODULE_DEFINE(engine, software_x11); +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_engine.h b/libraries/evas/src/modules/engines/software_x11/evas_engine.h new file mode 100644 index 0000000..80b71b7 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_engine.h @@ -0,0 +1,137 @@ +#ifndef EVAS_ENGINE_H +# define EVAS_ENGINE_H + +# include +# include + +# ifdef BUILD_ENGINE_SOFTWARE_XLIB +# include +# include +# include +# include +# include // xres - dpi +# endif + +# ifdef BUILD_ENGINE_SOFTWARE_XCB +# include +# include +# include +# endif + +extern int _evas_engine_soft_x11_log_dom; + +# ifdef ERR +# undef ERR +# endif +# define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_x11_log_dom, __VA_ARGS__) + +# ifdef DBG +# undef DBG +# endif +# define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_x11_log_dom, __VA_ARGS__) + +# ifdef INF +# undef INF +# endif +# define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_x11_log_dom, __VA_ARGS__) + +# ifdef WRN +# undef WRN +# endif +# define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_x11_log_dom, __VA_ARGS__) + +# ifdef CRIT +# undef CRIT +# endif +# define CRIT(...) \ + EINA_LOG_DOM_CRIT(_evas_engine_soft_x11_log_dom, __VA_ARGS__) + +typedef enum _Outbuf_Depth Outbuf_Depth; + +enum _Outbuf_Depth +{ + OUTBUF_DEPTH_NONE, + OUTBUF_DEPTH_INHERIT, + OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED, + OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED, + OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED, + OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED, + OUTBUF_DEPTH_RGB_32BPP_888_8888, + OUTBUF_DEPTH_LAST +}; + +typedef struct _Outbuf Outbuf; + +struct _Outbuf +{ + Outbuf_Depth depth; + int w, h; + int rot; + int onebuf; + + struct + { + Convert_Pal *pal; + union + { +# ifdef BUILD_ENGINE_SOFTWARE_XLIB + struct + { + Display *disp; + Window win; + Pixmap mask; + Visual *vis; + Colormap cmap; + int depth, shm; + GC gc, gcm; + unsigned char swap : 1; + unsigned char bit_swap : 1; + } xlib; +# endif +# ifdef BUILD_ENGINE_SOFTWARE_XCB + struct + { + xcb_connection_t *conn; + xcb_screen_t *screen; + xcb_window_t win; + xcb_pixmap_t mask; + xcb_visualtype_t *visual; + xcb_colormap_t cmap; + int depth, shm; + xcb_gcontext_t gc, gcm; + unsigned char swap : 1; + unsigned char bit_swap : 1; + } xcb; +# endif + } x11; + struct + { + DATA32 r, g, b; + } mask; + + /* 1 big buffer for updates - flush on idle_flush */ + RGBA_Image *onebuf; + Eina_List *onebuf_regions; + + /* a list of pending regions to write to the target */ + Eina_List *pending_writes; + + /* a list of previous frame pending regions to write to the target */ + Eina_List *prev_pending_writes; + +# ifdef EVAS_FRAME_QUEUING + /* protecting prev_pending_writes */ + LK(lock); +# endif + + unsigned char mask_dither : 1; + unsigned char destination_alpha : 1; + unsigned char debug : 1; + unsigned char synced : 1; + } priv; +}; + +void evas_software_xlib_x_init(void); +void evas_software_xcb_init(void); + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.c b/libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.c new file mode 100644 index 0000000..49ce721 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.c @@ -0,0 +1,498 @@ +#include "evas_common.h" +#include "evas_xcb_buffer.h" + +/* local function prototypes */ +static void _xcbob_sync(xcb_connection_t *conn); +static xcb_image_t *_xcbob_create_native(xcb_connection_t *conn, int w, int h, xcb_image_format_t format, uint8_t depth, void *base, uint32_t bytes, uint8_t *data); +static xcb_format_t *_xcbob_find_format(const xcb_setup_t *setup, uint8_t depth); +static xcb_visualtype_t *_xcbob_find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id); + +void +evas_software_xcb_write_mask_line(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y) +{ + int x, bpl = 0; + DATA32 *src_ptr; + DATA8 *dst_ptr; + + src_ptr = src; + dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); + dst_ptr = dst_ptr + (bpl * y); + w -= 7; + if (buf->priv.x11.xcb.bit_swap) + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0])) >> 7) << 7) | + ((A_VAL(&(src_ptr[1])) >> 7) << 6) | + ((A_VAL(&(src_ptr[2])) >> 7) << 5) | + ((A_VAL(&(src_ptr[3])) >> 7) << 4) | + ((A_VAL(&(src_ptr[4])) >> 7) << 3) | + ((A_VAL(&(src_ptr[5])) >> 7) << 2) | + ((A_VAL(&(src_ptr[6])) >> 7) << 1) | + ((A_VAL(&(src_ptr[7])) >> 7) << 0); + src_ptr += 8; + dst_ptr++; + } + } + else + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0])) >> 7) << 0) | + ((A_VAL(&(src_ptr[1])) >> 7) << 1) | + ((A_VAL(&(src_ptr[2])) >> 7) << 2) | + ((A_VAL(&(src_ptr[3])) >> 7) << 3) | + ((A_VAL(&(src_ptr[4])) >> 7) << 4) | + ((A_VAL(&(src_ptr[5])) >> 7) << 5) | + ((A_VAL(&(src_ptr[6])) >> 7) << 6) | + ((A_VAL(&(src_ptr[7])) >> 7) << 7); + src_ptr += 8; + dst_ptr++; + } + } + w += 7; + for (; x < w; x ++) + { + xcb_image_put_pixel(xcbob->xim, x, y, A_VAL(src_ptr) >> 7); + src_ptr++; + } +} + +void +evas_software_xcb_write_mask_line_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y) +{ + int x, bpl = 0; + DATA32 *src_ptr; + DATA8 *dst_ptr; + + src_ptr = src + w - 1; + dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); + dst_ptr = dst_ptr + (bpl * y); + w -= 7; + if (buf->priv.x11.xcb.bit_swap) + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0])) >> 7) << 7) | + ((A_VAL(&(src_ptr[-1])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-2])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-3])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-4])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-5])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-6])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-7])) >> 7) << 0); + src_ptr -= 8; + dst_ptr++; + } + } + else + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0])) >> 7) << 0) | + ((A_VAL(&(src_ptr[-1])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-2])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-3])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-4])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-5])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-6])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-7])) >> 7) << 7); + src_ptr -= 8; + dst_ptr++; + } + } + w += 7; + for (; x < w; x ++) + { + xcb_image_put_pixel(xcbob->xim, x, y, A_VAL(src_ptr) >> 7); + src_ptr--; + } +} + +void +evas_software_xcb_write_mask_line_vert(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w) +{ + int yy, bpl = 0; + DATA32 *src_ptr; + DATA8 *dst_ptr; + + src_ptr = src; + dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); + dst_ptr = dst_ptr + (bpl * y); + h -= 7; + if (buf->priv.x11.xcb.bit_swap) + { + for (yy = 0; yy < h; yy += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0 * w])) >> 7) << 7) | + ((A_VAL(&(src_ptr[1 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[2 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[3 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[4 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[5 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[6 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[7 * w])) >> 7) << 0); + src_ptr += 8 * w; + dst_ptr++; + } + } + else + { + for (yy = 0; yy < h; yy += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0 * w])) >> 7) << 0) | + ((A_VAL(&(src_ptr[1 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[2 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[3 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[4 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[5 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[6 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[7 * w])) >> 7) << 7); + src_ptr += 8 * w; + dst_ptr++; + } + } + h += 7; + for (; yy < h; yy ++) + { + xcb_image_put_pixel(xcbob->xim, yy, y, A_VAL(src_ptr) >> 7); + src_ptr += w; + } +} + +void +evas_software_xcb_write_mask_line_vert_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w) +{ + int yy, bpl = 0; + DATA32 *src_ptr; + DATA8 *dst_ptr; + + src_ptr = src + ((h - 1) * w); + dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); + dst_ptr = dst_ptr + (bpl * y); + h -= 7; + if (buf->priv.x11.xcb.bit_swap) + { + for (yy = 0; yy < h; yy += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 7) | + ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 0); + src_ptr -= 8 * w; + dst_ptr++; + } + } + else + { + for (yy = 0; yy < h; yy += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 0) | + ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 7); + src_ptr -= 8 * w; + dst_ptr++; + } + } + h += 7; + for (; yy < h; yy ++) + { + xcb_image_put_pixel(xcbob->xim, yy, y, A_VAL(src_ptr) >> 7); + src_ptr -= w; + } +} + +Eina_Bool +evas_software_xcb_can_do_shm(xcb_connection_t *conn, xcb_screen_t *screen) +{ + const xcb_query_extension_reply_t *reply; + static xcb_connection_t *cached_conn = NULL; + static int cached_result = 0; + + if (conn == cached_conn) return cached_result; + cached_conn = conn; + + reply = xcb_get_extension_data(conn, &xcb_shm_id); + if ((reply) && (reply->present)) + { + xcb_visualtype_t *visual; + Xcb_Output_Buffer *xcbob = NULL; + + visual = _xcbob_find_visual_by_id(screen, screen->root_visual); + xcbob = + evas_software_xcb_output_buffer_new(conn, visual, screen->root_depth, + 16, 16, 2, NULL); + if (!xcbob) + cached_result = 0; + else + { + evas_software_xcb_output_buffer_free(xcbob, EINA_TRUE); + cached_result = 1; + } + } + else + cached_result = 0; + + return cached_result; +} + +Xcb_Output_Buffer * +evas_software_xcb_output_buffer_new(xcb_connection_t *conn, xcb_visualtype_t *vis, int depth, int w, int h, int try_shm, unsigned char *data) +{ + Xcb_Output_Buffer *xcbob = NULL; + + if (!(xcbob = calloc(1, sizeof(Xcb_Output_Buffer)))) + return NULL; + + xcbob->connection = conn; + xcbob->visual = vis; + xcbob->xim = NULL; + xcbob->shm_info = NULL; + xcbob->w = w; + xcbob->h = h; + + if (try_shm > 0) + { + xcbob->shm_info = malloc(sizeof(xcb_shm_segment_info_t)); + if (xcbob->shm_info) + { + xcbob->shm_info->shmseg = xcb_generate_id(conn); + xcbob->xim = + _xcbob_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, + depth, NULL, ~0, NULL); + if (xcbob->xim) + { + xcbob->shm_info->shmid = + shmget(IPC_PRIVATE, + xcbob->xim->stride * xcbob->xim->height, + (IPC_CREAT | 0777)); + if (xcbob->shm_info->shmid == (uint32_t)-1) + { + xcb_image_destroy(xcbob->xim); + free(xcbob->shm_info); + free(xcbob); + return NULL; + } + xcbob->shm_info->shmaddr = xcbob->xim->data = + shmat(xcbob->shm_info->shmid, 0, 0); + if (xcbob->shm_info->shmaddr != ((void *)-1)) + { + /* Sync only needed for testing */ + if (try_shm == 2) _xcbob_sync(conn); + +#if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) + if (evas_common_frameq_enabled()) + xcb_grab_server(conn); +#endif + xcb_shm_attach(conn, xcbob->shm_info->shmseg, + xcbob->shm_info->shmid, 0); +#if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) + if (evas_common_frameq_enabled()) + xcb_ungrab_server(conn); +#endif + if (try_shm == 2) _xcbob_sync(conn); + + xcbob->bpl = xcbob->xim->stride; + xcbob->psize = (xcbob->bpl * xcbob->h); + return xcbob; + } + shmdt(xcbob->shm_info->shmaddr); + shmctl(xcbob->shm_info->shmid, IPC_RMID, 0); + } + if (xcbob->xim) xcb_image_destroy(xcbob->xim); + xcbob->xim = NULL; + } + if (xcbob->shm_info) free(xcbob->shm_info); + xcbob->shm_info = NULL; + } + + if (try_shm > 1) return NULL; + + /* no shm */ + xcbob->xim = + _xcbob_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, + depth, NULL, ~0, NULL); + if (!xcbob->xim) + { + free(xcbob); + return NULL; + } + + xcbob->data = data; + + if (!xcbob->xim->data) + { + xcbob->xim->data = malloc(xcbob->xim->stride * xcbob->xim->height); + if (!xcbob->xim->data) + { + xcb_image_destroy(xcbob->xim); + free(xcbob); + return NULL; + } + } + xcbob->bpl = xcbob->xim->stride; + xcbob->psize = (xcbob->bpl * xcbob->h); + return xcbob; +} + +void +evas_software_xcb_output_buffer_free(Xcb_Output_Buffer *xcbob, Eina_Bool sync) +{ + if (xcbob->shm_info) + { + if (sync) _xcbob_sync(xcbob->connection); + xcb_shm_detach(xcbob->connection, xcbob->shm_info->shmseg); + xcb_image_destroy(xcbob->xim); + shmdt(xcbob->shm_info->shmaddr); + shmctl(xcbob->shm_info->shmid, IPC_RMID, 0); + free(xcbob->shm_info); + } + else + { + if (xcbob->data) xcbob->xim->data = NULL; +// free(xcbob->xim->data); + xcb_image_destroy(xcbob->xim); + } + free(xcbob); +} + +void +evas_software_xcb_output_buffer_paste(Xcb_Output_Buffer *xcbob, xcb_drawable_t drawable, xcb_gcontext_t gc, int x, int y, Eina_Bool sync) +{ + if (xcbob->shm_info) + { + xcb_image_shm_put(xcbob->connection, drawable, gc, xcbob->xim, + *xcbob->shm_info, 0, 0, x, y, xcbob->w, xcbob->h, 0); + if (sync) _xcbob_sync(xcbob->connection); + } + else + xcb_image_put(xcbob->connection, drawable, gc, xcbob->xim, x, y, 0); +} + +DATA8 * +evas_software_xcb_output_buffer_data(Xcb_Output_Buffer *xcbob, int *bpl_ret) +{ + if (bpl_ret) *bpl_ret = xcbob->xim->stride; + return (DATA8 *)xcbob->xim->data; +} + +int +evas_software_xcb_output_buffer_depth(Xcb_Output_Buffer *xcbob) +{ + return xcbob->xim->bpp; +} + +int +evas_software_xcb_output_buffer_byte_order(Xcb_Output_Buffer *xcbob) +{ + return xcbob->xim->byte_order; +} + +int +evas_software_xcb_output_buffer_bit_order(Xcb_Output_Buffer *xcbob) +{ + return xcbob->xim->bit_order; +} + +/* local functions */ +static void +_xcbob_sync(xcb_connection_t *conn) +{ + free(xcb_get_input_focus_reply(conn, + xcb_get_input_focus_unchecked(conn), NULL)); +} + +static xcb_image_t * +_xcbob_create_native(xcb_connection_t *conn, int w, int h, xcb_image_format_t format, uint8_t depth, void *base, uint32_t bytes, uint8_t *data) +{ + static uint8_t dpth = 0; + static xcb_format_t *fmt = NULL; + const xcb_setup_t *setup; + xcb_image_format_t xif; + + /* NB: We cannot use xcb_image_create_native as it only creates images + * using MSB_FIRST, so this routine recreates that function and uses + * the endian-ness of the server setup */ + setup = xcb_get_setup(conn); + xif = format; + + if ((xif == XCB_IMAGE_FORMAT_Z_PIXMAP) && (depth == 1)) + xif = XCB_IMAGE_FORMAT_XY_PIXMAP; + + if (dpth != depth) + { + dpth = depth; + fmt = _xcbob_find_format(setup, depth); + if (!fmt) return 0; + } + + switch (xif) + { + case XCB_IMAGE_FORMAT_XY_BITMAP: + if (depth != 1) return 0; + case XCB_IMAGE_FORMAT_XY_PIXMAP: + case XCB_IMAGE_FORMAT_Z_PIXMAP: + return xcb_image_create(w, h, xif, + fmt->scanline_pad, + fmt->depth, fmt->bits_per_pixel, + setup->bitmap_format_scanline_unit, + setup->image_byte_order, + setup->bitmap_format_bit_order, + base, bytes, data); + default: + break; + } + + return 0; +} + +static xcb_format_t * +_xcbob_find_format(const xcb_setup_t *setup, uint8_t depth) +{ + xcb_format_t *fmt, *fmtend; + + fmt = xcb_setup_pixmap_formats(setup); + fmtend = fmt + xcb_setup_pixmap_formats_length(setup); + for (; fmt != fmtend; ++fmt) + if (fmt->depth == depth) + return fmt; + + return 0; +} + +static xcb_visualtype_t * +_xcbob_find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id) +{ + xcb_depth_iterator_t diter; + xcb_visualtype_iterator_t viter; + + diter = xcb_screen_allowed_depths_iterator(screen); + for (; diter.rem; xcb_depth_next(&diter)) + { + viter = xcb_depth_visuals_iterator(diter.data); + for (; viter.rem; xcb_visualtype_next(&viter)) + { + if (viter.data->visual_id == id) + return viter.data; + } + } + + return 0; +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.h b/libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.h new file mode 100644 index 0000000..dc1f0b4 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_buffer.h @@ -0,0 +1,30 @@ +#ifndef EVAS_XCB_BUFFER_H +# define EVAS_XCB_BUFFER_H + +# include "evas_engine.h" + +typedef struct _Xcb_Output_Buffer Xcb_Output_Buffer; +struct _Xcb_Output_Buffer +{ + xcb_connection_t *connection; + xcb_visualtype_t *visual; + xcb_image_t *xim; + xcb_shm_segment_info_t *shm_info; + unsigned char *data; + int w, h, bpl, psize; +}; + +void evas_software_xcb_write_mask_line(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y); +void evas_software_xcb_write_mask_line_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y); +void evas_software_xcb_write_mask_line_vert(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w); +void evas_software_xcb_write_mask_line_vert_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w); +Eina_Bool evas_software_xcb_can_do_shm(xcb_connection_t *conn, xcb_screen_t *screen); +Xcb_Output_Buffer *evas_software_xcb_output_buffer_new(xcb_connection_t *conn, xcb_visualtype_t *vis, int depth, int w, int h, int try_shm, unsigned char *data); +void evas_software_xcb_output_buffer_free(Xcb_Output_Buffer *xcbob, Eina_Bool sync); +void evas_software_xcb_output_buffer_paste(Xcb_Output_Buffer *xcbob, xcb_drawable_t drawable, xcb_gcontext_t gc, int x, int y, Eina_Bool sync); +DATA8 *evas_software_xcb_output_buffer_data(Xcb_Output_Buffer *xcbob, int *bpl_ret); +int evas_software_xcb_output_buffer_depth(Xcb_Output_Buffer *xcbob); +int evas_software_xcb_output_buffer_byte_order(Xcb_Output_Buffer *xcbob); +int evas_software_xcb_output_buffer_bit_order(Xcb_Output_Buffer *xcbob); + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_color.c b/libraries/evas/src/modules/engines/software_x11/evas_xcb_color.c new file mode 100644 index 0000000..3ed6037 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_color.c @@ -0,0 +1,424 @@ +#include "evas_common.h" + +#include "evas_engine.h" + +typedef struct _Convert_Pal_Priv Convert_Pal_Priv; + +struct _Convert_Pal_Priv +{ + xcb_connection_t *conn; + xcb_colormap_t cmap; + xcb_visualtype_t *vis; +}; + +typedef DATA8 * (*Xcb_Func_Alloc_Colors) (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); + +static Xcb_Func_Alloc_Colors x_color_alloc[PAL_MODE_LAST + 1]; +static int x_color_count[PAL_MODE_LAST + 1]; +static Eina_List *palettes = NULL; + +static DATA8 * x_color_alloc_rgb(int nr, int ng, int nb, xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_gray(int ng, xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); + +static DATA8 * x_color_alloc_rgb_332 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_rgb_666 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_rgb_232 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_rgb_222 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_rgb_221 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_rgb_121 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_rgb_111 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_gray_256 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_gray_64 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_gray_16 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_gray_4 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); +static DATA8 * x_color_alloc_mono (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); + +static DATA8 * +x_color_alloc_rgb(int nr, + int ng, + int nb, + xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + int r, g, b, i; + DATA8 *color_lut; + int sig_mask = 0; + int delt = 0; + + for (i = 0; i < v->bits_per_rgb_value; i++) sig_mask |= (0x1 << i); + sig_mask <<= (16 - v->bits_per_rgb_value); + i = 0; + color_lut = malloc((nr) * (ng) * (nb)); + if (!color_lut) return NULL; + delt = 0x0101 * 3; + /* FIXME: remove the round-trip ? */ + for (r = 0; r < (nr); r++) + { + for (g = 0; g < (ng); g++) + { + for (b = 0; b < (nb); b++) + { + xcb_coloritem_t xcl; + xcb_coloritem_t xcl_in; + xcb_alloc_color_reply_t *rep; + int val; + int dr, dg, db; + + val = (int)((((double)r) / ((nr) - 1)) * 255); + val = (val << 8) | val; + xcl.red = (uint16_t)(val); + val = (int)((((double)g) / ((ng) - 1)) * 255); + val = (val << 8) | val; + xcl.green = (uint16_t)(val); + val = (int)((((double)b) / ((nb) - 1)) * 255); + val = (val << 8) | val; + xcl.blue = (uint16_t)(val); + xcl_in = xcl; + rep = xcb_alloc_color_reply(conn, + xcb_alloc_color_unchecked(conn, + cmap, + xcl.red, + xcl.green, + xcl.blue), + 0); + dr = (int)xcl_in.red - (int)xcl.red; + if (dr < 0) dr = -dr; + dg = (int)xcl_in.green - (int)xcl.green; + if (dg < 0) dg = -dg; + db = (int)xcl_in.blue - (int)xcl.blue; + if (db < 0) db = -db; +/* + printf("ASK [%i]: %04x %04x %04x = %04x %04x %04x | dif = %04x / %04x\n", + ret, + xcl_in.red, xcl_in.green, xcl_in.blue, + xcl.red, xcl.green, xcl.blue, + (dr + dg +db), delt); + */ + + /* TODO: XAllocColor tries to approach the color */ + /* in case the allocation fails */ + /* XCB does not that (i think). It should be done */ + /* So if rep == NULL, the other following tests */ + /* should be always satisfied */ + if ((!rep) || + ((dr + dg + db) > delt) + /* + ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || + ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || + ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask)) + */ + ) + { + uint32_t pixels[256]; + int j; + + if (i > 0) + { + for (j = 0; j < i; j++) + pixels[j] = (uint32_t)color_lut[j]; + xcb_free_colors(conn, cmap, 0, i, pixels); + } + free(color_lut); + return NULL; + } + color_lut[i] = rep->pixel; + i++; + free(rep); + } + } + } + return color_lut; +} + +static DATA8 * +x_color_alloc_gray(int ng, + xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + int g, i; + DATA8 *color_lut; + int sig_mask = 0; + + for (i = 0; i < v->bits_per_rgb_value; i++) sig_mask |= (0x1 << i); + sig_mask <<= (16 - v->bits_per_rgb_value); + i = 0; + color_lut = malloc(ng); + if (!color_lut) return NULL; + /* FIXME: remove the round-trip ? */ + for (g = 0; g < (ng); g++) + { + xcb_coloritem_t xcl; + xcb_coloritem_t xcl_in; + int val; + xcb_alloc_color_reply_t *rep; + + val = (int)((((double)g) / ((ng) - 1)) * 255); + val = (val << 8) | val; + xcl.red = (uint16_t)(val); + xcl.green = (uint16_t)(val); + xcl.blue = (uint16_t)(val); + xcl_in = xcl; + rep = xcb_alloc_color_reply(conn, + xcb_alloc_color_unchecked(conn, + cmap, + xcl.red, + xcl.green, + xcl.blue), + 0); + /* FIXME: XAllocColor tries to approach the color */ + /* in case the allocation fails */ + /* XCB does not that (i think). It should be done */ + /* So if rep == NULL, the other following tests */ + /* should be always satisfied */ + if ((!rep) || + ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || + ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || + ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask))) + { + uint32_t pixels[256]; + int j; + + if (i > 0) + { + for (j = 0; j < i; j++) + pixels[j] = (uint32_t) color_lut[j]; + xcb_free_colors(conn, cmap, 0, i, pixels); + } + free(color_lut); + return NULL; + } + color_lut[i] = rep->pixel; + i++; + free(rep); + } + return color_lut; +} + +static DATA8 * +x_color_alloc_rgb_332(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(8, 8, 4, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_666(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(6, 6, 6, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_232(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(4, 8, 4, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_222(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(4, 4, 4, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_221(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(4, 4, 2, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_121(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(2, 4, 2, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_111(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_rgb(2, 2, 2, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_256(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_gray(256, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_64(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_gray(64, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_16(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_gray(32, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_4(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_gray(16, conn, cmap, v); +} + +static DATA8 * +x_color_alloc_mono(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *v) +{ + return x_color_alloc_gray(2, conn, cmap, v); +} + +void +evas_software_xcb_color_init(void) +{ + static int initialised = 0; + + if (initialised) return; + x_color_alloc[PAL_MODE_NONE] = NULL; + x_color_count[PAL_MODE_NONE] = 0; + + x_color_alloc[PAL_MODE_MONO] = x_color_alloc_mono; + x_color_count[PAL_MODE_MONO] = 2; + + x_color_alloc[PAL_MODE_GRAY4] = x_color_alloc_gray_4; + x_color_count[PAL_MODE_GRAY4] = 4; + + x_color_alloc[PAL_MODE_GRAY16] = x_color_alloc_gray_16; + x_color_count[PAL_MODE_GRAY16] = 16; + + x_color_alloc[PAL_MODE_GRAY64] = x_color_alloc_gray_64; + x_color_count[PAL_MODE_GRAY64] = 64; + + x_color_alloc[PAL_MODE_GRAY256] = x_color_alloc_gray_256; + x_color_count[PAL_MODE_GRAY256] = 256; + + x_color_alloc[PAL_MODE_RGB111] = x_color_alloc_rgb_111; + x_color_count[PAL_MODE_RGB111] = 2 * 2 * 2; + + x_color_alloc[PAL_MODE_RGB121] = x_color_alloc_rgb_121; + x_color_count[PAL_MODE_RGB121] = 2 * 4 * 2; + + x_color_alloc[PAL_MODE_RGB221] = x_color_alloc_rgb_221; + x_color_count[PAL_MODE_RGB221] = 4 * 4 * 2; + + x_color_alloc[PAL_MODE_RGB222] = x_color_alloc_rgb_222; + x_color_count[PAL_MODE_RGB222] = 4 * 4 * 4; + + x_color_alloc[PAL_MODE_RGB232] = x_color_alloc_rgb_232; + x_color_count[PAL_MODE_RGB232] = 4 * 8 * 4; + + x_color_alloc[PAL_MODE_RGB666] = x_color_alloc_rgb_666; + x_color_count[PAL_MODE_RGB666] = 6 * 6 * 6; + + x_color_alloc[PAL_MODE_RGB332] = x_color_alloc_rgb_332; + x_color_count[PAL_MODE_RGB332] = 8 * 8 * 4; + + x_color_alloc[PAL_MODE_LAST] = NULL; + x_color_count[PAL_MODE_LAST] = 0; + initialised = 1; +} + +Convert_Pal * +evas_software_xcb_color_allocate(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *vis, + Convert_Pal_Mode colors) +{ + Convert_Pal_Priv *palpriv; + Convert_Pal *pal; + Convert_Pal_Mode c; + Eina_List *l; + +/* printf("ALLOC cmap=%i vis=%p\n", cmap, vis);*/ + EINA_LIST_FOREACH(palettes, l, pal) + { + palpriv = pal->data; + if ((conn == palpriv->conn) && + (vis == palpriv->vis) && + (cmap == palpriv->cmap)) + { + pal->references++; + return pal; + } + } + pal = calloc(1, sizeof(struct _Convert_Pal)); + if (!pal) return NULL; + for (c = colors; c > PAL_MODE_NONE; c--) + { + if (x_color_alloc[c]) + { +/* printf("TRY PAL %i\n", c);*/ + pal->lookup = (x_color_alloc[c])(conn, cmap, vis); + if (pal->lookup) break; + } + } + pal->references = 1; + pal->colors = c; + pal->count = x_color_count[c]; + palpriv = calloc(1, sizeof(Convert_Pal_Priv)); + pal->data = palpriv; + if (!palpriv) + { + if (pal->lookup) free(pal->lookup); + free(pal); + return NULL; + } + palpriv->conn = conn; + palpriv->vis = vis; + palpriv->cmap = cmap; + if (pal->colors == PAL_MODE_NONE) + { + if (pal->lookup) free(pal->lookup); + free(pal); + return NULL; + } + palettes = eina_list_append(palettes, pal); + return pal; +} + +void +evas_software_xcb_color_deallocate(xcb_connection_t *conn, + xcb_colormap_t cmap, + xcb_visualtype_t *vis __UNUSED__, + Convert_Pal *pal) +{ + uint32_t pixels[256]; + int j; + + pal->references--; + if (pal->references > 0) return; + if (pal->lookup) + { + for(j = 0; j < pal->count; j++) + pixels[j] = (uint32_t) pal->lookup[j]; + xcb_free_colors(conn, cmap, 0, pal->count, pixels); + free(pal->lookup); + } + free(pal->data); + palettes = eina_list_remove(palettes, pal); + free(pal); +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_color.h b/libraries/evas/src/modules/engines/software_x11/evas_xcb_color.h new file mode 100644 index 0000000..7dcaeaf --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_color.h @@ -0,0 +1,10 @@ +#ifndef EVAS_XCB_COLOR_H +# define EVAS_XCB_COLOR_H + +# include "evas_engine.h" + +void evas_software_xcb_color_init(void); +Convert_Pal *evas_software_xcb_color_allocate(xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *vis, Convert_Pal_Mode colors); +void evas_software_xcb_color_deallocate(xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *vis, Convert_Pal *pal); + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_main.c b/libraries/evas/src/modules/engines/software_x11/evas_xcb_main.c new file mode 100644 index 0000000..d187016 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_main.c @@ -0,0 +1,8 @@ +#include "evas_common.h" +#include "evas_engine.h" + +void +evas_software_xcb_init(void) +{ + +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c b/libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c new file mode 100644 index 0000000..71759be --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.c @@ -0,0 +1,1092 @@ +#include "evas_common.h" +#include "evas_macros.h" +#include "evas_xcb_outbuf.h" +#include "evas_xcb_buffer.h" +#include "evas_xcb_color.h" +#include + +/* local structures */ +typedef struct _Outbuf_Region Outbuf_Region; +struct _Outbuf_Region +{ + Xcb_Output_Buffer *xcbob, *mask; + int x, y, w, h; +}; + +/* local function prototypes */ +static Xcb_Output_Buffer *_find_xcbob(xcb_connection_t *conn, xcb_visualtype_t *vis, int depth, int w, int h, Eina_Bool shm, void *data); +static void _unfind_xcbob(Xcb_Output_Buffer *xcbob, Eina_Bool sync); +static void _clear_xcbob(Eina_Bool sync); +static void _xcbob_sync(xcb_connection_t *conn); + +/* local variables */ +static Eina_List *_shmpool = NULL; +static int _shmsize = 0; +static int _shmlimit = (10 * 1024 * 1024); +static const unsigned int _shmcountlimit = 32; + +#ifdef EVAS_FRAME_QUEUING +static LK(lock_shmpool); +# define SHMPOOL_LOCK() LKL(lock_shmpool); +# define SHMPOOL_UNLOCK() LKU(lock_shmpool); +#else +# define SHMPOOL_LOCK() +# define SHMPOOL_UNLOCK() +#endif + +void +evas_software_xcb_outbuf_init(void) +{ +#ifdef EVAS_FRAME_QUEUING + LKI(lock_shmpool); +#endif +} + +void +evas_software_xcb_outbuf_free(Outbuf *buf) +{ +#ifdef EVAS_FRAME_QUEUING + LKL(buf->priv.lock); +#endif + while (buf->priv.pending_writes) + { + RGBA_Image *im = NULL; + Outbuf_Region *obr = NULL; + + im = buf->priv.pending_writes->data; + buf->priv.pending_writes = + eina_list_remove_list(buf->priv.pending_writes, + buf->priv.pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); + if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); + free(obr); + } +#ifdef EVAS_FRAME_QUEUING + LKU(buf->priv.lock); +#endif + evas_software_xcb_outbuf_idle_flush(buf); + evas_software_xcb_outbuf_flush(buf); + if (buf->priv.x11.xcb.gc) + xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc); + if (buf->priv.x11.xcb.gcm) + xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gcm); + if (buf->priv.pal) + evas_software_xcb_color_deallocate(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.cmap, + buf->priv.x11.xcb.visual, + buf->priv.pal); +#ifdef EVAS_FRAME_QUEUING + LKD(buf->priv.lock); +#endif + free(buf); + _clear_xcbob(EINA_FALSE); +} + +Outbuf * +evas_software_xcb_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, xcb_connection_t *conn, xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, int xdepth, Eina_Bool grayscale, int max_colors, xcb_drawable_t mask, Eina_Bool shape_dither, Eina_Bool alpha) +{ + Outbuf *buf = NULL; + Gfx_Func_Convert func_conv= NULL; + const xcb_setup_t *setup; + + if (!(buf = calloc(1, sizeof(Outbuf)))) + return NULL; + + setup = xcb_get_setup(conn); + + buf->w = w; + buf->h = h; + buf->depth = depth; + buf->rot = rot; + buf->priv.x11.xcb.conn = conn; + buf->priv.x11.xcb.screen = screen; + buf->priv.x11.xcb.visual = vis; + buf->priv.x11.xcb.cmap = cmap; + buf->priv.x11.xcb.depth = xdepth; + buf->priv.mask_dither = shape_dither; + buf->priv.destination_alpha = alpha; + buf->priv.x11.xcb.shm = evas_software_xcb_can_do_shm(conn, screen); + +#ifdef WORDS_BIGENDIAN + if (setup->image_byte_order == XCB_IMAGE_ORDER_LSB_FIRST) + buf->priv.x11.xcb.swap = EINA_TRUE; +#else + if (setup->image_byte_order == XCB_IMAGE_ORDER_MSB_FIRST) + buf->priv.x11.xcb.swap = EINA_TRUE; +#endif + if (setup->bitmap_format_bit_order == XCB_IMAGE_ORDER_MSB_FIRST) + buf->priv.x11.xcb.bit_swap = EINA_TRUE; + + if (((vis->_class == XCB_VISUAL_CLASS_TRUE_COLOR) || + (vis->_class == XCB_VISUAL_CLASS_DIRECT_COLOR)) && (xdepth > 8)) + { + buf->priv.mask.r = (DATA32)vis->red_mask; + buf->priv.mask.g = (DATA32)vis->green_mask; + buf->priv.mask.b = (DATA32)vis->blue_mask; + if (buf->priv.x11.xcb.swap) + { + SWAP32(buf->priv.mask.r); + SWAP32(buf->priv.mask.g); + SWAP32(buf->priv.mask.b); + } + } + else if ((vis->_class == XCB_VISUAL_CLASS_PSEUDO_COLOR) || + (vis->_class == XCB_VISUAL_CLASS_STATIC_COLOR) || + (vis->_class == XCB_VISUAL_CLASS_GRAY_SCALE) || + (vis->_class == XCB_VISUAL_CLASS_STATIC_GRAY) || + (xdepth <= 8)) + { + Convert_Pal_Mode pm = PAL_MODE_RGB332; + + if ((vis->_class == XCB_VISUAL_CLASS_GRAY_SCALE) || + (vis->_class == XCB_VISUAL_CLASS_STATIC_GRAY)) + grayscale = EINA_TRUE; + if (grayscale) + { + if (max_colors >= 256) + pm = PAL_MODE_GRAY256; + else if (max_colors >= 64) + pm = PAL_MODE_GRAY64; + else if (max_colors >= 16) + pm = PAL_MODE_GRAY16; + else if (max_colors >= 4) + pm = PAL_MODE_GRAY4; + else + pm = PAL_MODE_MONO; + } + else + { + if (max_colors >= 256) + pm = PAL_MODE_RGB332; + else if (max_colors >= 216) + pm = PAL_MODE_RGB666; + else if (max_colors >= 128) + pm = PAL_MODE_RGB232; + else if (max_colors >= 64) + pm = PAL_MODE_RGB222; + else if (max_colors >= 32) + pm = PAL_MODE_RGB221; + else if (max_colors >= 16) + pm = PAL_MODE_RGB121; + else if (max_colors >= 8) + pm = PAL_MODE_RGB111; + else if (max_colors >= 4) + pm = PAL_MODE_GRAY4; + else + pm = PAL_MODE_MONO; + } + /* FIXME: Only allocate once per display & colormap */ + buf->priv.pal = + evas_software_xcb_color_allocate(conn, cmap, vis, pm); + if (!buf->priv.pal) + { + free(buf); + return NULL; + } + } + if ((buf->rot == 0) || (buf->rot == 180)) + { + w = buf->w; + h = buf->h; + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + w = buf->h; + h = buf->w; + } + + if (buf->priv.pal) + { + func_conv = + evas_common_convert_func_get(0, w, h, xdepth, + buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, + buf->priv.pal->colors, buf->rot); + } + else + { + func_conv = + evas_common_convert_func_get(0, w, h, xdepth, + buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, + PAL_MODE_NONE, buf->rot); + } + if (!func_conv) + { + ERR("XCB Engine" + " {" + " At depth %i:" + " RGB format mask: %08x, %08x, %08x" + " Palette mode: %i" + " Not supported by any compiled in converters!" + " }", buf->priv.x11.xcb.depth, buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + buf->priv.pal ? (int)buf->priv.pal->colors : -1); + } + + evas_software_xcb_outbuf_drawable_set(buf, draw); + evas_software_xcb_outbuf_mask_set(buf, mask); + +#ifdef EVAS_FRAME_QUEUING + LKI(buf->priv.lock); +#endif + + return buf; +} + +RGBA_Image * +evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch) +{ + RGBA_Image *im = NULL; + Outbuf_Region *obr = NULL; + Eina_Bool use_shm = EINA_TRUE; + Eina_Bool alpha = EINA_FALSE; + int bpl = 0; + + if ((buf->onebuf) && (buf->priv.x11.xcb.shm)) + { + Eina_Rectangle *rect; + + RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h); + + if (!(obr = calloc(1, sizeof(Outbuf_Region)))) + return NULL; + + if (!(rect = eina_rectangle_new(x, y, w, h))) + { + free(obr); + return NULL; + } + + buf->priv.onebuf_regions = + eina_list_append(buf->priv.onebuf_regions, rect); + if (buf->priv.onebuf) + { + if (cx) *cx = x; + if (cy) *cy = y; + if (cw) *cw = w; + if (ch) *ch = h; + if (!buf->priv.synced) + { + _xcbob_sync(buf->priv.x11.xcb.conn); + buf->priv.synced = EINA_TRUE; + } + return buf->priv.onebuf; + } + obr->x = 0; + obr->y = 0; + obr->w = buf->w; + obr->h = buf->h; + if (cx) *cx = x; + if (cy) *cy = y; + if (cw) *cw = w; + if (ch) *ch = h; + + alpha = ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha)); + use_shm = buf->priv.x11.xcb.shm; + + if ((buf->rot == 0) && (buf->priv.mask.r == 0xff0000) && + (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff)) + { + obr->xcbob = + evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.visual, + buf->priv.x11.xcb.depth, + buf->w, buf->h, use_shm, + NULL); + if (!obr->xcbob) + { + free(obr); + return NULL; + } + im = + (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), + buf->w, buf->h, + (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl), + alpha, EVAS_COLORSPACE_ARGB8888); + if (!im) + { + evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE); + free(obr); + return NULL; + } + im->extended_info = obr; + if (buf->priv.x11.xcb.mask) + { + obr->mask = + evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.visual, + 1, buf->w, buf->h, + use_shm, NULL); + } + } + else + { + int bw = 0, bh = 0; + + im = + (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); + if (!im) + { + free(obr); + return NULL; + } + im->cache_entry.flags.alpha |= (alpha ? 1 : 0); + evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h); + im->extended_info = obr; + if ((buf->rot == 0) || (buf->rot == 180)) + { + bw = buf->w; + bh = buf->h; + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + bw = buf->h; + bh = buf->w; + } + obr->xcbob = + evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.visual, + buf->priv.x11.xcb.depth, + bw, bh, use_shm, NULL); + if (!obr->xcbob) + { + evas_cache_image_drop(&im->cache_entry); + free(obr); + return NULL; + } + if (buf->priv.x11.xcb.mask) + { + obr->mask = + evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.visual, + 1, bw, bh, use_shm, + NULL); + } + } + /* FIXME: We should be able to remove this memset. */ + if ((alpha) && (im->image.data)) + { + /* FIXME: Faster memset */ +// memset(im->image.data, 0, (w * h * sizeof(DATA32))); + } + buf->priv.onebuf = im; + return im; + } + + if (!(obr = calloc(1, sizeof(Outbuf_Region)))) + return NULL; + + obr->x = x; + obr->y = y; + obr->w = w; + obr->h = h; + if (cx) *cx = 0; + if (cy) *cy = 0; + if (cw) *cw = w; + if (ch) *ch = h; + + use_shm = buf->priv.x11.xcb.shm; + alpha = ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha)); + if ((buf->rot == 0) && (buf->priv.mask.r == 0xff0000) && + (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff)) + { + obr->xcbob = + _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, + buf->priv.x11.xcb.depth, w, h, use_shm, NULL); + if (!obr->xcbob) + { + free(obr); + return NULL; + } + im = + (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), + w, h, + (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl), + alpha, EVAS_COLORSPACE_ARGB8888); + if (!im) + { + _unfind_xcbob(obr->xcbob, EINA_FALSE); + free(obr); + return NULL; + } + im->extended_info = obr; + if (buf->priv.x11.xcb.mask) + { + obr->mask = + _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, + 1, w, h, use_shm, NULL); + } + } + else + { + int bw = 0, bh = 0; + + im = + (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); + if (!im) + { + free(obr); + return NULL; + } + im->cache_entry.flags.alpha |= (alpha ? 1 : 0); + evas_cache_image_surface_alloc(&im->cache_entry, w, h); + im->extended_info = obr; + if ((buf->rot == 0) || (buf->rot == 180)) + { + bw = w; + bh = h; + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + bw = h; + bh = w; + } + obr->xcbob = + _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, + buf->priv.x11.xcb.depth, bw, bh, use_shm, NULL); + if (!obr->xcbob) + { + evas_cache_image_drop(&im->cache_entry); + free(obr); + return NULL; + } + if (buf->priv.x11.xcb.mask) + { + obr->mask = + _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, 1, + bw, bh, use_shm, NULL); + } + } + /* FIXME: We should be able to remove this memset. */ + if (((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha)) && + (im->image.data)) + { + /* FIXME: Faster memset */ +// memset(im->image.data, 0, (w * h * sizeof(DATA32))); + } + +#ifdef EVAS_FRAME_QUEUING + if (!evas_common_frameq_enabled()) +#endif + buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im); + + return im; +} + +void +evas_software_xcb_outbuf_free_region_for_update(Outbuf *buf __UNUSED__, RGBA_Image *update __UNUSED__) +{ + /* NOOP: Cleaned up on flush */ +} + +void +evas_software_xcb_outbuf_flush(Outbuf *buf) +{ + Eina_List *l = NULL; + RGBA_Image *im = NULL; + Outbuf_Region *obr = NULL; + + if ((buf->priv.onebuf) && (buf->priv.onebuf_regions)) + { + pixman_region16_t tmpr; + + im = buf->priv.onebuf; + obr = im->extended_info; + pixman_region_init(&tmpr); + while (buf->priv.onebuf_regions) + { + Eina_Rectangle *rect, xr = { 0, 0, 0, 0 }; + + rect = buf->priv.onebuf_regions->data; + buf->priv.onebuf_regions = + eina_list_remove_list(buf->priv.onebuf_regions, + buf->priv.onebuf_regions); + if (buf->rot == 0) + { + xr.x = rect->x; + xr.y = rect->y; + xr.w = rect->w; + xr.h = rect->h; + } + else if (buf->rot == 90) + { + xr.x = rect->y; + xr.y = buf->w - rect->x - rect->w; + xr.w = rect->h; + xr.h = rect->w; + } + else if (buf->rot == 180) + { + xr.x = buf->w - rect->x - rect->w; + xr.y = buf->h - rect->y - rect->h; + xr.w = rect->w; + xr.h = rect->h; + } + else if (buf->rot == 270) + { + xr.x = buf->h - rect->y - rect->h; + xr.y = rect->x; + xr.w = rect->h; + xr.h = rect->w; + } + pixman_region_union_rect(&tmpr, &tmpr, xr.x, xr.y, xr.w, xr.h); + if (buf->priv.debug) + evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win, + xr.x, xr.y, xr.w, xr.h); + eina_rectangle_free(rect); + } + xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, + XCB_CLIP_ORDERING_YX_BANDED, + buf->priv.x11.xcb.gc, 0, 0, + pixman_region_n_rects(&tmpr), + (const xcb_rectangle_t *)pixman_region_rectangles(&tmpr, NULL)); + if (obr->xcbob) + evas_software_xcb_output_buffer_paste(obr->xcbob, + buf->priv.x11.xcb.win, + buf->priv.x11.xcb.gc, 0, 0, 0); + if (obr->mask) + { + xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, + XCB_CLIP_ORDERING_YX_BANDED, + buf->priv.x11.xcb.gcm, 0, 0, + pixman_region_n_rects(&tmpr), + (const xcb_rectangle_t *)pixman_region_rectangles(&tmpr, NULL)); + evas_software_xcb_output_buffer_paste(obr->mask, + buf->priv.x11.xcb.mask, + buf->priv.x11.xcb.gcm, + 0, 0, 0); + } + pixman_region_fini(&tmpr); + buf->priv.synced = EINA_FALSE; + } + else + { +#if 1 + _xcbob_sync(buf->priv.x11.xcb.conn); + EINA_LIST_FOREACH(buf->priv.pending_writes, l, im) + { + obr = im->extended_info; + if (buf->priv.debug) + evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win, + obr->x, obr->y, obr->w, obr->h); + if (obr->xcbob) + evas_software_xcb_output_buffer_paste(obr->xcbob, + buf->priv.x11.xcb.win, + buf->priv.x11.xcb.gc, + obr->x, obr->y, 0); + if (obr->mask) + evas_software_xcb_output_buffer_paste(obr->mask, + buf->priv.x11.xcb.mask, + buf->priv.x11.xcb.gcm, + obr->x, obr->y, 0); + } +# ifdef EVAS_FRAME_QUEUING + LKL(buf->priv.lock); +# endif + while (buf->priv.prev_pending_writes) + { + im = buf->priv.prev_pending_writes->data; + buf->priv.prev_pending_writes = + eina_list_remove_list(buf->priv.prev_pending_writes, + buf->priv.prev_pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); + if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); + free(obr); + } + buf->priv.prev_pending_writes = buf->priv.pending_writes; +# ifdef EVAS_FRAME_QUEUING + LKU(buf->priv.lock); +# endif + buf->priv.pending_writes = NULL; + xcb_flush(buf->priv.x11.xcb.conn); +#else + /* FIXME: Async Push Disabled */ + + _xcbob_sync(buf->priv.x11.xcb.conn); + while (buf->priv.pending_writes) + { + im = eina_list_data_get(buf->priv.pending_writes); + buf->priv.pending_writes = + eina_list_remove_list(buf->priv.pending_writes, + buf->priv.pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); + if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); + free(obr); + evas_cache_image_drop(&im->cache_entry); + } +#endif + } + evas_common_cpu_end_opt(); +} + +void +evas_software_xcb_outbuf_idle_flush(Outbuf *buf) +{ + if (buf->priv.onebuf) + { + RGBA_Image *im; + Outbuf_Region *obr; + + im = buf->priv.onebuf; + buf->priv.onebuf = NULL; + obr = im->extended_info; + if (obr->xcbob) + evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE); + if (obr->mask) + evas_software_xcb_output_buffer_free(obr->mask, EINA_FALSE); + free(obr); + evas_cache_image_drop(&im->cache_entry); + } + else + { +#ifdef EVAS_FRAME_QUEUING + LKL(buf->priv.lock); +#endif + if (buf->priv.prev_pending_writes) + _xcbob_sync(buf->priv.x11.xcb.conn); + while (buf->priv.prev_pending_writes) + { + RGBA_Image *im; + Outbuf_Region *obr; + + im = buf->priv.prev_pending_writes->data; + buf->priv.prev_pending_writes = + eina_list_remove_list(buf->priv.prev_pending_writes, + buf->priv.prev_pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); + if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); + free(obr); + } +#ifdef EVAS_FRAME_QUEUING + LKU(buf->priv.lock); +#endif + _clear_xcbob(EINA_FALSE); + } +} + +void +evas_software_xcb_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) +{ + Gfx_Func_Convert func_conv = NULL; + Outbuf_Region *obr = NULL; + DATA32 *src_data = NULL; + unsigned char *data = NULL; + int bpl = 0, yy = 0; + int bw = 0, bh = 0; + + obr = update->extended_info; + if (!obr->xcbob) return; + + if ((buf->rot == 0) || (buf->rot == 180)) + { + bw = w; + bh = h; + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + bw = h; + bh = w; + } + if (buf->priv.pal) + { + func_conv = + evas_common_convert_func_get(0, bw, bh, buf->depth, buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + buf->priv.pal->colors, buf->rot); + } + else + { + func_conv = + evas_common_convert_func_get(0, bw, bh, buf->depth, buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + PAL_MODE_NONE, buf->rot); + } + if (!func_conv) return; + + if (!(data = evas_software_xcb_output_buffer_data(obr->xcbob, &bpl))) + return; + if (!(src_data = update->image.data)) return; + if (buf->rot == 0) + { + obr->x = x; + obr->y = y; + obr->w = w; + obr->h = h; + } + else if (buf->rot == 90) + { + obr->x = y; + obr->y = (buf->w - x - w); + obr->w = h; + obr->h = w; + } + else if (buf->rot == 180) + { + obr->x = (buf->w - x - w); + obr->y = (buf->h - y - h); + obr->w = w; + obr->h = h; + } + else if (buf->rot == 270) + { + obr->x = (buf->h - y - h); + obr->y = x; + obr->w = h; + obr->h = w; + } + if (buf->onebuf) + { + src_data += x + (y * update->cache_entry.w); + data += (bpl * obr->y) + (obr->x * (buf->depth / 8)); + } + if (data != (unsigned char *)src_data) + { + if (buf->priv.pal) + func_conv(src_data, data, update->cache_entry.w - w, + (bpl / (buf->depth / 8)) - obr->w, + obr->w, obr->h, x, y, buf->priv.pal->lookup); + else + func_conv(src_data, data, update->cache_entry.w - w, + (bpl / (buf->depth / 8)) - obr->w, + obr->w, obr->h, x, y, NULL); + } +#if 1 +#else + /* Async Push */ + if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) + { + if (buf->priv.debug) + evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win, + obr->x, obr->y, obr->w, obr->h); + if (obr->xcbob) + evas_software_xcb_output_buffer_paste(obr->xcbob, + buf->priv.x11.xcb.win, + buf->priv.x11.xcb.gc, + obr->x, obr->y, 0); + } +#endif + if (obr->mask) + { + if (buf->rot == 0) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xcb_write_mask_line(buf, obr->mask, + src_data + (yy * obr->w), + obr->w, yy); + } + else if (buf->rot == 90) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xcb_write_mask_line_vert(buf, obr->mask, + src_data + yy, + h, (obr->h - yy - 1), w); + } + else if (buf->rot == 180) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xcb_write_mask_line_rev(buf, obr->mask, + src_data + (yy * obr->w), + obr->w, (obr->h - yy - 1)); + } + else if (buf->rot == 270) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xcb_write_mask_line_vert_rev(buf, obr->mask, + src_data + yy, + h, yy, w); + } +#if 1 +#else + /* Async Push */ + if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) + evas_software_xcb_output_buffer_paste(obr->mask, + buf->priv.x11.xcb.mask, + buf->priv.x11.xcb.gcm, + obr->x, obr->y, 0); +#endif + } +#if 1 +#else + xcb_flush(buf->priv.x11.xcb.conn); +#endif +} + +void +evas_software_xcb_outbuf_reconfigure(Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth) +{ + if ((w == buf->w) && (h == buf->h) && (rot == buf->rot) && + (depth == buf->depth)) return; + buf->w = w; + buf->h = h; + buf->rot = rot; + evas_software_xcb_outbuf_idle_flush(buf); +} + +int +evas_software_xcb_outbuf_width_get(Outbuf *buf) +{ + return buf->w; +} + +int +evas_software_xcb_outbuf_height_get(Outbuf *buf) +{ + return buf->h; +} + +Outbuf_Depth +evas_software_xcb_outbuf_depth_get(Outbuf *buf) +{ + return buf->depth; +} + +void +evas_software_xcb_outbuf_drawable_set(Outbuf *buf, xcb_drawable_t drawable) +{ + if (buf->priv.x11.xcb.win == drawable) return; + if (buf->priv.x11.xcb.gc) + { + xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc); + buf->priv.x11.xcb.gc = 0; + } + buf->priv.x11.xcb.win = drawable; + buf->priv.x11.xcb.gc = xcb_generate_id(buf->priv.x11.xcb.conn); + xcb_create_gc(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.gc, buf->priv.x11.xcb.win, 0, NULL); +} + +void +evas_software_xcb_outbuf_mask_set(Outbuf *buf, xcb_drawable_t mask) +{ + if (buf->priv.x11.xcb.mask == mask) return; + if (buf->priv.x11.xcb.gcm) + { + xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gcm); + buf->priv.x11.xcb.gcm = 0; + } + buf->priv.x11.xcb.mask = mask; + if (buf->priv.x11.xcb.mask) + { + buf->priv.x11.xcb.gcm = xcb_generate_id(buf->priv.x11.xcb.conn); + xcb_create_gc(buf->priv.x11.xcb.conn, + buf->priv.x11.xcb.gcm, buf->priv.x11.xcb.mask, 0, NULL); + } +} + +int +evas_software_xcb_outbuf_rotation_get(Outbuf *buf) +{ + return buf->rot; +} + +void +evas_software_xcb_outbuf_rotation_set(Outbuf *buf, int rotation) +{ + buf->rot = rotation; +} + +Eina_Bool +evas_software_xcb_outbuf_alpha_get(Outbuf *buf) +{ + return buf->priv.x11.xcb.mask; +} + +void +evas_software_xcb_outbuf_debug_set(Outbuf *buf, Eina_Bool debug) +{ + buf->priv.debug = debug; +} + +void +evas_software_xcb_outbuf_debug_show(Outbuf *buf, xcb_drawable_t drawable, int x, int y, int w, int h) +{ + int i; + xcb_screen_t *screen = NULL; + xcb_get_geometry_reply_t *geom; + xcb_drawable_t root; + xcb_screen_iterator_t si; + + geom = + xcb_get_geometry_reply(buf->priv.x11.xcb.conn, + xcb_get_geometry_unchecked(buf->priv.x11.xcb.conn, + drawable), 0); + root = geom->root; + free(geom); + geom = + xcb_get_geometry_reply(buf->priv.x11.xcb.conn, + xcb_get_geometry_unchecked(buf->priv.x11.xcb.conn, + root), 0); + + si = xcb_setup_roots_iterator((xcb_setup_t *)xcb_get_setup(buf->priv.x11.xcb.conn)); + for (; si.rem; xcb_screen_next(&si)) + { + if (si.data->root == geom->root) + { + screen = si.data; + break; + } + } + free(geom); + + for (i = 0; i < 20; i++) + { + xcb_rectangle_t rect = { x, y, w, h}; + uint32_t mask; + uint32_t value[2]; + + mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; + value[0] = screen->black_pixel; + value[1] = XCB_EXPOSURES_NOT_ALLOWED; + xcb_change_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc, + mask, value); + xcb_poly_fill_rectangle(buf->priv.x11.xcb.conn, drawable, + buf->priv.x11.xcb.gc, 1, &rect); + _xcbob_sync(buf->priv.x11.xcb.conn); + _xcbob_sync(buf->priv.x11.xcb.conn); + + mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; + value[0] = screen->white_pixel; + value[1] = XCB_EXPOSURES_NOT_ALLOWED; + xcb_change_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc, + mask, value); + xcb_poly_fill_rectangle(buf->priv.x11.xcb.conn, drawable, + buf->priv.x11.xcb.gc, 1, &rect); + _xcbob_sync(buf->priv.x11.xcb.conn); + _xcbob_sync(buf->priv.x11.xcb.conn); + } +} + +#ifdef EVAS_FRAME_QUEUING +void +evas_software_xcb_outbuf_priv_set(Outbuf *buf, void *cur, void *prev __UNUSED__) +{ + buf->priv.pending_writes = (Eina_List *)cur; +} +#endif + +/* local functions */ +static Xcb_Output_Buffer * +_find_xcbob(xcb_connection_t *conn, xcb_visualtype_t *vis, int depth, int w, int h, Eina_Bool shm, void *data) +{ + Eina_List *l = NULL, *xl = NULL; + Xcb_Output_Buffer *xcbob = NULL, *xcbob2 = NULL; + int lbytes = 0, bpp = 0, sz = 0; + int fitness = 0x7fffffff; + + if (!shm) + return evas_software_xcb_output_buffer_new(conn, vis, depth, w, h, + shm, data); + + lbytes = (((w + 31) / 32) * 4); + if (depth > 1) + { + bpp = (depth / 8); + if (bpp == 3) bpp = 4; + lbytes = ((((w * bpp) + 3) / 4) * 4); + } + + sz = (lbytes * h); + SHMPOOL_LOCK(); + EINA_LIST_FOREACH(_shmpool, l, xcbob2) + { + int szdif = 0; + + if ((xcbob2->xim->depth != depth) || (xcbob2->visual != vis) || + (xcbob2->connection != conn)) continue; + szdif = (xcbob2->psize - sz); + if (szdif < 0) continue; + if (szdif == 0) + { + xcbob = xcbob2; + xl = l; + goto have_xcbob; + } + if (szdif < fitness) + { + xcbob = xcbob2; + xl = l; + fitness = szdif; + } + } + if ((fitness > (100 * 100)) || (!xcbob)) + { + SHMPOOL_UNLOCK(); + return evas_software_xcb_output_buffer_new(conn, vis, depth, + w, h, shm, data); + } + +have_xcbob: + _shmpool = eina_list_remove_list(_shmpool, xl); + xcbob->w = w; + xcbob->h = h; + xcbob->bpl = lbytes; + xcbob->xim->width = xcbob->w; + xcbob->xim->height = xcbob->h; + xcbob->xim->stride = xcbob->bpl; + _shmsize -= (xcbob->psize * (xcbob->xim->depth / 8)); + SHMPOOL_UNLOCK(); + return xcbob; +} + +static void +_unfind_xcbob(Xcb_Output_Buffer *xcbob, Eina_Bool sync) +{ + if (xcbob->shm_info) + { + SHMPOOL_LOCK(); + _shmpool = eina_list_prepend(_shmpool, xcbob); + _shmsize += xcbob->psize * xcbob->xim->depth / 8; + while ((_shmsize > _shmlimit) || + (eina_list_count(_shmpool) > _shmcountlimit)) + { + Eina_List *xl = NULL; + + if (!(xl = eina_list_last(_shmpool))) + { + _shmsize = 0; + break; + } + xcbob = xl->data; + _shmpool = eina_list_remove_list(_shmpool, xl); + _shmsize -= xcbob->psize * xcbob->xim->depth / 8; + evas_software_xcb_output_buffer_free(xcbob, sync); + } + SHMPOOL_UNLOCK(); + } + else + evas_software_xcb_output_buffer_free(xcbob, sync); +} + +static void +_clear_xcbob(Eina_Bool sync) +{ + SHMPOOL_LOCK(); + while (_shmpool) + { + Xcb_Output_Buffer *xcbob; + + xcbob = _shmpool->data; + _shmpool = eina_list_remove_list(_shmpool, _shmpool); + evas_software_xcb_output_buffer_free(xcbob, sync); + } + _shmsize = 0; + SHMPOOL_UNLOCK(); +} + +static void +_xcbob_sync(xcb_connection_t *conn) +{ + free(xcb_get_input_focus_reply(conn, + xcb_get_input_focus_unchecked(conn), NULL)); +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.h b/libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.h new file mode 100644 index 0000000..b711848 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_outbuf.h @@ -0,0 +1,30 @@ +#ifndef EVAS_XCB_OUTBUF_H +# define EVAS_XCB_OUTBUF_H + +# include "evas_engine.h" + +void evas_software_xcb_outbuf_init(void); +void evas_software_xcb_outbuf_free(Outbuf *buf); +Outbuf *evas_software_xcb_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, xcb_connection_t *conn, xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, int xdepth, Eina_Bool grayscale, int max_colors, xcb_drawable_t mask, Eina_Bool shape_dither, Eina_Bool alpha); +RGBA_Image *evas_software_xcb_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); +void evas_software_xcb_outbuf_free_region_for_update(Outbuf *buf, RGBA_Image *update); +void evas_software_xcb_outbuf_flush(Outbuf *buf); +void evas_software_xcb_outbuf_idle_flush(Outbuf *buf); +void evas_software_xcb_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h); +void evas_software_xcb_outbuf_reconfigure(Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth); +int evas_software_xcb_outbuf_width_get(Outbuf *buf); +int evas_software_xcb_outbuf_height_get(Outbuf *buf); +Outbuf_Depth evas_software_xcb_outbuf_depth_get(Outbuf *buf); +void evas_software_xcb_outbuf_drawable_set(Outbuf *buf, xcb_drawable_t drawable); +void evas_software_xcb_outbuf_mask_set(Outbuf *buf, xcb_drawable_t mask); +int evas_software_xcb_outbuf_rotation_get(Outbuf *buf); +void evas_software_xcb_outbuf_rotation_set(Outbuf *buf, int rotation); +Eina_Bool evas_software_xcb_outbuf_alpha_get(Outbuf *buf); +void evas_software_xcb_outbuf_debug_set(Outbuf *buf, Eina_Bool debug); +void evas_software_xcb_outbuf_debug_show(Outbuf *buf, xcb_drawable_t drawable, int x, int y, int w, int h); + +# ifdef EVAS_FRAME_QUEUING +void evas_software_xcb_outbuf_priv_set(Outbuf *buf, void *cur, void *prev); +# endif + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.c b/libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.c new file mode 100644 index 0000000..3a0bda5 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.c @@ -0,0 +1,108 @@ +#include "evas_common.h" +#include "evas_xcb_xdefaults.h" +#include + +/* local function prototypes */ +static Eina_Bool _evas_xcb_xdefaults_glob_match(const char *str, const char *glob); + +/* local variables */ +static Eina_File *_evas_xcb_xdefaults_file = NULL; +static char *_evas_xcb_xdefaults_data = NULL; + +void +_evas_xcb_xdefaults_init(void) +{ + char buff[PATH_MAX]; + + snprintf(buff, sizeof(buff), "%s/.Xdefaults", getenv("HOME")); + if ((_evas_xcb_xdefaults_file = eina_file_open(buff, EINA_FALSE))) + { + eina_mmap_safety_enabled_set(EINA_TRUE); + + _evas_xcb_xdefaults_data = + eina_file_map_all(_evas_xcb_xdefaults_file, EINA_FILE_SEQUENTIAL); + } +} + +void +_evas_xcb_xdefaults_shutdown(void) +{ + if (!_evas_xcb_xdefaults_file) return; + if (_evas_xcb_xdefaults_data) + eina_file_map_free(_evas_xcb_xdefaults_file, _evas_xcb_xdefaults_data); + if (_evas_xcb_xdefaults_file) eina_file_close(_evas_xcb_xdefaults_file); +} + +char * +_evas_xcb_xdefaults_string_get(const char *prog, const char *param) +{ + char buff[1024], ret[1024]; + char *str = NULL; + char **ea = NULL; + unsigned int count = 0, i = 0; + + if ((!_evas_xcb_xdefaults_data) || (!_evas_xcb_xdefaults_file)) + return NULL; + + snprintf(buff, sizeof(buff), "*%s*.*%s*", prog, param); + + str = _evas_xcb_xdefaults_data; + ea = eina_str_split_full(str, "\n", -1, &count); + for (i = 0; i < count; i++) + { + if (_evas_xcb_xdefaults_glob_match(ea[i], buff)) + sscanf(ea[i], "%*[^:]:%*[ ]%s", ret); + } + if ((ea) && (ea[0])) + { + free(ea[0]); + free(ea); + } + + return strdup(ret); +} + +int +_evas_xcb_xdefaults_int_get(const char *prog, const char *param) +{ + char buff[1024]; + char *str = NULL; + char **ea = NULL; + unsigned int count = 0, i = 0; + int ret = -1; + + if ((!_evas_xcb_xdefaults_data) || (!_evas_xcb_xdefaults_file)) + return 0; + + snprintf(buff, sizeof(buff), "*%s*.*%s*", prog, param); + + str = _evas_xcb_xdefaults_data; + ea = eina_str_split_full(str, "\n", -1, &count); + for (i = 0; i < count; i++) + { + if (_evas_xcb_xdefaults_glob_match(ea[i], buff)) + sscanf(ea[i], "%*[^:]:%*[ ]%d", &ret); + } + if ((ea) && (ea[0])) + { + free(ea[0]); + free(ea); + } + + return ret; +} + +/* local functions */ +static Eina_Bool +_evas_xcb_xdefaults_glob_match(const char *str, const char *glob) +{ + if ((!str) || (!glob)) return EINA_FALSE; + if (glob[0] == 0) + { + if (str[0] == 0) return EINA_TRUE; + return EINA_FALSE; + } + if (!strcmp(glob, "*")) return EINA_TRUE; + if (!fnmatch(glob, str, 0)) return EINA_TRUE; + return EINA_FALSE; +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.h b/libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.h new file mode 100644 index 0000000..c5f4ab8 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xcb_xdefaults.h @@ -0,0 +1,11 @@ +#ifndef EVAS_XCB_XDEFAULTS_H +# define EVAS_XCB_XDEFAULTS_H + +# include "evas_engine.h" + +void _evas_xcb_xdefaults_init(void); +void _evas_xcb_xdefaults_shutdown(void); +char *_evas_xcb_xdefaults_string_get(const char *prog, const char *param); +int _evas_xcb_xdefaults_int_get(const char *prog, const char *param); + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.c b/libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.c new file mode 100644 index 0000000..594041c --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.c @@ -0,0 +1,428 @@ +#include "evas_common.h" + +#include "evas_xlib_buffer.h" + +static int _x_err = 0; + +void +evas_software_xlib_x_write_mask_line(Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y) +{ + int x; + DATA32 *src_ptr; + DATA8 *dst_ptr; + int bpl = 0; + + src_ptr = src; + dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); + dst_ptr = dst_ptr + (bpl * y); + w -= 7; + if (buf->priv.x11.xlib.bit_swap) + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0])) >> 7) << 7) | + ((A_VAL(&(src_ptr[1])) >> 7) << 6) | + ((A_VAL(&(src_ptr[2])) >> 7) << 5) | + ((A_VAL(&(src_ptr[3])) >> 7) << 4) | + ((A_VAL(&(src_ptr[4])) >> 7) << 3) | + ((A_VAL(&(src_ptr[5])) >> 7) << 2) | + ((A_VAL(&(src_ptr[6])) >> 7) << 1) | + ((A_VAL(&(src_ptr[7])) >> 7) << 0); + src_ptr += 8; + dst_ptr++; + } + } + else + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0])) >> 7) << 0) | + ((A_VAL(&(src_ptr[1])) >> 7) << 1) | + ((A_VAL(&(src_ptr[2])) >> 7) << 2) | + ((A_VAL(&(src_ptr[3])) >> 7) << 3) | + ((A_VAL(&(src_ptr[4])) >> 7) << 4) | + ((A_VAL(&(src_ptr[5])) >> 7) << 5) | + ((A_VAL(&(src_ptr[6])) >> 7) << 6) | + ((A_VAL(&(src_ptr[7])) >> 7) << 7); + src_ptr += 8; + dst_ptr++; + } + } + w += 7; + for (; x < w; x ++) + { + XPutPixel(xob->xim, x, y, A_VAL(src_ptr) >> 7); + src_ptr++; + } +} + +void +evas_software_xlib_x_write_mask_line_rev(Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y) +{ + int x; + DATA32 *src_ptr; + DATA8 *dst_ptr; + int bpl = 0; + + src_ptr = src + w - 1; + dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); + dst_ptr = dst_ptr + (bpl * y); + w -= 7; + if (buf->priv.x11.xlib.bit_swap) + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0])) >> 7) << 7) | + ((A_VAL(&(src_ptr[-1])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-2])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-3])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-4])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-5])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-6])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-7])) >> 7) << 0); + src_ptr -= 8; + dst_ptr++; + } + } + else + { + for (x = 0; x < w; x += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0])) >> 7) << 0) | + ((A_VAL(&(src_ptr[-1])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-2])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-3])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-4])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-5])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-6])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-7])) >> 7) << 7); + src_ptr -= 8; + dst_ptr++; + } + } + w += 7; + for (; x < w; x ++) + { + XPutPixel(xob->xim, x, y, A_VAL(src_ptr) >> 7); + src_ptr--; + } +} + +void +evas_software_xlib_x_write_mask_line_vert(Outbuf *buf, X_Output_Buffer *xob, + DATA32 *src, + int h, int ym, int w) +{ + int y; + DATA32 *src_ptr; + DATA8 *dst_ptr; + int bpl = 0; + + src_ptr = src; + dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); + dst_ptr = dst_ptr + (bpl * ym); + h -= 7; + if (buf->priv.x11.xlib.bit_swap) + { + for (y = 0; y < h; y += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0 * w])) >> 7) << 7) | + ((A_VAL(&(src_ptr[1 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[2 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[3 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[4 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[5 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[6 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[7 * w])) >> 7) << 0); + src_ptr += 8 * w; + dst_ptr++; + } + } + else + { + for (y = 0; y < h; y += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[0 * w])) >> 7) << 0) | + ((A_VAL(&(src_ptr[1 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[2 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[3 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[4 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[5 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[6 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[7 * w])) >> 7) << 7); + src_ptr += 8 * w; + dst_ptr++; + } + } + h += 7; + for (; y < h; y ++) + { + XPutPixel(xob->xim, y, ym, A_VAL(src_ptr) >> 7); + src_ptr += w; + } +} + +void +evas_software_xlib_x_write_mask_line_vert_rev(Outbuf *buf, X_Output_Buffer *xob, + DATA32 *src, + int h, int ym, int w) +{ + int y; + DATA32 *src_ptr; + DATA8 *dst_ptr; + int bpl = 0; + + src_ptr = src + ((h - 1) * w); + dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); + dst_ptr = dst_ptr + (bpl * ym); + h -= 7; + if (buf->priv.x11.xlib.bit_swap) + { + for (y = 0; y < h; y += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 7) | + ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 0); + src_ptr -= 8 * w; + dst_ptr++; + } + } + else + { + for (y = 0; y < h; y += 8) + { + *dst_ptr = + ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 0) | + ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 1) | + ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 2) | + ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 3) | + ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 4) | + ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 5) | + ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 6) | + ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 7); + src_ptr -= 8 * w; + dst_ptr++; + } + } + h += 7; + for (; y < h; y ++) + { + XPutPixel(xob->xim, y, ym, A_VAL(src_ptr) >> 7); + src_ptr -= w; + } +} + +int +evas_software_xlib_x_can_do_shm(Display *d) +{ + static Display *cached_d = NULL; + static int cached_result = 0; + + if (d == cached_d) return cached_result; + cached_d = d; + if (XShmQueryExtension(d)) + { + X_Output_Buffer *xob; + + xob = evas_software_xlib_x_output_buffer_new + (d, DefaultVisual(d, DefaultScreen(d)), + DefaultDepth(d, DefaultScreen(d)), 16, 16, 2, NULL); + if (!xob) + { + cached_result = 0; + return 0; + } + evas_software_xlib_x_output_buffer_free(xob, 1); + cached_result = 1; + return 1; + } + cached_result = 0; + return 0; +} + +static void +x_output_tmp_x_err(Display *d __UNUSED__, XErrorEvent *ev __UNUSED__) +{ + _x_err = 1; + return; +} + +//static int creates = 0; + +X_Output_Buffer * +evas_software_xlib_x_output_buffer_new(Display *d, Visual *v, int depth, int w, int h, int try_shm, void *data) +{ + X_Output_Buffer *xob; + + xob = calloc(1, sizeof(X_Output_Buffer)); + if (!xob) return NULL; + + xob->display = d; + xob->visual = v; + xob->xim = NULL; + xob->shm_info = NULL; + xob->w = w; + xob->h = h; + + if (try_shm > 0) + { + xob->shm_info = malloc(sizeof(XShmSegmentInfo)); + if (xob->shm_info) + { + xob->xim = XShmCreateImage(d, v, depth, ZPixmap, NULL, + xob->shm_info, w, h); + if (xob->xim) + { + xob->shm_info->shmid = shmget(IPC_PRIVATE, + xob->xim->bytes_per_line * + xob->xim->height, + IPC_CREAT | 0777); + if (xob->shm_info->shmid >= 0) + { + xob->shm_info->readOnly = False; + xob->shm_info->shmaddr = xob->xim->data = + shmat(xob->shm_info->shmid, 0, 0); + if (xob->shm_info->shmaddr != ((void *)-1)) + { + XErrorHandler ph; + + if (try_shm == 2) // only needed during testing + { + XSync(d, False); + _x_err = 0; + ph = XSetErrorHandler((XErrorHandler) + x_output_tmp_x_err); + } +#if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) + /* workaround for libXext of lower then 1.1.1 */ + if (evas_common_frameq_enabled()) + XLockDisplay(d); +#endif + XShmAttach(d, xob->shm_info); +#if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) + /* workaround for libXext of lower then 1.1.1 */ + if (evas_common_frameq_enabled()) + XUnlockDisplay(d); +#endif + + if (try_shm == 2) // only needed during testing + { + XSync(d, False); + XSetErrorHandler((XErrorHandler)ph); + } + if (!_x_err) + { + xob->bpl = xob->xim->bytes_per_line; + xob->psize = xob->bpl * xob->h; + return xob; + } + } + shmdt(xob->shm_info->shmaddr); + shmctl(xob->shm_info->shmid, IPC_RMID, 0); + } + if (xob->xim) XDestroyImage(xob->xim); + xob->xim = NULL; + } + if (xob->shm_info) free(xob->shm_info); + xob->shm_info = NULL; + } + } + + if (try_shm > 1) return NULL; + + xob->xim = XCreateImage(d, v, depth, ZPixmap, 0, data, w, h, 32, 0); + if (!xob->xim) + { + free(xob); + return NULL; + } + + xob->data = data; + + if (!xob->xim->data) + { + xob->xim->data = malloc(xob->xim->bytes_per_line * xob->xim->height); + if (!xob->xim->data) + { + XDestroyImage(xob->xim); + free(xob); + return NULL; + } + } + xob->bpl = xob->xim->bytes_per_line; + xob->psize = xob->bpl * xob->h; + return xob; +} + +void +evas_software_xlib_x_output_buffer_free(X_Output_Buffer *xob, int psync) +{ + if (xob->shm_info) + { + if (psync) XSync(xob->display, False); + XShmDetach(xob->display, xob->shm_info); + XDestroyImage(xob->xim); + shmdt(xob->shm_info->shmaddr); + shmctl(xob->shm_info->shmid, IPC_RMID, 0); + free(xob->shm_info); + } + else + { + if (xob->data) xob->xim->data = NULL; + XDestroyImage(xob->xim); + } + free(xob); +} + +void +evas_software_xlib_x_output_buffer_paste(X_Output_Buffer *xob, Drawable d, GC gc, int x, int y, int psync) +{ + if (xob->shm_info) + { + XShmPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y, + xob->w, xob->h, False); + if (psync) XSync(xob->display, False); + } + else + { + XPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y, + xob->w, xob->h); + } +} + +DATA8 * +evas_software_xlib_x_output_buffer_data(X_Output_Buffer *xob, int *bytes_per_line_ret) +{ + if (bytes_per_line_ret) *bytes_per_line_ret = xob->xim->bytes_per_line; + return (DATA8 *)xob->xim->data; +} + +int +evas_software_xlib_x_output_buffer_depth(X_Output_Buffer *xob) +{ + return xob->xim->bits_per_pixel; +} + +int +evas_software_xlib_x_output_buffer_byte_order(X_Output_Buffer *xob) +{ + return xob->xim->byte_order; +} + +int +evas_software_xlib_x_output_buffer_bit_order(X_Output_Buffer *xob) +{ + return xob->xim->bitmap_bit_order; +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.h b/libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.h new file mode 100644 index 0000000..01c4db0 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_buffer.h @@ -0,0 +1,45 @@ +#ifndef EVAS_XLIB_BUFFER_H +#define EVAS_XLIB_BUFFER_H + + +#include "evas_engine.h" + + +typedef struct _X_Output_Buffer X_Output_Buffer; + +struct _X_Output_Buffer +{ + Display *display; + XImage *xim; + XShmSegmentInfo *shm_info; + Visual *visual; + void *data; + int w; + int h; + int bpl; + int psize; +}; + +void evas_software_xlib_x_write_mask_line (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y); +void evas_software_xlib_x_write_mask_line_rev (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y); +void evas_software_xlib_x_write_mask_line_vert (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int h, int ym, int w); +void evas_software_xlib_x_write_mask_line_vert_rev (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int h, int ym, int w); + +int evas_software_xlib_x_can_do_shm (Display *d); + +X_Output_Buffer *evas_software_xlib_x_output_buffer_new (Display *d, Visual *v, int depth, int w, int h, int try_shm, void *data); + +void evas_software_xlib_x_output_buffer_free (X_Output_Buffer *xob, int sync); + +void evas_software_xlib_x_output_buffer_paste (X_Output_Buffer *xob, Drawable d, GC gc, int x, int y, int sync); + +DATA8 *evas_software_xlib_x_output_buffer_data (X_Output_Buffer *xob, int *bytes_per_line_ret); + +int evas_software_xlib_x_output_buffer_depth (X_Output_Buffer *xob); + +int evas_software_xlib_x_output_buffer_byte_order (X_Output_Buffer *xob); + +int evas_software_xlib_x_output_buffer_bit_order (X_Output_Buffer *xob); + + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_color.c b/libraries/evas/src/modules/engines/software_x11/evas_xlib_color.c new file mode 100644 index 0000000..1df0406 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_color.c @@ -0,0 +1,368 @@ +#include "evas_common.h" + +#include "evas_engine.h" + +#include +#include + +typedef struct _Convert_Pal_Priv Convert_Pal_Priv; + +struct _Convert_Pal_Priv +{ + Display *disp; + Colormap cmap; + Visual *vis; +}; + +typedef DATA8 * (*X_Func_Alloc_Colors) (Display *d, Colormap cmap, Visual *v); + +static X_Func_Alloc_Colors x_color_alloc[PAL_MODE_LAST + 1]; +static int x_color_count[PAL_MODE_LAST + 1]; +static Eina_List *palettes = NULL; + +static DATA8 * x_color_alloc_rgb(int nr, int ng, int nb, Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_gray(int ng, Display *d, Colormap cmap, Visual *v); + +static DATA8 * x_color_alloc_rgb_332(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_rgb_666(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_rgb_232(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_rgb_222(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_rgb_221(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_rgb_121(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_rgb_111(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_gray_256(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_gray_64(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_gray_16(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_gray_4(Display *d, Colormap cmap, Visual *v); +static DATA8 * x_color_alloc_mono(Display *d, Colormap cmap, Visual *v); + +static DATA8 * +x_color_alloc_rgb(int nr, int ng, int nb, Display *d, Colormap cmap, Visual *v) +{ + int r, g, b, i; + DATA8 *color_lut; + int sig_mask = 0, delt = 0; + + for (i = 0; i < v->bits_per_rgb; i++) sig_mask |= (0x1 << i); + sig_mask <<= (16 - v->bits_per_rgb); + i = 0; + color_lut = malloc((nr) * (ng) * (nb)); + if (!color_lut) return NULL; + delt = 0x0101 * 3; + for (r = 0; r < (nr); r++) + { + for (g = 0; g < (ng); g++) + { + for (b = 0; b < (nb); b++) + { + XColor xcl; + XColor xcl_in; + int val; + Status ret; + int dr, dg, db; + + val = (int)((((double)r) / ((nr) - 1)) * 255); + val = (val << 8) | val; + xcl.red = (unsigned short)(val); + val = (int)((((double)g) / ((ng) - 1)) * 255); + val = (val << 8) | val; + xcl.green = (unsigned short)(val); + val = (int)((((double)b) / ((nb) - 1)) * 255); + val = (val << 8) | val; + xcl.blue = (unsigned short)(val); + xcl_in = xcl; + ret = XAllocColor(d, cmap, &xcl); + dr = (int)xcl_in.red - (int)xcl.red; + if (dr < 0) dr = -dr; + dg = (int)xcl_in.green - (int)xcl.green; + if (dg < 0) dg = -dg; + db = (int)xcl_in.blue - (int)xcl.blue; + if (db < 0) db = -db; +/* + printf("ASK [%i]: %04x %04x %04x = %04x %04x %04x | dif = %04x / %04x\n", + ret, + xcl_in.red, xcl_in.green, xcl_in.blue, + xcl.red, xcl.green, xcl.blue, + (dr + dg +db), delt); + */ + if ((ret == 0) || + ((dr + dg + db) > delt) +/* + || + ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || + ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || + ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask)) + */ + ) + { + unsigned long pixels[256]; + int j; + + if (i > 0) + { + for (j = 0; j < i; j++) + pixels[j] = (unsigned long) color_lut[j]; + XFreeColors(d, cmap, pixels, i, 0); + } + free(color_lut); + return NULL; + } + color_lut[i] = xcl.pixel; + i++; + } + } + } + return color_lut; +} + +static DATA8 * +x_color_alloc_gray(int ng, Display *d, Colormap cmap, Visual *v) +{ + int g, i; + DATA8 *color_lut; + int sig_mask = 0; + + for (i = 0; i < v->bits_per_rgb; i++) sig_mask |= (0x1 << i); + sig_mask <<= (16 - v->bits_per_rgb); + i = 0; + color_lut = malloc(ng); + if (!color_lut) return NULL; + for (g = 0; g < (ng); g++) + { + XColor xcl; + XColor xcl_in; + int val; + Status ret; + + val = (int)((((double)g) / ((ng) - 1)) * 255); + val = (val << 8) | val; + xcl.red = (unsigned short)(val); + xcl.green = (unsigned short)(val); + xcl.blue = (unsigned short)(val); + xcl_in = xcl; + ret = XAllocColor(d, cmap, &xcl); + if ((ret == 0) || + ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || + ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || + ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask))) + { + unsigned long pixels[256]; + int j; + + if (i > 0) + { + for (j = 0; j < i; j++) + pixels[j] = (unsigned long) color_lut[j]; + XFreeColors(d, cmap, pixels, i, 0); + } + free(color_lut); + return NULL; + } + color_lut[i] = xcl.pixel; + i++; + } + return color_lut; +} + +static DATA8 * +x_color_alloc_rgb_332(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(8, 8, 4, d, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_666(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(6, 6, 6, d, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_232(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(4, 8, 4, d, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_222(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(4, 4, 4, d, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_221(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(4, 4, 2, d, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_121(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(2, 4, 2, d, cmap, v); +} + +static DATA8 * +x_color_alloc_rgb_111(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_rgb(2, 2, 2, d, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_256(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_gray(256, d, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_64(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_gray(64, d, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_16(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_gray(32, d, cmap, v); +} + +static DATA8 * +x_color_alloc_gray_4(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_gray(16, d, cmap, v); +} + +static DATA8 * +x_color_alloc_mono(Display *d, Colormap cmap, Visual *v) +{ + return x_color_alloc_gray(2, d, cmap, v); +} + +void +evas_software_xlib_x_color_init(void) +{ + static int initialised = 0; + + if (initialised) return; + x_color_alloc[PAL_MODE_NONE] = NULL; + x_color_count[PAL_MODE_NONE] = 0; + + x_color_alloc[PAL_MODE_MONO] = x_color_alloc_mono; + x_color_count[PAL_MODE_MONO] = 2; + + x_color_alloc[PAL_MODE_GRAY4] = x_color_alloc_gray_4; + x_color_count[PAL_MODE_GRAY4] = 4; + + x_color_alloc[PAL_MODE_GRAY16] = x_color_alloc_gray_16; + x_color_count[PAL_MODE_GRAY16] = 16; + + x_color_alloc[PAL_MODE_GRAY64] = x_color_alloc_gray_64; + x_color_count[PAL_MODE_GRAY64] = 64; + + x_color_alloc[PAL_MODE_GRAY256] = x_color_alloc_gray_256; + x_color_count[PAL_MODE_GRAY256] = 256; + + x_color_alloc[PAL_MODE_RGB111] = x_color_alloc_rgb_111; + x_color_count[PAL_MODE_RGB111] = 2 * 2 * 2; + + x_color_alloc[PAL_MODE_RGB121] = x_color_alloc_rgb_121; + x_color_count[PAL_MODE_RGB121] = 2 * 4 * 2; + + x_color_alloc[PAL_MODE_RGB221] = x_color_alloc_rgb_221; + x_color_count[PAL_MODE_RGB221] = 4 * 4 * 2; + + x_color_alloc[PAL_MODE_RGB222] = x_color_alloc_rgb_222; + x_color_count[PAL_MODE_RGB222] = 4 * 4 * 4; + + x_color_alloc[PAL_MODE_RGB232] = x_color_alloc_rgb_232; + x_color_count[PAL_MODE_RGB232] = 4 * 8 * 4; + + x_color_alloc[PAL_MODE_RGB666] = x_color_alloc_rgb_666; + x_color_count[PAL_MODE_RGB666] = 6 * 6 * 6; + + x_color_alloc[PAL_MODE_RGB332] = x_color_alloc_rgb_332; + x_color_count[PAL_MODE_RGB332] = 8 * 8 * 4; + + x_color_alloc[PAL_MODE_LAST] = NULL; + x_color_count[PAL_MODE_LAST] = 0; + initialised = 1; +} + +Convert_Pal * +evas_software_xlib_x_color_allocate(Display *disp, + Colormap cmap, + Visual *vis, + Convert_Pal_Mode colors) +{ + Convert_Pal_Priv *palpriv; + Convert_Pal *pal; + Convert_Pal_Mode c; + Eina_List *l; + +/* printf("ALLOC cmap=%i vis=%p\n", cmap, vis);*/ + EINA_LIST_FOREACH(palettes, l, pal) + { + palpriv = pal->data; + if ((disp == palpriv->disp) && + (vis == palpriv->vis) && + (cmap == palpriv->cmap)) + { + pal->references++; + return pal; + } + } + pal = calloc(1, sizeof(struct _Convert_Pal)); + if (!pal) return NULL; + for (c = colors; c > PAL_MODE_NONE; c--) + { + if (x_color_alloc[c]) + { +/* printf("TRY PAL %i\n", c);*/ + pal->lookup = (x_color_alloc[c])(disp, cmap, vis); + if (pal->lookup) break; + } + } + pal->references = 1; + pal->colors = c; + pal->count = x_color_count[c]; + palpriv = calloc(1, sizeof(Convert_Pal_Priv)); + pal->data = palpriv; + if (!palpriv) + { + if (pal->lookup) free(pal->lookup); + free(pal); + return NULL; + } + palpriv->disp = disp; + palpriv->vis = vis; + palpriv->cmap = cmap; + if (pal->colors == PAL_MODE_NONE) + { + if (pal->lookup) free(pal->lookup); + free(pal); + return NULL; + } + palettes = eina_list_append(palettes, pal); + return pal; +} + +void +evas_software_xlib_x_color_deallocate(Display *disp, + Colormap cmap, + Visual *vis __UNUSED__, + Convert_Pal *pal) +{ + unsigned long pixels[256]; + int j; + + pal->references--; + if (pal->references > 0) return; + if (pal->lookup) + { + for(j = 0; j < pal->count; j++) + pixels[j] = (unsigned long) pal->lookup[j]; + XFreeColors(disp, cmap, pixels, pal->count, 0); + free(pal->lookup); + } + free(pal->data); + palettes = eina_list_remove(palettes, pal); + free(pal); +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_color.h b/libraries/evas/src/modules/engines/software_x11/evas_xlib_color.h new file mode 100644 index 0000000..e9f8afb --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_color.h @@ -0,0 +1,16 @@ +#ifndef EVAS_XLIB_COLOR_H +#define EVAS_XLIB_COLOR_H + +void evas_software_xlib_x_color_init (void); + +Convert_Pal *evas_software_xlib_x_color_allocate (Display *disp, + Colormap cmap, + Visual *vis, + Convert_Pal_Mode colors); + +void evas_software_xlib_x_color_deallocate (Display *disp, + Colormap cmap, + Visual *vis, + Convert_Pal *pal); + +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_main.c b/libraries/evas/src/modules/engines/software_x11/evas_xlib_main.c new file mode 100644 index 0000000..3c153e1 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_main.c @@ -0,0 +1,7 @@ +#include "evas_common.h" +#include "evas_engine.h" + +void +evas_software_xlib_x_init(void) +{ +} diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c b/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c new file mode 100644 index 0000000..1b1d3d9 --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c @@ -0,0 +1,1135 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "evas_common.h" +#include "evas_macros.h" +#include "evas_xlib_outbuf.h" +#include "evas_xlib_buffer.h" +#include "evas_xlib_color.h" + + +typedef struct _Outbuf_Region Outbuf_Region; + +struct _Outbuf_Region +{ + X_Output_Buffer *xob; + X_Output_Buffer *mxob; + int x; + int y; + int w; + int h; +}; + +static Eina_List *shmpool = NULL; +static int shmsize = 0; +static int shmmemlimit = 10 * 1024 * 1024; +static const unsigned int shmcountlimit = 32; + +#ifdef EVAS_FRAME_QUEUING +static LK(lock_shmpool); +#define SHMPOOL_LOCK() LKL(lock_shmpool) +#define SHMPOOL_UNLOCK() LKU(lock_shmpool) +#else +#define SHMPOOL_LOCK() +#define SHMPOOL_UNLOCK() +#endif + +static X_Output_Buffer * +_find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data) +{ + Eina_List *l, *xl = NULL; + X_Output_Buffer *xob = NULL; + X_Output_Buffer *xob2; + int fitness = 0x7fffffff; + int sz, lbytes, bpp; + + if (!shm) + return evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data); + if (depth > 1) + { + bpp = depth / 8; + if (bpp == 3) bpp = 4; + lbytes = (((w * bpp) + 3) / 4) * 4; + } + else + lbytes = ((w + 31) / 32) * 4; + sz = lbytes * h; + SHMPOOL_LOCK(); + EINA_LIST_FOREACH(shmpool, l, xob2) + { + int szdif; + + if ((xob2->xim->depth != depth) || (xob2->visual != v) || + (xob2->display != d)) + continue; + szdif = xob2->psize - sz; + if (szdif < 0) continue; + if (szdif == 0) + { + xob = xob2; + xl = l; + goto have_xob; + } + if (szdif < fitness) + { + fitness = szdif; + xob = xob2; + xl = l; + } + } + if ((fitness > (100 * 100)) || (!xob)) + { + SHMPOOL_UNLOCK(); + xob = evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data); + return xob; + } + + have_xob: + shmpool = eina_list_remove_list(shmpool, xl); + xob->w = w; + xob->h = h; + xob->bpl = lbytes; + xob->xim->width = xob->w; + xob->xim->height = xob->h; + xob->xim->bytes_per_line = xob->bpl; + shmsize -= xob->psize * (xob->xim->depth / 8); + SHMPOOL_UNLOCK(); + return xob; +} + +static void +_unfind_xob(X_Output_Buffer *xob, int psync) +{ + if (xob->shm_info) + { + SHMPOOL_LOCK(); + shmpool = eina_list_prepend(shmpool, xob); + shmsize += xob->psize * xob->xim->depth / 8; + while ((shmsize > (shmmemlimit)) || + (eina_list_count(shmpool) > shmcountlimit)) + { + Eina_List *xl; + + xl = eina_list_last(shmpool); + if (!xl) + { + shmsize = 0; + break; + } + xob = xl->data; + shmpool = eina_list_remove_list(shmpool, xl); + shmsize -= xob->psize * xob->xim->depth / 8; + evas_software_xlib_x_output_buffer_free(xob, psync); + } + SHMPOOL_UNLOCK(); + } + else + evas_software_xlib_x_output_buffer_free(xob, psync); +} + +static void +_clear_xob(int psync) +{ + SHMPOOL_LOCK(); + while (shmpool) + { + X_Output_Buffer *xob; + + xob = shmpool->data; + shmpool = eina_list_remove_list(shmpool, shmpool); + evas_software_xlib_x_output_buffer_free(xob, psync); + } + shmsize = 0; + SHMPOOL_UNLOCK(); +} + +void +evas_software_xlib_outbuf_init(void) +{ +#ifdef EVAS_FRAME_QUEUING + LKI(lock_shmpool); +#endif +} + +void +evas_software_xlib_outbuf_free(Outbuf *buf) +{ +#ifdef EVAS_FRAME_QUEUING + LKL(buf->priv.lock); +#endif + while (buf->priv.pending_writes) + { + RGBA_Image *im; + Outbuf_Region *obr; + + im = buf->priv.pending_writes->data; + buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xob) _unfind_xob(obr->xob, 0); + if (obr->mxob) _unfind_xob(obr->mxob, 0); + free(obr); + } +#ifdef EVAS_FRAME_QUEUING + LKU(buf->priv.lock); +#endif + evas_software_xlib_outbuf_idle_flush(buf); + evas_software_xlib_outbuf_flush(buf); + if (buf->priv.x11.xlib.gc) + XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc); + if (buf->priv.x11.xlib.gcm) + XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm); + if (buf->priv.pal) + evas_software_xlib_x_color_deallocate(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.cmap, + buf->priv.x11.xlib.vis, buf->priv.pal); +#ifdef EVAS_FRAME_QUEUING + LKD(buf->priv.lock); +#endif + free(buf); + _clear_xob(0); +} + +Outbuf * +evas_software_xlib_outbuf_setup_x(int w, int h, int rot, Outbuf_Depth depth, + Display *disp, Drawable draw, Visual *vis, + Colormap cmap, int x_depth, + int grayscale, int max_colors, Pixmap mask, + int shape_dither, int destination_alpha) +{ + Outbuf *buf; + + buf = calloc(1, sizeof(Outbuf)); + if (!buf) + return NULL; + + buf->w = w; + buf->h = h; + buf->depth = depth; + buf->rot = rot; + + buf->priv.x11.xlib.disp = disp; + buf->priv.x11.xlib.vis = vis; + buf->priv.x11.xlib.cmap = cmap; + buf->priv.x11.xlib.depth = x_depth; + + buf->priv.mask_dither = shape_dither; + buf->priv.destination_alpha = destination_alpha; + + { + Gfx_Func_Convert conv_func; + X_Output_Buffer *xob; + + buf->priv.x11.xlib.shm = evas_software_xlib_x_can_do_shm(buf->priv.x11.xlib.disp); + xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + 1, 1, buf->priv.x11.xlib.shm, NULL); + + conv_func = NULL; + if (xob) + { +#ifdef WORDS_BIGENDIAN + if (evas_software_xlib_x_output_buffer_byte_order(xob) == LSBFirst) + buf->priv.x11.xlib.swap = 1; + if (evas_software_xlib_x_output_buffer_bit_order(xob) == MSBFirst) + buf->priv.x11.xlib.bit_swap = 1; +#else + if (evas_software_xlib_x_output_buffer_byte_order(xob) == MSBFirst) + buf->priv.x11.xlib.swap = 1; + if (evas_software_xlib_x_output_buffer_bit_order(xob) == MSBFirst) + buf->priv.x11.xlib.bit_swap = 1; +#endif + if (((vis->class == TrueColor) || (vis->class == DirectColor)) && + (x_depth > 8)) + { + buf->priv.mask.r = (DATA32) vis->red_mask; + buf->priv.mask.g = (DATA32) vis->green_mask; + buf->priv.mask.b = (DATA32) vis->blue_mask; + if (buf->priv.x11.xlib.swap) + { + SWAP32(buf->priv.mask.r); + SWAP32(buf->priv.mask.g); + SWAP32(buf->priv.mask.b); + } + } + else if ((vis->class == PseudoColor) || + (vis->class == StaticColor) || + (vis->class == GrayScale) || + (vis->class == StaticGray) || + (x_depth <= 8)) + { + Convert_Pal_Mode pm = PAL_MODE_RGB332; + + if ((vis->class == GrayScale) || (vis->class == StaticGray)) + grayscale = 1; + if (grayscale) + { + if (max_colors >= 256) + pm = PAL_MODE_GRAY256; + else if (max_colors >= 64) + pm = PAL_MODE_GRAY64; + else if (max_colors >= 16) + pm = PAL_MODE_GRAY16; + else if (max_colors >= 4) + pm = PAL_MODE_GRAY4; + else + pm = PAL_MODE_MONO; + } + else + { + if (max_colors >= 256) + pm = PAL_MODE_RGB332; + else if (max_colors >= 216) + pm = PAL_MODE_RGB666; + else if (max_colors >= 128) + pm = PAL_MODE_RGB232; + else if (max_colors >= 64) + pm = PAL_MODE_RGB222; + else if (max_colors >= 32) + pm = PAL_MODE_RGB221; + else if (max_colors >= 16) + pm = PAL_MODE_RGB121; + else if (max_colors >= 8) + pm = PAL_MODE_RGB111; + else if (max_colors >= 4) + pm = PAL_MODE_GRAY4; + else + pm = PAL_MODE_MONO; + } + /* FIXME: only alloc once per display+cmap */ + buf->priv.pal = evas_software_xlib_x_color_allocate(disp, cmap, vis, + pm); + if (!buf->priv.pal) + { + free(buf); + return NULL; + } + } + if (buf->priv.pal) + { + if (buf->rot == 0 || buf->rot == 180) + conv_func = evas_common_convert_func_get(0, buf->w, buf->h, + evas_software_xlib_x_output_buffer_depth + (xob), buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, + buf->priv.pal->colors, + buf->rot); + else if (buf->rot == 90 || buf->rot == 270) + conv_func = evas_common_convert_func_get(0, buf->h, buf->w, + evas_software_xlib_x_output_buffer_depth + (xob), buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, + buf->priv.pal->colors, + buf->rot); + } + else + { + if (buf->rot == 0 || buf->rot == 180) + conv_func = evas_common_convert_func_get(0, buf->w, buf->h, + evas_software_xlib_x_output_buffer_depth + (xob), buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, PAL_MODE_NONE, + buf->rot); + else if (buf->rot == 90 || buf->rot == 270) + conv_func = evas_common_convert_func_get(0, buf->h, buf->w, + evas_software_xlib_x_output_buffer_depth + (xob), buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, PAL_MODE_NONE, + buf->rot); + } + evas_software_xlib_x_output_buffer_free(xob, 1); + if (!conv_func) + { + ERR("At depth: %i, RGB format mask: %08x %08x %08x, " + "Palette mode: %i. " + "Not supported by compiled in converters!", + buf->priv.x11.xlib.depth, + buf->priv.mask.r, + buf->priv.mask.g, + buf->priv.mask.b, + buf->priv.pal ? (int)buf->priv.pal->colors : -1); + } + } + evas_software_xlib_outbuf_drawable_set(buf, draw); + evas_software_xlib_outbuf_mask_set(buf, mask); + } +#ifdef EVAS_FRAME_QUEUING + LKI(buf->priv.lock); +#endif + return buf; +} + +RGBA_Image * +evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch) +{ + RGBA_Image *im; + Outbuf_Region *obr; + int bpl = 0; + int use_shm = 1; + int alpha; + + if ((buf->onebuf) && (buf->priv.x11.xlib.shm)) + { + Eina_Rectangle *rect; + + RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h); + obr = calloc(1, sizeof(Outbuf_Region)); + if (!obr) return NULL; + rect = eina_rectangle_new(x, y, w, h); + if (!rect) + { + free(obr); + return NULL; + } + + buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect); + if (buf->priv.onebuf) + { + *cx = x; + *cy = y; + *cw = w; + *ch = h; + if (!buf->priv.synced) + { + XSync(buf->priv.x11.xlib.disp, False); + buf->priv.synced = 1; + } + return buf->priv.onebuf; + } + obr->x = 0; + obr->y = 0; + obr->w = buf->w; + obr->h = buf->h; + *cx = x; + *cy = y; + *cw = w; + *ch = h; + + alpha = ((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)); + + use_shm = buf->priv.x11.xlib.shm; + if ((buf->rot == 0) && + (buf->priv.mask.r == 0xff0000) && + (buf->priv.mask.g == 0x00ff00) && + (buf->priv.mask.b == 0x0000ff)) + { + obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + buf->w, buf->h, + use_shm, + NULL); + if (!obr->xob) + { + free(obr); + return NULL; + } + im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), + buf->w, buf->h, + (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl), + alpha, EVAS_COLORSPACE_ARGB8888); + if (!im) + { + evas_software_xlib_x_output_buffer_free(obr->xob, 0); + free(obr); + return NULL; + } + im->extended_info = obr; + if (buf->priv.x11.xlib.mask) + obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + 1, + buf->w, buf->h, + use_shm, + NULL); + } + else + { + im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); + if (!im) + { + free(obr); + return NULL; + } + im->cache_entry.flags.alpha |= alpha ? 1 : 0; + evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h); + im->extended_info = obr; + if ((buf->rot == 0) || (buf->rot == 180)) + { + obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + buf->w, buf->h, + use_shm, + NULL); + if (!obr->xob) + { + evas_cache_image_drop(&im->cache_entry); + free(obr); + return NULL; + } + if (buf->priv.x11.xlib.mask) + obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + 1, buf->w, buf->h, + use_shm, + NULL); + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + buf->h, buf->w, + use_shm, + NULL); + if (!obr->xob) + { + evas_cache_image_drop(&im->cache_entry); + free(obr); + return NULL; + } + if (buf->priv.x11.xlib.mask) + obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + 1, buf->h, buf->w, + use_shm, + NULL); + } + } + /* FIXME: We should be able to remove this memset, but somewhere in the process + we copy too much to the destination surface and some area are not cleaned before copy. */ + if ((alpha) && (im->image.data)) + { + /* FIXME: faster memset! */ +// memset(im->image.data, 0, w * h * sizeof(DATA32)); + } + + buf->priv.onebuf = im; + return im; + } + + obr = calloc(1, sizeof(Outbuf_Region)); + if (!obr) return NULL; + obr->x = x; + obr->y = y; + obr->w = w; + obr->h = h; + *cx = 0; + *cy = 0; + *cw = w; + *ch = h; + + use_shm = buf->priv.x11.xlib.shm; + /* FIXME: magic - i found if shm regions are smaller than 200x200 its + * faster to use ximages over unix sockets - trial and error + */ +// use_shm = 0; /* 630 -> 1006 fps */ +// if ((w * h) < (200 * 200)) use_shm = 0; /* 630 -> 962 fps */ + + alpha = ((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)); + + if ((buf->rot == 0) && + (buf->priv.mask.r == 0xff0000) && + (buf->priv.mask.g == 0x00ff00) && + (buf->priv.mask.b == 0x0000ff)) + { + obr->xob = _find_xob(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + w, h, + use_shm, + NULL); + if (!obr->xob) + { + free(obr); + return NULL; + } + im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), + w, h, + (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl), + alpha, EVAS_COLORSPACE_ARGB8888); + if (!im) + { + _unfind_xob(obr->xob, 0); + free(obr); + return NULL; + } + im->extended_info = obr; + if (buf->priv.x11.xlib.mask) + obr->mxob = _find_xob(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + 1, w, h, + use_shm, + NULL); + } + else + { + im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); + if (!im) + { + free(obr); + return NULL; + } + im->cache_entry.flags.alpha |= alpha ? 1 : 0; + evas_cache_image_surface_alloc(&im->cache_entry, w, h); + im->extended_info = obr; + if ((buf->rot == 0) || (buf->rot == 180)) + { + obr->xob = _find_xob(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + w, h, + use_shm, + NULL); + if (!obr->xob) + { + evas_cache_image_drop(&im->cache_entry); + free(obr); + return NULL; + } + if (buf->priv.x11.xlib.mask) + obr->mxob = _find_xob(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + 1, w, h, + use_shm, + NULL); + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + obr->xob = _find_xob(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + buf->priv.x11.xlib.depth, + h, w, + use_shm, + NULL); + if (!obr->xob) + { + evas_cache_image_drop(&im->cache_entry); + free(obr); + return NULL; + } + if (buf->priv.x11.xlib.mask) + obr->mxob = _find_xob(buf->priv.x11.xlib.disp, + buf->priv.x11.xlib.vis, + 1, h, w, + use_shm, + NULL); + } + } + /* FIXME: We should be able to remove this memset, but somewhere in the process + we copy too much to the destination surface and some area are not cleaned before copy. */ + if (((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)) && + (im->image.data)) + { + /* FIXME: faster memset! */ +// memset(im->image.data, 0, w * h * sizeof(DATA32)); + } + +#ifdef EVAS_FRAME_QUEUING + if (!evas_common_frameq_enabled()) +#endif + buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im); + return im; +} + +void +evas_software_xlib_outbuf_free_region_for_update(Outbuf *buf __UNUSED__, RGBA_Image *update __UNUSED__) +{ + /* no need to do anything - they are cleaned up on flush */ +} + +void +evas_software_xlib_outbuf_flush(Outbuf *buf) +{ + Eina_List *l; + RGBA_Image *im; + Outbuf_Region *obr; + + if ((buf->priv.onebuf) && (buf->priv.onebuf_regions)) + { + Region tmpr; + + im = buf->priv.onebuf; + obr = im->extended_info; + tmpr = XCreateRegion(); + while (buf->priv.onebuf_regions) + { + Eina_Rectangle *rect; + XRectangle xr; + + rect = buf->priv.onebuf_regions->data; + buf->priv.onebuf_regions = eina_list_remove_list(buf->priv.onebuf_regions, buf->priv.onebuf_regions); + if (buf->rot == 0) + { + xr.x = rect->x; + xr.y = rect->y; + xr.width = rect->w; + xr.height = rect->h; + } + else if (buf->rot == 90) + { + xr.x = rect->y; + xr.y = buf->w - rect->x - rect->w; + xr.width = rect->h; + xr.height = rect->w; + } + else if (buf->rot == 180) + { + xr.x = buf->w - rect->x - rect->w; + xr.y = buf->h - rect->y - rect->h; + xr.width = rect->w; + xr.height = rect->h; + } + else if (buf->rot == 270) + { + xr.x = buf->h - rect->y - rect->h; + xr.y = rect->x; + xr.width = rect->h; + xr.height = rect->w; + } + XUnionRectWithRegion(&xr, tmpr, tmpr); + if (buf->priv.debug) + evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, + xr.x, xr.y, xr.width, xr.height); + eina_rectangle_free(rect); + } + XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, tmpr); + if (obr->xob) + evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, + buf->priv.x11.xlib.gc, + 0, 0, 0); + if (obr->mxob) + { + XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm, tmpr); + evas_software_xlib_x_output_buffer_paste(obr->mxob, + buf->priv.x11.xlib.mask, + buf->priv.x11.xlib.gcm, + 0, 0, 0); + } + XDestroyRegion(tmpr); + buf->priv.synced = 0; + } + else + { +#if 1 + XSync(buf->priv.x11.xlib.disp, False); + EINA_LIST_FOREACH(buf->priv.pending_writes, l, im) + { + obr = im->extended_info; + if (buf->priv.debug) + evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, + obr->x, obr->y, obr->w, obr->h); + if (obr->xob) + evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, + buf->priv.x11.xlib.gc, + obr->x, obr->y, 0); + if (obr->mxob) + evas_software_xlib_x_output_buffer_paste(obr->mxob, + buf->priv.x11.xlib.mask, + buf->priv.x11.xlib.gcm, + obr->x, obr->y, 0); + } +#ifdef EVAS_FRAME_QUEUING + LKL(buf->priv.lock); +#endif + while (buf->priv.prev_pending_writes) + { + im = buf->priv.prev_pending_writes->data; + buf->priv.prev_pending_writes = + eina_list_remove_list(buf->priv.prev_pending_writes, + buf->priv.prev_pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xob) _unfind_xob(obr->xob, 0); + if (obr->mxob) _unfind_xob(obr->mxob, 0); + free(obr); + } + buf->priv.prev_pending_writes = buf->priv.pending_writes; +#ifdef EVAS_FRAME_QUEUING + LKU(buf->priv.lock); +#endif + buf->priv.pending_writes = NULL; + XFlush(buf->priv.x11.xlib.disp); +#else + /* XX async push - disable */ + /* + EINA_LIST_FOREACH(buf->priv.pending_writes, l, im) + { + obr = im->extended_info; + if (buf->priv.debug) + evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, + obr->x, obr->y, obr->w, obr->h); + evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, + buf->priv.x11.xlib.gc, + obr->x, obr->y, 0); + if (obr->mxob) + evas_software_xlib_x_output_buffer_paste(obr->mxob, + buf->priv.x11.xlib.mask, + buf->priv.x11.xlib.gcm, + obr->x, obr->y, 0); + } + */ + XSync(buf->priv.x11.xlib.disp, False); + + while (buf->priv.pending_writes) + { + RGBA_Image *im; + Outbuf_Region *obr; + + im = eina_list_data_get(buf->priv.pending_writes); + buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xob) _unfind_xob(obr->xob, 0); + if (obr->mxob) _unfind_xob(obr->mxob, 0); + free(obr); + evas_cache_image_drop(&im->cache_entry); + } +#endif + } + evas_common_cpu_end_opt(); +} + +void +evas_software_xlib_outbuf_idle_flush(Outbuf *buf) +{ + if (buf->priv.onebuf) + { + RGBA_Image *im; + Outbuf_Region *obr; + + im = buf->priv.onebuf; + buf->priv.onebuf = NULL; + obr = im->extended_info; + if (obr->xob) evas_software_xlib_x_output_buffer_free(obr->xob, 0); + if (obr->mxob) evas_software_xlib_x_output_buffer_free(obr->mxob, 0); + free(obr); + evas_cache_image_drop(&im->cache_entry); + } + else + { +#ifdef EVAS_FRAME_QUEUING + LKL(buf->priv.lock); +#endif + if (buf->priv.prev_pending_writes) XSync(buf->priv.x11.xlib.disp, False); + while (buf->priv.prev_pending_writes) + { + RGBA_Image *im; + Outbuf_Region *obr; + + im = buf->priv.prev_pending_writes->data; + buf->priv.prev_pending_writes = + eina_list_remove_list(buf->priv.prev_pending_writes, + buf->priv.prev_pending_writes); + obr = im->extended_info; + evas_cache_image_drop(&im->cache_entry); + if (obr->xob) _unfind_xob(obr->xob, 0); + if (obr->mxob) _unfind_xob(obr->mxob, 0); + free(obr); + } +#ifdef EVAS_FRAME_QUEUING + LKU(buf->priv.lock); +#endif + _clear_xob(0); + } +} + +void +evas_software_xlib_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) +{ + Gfx_Func_Convert conv_func = NULL; + Outbuf_Region *obr; + DATA32 *src_data; + unsigned char *data; + int bpl = 0, yy; + + obr = update->extended_info; + if (buf->priv.pal) + { + if ((buf->rot == 0) || (buf->rot == 180)) + conv_func = evas_common_convert_func_get(0, w, h, + evas_software_xlib_x_output_buffer_depth + (obr->xob), buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + buf->priv.pal->colors, buf->rot); + else if ((buf->rot == 90) || (buf->rot == 270)) + conv_func = evas_common_convert_func_get(0, h, w, + evas_software_xlib_x_output_buffer_depth + (obr->xob), buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + buf->priv.pal->colors, buf->rot); + } + else + { + if ((buf->rot == 0) || (buf->rot == 180)) + conv_func = evas_common_convert_func_get(0, w, h, + evas_software_xlib_x_output_buffer_depth + (obr->xob), buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + PAL_MODE_NONE, buf->rot); + else if ((buf->rot == 90) || (buf->rot == 270)) + conv_func = evas_common_convert_func_get(0, h, w, + evas_software_xlib_x_output_buffer_depth + (obr->xob), buf->priv.mask.r, + buf->priv.mask.g, buf->priv.mask.b, + PAL_MODE_NONE, buf->rot); + } + if (!conv_func) return; + + if (!obr->xob) return; + data = evas_software_xlib_x_output_buffer_data(obr->xob, &bpl); + if (!data) return; + src_data = update->image.data; + if (!src_data) return; + if (buf->rot == 0) + { + obr->x = x; + obr->y = y; + } + else if (buf->rot == 90) + { + obr->x = y; + obr->y = buf->w - x - w; + } + else if (buf->rot == 180) + { + obr->x = buf->w - x - w; + obr->y = buf->h - y - h; + } + else if (buf->rot == 270) + { + obr->x = buf->h - y - h; + obr->y = x; + } + if ((buf->rot == 0) || (buf->rot == 180)) + { + obr->w = w; + obr->h = h; + } + else if ((buf->rot == 90) || (buf->rot == 270)) + { + obr->w = h; + obr->h = w; + } + if (buf->onebuf) + { + src_data += x + (y * update->cache_entry.w); + data += (bpl * obr->y) + + (obr->x * (evas_software_xlib_x_output_buffer_depth(obr->xob) / 8)); + } + if (buf->priv.pal) + { + if (data != (unsigned char *)src_data) + conv_func(src_data, data, + update->cache_entry.w - w, + bpl / + ((evas_software_xlib_x_output_buffer_depth(obr->xob) / + 8)) - obr->w, obr->w, obr->h, x, y, + buf->priv.pal->lookup); + } + else + { + if (data != (unsigned char *)src_data) + conv_func(src_data, data, + update->cache_entry.w - w, + bpl / + ((evas_software_xlib_x_output_buffer_depth(obr->xob) / + 8)) - obr->w, obr->w, obr->h, x, y, NULL); + } +#if 1 +#else + /* XX async push */ + if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) + { + if (buf->priv.debug) + evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, + obr->x, obr->y, obr->w, obr->h); + if (obr->xob) + evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, + buf->priv.x11.xlib.gc, + obr->x, obr->y, 0); + } +#endif + if (obr->mxob) + { + if (buf->rot == 0) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xlib_x_write_mask_line(buf, obr->mxob, + src_data + + (yy * obr->w), obr->w, yy); + } + else if (buf->rot == 90) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xlib_x_write_mask_line_vert(buf, obr->mxob, + src_data + yy, + h, // h + obr->h - yy - 1, // ym + w); // w + } + else if (buf->rot == 180) + { + for (yy = 0; yy < obr->h; yy++) + { + evas_software_xlib_x_write_mask_line_rev(buf, obr->mxob, + src_data + + (yy * obr->w), + obr->w, obr->h - yy - 1); + } + } + else if (buf->rot == 270) + { + for (yy = 0; yy < obr->h; yy++) + evas_software_xlib_x_write_mask_line_vert_rev(buf, obr->mxob, + src_data + yy, + h, // h + yy, // ym + w); // w + } +#if 1 +#else + /* XX async push */ + if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) + evas_software_xlib_x_output_buffer_paste(obr->mxob, + buf->priv.x11.xlib.mask, + buf->priv.x11.xlib.gcm, + obr->x, obr->y, 0); +#endif + } +#if 1 +#else + XFlush(buf->priv.x11.xlib.disp); +#endif +} + +void +evas_software_xlib_outbuf_reconfigure(Outbuf * buf, int w, int h, int rot, + Outbuf_Depth depth) +{ + if ((w == buf->w) && + (h == buf->h) && + (rot == buf->rot) && + (depth == buf->depth)) return; + buf->w = w; + buf->h = h; + buf->rot = rot; + evas_software_xlib_outbuf_idle_flush(buf); +} + +int +evas_software_xlib_outbuf_get_width(Outbuf * buf) +{ + return buf->w; +} + +int +evas_software_xlib_outbuf_get_height(Outbuf * buf) +{ + return buf->h; +} + +Outbuf_Depth +evas_software_xlib_outbuf_get_depth(Outbuf * buf) +{ + return buf->depth; +} + +int +evas_software_xlib_outbuf_get_rot(Outbuf * buf) +{ + return buf->rot; +} + +void +evas_software_xlib_outbuf_drawable_set(Outbuf * buf, Drawable draw) +{ + XGCValues gcv; + + if (buf->priv.x11.xlib.win == draw) return; + if (buf->priv.x11.xlib.gc) + { + XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc); + buf->priv.x11.xlib.gc = NULL; + } + buf->priv.x11.xlib.win = draw; + buf->priv.x11.xlib.gc = XCreateGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.win, 0, &gcv); +} + +void +evas_software_xlib_outbuf_mask_set(Outbuf * buf, Pixmap mask) +{ + XGCValues gcv; + + if (buf->priv.x11.xlib.mask == mask) return; + if (buf->priv.x11.xlib.gcm) + { + XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm); + buf->priv.x11.xlib.gcm = NULL; + } + buf->priv.x11.xlib.mask = mask; + if (buf->priv.x11.xlib.mask) + buf->priv.x11.xlib.gcm = XCreateGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.mask, 0, &gcv); +} + +void +evas_software_xlib_outbuf_debug_set(Outbuf * buf, int debug) +{ + buf->priv.debug = debug; +} + +void +evas_software_xlib_outbuf_debug_show(Outbuf * buf, Drawable draw, int x, int y, int w, + int h) +{ + int i; + int screen_num = 0; + + { + int wx, wy; + unsigned int ww, wh, bd, dp; + Window wdum, root; + XWindowAttributes wattr; + + XGetGeometry(buf->priv.x11.xlib.disp, draw, &root, &wx, &wy, &ww, &wh, &bd, &dp); + XGetGeometry(buf->priv.x11.xlib.disp, root, &wdum, &wx, &wy, &ww, &wh, &bd, &dp); + XGetWindowAttributes(buf->priv.x11.xlib.disp, root, &wattr); + screen_num = XScreenNumberOfScreen(wattr.screen); + } + for (i = 0; i < 20; i++) + { + XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, + BlackPixel(buf->priv.x11.xlib.disp, screen_num)); + XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h); + XSync(buf->priv.x11.xlib.disp, False); + XSync(buf->priv.x11.xlib.disp, False); + XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, + WhitePixel(buf->priv.x11.xlib.disp, screen_num)); + XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h); + XSync(buf->priv.x11.xlib.disp, False); + XSync(buf->priv.x11.xlib.disp, False); + } +} + +Eina_Bool +evas_software_xlib_outbuf_alpha_get(Outbuf *buf) +{ + return buf->priv.x11.xlib.mask; +} + +#ifdef EVAS_FRAME_QUEUING +void +evas_software_xlib_outbuf_set_priv(Outbuf *buf, void *cur, void *prev __UNUSED__) +{ + buf->priv.pending_writes = (Eina_List *)cur; +} +#endif diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.h b/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.h new file mode 100644 index 0000000..d70eb8d --- /dev/null +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.h @@ -0,0 +1,92 @@ +#ifndef EVAS_XLIB_OUTBUF_H +#define EVAS_XLIB_OUTBUF_H + + +#include "evas_engine.h" + + +void evas_software_xlib_outbuf_init (void); + +void evas_software_xlib_outbuf_free (Outbuf *buf); + +Outbuf *evas_software_xlib_outbuf_setup_x (int w, + int h, + int rot, + Outbuf_Depth depth, + Display *disp, + Drawable draw, + Visual *vis, + Colormap cmap, + int x_depth, + int grayscale, + int max_colors, + Pixmap mask, + int shape_dither, + int destination_alpha); + + +RGBA_Image *evas_software_xlib_outbuf_new_region_for_update (Outbuf *buf, + int x, + int y, + int w, + int h, + int *cx, + int *cy, + int *cw, + int *ch); + +void evas_software_xlib_outbuf_free_region_for_update (Outbuf *buf, + RGBA_Image *update); + +void evas_software_xlib_outbuf_flush (Outbuf *buf); + +void evas_software_xlib_outbuf_idle_flush (Outbuf *buf); + +void evas_software_xlib_outbuf_push_updated_region (Outbuf *buf, + RGBA_Image *update, + int x, + int y, + int w, + int h); + +void evas_software_xlib_outbuf_reconfigure (Outbuf *buf, + int w, + int h, + int rot, + Outbuf_Depth depth); + +int evas_software_xlib_outbuf_get_width (Outbuf *buf); + +int evas_software_xlib_outbuf_get_height (Outbuf *buf); + +Outbuf_Depth evas_software_xlib_outbuf_get_depth (Outbuf *buf); + +int evas_software_xlib_outbuf_get_rot (Outbuf *buf); + +void evas_software_xlib_outbuf_drawable_set (Outbuf *buf, + Drawable draw); + +void evas_software_xlib_outbuf_mask_set (Outbuf *buf, + Pixmap mask); + +void evas_software_xlib_outbuf_rotation_set (Outbuf *buf, + int rot); + +void evas_software_xlib_outbuf_debug_set (Outbuf *buf, + int debug); + +void evas_software_xlib_outbuf_debug_show (Outbuf *buf, + Drawable draw, + int x, + int y, + int w, + int h); + +Eina_Bool evas_software_xlib_outbuf_alpha_get (Outbuf *buf); +#ifdef EVAS_FRAME_QUEUING +void evas_software_xlib_outbuf_set_priv (Outbuf *buf, + void *cur, + void *prev); +#endif + +#endif -- cgit v1.1