diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/evas/src/modules/engines/software_x11 | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
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.
Diffstat (limited to '')
21 files changed, 6453 insertions, 0 deletions
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 @@ | |||
1 | #ifndef _EVAS_ENGINE_SOFTWARE_X11_H | ||
2 | # define _EVAS_ENGINE_SOFTWARE_X11_H | ||
3 | |||
4 | typedef enum | ||
5 | { | ||
6 | EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB, | ||
7 | EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB | ||
8 | } Evas_Engine_Info_Software_X11_Backend; | ||
9 | |||
10 | typedef struct _Evas_Engine_Info_Software_X11 Evas_Engine_Info_Software_X11; | ||
11 | |||
12 | struct _Evas_Engine_Info_Software_X11 | ||
13 | { | ||
14 | /* PRIVATE - don't mess with this baby or evas will poke its tongue out */ | ||
15 | /* at you and make nasty noises */ | ||
16 | Evas_Engine_Info magic; | ||
17 | |||
18 | /* engine specific data & parameters it needs to set up */ | ||
19 | struct | ||
20 | { | ||
21 | Evas_Engine_Info_Software_X11_Backend backend; | ||
22 | |||
23 | void *connection, *screen; | ||
24 | unsigned int drawable, mask; | ||
25 | void *visual; | ||
26 | unsigned int colormap; | ||
27 | int depth, rotation; | ||
28 | |||
29 | Eina_Bool alloc_grayscale : 1; | ||
30 | Eina_Bool debug : 1; | ||
31 | Eina_Bool shape_dither : 1; | ||
32 | Eina_Bool destination_alpha : 1; | ||
33 | Eina_Bool track_mask_changes : 1; | ||
34 | |||
35 | int alloc_colors_max; | ||
36 | } info; | ||
37 | |||
38 | /* engine specific function calls to query stuff about the destination */ | ||
39 | struct | ||
40 | { | ||
41 | void *(*best_visual_get) (int backend, void *connection, int screen); | ||
42 | unsigned int (*best_colormap_get) (int backend, void *connection, int screen); | ||
43 | int (*best_depth_get) (int backend, void *connection, int screen); | ||
44 | } func; | ||
45 | |||
46 | unsigned char mask_changed : 1; | ||
47 | |||
48 | /* non-blocking or blocking mode */ | ||
49 | Evas_Engine_Render_Mode render_mode; | ||
50 | }; | ||
51 | |||
52 | #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 @@ | |||
1 | |||
2 | MAINTAINERCLEANFILES = Makefile.in | ||
3 | |||
4 | if BUILD_ENGINE_SOFTWARE_X11 | ||
5 | |||
6 | SOFTWARE_X11_SOURCES = evas_engine.c | ||
7 | |||
8 | if BUILD_ENGINE_SOFTWARE_XLIB | ||
9 | |||
10 | AM_CPPFLAGS = \ | ||
11 | -I. \ | ||
12 | -I$(top_srcdir)/src/lib \ | ||
13 | -I$(top_srcdir)/src/lib/include \ | ||
14 | -I$(top_srcdir)/src/modules/engines \ | ||
15 | @FREETYPE_CFLAGS@ \ | ||
16 | @PIXMAN_CFLAGS@ \ | ||
17 | @EINA_CFLAGS@ \ | ||
18 | @evas_engine_software_xlib_cflags@ | ||
19 | |||
20 | SOFTWARE_X11_SOURCES += \ | ||
21 | evas_xlib_outbuf.c \ | ||
22 | evas_xlib_buffer.c \ | ||
23 | evas_xlib_color.c \ | ||
24 | evas_xlib_main.c | ||
25 | |||
26 | SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @EINA_LIBS@ @evas_engine_software_xlib_libs@ | ||
27 | |||
28 | endif | ||
29 | |||
30 | if BUILD_ENGINE_SOFTWARE_XCB | ||
31 | |||
32 | AM_CPPFLAGS = \ | ||
33 | -I. \ | ||
34 | -I$(top_srcdir)/src/lib \ | ||
35 | -I$(top_srcdir)/src/lib/include \ | ||
36 | -I$(top_srcdir)/src/modules/engines \ | ||
37 | @FREETYPE_CFLAGS@ \ | ||
38 | @PIXMAN_CFLAGS@ \ | ||
39 | @EINA_CFLAGS@ \ | ||
40 | @evas_engine_software_xcb_cflags@ | ||
41 | |||
42 | SOFTWARE_X11_SOURCES += \ | ||
43 | evas_xcb_xdefaults.c \ | ||
44 | evas_xcb_outbuf.c \ | ||
45 | evas_xcb_buffer.c \ | ||
46 | evas_xcb_color.c \ | ||
47 | evas_xcb_main.c | ||
48 | |||
49 | SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @PIXMAN_LIBS@ @EINA_LIBS@ @evas_engine_software_xcb_libs@ | ||
50 | |||
51 | endif | ||
52 | |||
53 | includes_HEADERS = Evas_Engine_Software_X11.h | ||
54 | includesdir = $(includedir)/evas-@VMAJ@ | ||
55 | |||
56 | if !EVAS_STATIC_BUILD_SOFTWARE_X11 | ||
57 | |||
58 | pkgdir = $(libdir)/evas/modules/engines/software_x11/$(MODULE_ARCH) | ||
59 | pkg_LTLIBRARIES = module.la | ||
60 | |||
61 | module_la_SOURCES = $(SOFTWARE_X11_SOURCES) | ||
62 | module_la_LIBADD = $(top_builddir)/src/lib/libevas.la $(SOFTWARE_X11_LIBADD) | ||
63 | module_la_LDFLAGS = -no-undefined -module -avoid-version | ||
64 | module_la_LIBTOOLFLAGS = --tag=disable-static | ||
65 | |||
66 | else | ||
67 | |||
68 | noinst_LTLIBRARIES = libevas_engine_software_x11.la | ||
69 | |||
70 | libevas_engine_software_x11_la_SOURCES = $(SOFTWARE_X11_SOURCES) | ||
71 | libevas_engine_software_x11_la_LIBADD = $(SOFTWARE_X11_LIBADD) | ||
72 | |||
73 | endif | ||
74 | endif | ||
75 | |||
76 | EXTRA_DIST = \ | ||
77 | evas_engine.h \ | ||
78 | evas_xlib_outbuf.h \ | ||
79 | evas_xlib_buffer.h \ | ||
80 | evas_xlib_color.h \ | ||
81 | evas_xcb_outbuf.h \ | ||
82 | evas_xcb_buffer.h \ | ||
83 | evas_xcb_color.h \ | ||
84 | evas_xcb_xdefaults.h | ||
85 | |||
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 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | |||
18 | |||
19 | VPATH = @srcdir@ | ||
20 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
21 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
22 | pkglibdir = $(libdir)/@PACKAGE@ | ||
23 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
25 | install_sh_DATA = $(install_sh) -c -m 644 | ||
26 | install_sh_PROGRAM = $(install_sh) -c | ||
27 | install_sh_SCRIPT = $(install_sh) -c | ||
28 | INSTALL_HEADER = $(INSTALL_DATA) | ||
29 | transform = $(program_transform_name) | ||
30 | NORMAL_INSTALL = : | ||
31 | PRE_INSTALL = : | ||
32 | POST_INSTALL = : | ||
33 | NORMAL_UNINSTALL = : | ||
34 | PRE_UNINSTALL = : | ||
35 | POST_UNINSTALL = : | ||
36 | build_triplet = @build@ | ||
37 | host_triplet = @host@ | ||
38 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@am__append_1 = \ | ||
39 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_outbuf.c \ | ||
40 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_buffer.c \ | ||
41 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_color.c \ | ||
42 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@evas_xlib_main.c | ||
43 | |||
44 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@am__append_2 = \ | ||
45 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_xdefaults.c \ | ||
46 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_outbuf.c \ | ||
47 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_buffer.c \ | ||
48 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_color.c \ | ||
49 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@evas_xcb_main.c | ||
50 | |||
51 | subdir = src/modules/engines/software_x11 | ||
52 | DIST_COMMON = $(am__includes_HEADERS_DIST) $(srcdir)/Makefile.am \ | ||
53 | $(srcdir)/Makefile.in | ||
54 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
55 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
56 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
57 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
58 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
59 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
60 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
61 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
62 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
63 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
64 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
65 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
66 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
67 | $(top_srcdir)/configure.ac | ||
68 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
69 | $(ACLOCAL_M4) | ||
70 | mkinstalldirs = $(install_sh) -d | ||
71 | CONFIG_HEADER = $(top_builddir)/config.h | ||
72 | CONFIG_CLEAN_FILES = | ||
73 | CONFIG_CLEAN_VPATH_FILES = | ||
74 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
75 | am__vpath_adj = case $$p in \ | ||
76 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
77 | *) f=$$p;; \ | ||
78 | esac; | ||
79 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
80 | am__install_max = 40 | ||
81 | am__nobase_strip_setup = \ | ||
82 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
83 | am__nobase_strip = \ | ||
84 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
85 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
86 | for p in $$list; do echo "$$p $$p"; done | \ | ||
87 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
88 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
89 | if (++n[$$2] == $(am__install_max)) \ | ||
90 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
91 | END { for (dir in files) print dir, files[dir] }' | ||
92 | am__base_list = \ | ||
93 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
94 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
95 | am__installdirs = "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)" | ||
96 | LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkg_LTLIBRARIES) | ||
97 | am__DEPENDENCIES_1 = | ||
98 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@libevas_engine_software_x11_la_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
99 | am__libevas_engine_software_x11_la_SOURCES_DIST = evas_engine.c \ | ||
100 | evas_xlib_outbuf.c evas_xlib_buffer.c evas_xlib_color.c \ | ||
101 | evas_xlib_main.c evas_xcb_xdefaults.c evas_xcb_outbuf.c \ | ||
102 | evas_xcb_buffer.c evas_xcb_color.c evas_xcb_main.c | ||
103 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@am__objects_1 = evas_xlib_outbuf.lo \ | ||
104 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ evas_xlib_buffer.lo \ | ||
105 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ evas_xlib_color.lo \ | ||
106 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ evas_xlib_main.lo | ||
107 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@am__objects_2 = evas_xcb_xdefaults.lo \ | ||
108 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_outbuf.lo \ | ||
109 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_buffer.lo \ | ||
110 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_color.lo \ | ||
111 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ evas_xcb_main.lo | ||
112 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@am__objects_3 = evas_engine.lo \ | ||
113 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_1) \ | ||
114 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_2) | ||
115 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am_libevas_engine_software_x11_la_OBJECTS = $(am__objects_3) | ||
116 | libevas_engine_software_x11_la_OBJECTS = \ | ||
117 | $(am_libevas_engine_software_x11_la_OBJECTS) | ||
118 | AM_V_lt = $(am__v_lt_$(V)) | ||
119 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
120 | am__v_lt_0 = --silent | ||
121 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@am_libevas_engine_software_x11_la_rpath = | ||
122 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_DEPENDENCIES = $(top_builddir)/src/lib/libevas.la \ | ||
123 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@ $(am__DEPENDENCIES_1) | ||
124 | am__module_la_SOURCES_DIST = evas_engine.c evas_xlib_outbuf.c \ | ||
125 | evas_xlib_buffer.c evas_xlib_color.c evas_xlib_main.c \ | ||
126 | evas_xcb_xdefaults.c evas_xcb_outbuf.c evas_xcb_buffer.c \ | ||
127 | evas_xcb_color.c evas_xcb_main.c | ||
128 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@am__objects_4 = module_la-evas_xlib_outbuf.lo \ | ||
129 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ module_la-evas_xlib_buffer.lo \ | ||
130 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ module_la-evas_xlib_color.lo \ | ||
131 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@ module_la-evas_xlib_main.lo | ||
132 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@am__objects_5 = module_la-evas_xcb_xdefaults.lo \ | ||
133 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_outbuf.lo \ | ||
134 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_buffer.lo \ | ||
135 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_color.lo \ | ||
136 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@ module_la-evas_xcb_main.lo | ||
137 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@am__objects_6 = \ | ||
138 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ module_la-evas_engine.lo \ | ||
139 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_4) \ | ||
140 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__objects_5) | ||
141 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@am_module_la_OBJECTS = $(am__objects_6) | ||
142 | module_la_OBJECTS = $(am_module_la_OBJECTS) | ||
143 | module_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | ||
144 | $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | ||
145 | $(AM_CFLAGS) $(CFLAGS) $(module_la_LDFLAGS) $(LDFLAGS) -o $@ | ||
146 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@am_module_la_rpath = -rpath \ | ||
147 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@ $(pkgdir) | ||
148 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
149 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
150 | am__depfiles_maybe = depfiles | ||
151 | am__mv = mv -f | ||
152 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
153 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
154 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
155 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
156 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
157 | $(AM_CFLAGS) $(CFLAGS) | ||
158 | AM_V_CC = $(am__v_CC_$(V)) | ||
159 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
160 | am__v_CC_0 = @echo " CC " $@; | ||
161 | AM_V_at = $(am__v_at_$(V)) | ||
162 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
163 | am__v_at_0 = @ | ||
164 | CCLD = $(CC) | ||
165 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
166 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
167 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
168 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
169 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
170 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
171 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
172 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
173 | am__v_GEN_0 = @echo " GEN " $@; | ||
174 | SOURCES = $(libevas_engine_software_x11_la_SOURCES) \ | ||
175 | $(module_la_SOURCES) | ||
176 | DIST_SOURCES = $(am__libevas_engine_software_x11_la_SOURCES_DIST) \ | ||
177 | $(am__module_la_SOURCES_DIST) | ||
178 | am__includes_HEADERS_DIST = Evas_Engine_Software_X11.h | ||
179 | HEADERS = $(includes_HEADERS) | ||
180 | ETAGS = etags | ||
181 | CTAGS = ctags | ||
182 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
183 | ACLOCAL = @ACLOCAL@ | ||
184 | ALLOCA = @ALLOCA@ | ||
185 | AMTAR = @AMTAR@ | ||
186 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
187 | AR = @AR@ | ||
188 | AS = @AS@ | ||
189 | AUTOCONF = @AUTOCONF@ | ||
190 | AUTOHEADER = @AUTOHEADER@ | ||
191 | AUTOMAKE = @AUTOMAKE@ | ||
192 | AWK = @AWK@ | ||
193 | CC = @CC@ | ||
194 | CCDEPMODE = @CCDEPMODE@ | ||
195 | CFLAGS = @CFLAGS@ | ||
196 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
197 | CHECK_LIBS = @CHECK_LIBS@ | ||
198 | CPP = @CPP@ | ||
199 | CPPFLAGS = @CPPFLAGS@ | ||
200 | CXX = @CXX@ | ||
201 | CXXCPP = @CXXCPP@ | ||
202 | CXXDEPMODE = @CXXDEPMODE@ | ||
203 | CXXFLAGS = @CXXFLAGS@ | ||
204 | CYGPATH_W = @CYGPATH_W@ | ||
205 | DEFS = @DEFS@ | ||
206 | DEPDIR = @DEPDIR@ | ||
207 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
208 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
209 | DLLTOOL = @DLLTOOL@ | ||
210 | DSYMUTIL = @DSYMUTIL@ | ||
211 | DUMPBIN = @DUMPBIN@ | ||
212 | ECHO_C = @ECHO_C@ | ||
213 | ECHO_N = @ECHO_N@ | ||
214 | ECHO_T = @ECHO_T@ | ||
215 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
216 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
217 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
218 | EDB_LIBS = @EDB_LIBS@ | ||
219 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
220 | EDJE_LIBS = @EDJE_LIBS@ | ||
221 | EET_CFLAGS = @EET_CFLAGS@ | ||
222 | EET_LIBS = @EET_LIBS@ | ||
223 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
224 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
225 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
226 | EGREP = @EGREP@ | ||
227 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
228 | EINA_LIBS = @EINA_LIBS@ | ||
229 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
230 | EVAS_LIBS = @EVAS_LIBS@ | ||
231 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
232 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
233 | EVIL_LIBS = @EVIL_LIBS@ | ||
234 | EXEEXT = @EXEEXT@ | ||
235 | FGREP = @FGREP@ | ||
236 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
237 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
238 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
239 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
240 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
241 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
242 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
243 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
244 | GREP = @GREP@ | ||
245 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
246 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
247 | INSTALL = @INSTALL@ | ||
248 | INSTALL_DATA = @INSTALL_DATA@ | ||
249 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
250 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
251 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
252 | LD = @LD@ | ||
253 | LDFLAGS = @LDFLAGS@ | ||
254 | LIBOBJS = @LIBOBJS@ | ||
255 | LIBS = @LIBS@ | ||
256 | LIBTOOL = @LIBTOOL@ | ||
257 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
258 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
259 | LIPO = @LIPO@ | ||
260 | LN_S = @LN_S@ | ||
261 | LTLIBOBJS = @LTLIBOBJS@ | ||
262 | MAKEINFO = @MAKEINFO@ | ||
263 | MKDIR_P = @MKDIR_P@ | ||
264 | MODULE_ARCH = @MODULE_ARCH@ | ||
265 | NM = @NM@ | ||
266 | NMEDIT = @NMEDIT@ | ||
267 | OBJC = @OBJC@ | ||
268 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
269 | OBJCFLAGS = @OBJCFLAGS@ | ||
270 | OBJDUMP = @OBJDUMP@ | ||
271 | OBJEXT = @OBJEXT@ | ||
272 | OTOOL = @OTOOL@ | ||
273 | OTOOL64 = @OTOOL64@ | ||
274 | PACKAGE = @PACKAGE@ | ||
275 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
276 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
277 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
278 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
279 | PACKAGE_URL = @PACKAGE_URL@ | ||
280 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
281 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
282 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
283 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
284 | PKG_CONFIG = @PKG_CONFIG@ | ||
285 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
286 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
287 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
288 | PNG_LIBS = @PNG_LIBS@ | ||
289 | RANLIB = @RANLIB@ | ||
290 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
291 | SDL_LIBS = @SDL_LIBS@ | ||
292 | SED = @SED@ | ||
293 | SET_MAKE = @SET_MAKE@ | ||
294 | SHELL = @SHELL@ | ||
295 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
296 | STRIP = @STRIP@ | ||
297 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
298 | SVG_LIBS = @SVG_LIBS@ | ||
299 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
300 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
301 | VERSION = @VERSION@ | ||
302 | VMAJ = @VMAJ@ | ||
303 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
304 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
305 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
306 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
307 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
308 | XCB_LIBS = @XCB_LIBS@ | ||
309 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
310 | XEXT_LIBS = @XEXT_LIBS@ | ||
311 | XMKMF = @XMKMF@ | ||
312 | X_CFLAGS = @X_CFLAGS@ | ||
313 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
314 | X_LIBS = @X_LIBS@ | ||
315 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
316 | abs_builddir = @abs_builddir@ | ||
317 | abs_srcdir = @abs_srcdir@ | ||
318 | abs_top_builddir = @abs_top_builddir@ | ||
319 | abs_top_srcdir = @abs_top_srcdir@ | ||
320 | ac_ct_CC = @ac_ct_CC@ | ||
321 | ac_ct_CXX = @ac_ct_CXX@ | ||
322 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
323 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
324 | altivec_cflags = @altivec_cflags@ | ||
325 | am__include = @am__include@ | ||
326 | am__leading_dot = @am__leading_dot@ | ||
327 | am__quote = @am__quote@ | ||
328 | am__tar = @am__tar@ | ||
329 | am__untar = @am__untar@ | ||
330 | bindir = @bindir@ | ||
331 | build = @build@ | ||
332 | build_alias = @build_alias@ | ||
333 | build_cpu = @build_cpu@ | ||
334 | build_os = @build_os@ | ||
335 | build_vendor = @build_vendor@ | ||
336 | builddir = @builddir@ | ||
337 | datadir = @datadir@ | ||
338 | datarootdir = @datarootdir@ | ||
339 | dlopen_libs = @dlopen_libs@ | ||
340 | docdir = @docdir@ | ||
341 | dvidir = @dvidir@ | ||
342 | edje_cc = @edje_cc@ | ||
343 | efl_doxygen = @efl_doxygen@ | ||
344 | efl_have_doxygen = @efl_have_doxygen@ | ||
345 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
346 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
347 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
348 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
349 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
350 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
351 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
352 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
353 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
354 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
355 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
356 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
357 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
358 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
359 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
360 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
361 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
362 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
363 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
364 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
365 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
366 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
367 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
368 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
369 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
370 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
371 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
372 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
373 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
374 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
375 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
376 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
377 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
378 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
379 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
380 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
381 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
382 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
383 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
384 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
385 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
386 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
387 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
388 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
389 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
390 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
391 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
392 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
393 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
394 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
395 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
396 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
397 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
398 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
399 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
400 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
401 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
402 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
403 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
404 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
405 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
406 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
407 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
408 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
409 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
410 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
411 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
412 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
413 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
414 | exec_prefix = @exec_prefix@ | ||
415 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
416 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
417 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
418 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
419 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
420 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
421 | have_lcov = @have_lcov@ | ||
422 | host = @host@ | ||
423 | host_alias = @host_alias@ | ||
424 | host_cpu = @host_cpu@ | ||
425 | host_os = @host_os@ | ||
426 | host_vendor = @host_vendor@ | ||
427 | htmldir = @htmldir@ | ||
428 | includedir = @includedir@ | ||
429 | infodir = @infodir@ | ||
430 | install_sh = @install_sh@ | ||
431 | libdir = @libdir@ | ||
432 | libexecdir = @libexecdir@ | ||
433 | localedir = @localedir@ | ||
434 | localstatedir = @localstatedir@ | ||
435 | lt_ECHO = @lt_ECHO@ | ||
436 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
437 | mandir = @mandir@ | ||
438 | mkdir_p = @mkdir_p@ | ||
439 | oldincludedir = @oldincludedir@ | ||
440 | pdfdir = @pdfdir@ | ||
441 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
442 | prefix = @prefix@ | ||
443 | program_transform_name = @program_transform_name@ | ||
444 | psdir = @psdir@ | ||
445 | pthread_cflags = @pthread_cflags@ | ||
446 | pthread_libs = @pthread_libs@ | ||
447 | release_info = @release_info@ | ||
448 | requirement_evas = @requirement_evas@ | ||
449 | sbindir = @sbindir@ | ||
450 | sharedstatedir = @sharedstatedir@ | ||
451 | srcdir = @srcdir@ | ||
452 | sysconfdir = @sysconfdir@ | ||
453 | target_alias = @target_alias@ | ||
454 | top_build_prefix = @top_build_prefix@ | ||
455 | top_builddir = @top_builddir@ | ||
456 | top_srcdir = @top_srcdir@ | ||
457 | version_info = @version_info@ | ||
458 | MAINTAINERCLEANFILES = Makefile.in | ||
459 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@SOFTWARE_X11_SOURCES = evas_engine.c \ | ||
460 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__append_1) \ | ||
461 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@ $(am__append_2) | ||
462 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@AM_CPPFLAGS = \ | ||
463 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I. \ | ||
464 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I$(top_srcdir)/src/lib \ | ||
465 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I$(top_srcdir)/src/lib/include \ | ||
466 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@-I$(top_srcdir)/src/modules/engines \ | ||
467 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@FREETYPE_CFLAGS@ \ | ||
468 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@PIXMAN_CFLAGS@ \ | ||
469 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@EINA_CFLAGS@ \ | ||
470 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@@evas_engine_software_xcb_cflags@ | ||
471 | |||
472 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@AM_CPPFLAGS = \ | ||
473 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I. \ | ||
474 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I$(top_srcdir)/src/lib \ | ||
475 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I$(top_srcdir)/src/lib/include \ | ||
476 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@-I$(top_srcdir)/src/modules/engines \ | ||
477 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@FREETYPE_CFLAGS@ \ | ||
478 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@PIXMAN_CFLAGS@ \ | ||
479 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@EINA_CFLAGS@ \ | ||
480 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@@evas_engine_software_xlib_cflags@ | ||
481 | |||
482 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XCB_TRUE@SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @PIXMAN_LIBS@ @EINA_LIBS@ @evas_engine_software_xcb_libs@ | ||
483 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@BUILD_ENGINE_SOFTWARE_XLIB_TRUE@SOFTWARE_X11_LIBADD = @FREETYPE_LIBS@ @EINA_LIBS@ @evas_engine_software_xlib_libs@ | ||
484 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@includes_HEADERS = Evas_Engine_Software_X11.h | ||
485 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@includesdir = $(includedir)/evas-@VMAJ@ | ||
486 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@pkgdir = $(libdir)/evas/modules/engines/software_x11/$(MODULE_ARCH) | ||
487 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@pkg_LTLIBRARIES = module.la | ||
488 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_SOURCES = $(SOFTWARE_X11_SOURCES) | ||
489 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_LIBADD = $(top_builddir)/src/lib/libevas.la $(SOFTWARE_X11_LIBADD) | ||
490 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_LDFLAGS = -no-undefined -module -avoid-version | ||
491 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static | ||
492 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@noinst_LTLIBRARIES = libevas_engine_software_x11.la | ||
493 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@libevas_engine_software_x11_la_SOURCES = $(SOFTWARE_X11_SOURCES) | ||
494 | @BUILD_ENGINE_SOFTWARE_X11_TRUE@@EVAS_STATIC_BUILD_SOFTWARE_X11_TRUE@libevas_engine_software_x11_la_LIBADD = $(SOFTWARE_X11_LIBADD) | ||
495 | EXTRA_DIST = \ | ||
496 | evas_engine.h \ | ||
497 | evas_xlib_outbuf.h \ | ||
498 | evas_xlib_buffer.h \ | ||
499 | evas_xlib_color.h \ | ||
500 | evas_xcb_outbuf.h \ | ||
501 | evas_xcb_buffer.h \ | ||
502 | evas_xcb_color.h \ | ||
503 | evas_xcb_xdefaults.h | ||
504 | |||
505 | all: all-am | ||
506 | |||
507 | .SUFFIXES: | ||
508 | .SUFFIXES: .c .lo .o .obj | ||
509 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
510 | @for dep in $?; do \ | ||
511 | case '$(am__configure_deps)' in \ | ||
512 | *$$dep*) \ | ||
513 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
514 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
515 | exit 1;; \ | ||
516 | esac; \ | ||
517 | done; \ | ||
518 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/engines/software_x11/Makefile'; \ | ||
519 | $(am__cd) $(top_srcdir) && \ | ||
520 | $(AUTOMAKE) --gnu src/modules/engines/software_x11/Makefile | ||
521 | .PRECIOUS: Makefile | ||
522 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
523 | @case '$?' in \ | ||
524 | *config.status*) \ | ||
525 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
526 | *) \ | ||
527 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
528 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
529 | esac; | ||
530 | |||
531 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
532 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
533 | |||
534 | $(top_srcdir)/configure: $(am__configure_deps) | ||
535 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
536 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
537 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
538 | $(am__aclocal_m4_deps): | ||
539 | |||
540 | clean-noinstLTLIBRARIES: | ||
541 | -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) | ||
542 | @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ | ||
543 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
544 | test "$$dir" != "$$p" || dir=.; \ | ||
545 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
546 | rm -f "$${dir}/so_locations"; \ | ||
547 | done | ||
548 | install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES) | ||
549 | @$(NORMAL_INSTALL) | ||
550 | test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)" | ||
551 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
552 | list2=; for p in $$list; do \ | ||
553 | if test -f $$p; then \ | ||
554 | list2="$$list2 $$p"; \ | ||
555 | else :; fi; \ | ||
556 | done; \ | ||
557 | test -z "$$list2" || { \ | ||
558 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \ | ||
559 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \ | ||
560 | } | ||
561 | |||
562 | uninstall-pkgLTLIBRARIES: | ||
563 | @$(NORMAL_UNINSTALL) | ||
564 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
565 | for p in $$list; do \ | ||
566 | $(am__strip_dir) \ | ||
567 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ | ||
568 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ | ||
569 | done | ||
570 | |||
571 | clean-pkgLTLIBRARIES: | ||
572 | -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES) | ||
573 | @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \ | ||
574 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
575 | test "$$dir" != "$$p" || dir=.; \ | ||
576 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
577 | rm -f "$${dir}/so_locations"; \ | ||
578 | done | ||
579 | libevas_engine_software_x11.la: $(libevas_engine_software_x11_la_OBJECTS) $(libevas_engine_software_x11_la_DEPENDENCIES) | ||
580 | $(AM_V_CCLD)$(LINK) $(am_libevas_engine_software_x11_la_rpath) $(libevas_engine_software_x11_la_OBJECTS) $(libevas_engine_software_x11_la_LIBADD) $(LIBS) | ||
581 | module.la: $(module_la_OBJECTS) $(module_la_DEPENDENCIES) | ||
582 | $(AM_V_CCLD)$(module_la_LINK) $(am_module_la_rpath) $(module_la_OBJECTS) $(module_la_LIBADD) $(LIBS) | ||
583 | |||
584 | mostlyclean-compile: | ||
585 | -rm -f *.$(OBJEXT) | ||
586 | |||
587 | distclean-compile: | ||
588 | -rm -f *.tab.c | ||
589 | |||
590 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_engine.Plo@am__quote@ | ||
591 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_buffer.Plo@am__quote@ | ||
592 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_color.Plo@am__quote@ | ||
593 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_main.Plo@am__quote@ | ||
594 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_outbuf.Plo@am__quote@ | ||
595 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xcb_xdefaults.Plo@am__quote@ | ||
596 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_buffer.Plo@am__quote@ | ||
597 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_color.Plo@am__quote@ | ||
598 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_main.Plo@am__quote@ | ||
599 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_xlib_outbuf.Plo@am__quote@ | ||
600 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_engine.Plo@am__quote@ | ||
601 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_buffer.Plo@am__quote@ | ||
602 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_color.Plo@am__quote@ | ||
603 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_main.Plo@am__quote@ | ||
604 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_outbuf.Plo@am__quote@ | ||
605 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xcb_xdefaults.Plo@am__quote@ | ||
606 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_buffer.Plo@am__quote@ | ||
607 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_color.Plo@am__quote@ | ||
608 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_main.Plo@am__quote@ | ||
609 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_xlib_outbuf.Plo@am__quote@ | ||
610 | |||
611 | .c.o: | ||
612 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
613 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
614 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
615 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
616 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
617 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
618 | |||
619 | .c.obj: | ||
620 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
621 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
622 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
623 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
624 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
625 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
626 | |||
627 | .c.lo: | ||
628 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
629 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
630 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
631 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
632 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
633 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
634 | |||
635 | module_la-evas_engine.lo: evas_engine.c | ||
636 | @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 | ||
637 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_engine.Tpo $(DEPDIR)/module_la-evas_engine.Plo | ||
638 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
639 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_engine.c' object='module_la-evas_engine.lo' libtool=yes @AMDEPBACKSLASH@ | ||
640 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
641 | @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 | ||
642 | |||
643 | module_la-evas_xlib_outbuf.lo: evas_xlib_outbuf.c | ||
644 | @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 | ||
645 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_outbuf.Tpo $(DEPDIR)/module_la-evas_xlib_outbuf.Plo | ||
646 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
647 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_outbuf.c' object='module_la-evas_xlib_outbuf.lo' libtool=yes @AMDEPBACKSLASH@ | ||
648 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
649 | @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 | ||
650 | |||
651 | module_la-evas_xlib_buffer.lo: evas_xlib_buffer.c | ||
652 | @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 | ||
653 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_buffer.Tpo $(DEPDIR)/module_la-evas_xlib_buffer.Plo | ||
654 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
655 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_buffer.c' object='module_la-evas_xlib_buffer.lo' libtool=yes @AMDEPBACKSLASH@ | ||
656 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
657 | @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 | ||
658 | |||
659 | module_la-evas_xlib_color.lo: evas_xlib_color.c | ||
660 | @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 | ||
661 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_color.Tpo $(DEPDIR)/module_la-evas_xlib_color.Plo | ||
662 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
663 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_color.c' object='module_la-evas_xlib_color.lo' libtool=yes @AMDEPBACKSLASH@ | ||
664 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
665 | @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 | ||
666 | |||
667 | module_la-evas_xlib_main.lo: evas_xlib_main.c | ||
668 | @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 | ||
669 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xlib_main.Tpo $(DEPDIR)/module_la-evas_xlib_main.Plo | ||
670 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
671 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xlib_main.c' object='module_la-evas_xlib_main.lo' libtool=yes @AMDEPBACKSLASH@ | ||
672 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
673 | @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 | ||
674 | |||
675 | module_la-evas_xcb_xdefaults.lo: evas_xcb_xdefaults.c | ||
676 | @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 | ||
677 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_xdefaults.Tpo $(DEPDIR)/module_la-evas_xcb_xdefaults.Plo | ||
678 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
679 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_xdefaults.c' object='module_la-evas_xcb_xdefaults.lo' libtool=yes @AMDEPBACKSLASH@ | ||
680 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
681 | @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 | ||
682 | |||
683 | module_la-evas_xcb_outbuf.lo: evas_xcb_outbuf.c | ||
684 | @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 | ||
685 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_outbuf.Tpo $(DEPDIR)/module_la-evas_xcb_outbuf.Plo | ||
686 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
687 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_outbuf.c' object='module_la-evas_xcb_outbuf.lo' libtool=yes @AMDEPBACKSLASH@ | ||
688 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
689 | @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 | ||
690 | |||
691 | module_la-evas_xcb_buffer.lo: evas_xcb_buffer.c | ||
692 | @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 | ||
693 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_buffer.Tpo $(DEPDIR)/module_la-evas_xcb_buffer.Plo | ||
694 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
695 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_buffer.c' object='module_la-evas_xcb_buffer.lo' libtool=yes @AMDEPBACKSLASH@ | ||
696 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
697 | @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 | ||
698 | |||
699 | module_la-evas_xcb_color.lo: evas_xcb_color.c | ||
700 | @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 | ||
701 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_color.Tpo $(DEPDIR)/module_la-evas_xcb_color.Plo | ||
702 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
703 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_color.c' object='module_la-evas_xcb_color.lo' libtool=yes @AMDEPBACKSLASH@ | ||
704 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
705 | @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 | ||
706 | |||
707 | module_la-evas_xcb_main.lo: evas_xcb_main.c | ||
708 | @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 | ||
709 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_xcb_main.Tpo $(DEPDIR)/module_la-evas_xcb_main.Plo | ||
710 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
711 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_xcb_main.c' object='module_la-evas_xcb_main.lo' libtool=yes @AMDEPBACKSLASH@ | ||
712 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
713 | @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 | ||
714 | |||
715 | mostlyclean-libtool: | ||
716 | -rm -f *.lo | ||
717 | |||
718 | clean-libtool: | ||
719 | -rm -rf .libs _libs | ||
720 | install-includesHEADERS: $(includes_HEADERS) | ||
721 | @$(NORMAL_INSTALL) | ||
722 | test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)" | ||
723 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
724 | for p in $$list; do \ | ||
725 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
726 | echo "$$d$$p"; \ | ||
727 | done | $(am__base_list) | \ | ||
728 | while read files; do \ | ||
729 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \ | ||
730 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \ | ||
731 | done | ||
732 | |||
733 | uninstall-includesHEADERS: | ||
734 | @$(NORMAL_UNINSTALL) | ||
735 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
736 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
737 | test -n "$$files" || exit 0; \ | ||
738 | echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \ | ||
739 | cd "$(DESTDIR)$(includesdir)" && rm -f $$files | ||
740 | |||
741 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
742 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
743 | unique=`for i in $$list; do \ | ||
744 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
745 | done | \ | ||
746 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
747 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
748 | mkid -fID $$unique | ||
749 | tags: TAGS | ||
750 | |||
751 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
752 | $(TAGS_FILES) $(LISP) | ||
753 | set x; \ | ||
754 | here=`pwd`; \ | ||
755 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
756 | unique=`for i in $$list; do \ | ||
757 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
758 | done | \ | ||
759 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
760 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
761 | shift; \ | ||
762 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
763 | test -n "$$unique" || unique=$$empty_fix; \ | ||
764 | if test $$# -gt 0; then \ | ||
765 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
766 | "$$@" $$unique; \ | ||
767 | else \ | ||
768 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
769 | $$unique; \ | ||
770 | fi; \ | ||
771 | fi | ||
772 | ctags: CTAGS | ||
773 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
774 | $(TAGS_FILES) $(LISP) | ||
775 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
776 | unique=`for i in $$list; do \ | ||
777 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
778 | done | \ | ||
779 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
780 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
781 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
782 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
783 | $$unique | ||
784 | |||
785 | GTAGS: | ||
786 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
787 | && $(am__cd) $(top_srcdir) \ | ||
788 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
789 | |||
790 | distclean-tags: | ||
791 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
792 | |||
793 | distdir: $(DISTFILES) | ||
794 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
795 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
796 | list='$(DISTFILES)'; \ | ||
797 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
798 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
799 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
800 | case $$dist_files in \ | ||
801 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
802 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
803 | sort -u` ;; \ | ||
804 | esac; \ | ||
805 | for file in $$dist_files; do \ | ||
806 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
807 | if test -d $$d/$$file; then \ | ||
808 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
809 | if test -d "$(distdir)/$$file"; then \ | ||
810 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
811 | fi; \ | ||
812 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
813 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
814 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
815 | fi; \ | ||
816 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
817 | else \ | ||
818 | test -f "$(distdir)/$$file" \ | ||
819 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
820 | || exit 1; \ | ||
821 | fi; \ | ||
822 | done | ||
823 | check-am: all-am | ||
824 | check: check-am | ||
825 | all-am: Makefile $(LTLIBRARIES) $(HEADERS) | ||
826 | installdirs: | ||
827 | for dir in "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)"; do \ | ||
828 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
829 | done | ||
830 | install: install-am | ||
831 | install-exec: install-exec-am | ||
832 | install-data: install-data-am | ||
833 | uninstall: uninstall-am | ||
834 | |||
835 | install-am: all-am | ||
836 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
837 | |||
838 | installcheck: installcheck-am | ||
839 | install-strip: | ||
840 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
841 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
842 | `test -z '$(STRIP)' || \ | ||
843 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
844 | mostlyclean-generic: | ||
845 | |||
846 | clean-generic: | ||
847 | |||
848 | distclean-generic: | ||
849 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
850 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
851 | |||
852 | maintainer-clean-generic: | ||
853 | @echo "This command is intended for maintainers to use" | ||
854 | @echo "it deletes files that may require special tools to rebuild." | ||
855 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
856 | clean: clean-am | ||
857 | |||
858 | clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ | ||
859 | clean-pkgLTLIBRARIES mostlyclean-am | ||
860 | |||
861 | distclean: distclean-am | ||
862 | -rm -rf ./$(DEPDIR) | ||
863 | -rm -f Makefile | ||
864 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
865 | distclean-tags | ||
866 | |||
867 | dvi: dvi-am | ||
868 | |||
869 | dvi-am: | ||
870 | |||
871 | html: html-am | ||
872 | |||
873 | html-am: | ||
874 | |||
875 | info: info-am | ||
876 | |||
877 | info-am: | ||
878 | |||
879 | install-data-am: install-includesHEADERS install-pkgLTLIBRARIES | ||
880 | |||
881 | install-dvi: install-dvi-am | ||
882 | |||
883 | install-dvi-am: | ||
884 | |||
885 | install-exec-am: | ||
886 | |||
887 | install-html: install-html-am | ||
888 | |||
889 | install-html-am: | ||
890 | |||
891 | install-info: install-info-am | ||
892 | |||
893 | install-info-am: | ||
894 | |||
895 | install-man: | ||
896 | |||
897 | install-pdf: install-pdf-am | ||
898 | |||
899 | install-pdf-am: | ||
900 | |||
901 | install-ps: install-ps-am | ||
902 | |||
903 | install-ps-am: | ||
904 | |||
905 | installcheck-am: | ||
906 | |||
907 | maintainer-clean: maintainer-clean-am | ||
908 | -rm -rf ./$(DEPDIR) | ||
909 | -rm -f Makefile | ||
910 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
911 | |||
912 | mostlyclean: mostlyclean-am | ||
913 | |||
914 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
915 | mostlyclean-libtool | ||
916 | |||
917 | pdf: pdf-am | ||
918 | |||
919 | pdf-am: | ||
920 | |||
921 | ps: ps-am | ||
922 | |||
923 | ps-am: | ||
924 | |||
925 | uninstall-am: uninstall-includesHEADERS uninstall-pkgLTLIBRARIES | ||
926 | |||
927 | .MAKE: install-am install-strip | ||
928 | |||
929 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
930 | clean-libtool clean-noinstLTLIBRARIES clean-pkgLTLIBRARIES \ | ||
931 | ctags distclean distclean-compile distclean-generic \ | ||
932 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
933 | html-am info info-am install install-am install-data \ | ||
934 | install-data-am install-dvi install-dvi-am install-exec \ | ||
935 | install-exec-am install-html install-html-am \ | ||
936 | install-includesHEADERS install-info install-info-am \ | ||
937 | install-man install-pdf install-pdf-am install-pkgLTLIBRARIES \ | ||
938 | install-ps install-ps-am install-strip installcheck \ | ||
939 | installcheck-am installdirs maintainer-clean \ | ||
940 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
941 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
942 | tags uninstall uninstall-am uninstall-includesHEADERS \ | ||
943 | uninstall-pkgLTLIBRARIES | ||
944 | |||
945 | |||
946 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
947 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
948 | .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 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_private.h" | ||
3 | |||
4 | #include "Evas_Engine_Software_X11.h" | ||
5 | #include "evas_engine.h" | ||
6 | |||
7 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
8 | # include "evas_xlib_outbuf.h" | ||
9 | # include "evas_xlib_color.h" | ||
10 | #endif | ||
11 | |||
12 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
13 | # include "evas_xcb_outbuf.h" | ||
14 | # include "evas_xcb_color.h" | ||
15 | # include "evas_xcb_xdefaults.h" | ||
16 | #endif | ||
17 | |||
18 | int _evas_engine_soft_x11_log_dom = -1; | ||
19 | |||
20 | /* function tables - filled in later (func and parent func) */ | ||
21 | static Evas_Func func, pfunc; | ||
22 | |||
23 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
24 | /* | ||
25 | struct xrdb_user | ||
26 | { | ||
27 | time_t last_stat; | ||
28 | time_t last_mtime; | ||
29 | XrmDatabase db; | ||
30 | }; | ||
31 | static struct xrdb_user xrdb_user = {0, 0, NULL}; | ||
32 | |||
33 | static Eina_Bool | ||
34 | xrdb_user_query(const char *name, const char *cls, char **type, XrmValue *val) | ||
35 | { | ||
36 | time_t last, now; | ||
37 | |||
38 | last = xrdb_user.last_stat; | ||
39 | now = time(NULL); | ||
40 | |||
41 | xrdb_user.last_stat = now; | ||
42 | if (last != now) // don't stat() more than once every second | ||
43 | { | ||
44 | struct stat st; | ||
45 | const char *home; | ||
46 | char tmp[PATH_MAX]; | ||
47 | |||
48 | if (!(home = getenv("HOME"))) | ||
49 | goto failed; | ||
50 | |||
51 | snprintf(tmp, sizeof(tmp), "%s/.Xdefaults", home); | ||
52 | if (stat(tmp, &st) != 0) goto failed; | ||
53 | if (xrdb_user.last_mtime != st.st_mtime) | ||
54 | { | ||
55 | if (xrdb_user.db) XrmDestroyDatabase(xrdb_user.db); | ||
56 | xrdb_user.db = XrmGetFileDatabase(tmp); | ||
57 | if (!xrdb_user.db) goto failed; | ||
58 | xrdb_user.last_mtime = st.st_mtime; | ||
59 | } | ||
60 | } | ||
61 | |||
62 | if (!xrdb_user.db) return EINA_FALSE; | ||
63 | return XrmGetResource(xrdb_user.db, name, cls, type, val); | ||
64 | |||
65 | failed: | ||
66 | if (xrdb_user.db) | ||
67 | { | ||
68 | XrmDestroyDatabase(xrdb_user.db); | ||
69 | xrdb_user.db = NULL; | ||
70 | } | ||
71 | xrdb_user.last_mtime = 0; | ||
72 | return EINA_FALSE; | ||
73 | } | ||
74 | */ | ||
75 | #endif | ||
76 | |||
77 | /* engine struct data */ | ||
78 | typedef struct _Render_Engine Render_Engine; | ||
79 | |||
80 | struct _Render_Engine | ||
81 | { | ||
82 | Tilebuf *tb; | ||
83 | Outbuf *ob; | ||
84 | Tilebuf_Rect *rects; | ||
85 | Eina_Inlist *cur_rect; | ||
86 | unsigned char end : 1; | ||
87 | /* | ||
88 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
89 | XrmDatabase xrdb; | ||
90 | #endif | ||
91 | struct | ||
92 | { | ||
93 | int dpi; | ||
94 | } xr; | ||
95 | */ | ||
96 | #ifdef EVAS_FRAME_QUEUING | ||
97 | Evas_Engine_Render_Mode render_mode; | ||
98 | #endif | ||
99 | |||
100 | void (*outbuf_free)(Outbuf *ob); | ||
101 | void (*outbuf_reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth); | ||
102 | int (*outbuf_get_rot)(Outbuf *ob); | ||
103 | 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); | ||
104 | void (*outbuf_push_updated_region)(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h); | ||
105 | void (*outbuf_free_region_for_update)(Outbuf *ob, RGBA_Image *update); | ||
106 | void (*outbuf_flush)(Outbuf *ob); | ||
107 | void (*outbuf_idle_flush)(Outbuf *ob); | ||
108 | Eina_Bool (*outbuf_alpha_get)(Outbuf *ob); | ||
109 | #ifdef EVAS_FRAME_QUEUING | ||
110 | void (*outbuf_set_priv)(Outbuf *ob, void *cur, void *prev); | ||
111 | #endif | ||
112 | }; | ||
113 | |||
114 | /* prototypes we will use here */ | ||
115 | static void *_best_visual_get(int backend, void *connection, int screen); | ||
116 | static unsigned int _best_colormap_get(int backend, void *connection, int screen); | ||
117 | static int _best_depth_get(int backend, void *connection, int screen); | ||
118 | |||
119 | static void *eng_info(Evas *e); | ||
120 | static void eng_info_free(Evas *e, void *info); | ||
121 | static int eng_setup(Evas *e, void *info); | ||
122 | static void eng_output_free(void *data); | ||
123 | static void eng_output_resize(void *data, int w, int h); | ||
124 | static void eng_output_tile_size_set(void *data, int w, int h); | ||
125 | static void eng_output_redraws_rect_add(void *data, int x, int y, int w, int h); | ||
126 | static void eng_output_redraws_rect_del(void *data, int x, int y, int w, int h); | ||
127 | static void eng_output_redraws_clear(void *data); | ||
128 | 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); | ||
129 | static void eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h); | ||
130 | static void eng_output_flush(void *data); | ||
131 | static void eng_output_idle_flush(void *data); | ||
132 | |||
133 | /* internal engine routines */ | ||
134 | |||
135 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
136 | static void * | ||
137 | _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw, | ||
138 | Visual *vis, Colormap cmap, int depth, int debug, | ||
139 | int grayscale, int max_colors, Pixmap mask, | ||
140 | int shape_dither, int destination_alpha) | ||
141 | { | ||
142 | Render_Engine *re; | ||
143 | // int status; | ||
144 | // char *type = NULL; | ||
145 | // XrmValue val; | ||
146 | |||
147 | if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; | ||
148 | |||
149 | evas_software_xlib_x_init(); | ||
150 | evas_software_xlib_x_color_init(); | ||
151 | evas_software_xlib_outbuf_init(); | ||
152 | /* | ||
153 | re->xr.dpi = 75000; // dpy * 1000 | ||
154 | |||
155 | status = xrdb_user_query("Xft.dpi", "Xft.Dpi", &type, &val); | ||
156 | if ((!status) || (!type)) | ||
157 | { | ||
158 | if (!re->xrdb) re->xrdb = XrmGetDatabase(disp); | ||
159 | if (re->xrdb) | ||
160 | status = XrmGetResource(re->xrdb, | ||
161 | "Xft.dpi", "Xft.Dpi", &type, &val); | ||
162 | } | ||
163 | |||
164 | if ((status) && (type)) | ||
165 | { | ||
166 | if (!strcmp(type, "String")) | ||
167 | { | ||
168 | const char *str, *dp; | ||
169 | |||
170 | str = val.addr; | ||
171 | dp = strchr(str, '.'); | ||
172 | if (!dp) dp = strchr(str, ','); | ||
173 | |||
174 | if (dp) | ||
175 | { | ||
176 | int subdpi, len, i; | ||
177 | char *buf; | ||
178 | |||
179 | buf = alloca(dp - str + 1); | ||
180 | strncpy(buf, str, dp - str); | ||
181 | buf[dp - str] = 0; | ||
182 | len = strlen(dp + 1); | ||
183 | subdpi = atoi(dp + 1); | ||
184 | |||
185 | if (len < 3) | ||
186 | { | ||
187 | for (i = len; i < 3; i++) | ||
188 | subdpi *= 10; | ||
189 | } | ||
190 | else if (len > 3) | ||
191 | { | ||
192 | for (i = len; i > 3; i--) | ||
193 | subdpi /= 10; | ||
194 | } | ||
195 | re->xr.dpi = atoi(buf) * 1000; | ||
196 | } | ||
197 | else | ||
198 | re->xr.dpi = atoi(str) * 1000; | ||
199 | evas_common_font_dpi_set(re->xr.dpi / 1000); | ||
200 | } | ||
201 | } | ||
202 | */ | ||
203 | re->ob = | ||
204 | evas_software_xlib_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, disp, | ||
205 | draw, vis, cmap, depth, grayscale, | ||
206 | max_colors, mask, shape_dither, | ||
207 | destination_alpha); | ||
208 | if (!re->ob) | ||
209 | { | ||
210 | free(re); | ||
211 | return NULL; | ||
212 | } | ||
213 | |||
214 | /* for updates return 1 big buffer, but only use portions of it, also cache | ||
215 | * it and keepit around until an idle_flush */ | ||
216 | |||
217 | /* disable for now - i am hunting down why some expedite tests are slower, | ||
218 | * as well as shaped stuff is broken and probable non-32bpp is broken as | ||
219 | * convert funcs dont do the right thing | ||
220 | * | ||
221 | */ | ||
222 | // re->ob->onebuf = 1; | ||
223 | |||
224 | evas_software_xlib_outbuf_debug_set(re->ob, debug); | ||
225 | re->tb = evas_common_tilebuf_new(w, h); | ||
226 | if (!re->tb) | ||
227 | { | ||
228 | evas_software_xlib_outbuf_free(re->ob); | ||
229 | free(re); | ||
230 | return NULL; | ||
231 | } | ||
232 | |||
233 | /* in preliminary tests 16x16 gave highest framerates */ | ||
234 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
235 | return re; | ||
236 | } | ||
237 | #endif | ||
238 | |||
239 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
240 | static void * | ||
241 | _output_xcb_setup(int w, int h, int rot, xcb_connection_t *conn, | ||
242 | xcb_screen_t *screen, xcb_drawable_t draw, | ||
243 | xcb_visualtype_t *vis, xcb_colormap_t cmap, int depth, | ||
244 | int debug, int grayscale, int max_colors, xcb_drawable_t mask, | ||
245 | int shape_dither, int destination_alpha) | ||
246 | { | ||
247 | Render_Engine *re; | ||
248 | // int v = 0; | ||
249 | |||
250 | if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; | ||
251 | |||
252 | evas_software_xcb_init(); | ||
253 | evas_software_xcb_color_init(); | ||
254 | evas_software_xcb_outbuf_init(); | ||
255 | /* | ||
256 | // FIXME: re->xrdb | ||
257 | _evas_xcb_xdefaults_init(); | ||
258 | v = _evas_xcb_xdefaults_int_get("Xft", "dpi"); | ||
259 | _evas_xcb_xdefaults_shutdown(); | ||
260 | if (v) re->xr.dpi = (v * 1000); | ||
261 | else re->xr.dpi = 75000; // dpy * 1000 | ||
262 | |||
263 | evas_common_font_dpi_set(re->xr.dpi / 1000); | ||
264 | */ | ||
265 | re->ob = | ||
266 | evas_software_xcb_outbuf_setup(w, h, rot, OUTBUF_DEPTH_INHERIT, conn, | ||
267 | screen, draw, vis, cmap, depth, | ||
268 | grayscale, max_colors, mask, | ||
269 | shape_dither, destination_alpha); | ||
270 | if (!re->ob) | ||
271 | { | ||
272 | free(re); | ||
273 | return NULL; | ||
274 | } | ||
275 | |||
276 | /* for updates return 1 big buffer, but only use portions of it, also cache | ||
277 | * it and keepit around until an idle_flush */ | ||
278 | |||
279 | /* disable for now - i am hunting down why some expedite tests are slower, | ||
280 | * as well as shaped stuff is broken and probable non-32bpp is broken as | ||
281 | * convert funcs dont do the right thing | ||
282 | * | ||
283 | */ | ||
284 | // re->ob->onebuf = 1; | ||
285 | |||
286 | evas_software_xcb_outbuf_debug_set(re->ob, debug); | ||
287 | |||
288 | re->tb = evas_common_tilebuf_new(w, h); | ||
289 | if (!re->tb) | ||
290 | { | ||
291 | evas_software_xcb_outbuf_free(re->ob); | ||
292 | free(re); | ||
293 | return NULL; | ||
294 | } | ||
295 | |||
296 | /* in preliminary tests 16x16 gave highest framerates */ | ||
297 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
298 | return re; | ||
299 | } | ||
300 | #endif | ||
301 | |||
302 | static void * | ||
303 | _best_visual_get(int backend, void *connection, int screen) | ||
304 | { | ||
305 | if (!connection) return NULL; | ||
306 | |||
307 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
308 | if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) | ||
309 | return DefaultVisual((Display *)connection, screen); | ||
310 | #endif | ||
311 | |||
312 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
313 | if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) | ||
314 | { | ||
315 | xcb_screen_iterator_t iter_screen; | ||
316 | xcb_depth_iterator_t iter_depth; | ||
317 | xcb_screen_t *s = NULL; | ||
318 | |||
319 | iter_screen = | ||
320 | xcb_setup_roots_iterator(xcb_get_setup((xcb_connection_t *)connection)); | ||
321 | for (; iter_screen.rem; --screen, xcb_screen_next(&iter_screen)) | ||
322 | if (screen == 0) | ||
323 | { | ||
324 | s = iter_screen.data; | ||
325 | break; | ||
326 | } | ||
327 | |||
328 | iter_depth = xcb_screen_allowed_depths_iterator(s); | ||
329 | for (; iter_depth.rem; xcb_depth_next(&iter_depth)) | ||
330 | { | ||
331 | xcb_visualtype_iterator_t iter_vis; | ||
332 | |||
333 | iter_vis = xcb_depth_visuals_iterator(iter_depth.data); | ||
334 | for (; iter_vis.rem; xcb_visualtype_next(&iter_vis)) | ||
335 | { | ||
336 | if (s->root_visual == iter_vis.data->visual_id) | ||
337 | return iter_vis.data; | ||
338 | } | ||
339 | } | ||
340 | } | ||
341 | #endif | ||
342 | |||
343 | return NULL; | ||
344 | } | ||
345 | |||
346 | static unsigned int | ||
347 | _best_colormap_get(int backend, void *connection, int screen) | ||
348 | { | ||
349 | if (!connection) return 0; | ||
350 | |||
351 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
352 | if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) | ||
353 | return DefaultColormap((Display *)connection, screen); | ||
354 | #endif | ||
355 | |||
356 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
357 | if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) | ||
358 | { | ||
359 | xcb_screen_iterator_t iter_screen; | ||
360 | xcb_screen_t *s = NULL; | ||
361 | |||
362 | iter_screen = | ||
363 | xcb_setup_roots_iterator(xcb_get_setup((xcb_connection_t *)connection)); | ||
364 | for (; iter_screen.rem; --screen, xcb_screen_next(&iter_screen)) | ||
365 | if (screen == 0) | ||
366 | { | ||
367 | s = iter_screen.data; | ||
368 | break; | ||
369 | } | ||
370 | |||
371 | return s->default_colormap; | ||
372 | } | ||
373 | #endif | ||
374 | |||
375 | return 0; | ||
376 | } | ||
377 | |||
378 | static int | ||
379 | _best_depth_get(int backend, void *connection, int screen) | ||
380 | { | ||
381 | if (!connection) return 0; | ||
382 | |||
383 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
384 | if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) | ||
385 | return DefaultDepth((Display *)connection, screen); | ||
386 | #endif | ||
387 | |||
388 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
389 | if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) | ||
390 | { | ||
391 | xcb_screen_iterator_t iter_screen; | ||
392 | xcb_screen_t *s = NULL; | ||
393 | |||
394 | iter_screen = | ||
395 | xcb_setup_roots_iterator(xcb_get_setup((xcb_connection_t *)connection)); | ||
396 | for (; iter_screen.rem; --screen, xcb_screen_next(&iter_screen)) | ||
397 | if (screen == 0) | ||
398 | { | ||
399 | s = iter_screen.data; | ||
400 | break; | ||
401 | } | ||
402 | |||
403 | return s->root_depth; | ||
404 | } | ||
405 | #endif | ||
406 | |||
407 | return 0; | ||
408 | } | ||
409 | |||
410 | /* engine api this module provides */ | ||
411 | static void * | ||
412 | eng_info(Evas *e __UNUSED__) | ||
413 | { | ||
414 | Evas_Engine_Info_Software_X11 *info; | ||
415 | |||
416 | if (!(info = calloc(1, sizeof(Evas_Engine_Info_Software_X11)))) | ||
417 | return NULL; | ||
418 | |||
419 | info->magic.magic = rand(); | ||
420 | info->info.debug = 0; | ||
421 | info->info.alloc_grayscale = 0; | ||
422 | info->info.alloc_colors_max = 216; | ||
423 | info->func.best_visual_get = _best_visual_get; | ||
424 | info->func.best_colormap_get = _best_colormap_get; | ||
425 | info->func.best_depth_get = _best_depth_get; | ||
426 | info->render_mode = EVAS_RENDER_MODE_BLOCKING; | ||
427 | return info; | ||
428 | } | ||
429 | |||
430 | static void | ||
431 | eng_info_free(Evas *e __UNUSED__, void *info) | ||
432 | { | ||
433 | Evas_Engine_Info_Software_X11 *in; | ||
434 | |||
435 | in = (Evas_Engine_Info_Software_X11 *)info; | ||
436 | free(in); | ||
437 | } | ||
438 | |||
439 | static int | ||
440 | eng_setup(Evas *e, void *in) | ||
441 | { | ||
442 | Evas_Engine_Info_Software_X11 *info; | ||
443 | Render_Engine *re = NULL; | ||
444 | |||
445 | info = (Evas_Engine_Info_Software_X11 *)in; | ||
446 | if (!e->engine.data.output) | ||
447 | { | ||
448 | /* if we haven't initialized - init (automatic abort if already done) */ | ||
449 | evas_common_cpu_init(); | ||
450 | evas_common_blend_init(); | ||
451 | evas_common_image_init(); | ||
452 | evas_common_convert_init(); | ||
453 | evas_common_scale_init(); | ||
454 | evas_common_rectangle_init(); | ||
455 | evas_common_polygon_init(); | ||
456 | evas_common_line_init(); | ||
457 | evas_common_font_init(); | ||
458 | evas_common_draw_init(); | ||
459 | evas_common_tilebuf_init(); | ||
460 | |||
461 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
462 | if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) | ||
463 | { | ||
464 | re = _output_xlib_setup(e->output.w, e->output.h, | ||
465 | info->info.rotation, info->info.connection, | ||
466 | info->info.drawable, info->info.visual, | ||
467 | info->info.colormap, | ||
468 | info->info.depth, info->info.debug, | ||
469 | info->info.alloc_grayscale, | ||
470 | info->info.alloc_colors_max, | ||
471 | info->info.mask, info->info.shape_dither, | ||
472 | info->info.destination_alpha); | ||
473 | |||
474 | re->outbuf_free = evas_software_xlib_outbuf_free; | ||
475 | re->outbuf_reconfigure = evas_software_xlib_outbuf_reconfigure; | ||
476 | re->outbuf_get_rot = evas_software_xlib_outbuf_get_rot; | ||
477 | re->outbuf_new_region_for_update = | ||
478 | evas_software_xlib_outbuf_new_region_for_update; | ||
479 | re->outbuf_push_updated_region = | ||
480 | evas_software_xlib_outbuf_push_updated_region; | ||
481 | re->outbuf_free_region_for_update = | ||
482 | evas_software_xlib_outbuf_free_region_for_update; | ||
483 | re->outbuf_flush = evas_software_xlib_outbuf_flush; | ||
484 | re->outbuf_idle_flush = evas_software_xlib_outbuf_idle_flush; | ||
485 | re->outbuf_alpha_get = evas_software_xlib_outbuf_alpha_get; | ||
486 | # ifdef EVAS_FRAME_QUEUING | ||
487 | re->outbuf_set_priv = evas_software_xlib_outbuf_set_priv; | ||
488 | re->render_mode = info->render_mode; | ||
489 | # endif | ||
490 | } | ||
491 | #endif | ||
492 | |||
493 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
494 | if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) | ||
495 | { | ||
496 | re = _output_xcb_setup(e->output.w, e->output.h, | ||
497 | info->info.rotation, info->info.connection, | ||
498 | info->info.screen, info->info.drawable, | ||
499 | info->info.visual, info->info.colormap, | ||
500 | info->info.depth, info->info.debug, | ||
501 | info->info.alloc_grayscale, | ||
502 | info->info.alloc_colors_max, | ||
503 | info->info.mask, info->info.shape_dither, | ||
504 | info->info.destination_alpha); | ||
505 | |||
506 | re->outbuf_free = evas_software_xcb_outbuf_free; | ||
507 | re->outbuf_reconfigure = evas_software_xcb_outbuf_reconfigure; | ||
508 | re->outbuf_get_rot = evas_software_xcb_outbuf_rotation_get; | ||
509 | re->outbuf_new_region_for_update = | ||
510 | evas_software_xcb_outbuf_new_region_for_update; | ||
511 | re->outbuf_push_updated_region = | ||
512 | evas_software_xcb_outbuf_push_updated_region; | ||
513 | re->outbuf_free_region_for_update = | ||
514 | evas_software_xcb_outbuf_free_region_for_update; | ||
515 | re->outbuf_flush = evas_software_xcb_outbuf_flush; | ||
516 | re->outbuf_idle_flush = evas_software_xcb_outbuf_idle_flush; | ||
517 | re->outbuf_alpha_get = evas_software_xcb_outbuf_alpha_get; | ||
518 | # ifdef EVAS_FRAME_QUEUING | ||
519 | re->outbuf_set_priv = evas_software_xcb_outbuf_priv_set; | ||
520 | re->render_mode = info->render_mode; | ||
521 | # endif | ||
522 | } | ||
523 | #endif | ||
524 | |||
525 | e->engine.data.output = re; | ||
526 | } | ||
527 | else | ||
528 | { | ||
529 | int ponebuf = 0; | ||
530 | |||
531 | #ifdef EVAS_FRAME_QUEUING | ||
532 | evas_common_frameq_flush(); | ||
533 | #endif | ||
534 | re = e->engine.data.output; | ||
535 | ponebuf = re->ob->onebuf; | ||
536 | |||
537 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
538 | if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) | ||
539 | { | ||
540 | evas_software_xlib_outbuf_free(re->ob); | ||
541 | re->ob = | ||
542 | evas_software_xlib_outbuf_setup_x(e->output.w, e->output.h, | ||
543 | info->info.rotation, | ||
544 | OUTBUF_DEPTH_INHERIT, | ||
545 | info->info.connection, | ||
546 | info->info.drawable, | ||
547 | info->info.visual, | ||
548 | info->info.colormap, | ||
549 | info->info.depth, | ||
550 | info->info.alloc_grayscale, | ||
551 | info->info.alloc_colors_max, | ||
552 | info->info.mask, | ||
553 | info->info.shape_dither, | ||
554 | info->info.destination_alpha); | ||
555 | |||
556 | evas_software_xlib_outbuf_debug_set(re->ob, info->info.debug); | ||
557 | # ifdef EVAS_FRAME_QUEUING | ||
558 | re->render_mode = info->render_mode; | ||
559 | # endif | ||
560 | } | ||
561 | #endif | ||
562 | |||
563 | #ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
564 | if (info->info.backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB) | ||
565 | { | ||
566 | evas_software_xcb_outbuf_free(re->ob); | ||
567 | re->ob = | ||
568 | evas_software_xcb_outbuf_setup(e->output.w, e->output.h, | ||
569 | info->info.rotation, | ||
570 | OUTBUF_DEPTH_INHERIT, | ||
571 | info->info.connection, | ||
572 | info->info.screen, | ||
573 | info->info.drawable, | ||
574 | info->info.visual, | ||
575 | info->info.colormap, | ||
576 | info->info.depth, | ||
577 | info->info.alloc_grayscale, | ||
578 | info->info.alloc_colors_max, | ||
579 | info->info.mask, | ||
580 | info->info.shape_dither, | ||
581 | info->info.destination_alpha); | ||
582 | |||
583 | evas_software_xcb_outbuf_debug_set(re->ob, info->info.debug); | ||
584 | #ifdef EVAS_FRAME_QUEUING | ||
585 | re->render_mode = info->render_mode; | ||
586 | #endif | ||
587 | } | ||
588 | #endif | ||
589 | re->ob->onebuf = ponebuf; | ||
590 | } | ||
591 | if (!e->engine.data.output) return 0; | ||
592 | if (!e->engine.data.context) | ||
593 | { | ||
594 | e->engine.data.context = | ||
595 | e->engine.func->context_new(e->engine.data.output); | ||
596 | } | ||
597 | |||
598 | re = e->engine.data.output; | ||
599 | |||
600 | return 1; | ||
601 | } | ||
602 | |||
603 | static void | ||
604 | eng_output_free(void *data) | ||
605 | { | ||
606 | Render_Engine *re; | ||
607 | |||
608 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
609 | // NOTE: XrmGetDatabase() result is shared per connection, do not free it. | ||
610 | // if (re->xrdb) XrmDestroyDatabase(re->xrdb); | ||
611 | #endif | ||
612 | |||
613 | if ((re = (Render_Engine *)data)) | ||
614 | { | ||
615 | re->outbuf_free(re->ob); | ||
616 | evas_common_tilebuf_free(re->tb); | ||
617 | if (re->rects) evas_common_tilebuf_free_render_rects(re->rects); | ||
618 | free(re); | ||
619 | } | ||
620 | |||
621 | evas_common_font_shutdown(); | ||
622 | evas_common_image_shutdown(); | ||
623 | } | ||
624 | |||
625 | static void | ||
626 | eng_output_resize(void *data, int w, int h) | ||
627 | { | ||
628 | Render_Engine *re; | ||
629 | |||
630 | re = (Render_Engine *)data; | ||
631 | re->outbuf_reconfigure(re->ob, w, h, re->outbuf_get_rot(re->ob), | ||
632 | OUTBUF_DEPTH_INHERIT); | ||
633 | evas_common_tilebuf_free(re->tb); | ||
634 | re->tb = evas_common_tilebuf_new(w, h); | ||
635 | if (re->tb) | ||
636 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
637 | } | ||
638 | |||
639 | static void | ||
640 | eng_output_tile_size_set(void *data, int w, int h) | ||
641 | { | ||
642 | Render_Engine *re; | ||
643 | |||
644 | re = (Render_Engine *)data; | ||
645 | evas_common_tilebuf_set_tile_size(re->tb, w, h); | ||
646 | } | ||
647 | |||
648 | static void | ||
649 | eng_output_redraws_rect_add(void *data, int x, int y, int w, int h) | ||
650 | { | ||
651 | Render_Engine *re; | ||
652 | |||
653 | re = (Render_Engine *)data; | ||
654 | evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); | ||
655 | } | ||
656 | |||
657 | static void | ||
658 | eng_output_redraws_rect_del(void *data, int x, int y, int w, int h) | ||
659 | { | ||
660 | Render_Engine *re; | ||
661 | |||
662 | re = (Render_Engine *)data; | ||
663 | evas_common_tilebuf_del_redraw(re->tb, x, y, w, h); | ||
664 | } | ||
665 | |||
666 | static void | ||
667 | eng_output_redraws_clear(void *data) | ||
668 | { | ||
669 | Render_Engine *re; | ||
670 | |||
671 | re = (Render_Engine *)data; | ||
672 | evas_common_tilebuf_clear(re->tb); | ||
673 | } | ||
674 | |||
675 | static void * | ||
676 | eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch) | ||
677 | { | ||
678 | Render_Engine *re; | ||
679 | RGBA_Image *surface; | ||
680 | Tilebuf_Rect *rect; | ||
681 | int ux, uy, uw, uh; | ||
682 | |||
683 | re = (Render_Engine *)data; | ||
684 | if (re->end) | ||
685 | { | ||
686 | re->end = 0; | ||
687 | return NULL; | ||
688 | } | ||
689 | if (!re->rects) | ||
690 | { | ||
691 | re->rects = evas_common_tilebuf_get_render_rects(re->tb); | ||
692 | re->cur_rect = EINA_INLIST_GET(re->rects); | ||
693 | } | ||
694 | if (!re->cur_rect) return NULL; | ||
695 | rect = (Tilebuf_Rect *)re->cur_rect; | ||
696 | ux = rect->x; uy = rect->y; uw = rect->w; uh = rect->h; | ||
697 | re->cur_rect = re->cur_rect->next; | ||
698 | if (!re->cur_rect) | ||
699 | { | ||
700 | evas_common_tilebuf_free_render_rects(re->rects); | ||
701 | re->rects = NULL; | ||
702 | re->end = 1; | ||
703 | } | ||
704 | |||
705 | surface = | ||
706 | re->outbuf_new_region_for_update(re->ob, ux, uy, uw, uh, cx, cy, cw, ch); | ||
707 | |||
708 | *x = ux; *y = uy; *w = uw; *h = uh; | ||
709 | return surface; | ||
710 | } | ||
711 | |||
712 | static void | ||
713 | eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h) | ||
714 | { | ||
715 | Render_Engine *re; | ||
716 | #ifdef EVAS_FRAME_QUEUING | ||
717 | Evas_Surface *e_surface; | ||
718 | #endif | ||
719 | |||
720 | re = (Render_Engine *)data; | ||
721 | #if defined(BUILD_PIPE_RENDER) && !defined(EVAS_FRAME_QUEUING) | ||
722 | evas_common_pipe_map_begin(surface); | ||
723 | #endif /* BUILD_PIPE_RENDER && !EVAS_FRAME_QUEUING*/ | ||
724 | |||
725 | #ifdef EVAS_FRAME_QUEUING | ||
726 | if (re->render_mode == EVAS_RENDER_MODE_NONBLOCKING) | ||
727 | { | ||
728 | /* create a new frame if this is the first surface of this frame */ | ||
729 | evas_common_frameq_prepare_frame(); | ||
730 | /* add surface into the frame */ | ||
731 | e_surface = evas_common_frameq_new_surface(surface, x, y, w, h); | ||
732 | evas_common_frameq_add_surface(e_surface); | ||
733 | return; | ||
734 | } | ||
735 | #endif | ||
736 | |||
737 | re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); | ||
738 | re->outbuf_free_region_for_update(re->ob, surface); | ||
739 | evas_common_cpu_end_opt(); | ||
740 | } | ||
741 | |||
742 | #ifdef EVAS_FRAME_QUEUING | ||
743 | static void * | ||
744 | eng_image_map_surface_new(void *data , int w, int h, int alpha) | ||
745 | { | ||
746 | void *surface; | ||
747 | DATA32 *pixels; | ||
748 | Render_Engine *re; | ||
749 | Evas_Surface *e_surface; | ||
750 | |||
751 | re = (Render_Engine *)data; | ||
752 | |||
753 | surface = | ||
754 | evas_cache_image_copied_data(evas_common_image_cache_get(), w, h, NULL, | ||
755 | alpha, EVAS_COLORSPACE_ARGB8888); | ||
756 | pixels = evas_cache_image_pixels(surface); | ||
757 | |||
758 | if (re->render_mode == EVAS_RENDER_MODE_NONBLOCKING) | ||
759 | { | ||
760 | /* create a new frame if this is the first surface of this frame */ | ||
761 | evas_common_frameq_prepare_frame(); | ||
762 | |||
763 | /* add surface into the frame */ | ||
764 | e_surface = evas_common_frameq_new_surface(surface, 0, 0, w, h); | ||
765 | |||
766 | /* this surface is not going to be pushed to screen */ | ||
767 | e_surface->dontpush = 1; | ||
768 | evas_common_frameq_add_surface(e_surface); | ||
769 | } | ||
770 | return surface; | ||
771 | } | ||
772 | |||
773 | static void | ||
774 | eng_output_frameq_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h) | ||
775 | { | ||
776 | Render_Engine *re; | ||
777 | |||
778 | re = (Render_Engine *)data; | ||
779 | re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); | ||
780 | re->outbuf_free_region_for_update(re->ob, surface); | ||
781 | evas_common_cpu_end_opt(); | ||
782 | } | ||
783 | |||
784 | static void | ||
785 | eng_output_frameq_flush(void *data) | ||
786 | { | ||
787 | Render_Engine *re; | ||
788 | |||
789 | re = (Render_Engine *)data; | ||
790 | re->outbuf_flush(re->ob); | ||
791 | } | ||
792 | |||
793 | static void | ||
794 | eng_output_frameq_set_priv(void *data, void *cur, void *prev) | ||
795 | { | ||
796 | Render_Engine *re; | ||
797 | |||
798 | re = (Render_Engine *)data; | ||
799 | re->outbuf_set_priv(re->ob, cur, prev); | ||
800 | } | ||
801 | #endif | ||
802 | |||
803 | static void | ||
804 | eng_output_flush(void *data) | ||
805 | { | ||
806 | Render_Engine *re; | ||
807 | |||
808 | re = (Render_Engine *)data; | ||
809 | #ifdef EVAS_FRAME_QUEUING | ||
810 | if (re->render_mode == EVAS_RENDER_MODE_NONBLOCKING) | ||
811 | { | ||
812 | evas_common_frameq_set_frame_data(data, | ||
813 | eng_output_frameq_redraws_next_update_push, | ||
814 | eng_output_frameq_flush, | ||
815 | eng_output_frameq_set_priv); | ||
816 | evas_common_frameq_ready_frame(); | ||
817 | evas_common_frameq_begin(); | ||
818 | } | ||
819 | else | ||
820 | #endif | ||
821 | re->outbuf_flush(re->ob); | ||
822 | } | ||
823 | |||
824 | static void | ||
825 | eng_output_idle_flush(void *data) | ||
826 | { | ||
827 | Render_Engine *re; | ||
828 | |||
829 | re = (Render_Engine *)data; | ||
830 | re->outbuf_idle_flush(re->ob); | ||
831 | } | ||
832 | |||
833 | static Eina_Bool | ||
834 | eng_canvas_alpha_get(void *data, void *context __UNUSED__) | ||
835 | { | ||
836 | Render_Engine *re; | ||
837 | |||
838 | re = (Render_Engine *)data; | ||
839 | return (re->ob->priv.destination_alpha) || (re->outbuf_alpha_get(re->ob)); | ||
840 | } | ||
841 | |||
842 | |||
843 | /* module advertising code */ | ||
844 | static int | ||
845 | module_open(Evas_Module *em) | ||
846 | { | ||
847 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
848 | static Eina_Bool xrm_inited = EINA_FALSE; | ||
849 | |||
850 | if (!xrm_inited) | ||
851 | { | ||
852 | xrm_inited = EINA_TRUE; | ||
853 | XrmInitialize(); | ||
854 | } | ||
855 | #endif | ||
856 | |||
857 | if (!em) return 0; | ||
858 | |||
859 | /* get whatever engine module we inherit from */ | ||
860 | if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0; | ||
861 | |||
862 | _evas_engine_soft_x11_log_dom = | ||
863 | eina_log_domain_register("evas-software_x11", EVAS_DEFAULT_LOG_COLOR); | ||
864 | |||
865 | if (_evas_engine_soft_x11_log_dom < 0) | ||
866 | { | ||
867 | EINA_LOG_ERR("Can not create a module log domain."); | ||
868 | return 0; | ||
869 | } | ||
870 | |||
871 | /* store it for later use */ | ||
872 | func = pfunc; | ||
873 | |||
874 | /* now to override methods */ | ||
875 | #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) | ||
876 | ORD(info); | ||
877 | ORD(info_free); | ||
878 | ORD(setup); | ||
879 | ORD(canvas_alpha_get); | ||
880 | ORD(output_free); | ||
881 | ORD(output_resize); | ||
882 | ORD(output_tile_size_set); | ||
883 | ORD(output_redraws_rect_add); | ||
884 | ORD(output_redraws_rect_del); | ||
885 | ORD(output_redraws_clear); | ||
886 | ORD(output_redraws_next_update_get); | ||
887 | ORD(output_redraws_next_update_push); | ||
888 | ORD(output_flush); | ||
889 | ORD(output_idle_flush); | ||
890 | #ifdef EVAS_FRAME_QUEUING | ||
891 | ORD(image_map_surface_new); | ||
892 | #endif | ||
893 | |||
894 | /* now advertise out own api */ | ||
895 | em->functions = (void *)(&func); | ||
896 | return 1; | ||
897 | } | ||
898 | |||
899 | static void | ||
900 | module_close(Evas_Module *em __UNUSED__) | ||
901 | { | ||
902 | eina_log_domain_unregister(_evas_engine_soft_x11_log_dom); | ||
903 | #ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
904 | /* | ||
905 | if (xrdb_user.db) | ||
906 | { | ||
907 | XrmDestroyDatabase(xrdb_user.db); | ||
908 | xrdb_user.last_stat = 0; | ||
909 | xrdb_user.last_mtime = 0; | ||
910 | xrdb_user.db = NULL; | ||
911 | } | ||
912 | */ | ||
913 | #endif | ||
914 | } | ||
915 | |||
916 | static Evas_Module_Api evas_modapi = | ||
917 | { | ||
918 | EVAS_MODULE_API_VERSION, "software_x11", "none", | ||
919 | { | ||
920 | module_open, | ||
921 | module_close | ||
922 | } | ||
923 | }; | ||
924 | |||
925 | EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, software_x11); | ||
926 | |||
927 | #ifndef EVAS_STATIC_BUILD_SOFTWARE_X11 | ||
928 | EVAS_EINA_MODULE_DEFINE(engine, software_x11); | ||
929 | #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 @@ | |||
1 | #ifndef EVAS_ENGINE_H | ||
2 | # define EVAS_ENGINE_H | ||
3 | |||
4 | # include <sys/ipc.h> | ||
5 | # include <sys/shm.h> | ||
6 | |||
7 | # ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
8 | # include <X11/Xlib.h> | ||
9 | # include <X11/Xutil.h> | ||
10 | # include <X11/Xatom.h> | ||
11 | # include <X11/extensions/XShm.h> | ||
12 | # include <X11/Xresource.h> // xres - dpi | ||
13 | # endif | ||
14 | |||
15 | # ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
16 | # include <xcb/xcb.h> | ||
17 | # include <xcb/shm.h> | ||
18 | # include <xcb/xcb_image.h> | ||
19 | # endif | ||
20 | |||
21 | extern int _evas_engine_soft_x11_log_dom; | ||
22 | |||
23 | # ifdef ERR | ||
24 | # undef ERR | ||
25 | # endif | ||
26 | # define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_soft_x11_log_dom, __VA_ARGS__) | ||
27 | |||
28 | # ifdef DBG | ||
29 | # undef DBG | ||
30 | # endif | ||
31 | # define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_soft_x11_log_dom, __VA_ARGS__) | ||
32 | |||
33 | # ifdef INF | ||
34 | # undef INF | ||
35 | # endif | ||
36 | # define INF(...) EINA_LOG_DOM_INFO(_evas_engine_soft_x11_log_dom, __VA_ARGS__) | ||
37 | |||
38 | # ifdef WRN | ||
39 | # undef WRN | ||
40 | # endif | ||
41 | # define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_soft_x11_log_dom, __VA_ARGS__) | ||
42 | |||
43 | # ifdef CRIT | ||
44 | # undef CRIT | ||
45 | # endif | ||
46 | # define CRIT(...) \ | ||
47 | EINA_LOG_DOM_CRIT(_evas_engine_soft_x11_log_dom, __VA_ARGS__) | ||
48 | |||
49 | typedef enum _Outbuf_Depth Outbuf_Depth; | ||
50 | |||
51 | enum _Outbuf_Depth | ||
52 | { | ||
53 | OUTBUF_DEPTH_NONE, | ||
54 | OUTBUF_DEPTH_INHERIT, | ||
55 | OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED, | ||
56 | OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED, | ||
57 | OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED, | ||
58 | OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED, | ||
59 | OUTBUF_DEPTH_RGB_32BPP_888_8888, | ||
60 | OUTBUF_DEPTH_LAST | ||
61 | }; | ||
62 | |||
63 | typedef struct _Outbuf Outbuf; | ||
64 | |||
65 | struct _Outbuf | ||
66 | { | ||
67 | Outbuf_Depth depth; | ||
68 | int w, h; | ||
69 | int rot; | ||
70 | int onebuf; | ||
71 | |||
72 | struct | ||
73 | { | ||
74 | Convert_Pal *pal; | ||
75 | union | ||
76 | { | ||
77 | # ifdef BUILD_ENGINE_SOFTWARE_XLIB | ||
78 | struct | ||
79 | { | ||
80 | Display *disp; | ||
81 | Window win; | ||
82 | Pixmap mask; | ||
83 | Visual *vis; | ||
84 | Colormap cmap; | ||
85 | int depth, shm; | ||
86 | GC gc, gcm; | ||
87 | unsigned char swap : 1; | ||
88 | unsigned char bit_swap : 1; | ||
89 | } xlib; | ||
90 | # endif | ||
91 | # ifdef BUILD_ENGINE_SOFTWARE_XCB | ||
92 | struct | ||
93 | { | ||
94 | xcb_connection_t *conn; | ||
95 | xcb_screen_t *screen; | ||
96 | xcb_window_t win; | ||
97 | xcb_pixmap_t mask; | ||
98 | xcb_visualtype_t *visual; | ||
99 | xcb_colormap_t cmap; | ||
100 | int depth, shm; | ||
101 | xcb_gcontext_t gc, gcm; | ||
102 | unsigned char swap : 1; | ||
103 | unsigned char bit_swap : 1; | ||
104 | } xcb; | ||
105 | # endif | ||
106 | } x11; | ||
107 | struct | ||
108 | { | ||
109 | DATA32 r, g, b; | ||
110 | } mask; | ||
111 | |||
112 | /* 1 big buffer for updates - flush on idle_flush */ | ||
113 | RGBA_Image *onebuf; | ||
114 | Eina_List *onebuf_regions; | ||
115 | |||
116 | /* a list of pending regions to write to the target */ | ||
117 | Eina_List *pending_writes; | ||
118 | |||
119 | /* a list of previous frame pending regions to write to the target */ | ||
120 | Eina_List *prev_pending_writes; | ||
121 | |||
122 | # ifdef EVAS_FRAME_QUEUING | ||
123 | /* protecting prev_pending_writes */ | ||
124 | LK(lock); | ||
125 | # endif | ||
126 | |||
127 | unsigned char mask_dither : 1; | ||
128 | unsigned char destination_alpha : 1; | ||
129 | unsigned char debug : 1; | ||
130 | unsigned char synced : 1; | ||
131 | } priv; | ||
132 | }; | ||
133 | |||
134 | void evas_software_xlib_x_init(void); | ||
135 | void evas_software_xcb_init(void); | ||
136 | |||
137 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_xcb_buffer.h" | ||
3 | |||
4 | /* local function prototypes */ | ||
5 | static void _xcbob_sync(xcb_connection_t *conn); | ||
6 | 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); | ||
7 | static xcb_format_t *_xcbob_find_format(const xcb_setup_t *setup, uint8_t depth); | ||
8 | static xcb_visualtype_t *_xcbob_find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id); | ||
9 | |||
10 | void | ||
11 | evas_software_xcb_write_mask_line(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y) | ||
12 | { | ||
13 | int x, bpl = 0; | ||
14 | DATA32 *src_ptr; | ||
15 | DATA8 *dst_ptr; | ||
16 | |||
17 | src_ptr = src; | ||
18 | dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); | ||
19 | dst_ptr = dst_ptr + (bpl * y); | ||
20 | w -= 7; | ||
21 | if (buf->priv.x11.xcb.bit_swap) | ||
22 | { | ||
23 | for (x = 0; x < w; x += 8) | ||
24 | { | ||
25 | *dst_ptr = | ||
26 | ((A_VAL(&(src_ptr[0])) >> 7) << 7) | | ||
27 | ((A_VAL(&(src_ptr[1])) >> 7) << 6) | | ||
28 | ((A_VAL(&(src_ptr[2])) >> 7) << 5) | | ||
29 | ((A_VAL(&(src_ptr[3])) >> 7) << 4) | | ||
30 | ((A_VAL(&(src_ptr[4])) >> 7) << 3) | | ||
31 | ((A_VAL(&(src_ptr[5])) >> 7) << 2) | | ||
32 | ((A_VAL(&(src_ptr[6])) >> 7) << 1) | | ||
33 | ((A_VAL(&(src_ptr[7])) >> 7) << 0); | ||
34 | src_ptr += 8; | ||
35 | dst_ptr++; | ||
36 | } | ||
37 | } | ||
38 | else | ||
39 | { | ||
40 | for (x = 0; x < w; x += 8) | ||
41 | { | ||
42 | *dst_ptr = | ||
43 | ((A_VAL(&(src_ptr[0])) >> 7) << 0) | | ||
44 | ((A_VAL(&(src_ptr[1])) >> 7) << 1) | | ||
45 | ((A_VAL(&(src_ptr[2])) >> 7) << 2) | | ||
46 | ((A_VAL(&(src_ptr[3])) >> 7) << 3) | | ||
47 | ((A_VAL(&(src_ptr[4])) >> 7) << 4) | | ||
48 | ((A_VAL(&(src_ptr[5])) >> 7) << 5) | | ||
49 | ((A_VAL(&(src_ptr[6])) >> 7) << 6) | | ||
50 | ((A_VAL(&(src_ptr[7])) >> 7) << 7); | ||
51 | src_ptr += 8; | ||
52 | dst_ptr++; | ||
53 | } | ||
54 | } | ||
55 | w += 7; | ||
56 | for (; x < w; x ++) | ||
57 | { | ||
58 | xcb_image_put_pixel(xcbob->xim, x, y, A_VAL(src_ptr) >> 7); | ||
59 | src_ptr++; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | void | ||
64 | evas_software_xcb_write_mask_line_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y) | ||
65 | { | ||
66 | int x, bpl = 0; | ||
67 | DATA32 *src_ptr; | ||
68 | DATA8 *dst_ptr; | ||
69 | |||
70 | src_ptr = src + w - 1; | ||
71 | dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); | ||
72 | dst_ptr = dst_ptr + (bpl * y); | ||
73 | w -= 7; | ||
74 | if (buf->priv.x11.xcb.bit_swap) | ||
75 | { | ||
76 | for (x = 0; x < w; x += 8) | ||
77 | { | ||
78 | *dst_ptr = | ||
79 | ((A_VAL(&(src_ptr[ 0])) >> 7) << 7) | | ||
80 | ((A_VAL(&(src_ptr[-1])) >> 7) << 6) | | ||
81 | ((A_VAL(&(src_ptr[-2])) >> 7) << 5) | | ||
82 | ((A_VAL(&(src_ptr[-3])) >> 7) << 4) | | ||
83 | ((A_VAL(&(src_ptr[-4])) >> 7) << 3) | | ||
84 | ((A_VAL(&(src_ptr[-5])) >> 7) << 2) | | ||
85 | ((A_VAL(&(src_ptr[-6])) >> 7) << 1) | | ||
86 | ((A_VAL(&(src_ptr[-7])) >> 7) << 0); | ||
87 | src_ptr -= 8; | ||
88 | dst_ptr++; | ||
89 | } | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | for (x = 0; x < w; x += 8) | ||
94 | { | ||
95 | *dst_ptr = | ||
96 | ((A_VAL(&(src_ptr[ 0])) >> 7) << 0) | | ||
97 | ((A_VAL(&(src_ptr[-1])) >> 7) << 1) | | ||
98 | ((A_VAL(&(src_ptr[-2])) >> 7) << 2) | | ||
99 | ((A_VAL(&(src_ptr[-3])) >> 7) << 3) | | ||
100 | ((A_VAL(&(src_ptr[-4])) >> 7) << 4) | | ||
101 | ((A_VAL(&(src_ptr[-5])) >> 7) << 5) | | ||
102 | ((A_VAL(&(src_ptr[-6])) >> 7) << 6) | | ||
103 | ((A_VAL(&(src_ptr[-7])) >> 7) << 7); | ||
104 | src_ptr -= 8; | ||
105 | dst_ptr++; | ||
106 | } | ||
107 | } | ||
108 | w += 7; | ||
109 | for (; x < w; x ++) | ||
110 | { | ||
111 | xcb_image_put_pixel(xcbob->xim, x, y, A_VAL(src_ptr) >> 7); | ||
112 | src_ptr--; | ||
113 | } | ||
114 | } | ||
115 | |||
116 | void | ||
117 | evas_software_xcb_write_mask_line_vert(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w) | ||
118 | { | ||
119 | int yy, bpl = 0; | ||
120 | DATA32 *src_ptr; | ||
121 | DATA8 *dst_ptr; | ||
122 | |||
123 | src_ptr = src; | ||
124 | dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); | ||
125 | dst_ptr = dst_ptr + (bpl * y); | ||
126 | h -= 7; | ||
127 | if (buf->priv.x11.xcb.bit_swap) | ||
128 | { | ||
129 | for (yy = 0; yy < h; yy += 8) | ||
130 | { | ||
131 | *dst_ptr = | ||
132 | ((A_VAL(&(src_ptr[0 * w])) >> 7) << 7) | | ||
133 | ((A_VAL(&(src_ptr[1 * w])) >> 7) << 6) | | ||
134 | ((A_VAL(&(src_ptr[2 * w])) >> 7) << 5) | | ||
135 | ((A_VAL(&(src_ptr[3 * w])) >> 7) << 4) | | ||
136 | ((A_VAL(&(src_ptr[4 * w])) >> 7) << 3) | | ||
137 | ((A_VAL(&(src_ptr[5 * w])) >> 7) << 2) | | ||
138 | ((A_VAL(&(src_ptr[6 * w])) >> 7) << 1) | | ||
139 | ((A_VAL(&(src_ptr[7 * w])) >> 7) << 0); | ||
140 | src_ptr += 8 * w; | ||
141 | dst_ptr++; | ||
142 | } | ||
143 | } | ||
144 | else | ||
145 | { | ||
146 | for (yy = 0; yy < h; yy += 8) | ||
147 | { | ||
148 | *dst_ptr = | ||
149 | ((A_VAL(&(src_ptr[0 * w])) >> 7) << 0) | | ||
150 | ((A_VAL(&(src_ptr[1 * w])) >> 7) << 1) | | ||
151 | ((A_VAL(&(src_ptr[2 * w])) >> 7) << 2) | | ||
152 | ((A_VAL(&(src_ptr[3 * w])) >> 7) << 3) | | ||
153 | ((A_VAL(&(src_ptr[4 * w])) >> 7) << 4) | | ||
154 | ((A_VAL(&(src_ptr[5 * w])) >> 7) << 5) | | ||
155 | ((A_VAL(&(src_ptr[6 * w])) >> 7) << 6) | | ||
156 | ((A_VAL(&(src_ptr[7 * w])) >> 7) << 7); | ||
157 | src_ptr += 8 * w; | ||
158 | dst_ptr++; | ||
159 | } | ||
160 | } | ||
161 | h += 7; | ||
162 | for (; yy < h; yy ++) | ||
163 | { | ||
164 | xcb_image_put_pixel(xcbob->xim, yy, y, A_VAL(src_ptr) >> 7); | ||
165 | src_ptr += w; | ||
166 | } | ||
167 | } | ||
168 | |||
169 | void | ||
170 | evas_software_xcb_write_mask_line_vert_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w) | ||
171 | { | ||
172 | int yy, bpl = 0; | ||
173 | DATA32 *src_ptr; | ||
174 | DATA8 *dst_ptr; | ||
175 | |||
176 | src_ptr = src + ((h - 1) * w); | ||
177 | dst_ptr = evas_software_xcb_output_buffer_data(xcbob, &bpl); | ||
178 | dst_ptr = dst_ptr + (bpl * y); | ||
179 | h -= 7; | ||
180 | if (buf->priv.x11.xcb.bit_swap) | ||
181 | { | ||
182 | for (yy = 0; yy < h; yy += 8) | ||
183 | { | ||
184 | *dst_ptr = | ||
185 | ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 7) | | ||
186 | ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 6) | | ||
187 | ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 5) | | ||
188 | ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 4) | | ||
189 | ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 3) | | ||
190 | ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 2) | | ||
191 | ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 1) | | ||
192 | ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 0); | ||
193 | src_ptr -= 8 * w; | ||
194 | dst_ptr++; | ||
195 | } | ||
196 | } | ||
197 | else | ||
198 | { | ||
199 | for (yy = 0; yy < h; yy += 8) | ||
200 | { | ||
201 | *dst_ptr = | ||
202 | ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 0) | | ||
203 | ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 1) | | ||
204 | ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 2) | | ||
205 | ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 3) | | ||
206 | ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 4) | | ||
207 | ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 5) | | ||
208 | ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 6) | | ||
209 | ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 7); | ||
210 | src_ptr -= 8 * w; | ||
211 | dst_ptr++; | ||
212 | } | ||
213 | } | ||
214 | h += 7; | ||
215 | for (; yy < h; yy ++) | ||
216 | { | ||
217 | xcb_image_put_pixel(xcbob->xim, yy, y, A_VAL(src_ptr) >> 7); | ||
218 | src_ptr -= w; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | Eina_Bool | ||
223 | evas_software_xcb_can_do_shm(xcb_connection_t *conn, xcb_screen_t *screen) | ||
224 | { | ||
225 | const xcb_query_extension_reply_t *reply; | ||
226 | static xcb_connection_t *cached_conn = NULL; | ||
227 | static int cached_result = 0; | ||
228 | |||
229 | if (conn == cached_conn) return cached_result; | ||
230 | cached_conn = conn; | ||
231 | |||
232 | reply = xcb_get_extension_data(conn, &xcb_shm_id); | ||
233 | if ((reply) && (reply->present)) | ||
234 | { | ||
235 | xcb_visualtype_t *visual; | ||
236 | Xcb_Output_Buffer *xcbob = NULL; | ||
237 | |||
238 | visual = _xcbob_find_visual_by_id(screen, screen->root_visual); | ||
239 | xcbob = | ||
240 | evas_software_xcb_output_buffer_new(conn, visual, screen->root_depth, | ||
241 | 16, 16, 2, NULL); | ||
242 | if (!xcbob) | ||
243 | cached_result = 0; | ||
244 | else | ||
245 | { | ||
246 | evas_software_xcb_output_buffer_free(xcbob, EINA_TRUE); | ||
247 | cached_result = 1; | ||
248 | } | ||
249 | } | ||
250 | else | ||
251 | cached_result = 0; | ||
252 | |||
253 | return cached_result; | ||
254 | } | ||
255 | |||
256 | Xcb_Output_Buffer * | ||
257 | 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) | ||
258 | { | ||
259 | Xcb_Output_Buffer *xcbob = NULL; | ||
260 | |||
261 | if (!(xcbob = calloc(1, sizeof(Xcb_Output_Buffer)))) | ||
262 | return NULL; | ||
263 | |||
264 | xcbob->connection = conn; | ||
265 | xcbob->visual = vis; | ||
266 | xcbob->xim = NULL; | ||
267 | xcbob->shm_info = NULL; | ||
268 | xcbob->w = w; | ||
269 | xcbob->h = h; | ||
270 | |||
271 | if (try_shm > 0) | ||
272 | { | ||
273 | xcbob->shm_info = malloc(sizeof(xcb_shm_segment_info_t)); | ||
274 | if (xcbob->shm_info) | ||
275 | { | ||
276 | xcbob->shm_info->shmseg = xcb_generate_id(conn); | ||
277 | xcbob->xim = | ||
278 | _xcbob_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, | ||
279 | depth, NULL, ~0, NULL); | ||
280 | if (xcbob->xim) | ||
281 | { | ||
282 | xcbob->shm_info->shmid = | ||
283 | shmget(IPC_PRIVATE, | ||
284 | xcbob->xim->stride * xcbob->xim->height, | ||
285 | (IPC_CREAT | 0777)); | ||
286 | if (xcbob->shm_info->shmid == (uint32_t)-1) | ||
287 | { | ||
288 | xcb_image_destroy(xcbob->xim); | ||
289 | free(xcbob->shm_info); | ||
290 | free(xcbob); | ||
291 | return NULL; | ||
292 | } | ||
293 | xcbob->shm_info->shmaddr = xcbob->xim->data = | ||
294 | shmat(xcbob->shm_info->shmid, 0, 0); | ||
295 | if (xcbob->shm_info->shmaddr != ((void *)-1)) | ||
296 | { | ||
297 | /* Sync only needed for testing */ | ||
298 | if (try_shm == 2) _xcbob_sync(conn); | ||
299 | |||
300 | #if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) | ||
301 | if (evas_common_frameq_enabled()) | ||
302 | xcb_grab_server(conn); | ||
303 | #endif | ||
304 | xcb_shm_attach(conn, xcbob->shm_info->shmseg, | ||
305 | xcbob->shm_info->shmid, 0); | ||
306 | #if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) | ||
307 | if (evas_common_frameq_enabled()) | ||
308 | xcb_ungrab_server(conn); | ||
309 | #endif | ||
310 | if (try_shm == 2) _xcbob_sync(conn); | ||
311 | |||
312 | xcbob->bpl = xcbob->xim->stride; | ||
313 | xcbob->psize = (xcbob->bpl * xcbob->h); | ||
314 | return xcbob; | ||
315 | } | ||
316 | shmdt(xcbob->shm_info->shmaddr); | ||
317 | shmctl(xcbob->shm_info->shmid, IPC_RMID, 0); | ||
318 | } | ||
319 | if (xcbob->xim) xcb_image_destroy(xcbob->xim); | ||
320 | xcbob->xim = NULL; | ||
321 | } | ||
322 | if (xcbob->shm_info) free(xcbob->shm_info); | ||
323 | xcbob->shm_info = NULL; | ||
324 | } | ||
325 | |||
326 | if (try_shm > 1) return NULL; | ||
327 | |||
328 | /* no shm */ | ||
329 | xcbob->xim = | ||
330 | _xcbob_create_native(conn, w, h, XCB_IMAGE_FORMAT_Z_PIXMAP, | ||
331 | depth, NULL, ~0, NULL); | ||
332 | if (!xcbob->xim) | ||
333 | { | ||
334 | free(xcbob); | ||
335 | return NULL; | ||
336 | } | ||
337 | |||
338 | xcbob->data = data; | ||
339 | |||
340 | if (!xcbob->xim->data) | ||
341 | { | ||
342 | xcbob->xim->data = malloc(xcbob->xim->stride * xcbob->xim->height); | ||
343 | if (!xcbob->xim->data) | ||
344 | { | ||
345 | xcb_image_destroy(xcbob->xim); | ||
346 | free(xcbob); | ||
347 | return NULL; | ||
348 | } | ||
349 | } | ||
350 | xcbob->bpl = xcbob->xim->stride; | ||
351 | xcbob->psize = (xcbob->bpl * xcbob->h); | ||
352 | return xcbob; | ||
353 | } | ||
354 | |||
355 | void | ||
356 | evas_software_xcb_output_buffer_free(Xcb_Output_Buffer *xcbob, Eina_Bool sync) | ||
357 | { | ||
358 | if (xcbob->shm_info) | ||
359 | { | ||
360 | if (sync) _xcbob_sync(xcbob->connection); | ||
361 | xcb_shm_detach(xcbob->connection, xcbob->shm_info->shmseg); | ||
362 | xcb_image_destroy(xcbob->xim); | ||
363 | shmdt(xcbob->shm_info->shmaddr); | ||
364 | shmctl(xcbob->shm_info->shmid, IPC_RMID, 0); | ||
365 | free(xcbob->shm_info); | ||
366 | } | ||
367 | else | ||
368 | { | ||
369 | if (xcbob->data) xcbob->xim->data = NULL; | ||
370 | // free(xcbob->xim->data); | ||
371 | xcb_image_destroy(xcbob->xim); | ||
372 | } | ||
373 | free(xcbob); | ||
374 | } | ||
375 | |||
376 | void | ||
377 | 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) | ||
378 | { | ||
379 | if (xcbob->shm_info) | ||
380 | { | ||
381 | xcb_image_shm_put(xcbob->connection, drawable, gc, xcbob->xim, | ||
382 | *xcbob->shm_info, 0, 0, x, y, xcbob->w, xcbob->h, 0); | ||
383 | if (sync) _xcbob_sync(xcbob->connection); | ||
384 | } | ||
385 | else | ||
386 | xcb_image_put(xcbob->connection, drawable, gc, xcbob->xim, x, y, 0); | ||
387 | } | ||
388 | |||
389 | DATA8 * | ||
390 | evas_software_xcb_output_buffer_data(Xcb_Output_Buffer *xcbob, int *bpl_ret) | ||
391 | { | ||
392 | if (bpl_ret) *bpl_ret = xcbob->xim->stride; | ||
393 | return (DATA8 *)xcbob->xim->data; | ||
394 | } | ||
395 | |||
396 | int | ||
397 | evas_software_xcb_output_buffer_depth(Xcb_Output_Buffer *xcbob) | ||
398 | { | ||
399 | return xcbob->xim->bpp; | ||
400 | } | ||
401 | |||
402 | int | ||
403 | evas_software_xcb_output_buffer_byte_order(Xcb_Output_Buffer *xcbob) | ||
404 | { | ||
405 | return xcbob->xim->byte_order; | ||
406 | } | ||
407 | |||
408 | int | ||
409 | evas_software_xcb_output_buffer_bit_order(Xcb_Output_Buffer *xcbob) | ||
410 | { | ||
411 | return xcbob->xim->bit_order; | ||
412 | } | ||
413 | |||
414 | /* local functions */ | ||
415 | static void | ||
416 | _xcbob_sync(xcb_connection_t *conn) | ||
417 | { | ||
418 | free(xcb_get_input_focus_reply(conn, | ||
419 | xcb_get_input_focus_unchecked(conn), NULL)); | ||
420 | } | ||
421 | |||
422 | static xcb_image_t * | ||
423 | _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) | ||
424 | { | ||
425 | static uint8_t dpth = 0; | ||
426 | static xcb_format_t *fmt = NULL; | ||
427 | const xcb_setup_t *setup; | ||
428 | xcb_image_format_t xif; | ||
429 | |||
430 | /* NB: We cannot use xcb_image_create_native as it only creates images | ||
431 | * using MSB_FIRST, so this routine recreates that function and uses | ||
432 | * the endian-ness of the server setup */ | ||
433 | setup = xcb_get_setup(conn); | ||
434 | xif = format; | ||
435 | |||
436 | if ((xif == XCB_IMAGE_FORMAT_Z_PIXMAP) && (depth == 1)) | ||
437 | xif = XCB_IMAGE_FORMAT_XY_PIXMAP; | ||
438 | |||
439 | if (dpth != depth) | ||
440 | { | ||
441 | dpth = depth; | ||
442 | fmt = _xcbob_find_format(setup, depth); | ||
443 | if (!fmt) return 0; | ||
444 | } | ||
445 | |||
446 | switch (xif) | ||
447 | { | ||
448 | case XCB_IMAGE_FORMAT_XY_BITMAP: | ||
449 | if (depth != 1) return 0; | ||
450 | case XCB_IMAGE_FORMAT_XY_PIXMAP: | ||
451 | case XCB_IMAGE_FORMAT_Z_PIXMAP: | ||
452 | return xcb_image_create(w, h, xif, | ||
453 | fmt->scanline_pad, | ||
454 | fmt->depth, fmt->bits_per_pixel, | ||
455 | setup->bitmap_format_scanline_unit, | ||
456 | setup->image_byte_order, | ||
457 | setup->bitmap_format_bit_order, | ||
458 | base, bytes, data); | ||
459 | default: | ||
460 | break; | ||
461 | } | ||
462 | |||
463 | return 0; | ||
464 | } | ||
465 | |||
466 | static xcb_format_t * | ||
467 | _xcbob_find_format(const xcb_setup_t *setup, uint8_t depth) | ||
468 | { | ||
469 | xcb_format_t *fmt, *fmtend; | ||
470 | |||
471 | fmt = xcb_setup_pixmap_formats(setup); | ||
472 | fmtend = fmt + xcb_setup_pixmap_formats_length(setup); | ||
473 | for (; fmt != fmtend; ++fmt) | ||
474 | if (fmt->depth == depth) | ||
475 | return fmt; | ||
476 | |||
477 | return 0; | ||
478 | } | ||
479 | |||
480 | static xcb_visualtype_t * | ||
481 | _xcbob_find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id) | ||
482 | { | ||
483 | xcb_depth_iterator_t diter; | ||
484 | xcb_visualtype_iterator_t viter; | ||
485 | |||
486 | diter = xcb_screen_allowed_depths_iterator(screen); | ||
487 | for (; diter.rem; xcb_depth_next(&diter)) | ||
488 | { | ||
489 | viter = xcb_depth_visuals_iterator(diter.data); | ||
490 | for (; viter.rem; xcb_visualtype_next(&viter)) | ||
491 | { | ||
492 | if (viter.data->visual_id == id) | ||
493 | return viter.data; | ||
494 | } | ||
495 | } | ||
496 | |||
497 | return 0; | ||
498 | } | ||
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 @@ | |||
1 | #ifndef EVAS_XCB_BUFFER_H | ||
2 | # define EVAS_XCB_BUFFER_H | ||
3 | |||
4 | # include "evas_engine.h" | ||
5 | |||
6 | typedef struct _Xcb_Output_Buffer Xcb_Output_Buffer; | ||
7 | struct _Xcb_Output_Buffer | ||
8 | { | ||
9 | xcb_connection_t *connection; | ||
10 | xcb_visualtype_t *visual; | ||
11 | xcb_image_t *xim; | ||
12 | xcb_shm_segment_info_t *shm_info; | ||
13 | unsigned char *data; | ||
14 | int w, h, bpl, psize; | ||
15 | }; | ||
16 | |||
17 | void evas_software_xcb_write_mask_line(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y); | ||
18 | void evas_software_xcb_write_mask_line_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y); | ||
19 | void evas_software_xcb_write_mask_line_vert(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w); | ||
20 | void evas_software_xcb_write_mask_line_vert_rev(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int h, int y, int w); | ||
21 | Eina_Bool evas_software_xcb_can_do_shm(xcb_connection_t *conn, xcb_screen_t *screen); | ||
22 | 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); | ||
23 | void evas_software_xcb_output_buffer_free(Xcb_Output_Buffer *xcbob, Eina_Bool sync); | ||
24 | 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); | ||
25 | DATA8 *evas_software_xcb_output_buffer_data(Xcb_Output_Buffer *xcbob, int *bpl_ret); | ||
26 | int evas_software_xcb_output_buffer_depth(Xcb_Output_Buffer *xcbob); | ||
27 | int evas_software_xcb_output_buffer_byte_order(Xcb_Output_Buffer *xcbob); | ||
28 | int evas_software_xcb_output_buffer_bit_order(Xcb_Output_Buffer *xcbob); | ||
29 | |||
30 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | |||
3 | #include "evas_engine.h" | ||
4 | |||
5 | typedef struct _Convert_Pal_Priv Convert_Pal_Priv; | ||
6 | |||
7 | struct _Convert_Pal_Priv | ||
8 | { | ||
9 | xcb_connection_t *conn; | ||
10 | xcb_colormap_t cmap; | ||
11 | xcb_visualtype_t *vis; | ||
12 | }; | ||
13 | |||
14 | typedef DATA8 * (*Xcb_Func_Alloc_Colors) (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
15 | |||
16 | static Xcb_Func_Alloc_Colors x_color_alloc[PAL_MODE_LAST + 1]; | ||
17 | static int x_color_count[PAL_MODE_LAST + 1]; | ||
18 | static Eina_List *palettes = NULL; | ||
19 | |||
20 | static DATA8 * x_color_alloc_rgb(int nr, int ng, int nb, xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
21 | static DATA8 * x_color_alloc_gray(int ng, xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
22 | |||
23 | static DATA8 * x_color_alloc_rgb_332 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
24 | static DATA8 * x_color_alloc_rgb_666 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
25 | static DATA8 * x_color_alloc_rgb_232 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
26 | static DATA8 * x_color_alloc_rgb_222 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
27 | static DATA8 * x_color_alloc_rgb_221 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
28 | static DATA8 * x_color_alloc_rgb_121 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
29 | static DATA8 * x_color_alloc_rgb_111 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
30 | static DATA8 * x_color_alloc_gray_256 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
31 | static DATA8 * x_color_alloc_gray_64 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
32 | static DATA8 * x_color_alloc_gray_16 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
33 | static DATA8 * x_color_alloc_gray_4 (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
34 | static DATA8 * x_color_alloc_mono (xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *v); | ||
35 | |||
36 | static DATA8 * | ||
37 | x_color_alloc_rgb(int nr, | ||
38 | int ng, | ||
39 | int nb, | ||
40 | xcb_connection_t *conn, | ||
41 | xcb_colormap_t cmap, | ||
42 | xcb_visualtype_t *v) | ||
43 | { | ||
44 | int r, g, b, i; | ||
45 | DATA8 *color_lut; | ||
46 | int sig_mask = 0; | ||
47 | int delt = 0; | ||
48 | |||
49 | for (i = 0; i < v->bits_per_rgb_value; i++) sig_mask |= (0x1 << i); | ||
50 | sig_mask <<= (16 - v->bits_per_rgb_value); | ||
51 | i = 0; | ||
52 | color_lut = malloc((nr) * (ng) * (nb)); | ||
53 | if (!color_lut) return NULL; | ||
54 | delt = 0x0101 * 3; | ||
55 | /* FIXME: remove the round-trip ? */ | ||
56 | for (r = 0; r < (nr); r++) | ||
57 | { | ||
58 | for (g = 0; g < (ng); g++) | ||
59 | { | ||
60 | for (b = 0; b < (nb); b++) | ||
61 | { | ||
62 | xcb_coloritem_t xcl; | ||
63 | xcb_coloritem_t xcl_in; | ||
64 | xcb_alloc_color_reply_t *rep; | ||
65 | int val; | ||
66 | int dr, dg, db; | ||
67 | |||
68 | val = (int)((((double)r) / ((nr) - 1)) * 255); | ||
69 | val = (val << 8) | val; | ||
70 | xcl.red = (uint16_t)(val); | ||
71 | val = (int)((((double)g) / ((ng) - 1)) * 255); | ||
72 | val = (val << 8) | val; | ||
73 | xcl.green = (uint16_t)(val); | ||
74 | val = (int)((((double)b) / ((nb) - 1)) * 255); | ||
75 | val = (val << 8) | val; | ||
76 | xcl.blue = (uint16_t)(val); | ||
77 | xcl_in = xcl; | ||
78 | rep = xcb_alloc_color_reply(conn, | ||
79 | xcb_alloc_color_unchecked(conn, | ||
80 | cmap, | ||
81 | xcl.red, | ||
82 | xcl.green, | ||
83 | xcl.blue), | ||
84 | 0); | ||
85 | dr = (int)xcl_in.red - (int)xcl.red; | ||
86 | if (dr < 0) dr = -dr; | ||
87 | dg = (int)xcl_in.green - (int)xcl.green; | ||
88 | if (dg < 0) dg = -dg; | ||
89 | db = (int)xcl_in.blue - (int)xcl.blue; | ||
90 | if (db < 0) db = -db; | ||
91 | /* | ||
92 | printf("ASK [%i]: %04x %04x %04x = %04x %04x %04x | dif = %04x / %04x\n", | ||
93 | ret, | ||
94 | xcl_in.red, xcl_in.green, xcl_in.blue, | ||
95 | xcl.red, xcl.green, xcl.blue, | ||
96 | (dr + dg +db), delt); | ||
97 | */ | ||
98 | |||
99 | /* TODO: XAllocColor tries to approach the color */ | ||
100 | /* in case the allocation fails */ | ||
101 | /* XCB does not that (i think). It should be done */ | ||
102 | /* So if rep == NULL, the other following tests */ | ||
103 | /* should be always satisfied */ | ||
104 | if ((!rep) || | ||
105 | ((dr + dg + db) > delt) | ||
106 | /* | ||
107 | ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || | ||
108 | ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || | ||
109 | ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask)) | ||
110 | */ | ||
111 | ) | ||
112 | { | ||
113 | uint32_t pixels[256]; | ||
114 | int j; | ||
115 | |||
116 | if (i > 0) | ||
117 | { | ||
118 | for (j = 0; j < i; j++) | ||
119 | pixels[j] = (uint32_t)color_lut[j]; | ||
120 | xcb_free_colors(conn, cmap, 0, i, pixels); | ||
121 | } | ||
122 | free(color_lut); | ||
123 | return NULL; | ||
124 | } | ||
125 | color_lut[i] = rep->pixel; | ||
126 | i++; | ||
127 | free(rep); | ||
128 | } | ||
129 | } | ||
130 | } | ||
131 | return color_lut; | ||
132 | } | ||
133 | |||
134 | static DATA8 * | ||
135 | x_color_alloc_gray(int ng, | ||
136 | xcb_connection_t *conn, | ||
137 | xcb_colormap_t cmap, | ||
138 | xcb_visualtype_t *v) | ||
139 | { | ||
140 | int g, i; | ||
141 | DATA8 *color_lut; | ||
142 | int sig_mask = 0; | ||
143 | |||
144 | for (i = 0; i < v->bits_per_rgb_value; i++) sig_mask |= (0x1 << i); | ||
145 | sig_mask <<= (16 - v->bits_per_rgb_value); | ||
146 | i = 0; | ||
147 | color_lut = malloc(ng); | ||
148 | if (!color_lut) return NULL; | ||
149 | /* FIXME: remove the round-trip ? */ | ||
150 | for (g = 0; g < (ng); g++) | ||
151 | { | ||
152 | xcb_coloritem_t xcl; | ||
153 | xcb_coloritem_t xcl_in; | ||
154 | int val; | ||
155 | xcb_alloc_color_reply_t *rep; | ||
156 | |||
157 | val = (int)((((double)g) / ((ng) - 1)) * 255); | ||
158 | val = (val << 8) | val; | ||
159 | xcl.red = (uint16_t)(val); | ||
160 | xcl.green = (uint16_t)(val); | ||
161 | xcl.blue = (uint16_t)(val); | ||
162 | xcl_in = xcl; | ||
163 | rep = xcb_alloc_color_reply(conn, | ||
164 | xcb_alloc_color_unchecked(conn, | ||
165 | cmap, | ||
166 | xcl.red, | ||
167 | xcl.green, | ||
168 | xcl.blue), | ||
169 | 0); | ||
170 | /* FIXME: XAllocColor tries to approach the color */ | ||
171 | /* in case the allocation fails */ | ||
172 | /* XCB does not that (i think). It should be done */ | ||
173 | /* So if rep == NULL, the other following tests */ | ||
174 | /* should be always satisfied */ | ||
175 | if ((!rep) || | ||
176 | ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || | ||
177 | ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || | ||
178 | ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask))) | ||
179 | { | ||
180 | uint32_t pixels[256]; | ||
181 | int j; | ||
182 | |||
183 | if (i > 0) | ||
184 | { | ||
185 | for (j = 0; j < i; j++) | ||
186 | pixels[j] = (uint32_t) color_lut[j]; | ||
187 | xcb_free_colors(conn, cmap, 0, i, pixels); | ||
188 | } | ||
189 | free(color_lut); | ||
190 | return NULL; | ||
191 | } | ||
192 | color_lut[i] = rep->pixel; | ||
193 | i++; | ||
194 | free(rep); | ||
195 | } | ||
196 | return color_lut; | ||
197 | } | ||
198 | |||
199 | static DATA8 * | ||
200 | x_color_alloc_rgb_332(xcb_connection_t *conn, | ||
201 | xcb_colormap_t cmap, | ||
202 | xcb_visualtype_t *v) | ||
203 | { | ||
204 | return x_color_alloc_rgb(8, 8, 4, conn, cmap, v); | ||
205 | } | ||
206 | |||
207 | static DATA8 * | ||
208 | x_color_alloc_rgb_666(xcb_connection_t *conn, | ||
209 | xcb_colormap_t cmap, | ||
210 | xcb_visualtype_t *v) | ||
211 | { | ||
212 | return x_color_alloc_rgb(6, 6, 6, conn, cmap, v); | ||
213 | } | ||
214 | |||
215 | static DATA8 * | ||
216 | x_color_alloc_rgb_232(xcb_connection_t *conn, | ||
217 | xcb_colormap_t cmap, | ||
218 | xcb_visualtype_t *v) | ||
219 | { | ||
220 | return x_color_alloc_rgb(4, 8, 4, conn, cmap, v); | ||
221 | } | ||
222 | |||
223 | static DATA8 * | ||
224 | x_color_alloc_rgb_222(xcb_connection_t *conn, | ||
225 | xcb_colormap_t cmap, | ||
226 | xcb_visualtype_t *v) | ||
227 | { | ||
228 | return x_color_alloc_rgb(4, 4, 4, conn, cmap, v); | ||
229 | } | ||
230 | |||
231 | static DATA8 * | ||
232 | x_color_alloc_rgb_221(xcb_connection_t *conn, | ||
233 | xcb_colormap_t cmap, | ||
234 | xcb_visualtype_t *v) | ||
235 | { | ||
236 | return x_color_alloc_rgb(4, 4, 2, conn, cmap, v); | ||
237 | } | ||
238 | |||
239 | static DATA8 * | ||
240 | x_color_alloc_rgb_121(xcb_connection_t *conn, | ||
241 | xcb_colormap_t cmap, | ||
242 | xcb_visualtype_t *v) | ||
243 | { | ||
244 | return x_color_alloc_rgb(2, 4, 2, conn, cmap, v); | ||
245 | } | ||
246 | |||
247 | static DATA8 * | ||
248 | x_color_alloc_rgb_111(xcb_connection_t *conn, | ||
249 | xcb_colormap_t cmap, | ||
250 | xcb_visualtype_t *v) | ||
251 | { | ||
252 | return x_color_alloc_rgb(2, 2, 2, conn, cmap, v); | ||
253 | } | ||
254 | |||
255 | static DATA8 * | ||
256 | x_color_alloc_gray_256(xcb_connection_t *conn, | ||
257 | xcb_colormap_t cmap, | ||
258 | xcb_visualtype_t *v) | ||
259 | { | ||
260 | return x_color_alloc_gray(256, conn, cmap, v); | ||
261 | } | ||
262 | |||
263 | static DATA8 * | ||
264 | x_color_alloc_gray_64(xcb_connection_t *conn, | ||
265 | xcb_colormap_t cmap, | ||
266 | xcb_visualtype_t *v) | ||
267 | { | ||
268 | return x_color_alloc_gray(64, conn, cmap, v); | ||
269 | } | ||
270 | |||
271 | static DATA8 * | ||
272 | x_color_alloc_gray_16(xcb_connection_t *conn, | ||
273 | xcb_colormap_t cmap, | ||
274 | xcb_visualtype_t *v) | ||
275 | { | ||
276 | return x_color_alloc_gray(32, conn, cmap, v); | ||
277 | } | ||
278 | |||
279 | static DATA8 * | ||
280 | x_color_alloc_gray_4(xcb_connection_t *conn, | ||
281 | xcb_colormap_t cmap, | ||
282 | xcb_visualtype_t *v) | ||
283 | { | ||
284 | return x_color_alloc_gray(16, conn, cmap, v); | ||
285 | } | ||
286 | |||
287 | static DATA8 * | ||
288 | x_color_alloc_mono(xcb_connection_t *conn, | ||
289 | xcb_colormap_t cmap, | ||
290 | xcb_visualtype_t *v) | ||
291 | { | ||
292 | return x_color_alloc_gray(2, conn, cmap, v); | ||
293 | } | ||
294 | |||
295 | void | ||
296 | evas_software_xcb_color_init(void) | ||
297 | { | ||
298 | static int initialised = 0; | ||
299 | |||
300 | if (initialised) return; | ||
301 | x_color_alloc[PAL_MODE_NONE] = NULL; | ||
302 | x_color_count[PAL_MODE_NONE] = 0; | ||
303 | |||
304 | x_color_alloc[PAL_MODE_MONO] = x_color_alloc_mono; | ||
305 | x_color_count[PAL_MODE_MONO] = 2; | ||
306 | |||
307 | x_color_alloc[PAL_MODE_GRAY4] = x_color_alloc_gray_4; | ||
308 | x_color_count[PAL_MODE_GRAY4] = 4; | ||
309 | |||
310 | x_color_alloc[PAL_MODE_GRAY16] = x_color_alloc_gray_16; | ||
311 | x_color_count[PAL_MODE_GRAY16] = 16; | ||
312 | |||
313 | x_color_alloc[PAL_MODE_GRAY64] = x_color_alloc_gray_64; | ||
314 | x_color_count[PAL_MODE_GRAY64] = 64; | ||
315 | |||
316 | x_color_alloc[PAL_MODE_GRAY256] = x_color_alloc_gray_256; | ||
317 | x_color_count[PAL_MODE_GRAY256] = 256; | ||
318 | |||
319 | x_color_alloc[PAL_MODE_RGB111] = x_color_alloc_rgb_111; | ||
320 | x_color_count[PAL_MODE_RGB111] = 2 * 2 * 2; | ||
321 | |||
322 | x_color_alloc[PAL_MODE_RGB121] = x_color_alloc_rgb_121; | ||
323 | x_color_count[PAL_MODE_RGB121] = 2 * 4 * 2; | ||
324 | |||
325 | x_color_alloc[PAL_MODE_RGB221] = x_color_alloc_rgb_221; | ||
326 | x_color_count[PAL_MODE_RGB221] = 4 * 4 * 2; | ||
327 | |||
328 | x_color_alloc[PAL_MODE_RGB222] = x_color_alloc_rgb_222; | ||
329 | x_color_count[PAL_MODE_RGB222] = 4 * 4 * 4; | ||
330 | |||
331 | x_color_alloc[PAL_MODE_RGB232] = x_color_alloc_rgb_232; | ||
332 | x_color_count[PAL_MODE_RGB232] = 4 * 8 * 4; | ||
333 | |||
334 | x_color_alloc[PAL_MODE_RGB666] = x_color_alloc_rgb_666; | ||
335 | x_color_count[PAL_MODE_RGB666] = 6 * 6 * 6; | ||
336 | |||
337 | x_color_alloc[PAL_MODE_RGB332] = x_color_alloc_rgb_332; | ||
338 | x_color_count[PAL_MODE_RGB332] = 8 * 8 * 4; | ||
339 | |||
340 | x_color_alloc[PAL_MODE_LAST] = NULL; | ||
341 | x_color_count[PAL_MODE_LAST] = 0; | ||
342 | initialised = 1; | ||
343 | } | ||
344 | |||
345 | Convert_Pal * | ||
346 | evas_software_xcb_color_allocate(xcb_connection_t *conn, | ||
347 | xcb_colormap_t cmap, | ||
348 | xcb_visualtype_t *vis, | ||
349 | Convert_Pal_Mode colors) | ||
350 | { | ||
351 | Convert_Pal_Priv *palpriv; | ||
352 | Convert_Pal *pal; | ||
353 | Convert_Pal_Mode c; | ||
354 | Eina_List *l; | ||
355 | |||
356 | /* printf("ALLOC cmap=%i vis=%p\n", cmap, vis);*/ | ||
357 | EINA_LIST_FOREACH(palettes, l, pal) | ||
358 | { | ||
359 | palpriv = pal->data; | ||
360 | if ((conn == palpriv->conn) && | ||
361 | (vis == palpriv->vis) && | ||
362 | (cmap == palpriv->cmap)) | ||
363 | { | ||
364 | pal->references++; | ||
365 | return pal; | ||
366 | } | ||
367 | } | ||
368 | pal = calloc(1, sizeof(struct _Convert_Pal)); | ||
369 | if (!pal) return NULL; | ||
370 | for (c = colors; c > PAL_MODE_NONE; c--) | ||
371 | { | ||
372 | if (x_color_alloc[c]) | ||
373 | { | ||
374 | /* printf("TRY PAL %i\n", c);*/ | ||
375 | pal->lookup = (x_color_alloc[c])(conn, cmap, vis); | ||
376 | if (pal->lookup) break; | ||
377 | } | ||
378 | } | ||
379 | pal->references = 1; | ||
380 | pal->colors = c; | ||
381 | pal->count = x_color_count[c]; | ||
382 | palpriv = calloc(1, sizeof(Convert_Pal_Priv)); | ||
383 | pal->data = palpriv; | ||
384 | if (!palpriv) | ||
385 | { | ||
386 | if (pal->lookup) free(pal->lookup); | ||
387 | free(pal); | ||
388 | return NULL; | ||
389 | } | ||
390 | palpriv->conn = conn; | ||
391 | palpriv->vis = vis; | ||
392 | palpriv->cmap = cmap; | ||
393 | if (pal->colors == PAL_MODE_NONE) | ||
394 | { | ||
395 | if (pal->lookup) free(pal->lookup); | ||
396 | free(pal); | ||
397 | return NULL; | ||
398 | } | ||
399 | palettes = eina_list_append(palettes, pal); | ||
400 | return pal; | ||
401 | } | ||
402 | |||
403 | void | ||
404 | evas_software_xcb_color_deallocate(xcb_connection_t *conn, | ||
405 | xcb_colormap_t cmap, | ||
406 | xcb_visualtype_t *vis __UNUSED__, | ||
407 | Convert_Pal *pal) | ||
408 | { | ||
409 | uint32_t pixels[256]; | ||
410 | int j; | ||
411 | |||
412 | pal->references--; | ||
413 | if (pal->references > 0) return; | ||
414 | if (pal->lookup) | ||
415 | { | ||
416 | for(j = 0; j < pal->count; j++) | ||
417 | pixels[j] = (uint32_t) pal->lookup[j]; | ||
418 | xcb_free_colors(conn, cmap, 0, pal->count, pixels); | ||
419 | free(pal->lookup); | ||
420 | } | ||
421 | free(pal->data); | ||
422 | palettes = eina_list_remove(palettes, pal); | ||
423 | free(pal); | ||
424 | } | ||
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 @@ | |||
1 | #ifndef EVAS_XCB_COLOR_H | ||
2 | # define EVAS_XCB_COLOR_H | ||
3 | |||
4 | # include "evas_engine.h" | ||
5 | |||
6 | void evas_software_xcb_color_init(void); | ||
7 | Convert_Pal *evas_software_xcb_color_allocate(xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *vis, Convert_Pal_Mode colors); | ||
8 | void evas_software_xcb_color_deallocate(xcb_connection_t *conn, xcb_colormap_t cmap, xcb_visualtype_t *vis, Convert_Pal *pal); | ||
9 | |||
10 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_engine.h" | ||
3 | |||
4 | void | ||
5 | evas_software_xcb_init(void) | ||
6 | { | ||
7 | |||
8 | } | ||
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 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_macros.h" | ||
3 | #include "evas_xcb_outbuf.h" | ||
4 | #include "evas_xcb_buffer.h" | ||
5 | #include "evas_xcb_color.h" | ||
6 | #include <pixman.h> | ||
7 | |||
8 | /* local structures */ | ||
9 | typedef struct _Outbuf_Region Outbuf_Region; | ||
10 | struct _Outbuf_Region | ||
11 | { | ||
12 | Xcb_Output_Buffer *xcbob, *mask; | ||
13 | int x, y, w, h; | ||
14 | }; | ||
15 | |||
16 | /* local function prototypes */ | ||
17 | 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); | ||
18 | static void _unfind_xcbob(Xcb_Output_Buffer *xcbob, Eina_Bool sync); | ||
19 | static void _clear_xcbob(Eina_Bool sync); | ||
20 | static void _xcbob_sync(xcb_connection_t *conn); | ||
21 | |||
22 | /* local variables */ | ||
23 | static Eina_List *_shmpool = NULL; | ||
24 | static int _shmsize = 0; | ||
25 | static int _shmlimit = (10 * 1024 * 1024); | ||
26 | static const unsigned int _shmcountlimit = 32; | ||
27 | |||
28 | #ifdef EVAS_FRAME_QUEUING | ||
29 | static LK(lock_shmpool); | ||
30 | # define SHMPOOL_LOCK() LKL(lock_shmpool); | ||
31 | # define SHMPOOL_UNLOCK() LKU(lock_shmpool); | ||
32 | #else | ||
33 | # define SHMPOOL_LOCK() | ||
34 | # define SHMPOOL_UNLOCK() | ||
35 | #endif | ||
36 | |||
37 | void | ||
38 | evas_software_xcb_outbuf_init(void) | ||
39 | { | ||
40 | #ifdef EVAS_FRAME_QUEUING | ||
41 | LKI(lock_shmpool); | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | void | ||
46 | evas_software_xcb_outbuf_free(Outbuf *buf) | ||
47 | { | ||
48 | #ifdef EVAS_FRAME_QUEUING | ||
49 | LKL(buf->priv.lock); | ||
50 | #endif | ||
51 | while (buf->priv.pending_writes) | ||
52 | { | ||
53 | RGBA_Image *im = NULL; | ||
54 | Outbuf_Region *obr = NULL; | ||
55 | |||
56 | im = buf->priv.pending_writes->data; | ||
57 | buf->priv.pending_writes = | ||
58 | eina_list_remove_list(buf->priv.pending_writes, | ||
59 | buf->priv.pending_writes); | ||
60 | obr = im->extended_info; | ||
61 | evas_cache_image_drop(&im->cache_entry); | ||
62 | if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); | ||
63 | if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); | ||
64 | free(obr); | ||
65 | } | ||
66 | #ifdef EVAS_FRAME_QUEUING | ||
67 | LKU(buf->priv.lock); | ||
68 | #endif | ||
69 | evas_software_xcb_outbuf_idle_flush(buf); | ||
70 | evas_software_xcb_outbuf_flush(buf); | ||
71 | if (buf->priv.x11.xcb.gc) | ||
72 | xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc); | ||
73 | if (buf->priv.x11.xcb.gcm) | ||
74 | xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gcm); | ||
75 | if (buf->priv.pal) | ||
76 | evas_software_xcb_color_deallocate(buf->priv.x11.xcb.conn, | ||
77 | buf->priv.x11.xcb.cmap, | ||
78 | buf->priv.x11.xcb.visual, | ||
79 | buf->priv.pal); | ||
80 | #ifdef EVAS_FRAME_QUEUING | ||
81 | LKD(buf->priv.lock); | ||
82 | #endif | ||
83 | free(buf); | ||
84 | _clear_xcbob(EINA_FALSE); | ||
85 | } | ||
86 | |||
87 | Outbuf * | ||
88 | 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) | ||
89 | { | ||
90 | Outbuf *buf = NULL; | ||
91 | Gfx_Func_Convert func_conv= NULL; | ||
92 | const xcb_setup_t *setup; | ||
93 | |||
94 | if (!(buf = calloc(1, sizeof(Outbuf)))) | ||
95 | return NULL; | ||
96 | |||
97 | setup = xcb_get_setup(conn); | ||
98 | |||
99 | buf->w = w; | ||
100 | buf->h = h; | ||
101 | buf->depth = depth; | ||
102 | buf->rot = rot; | ||
103 | buf->priv.x11.xcb.conn = conn; | ||
104 | buf->priv.x11.xcb.screen = screen; | ||
105 | buf->priv.x11.xcb.visual = vis; | ||
106 | buf->priv.x11.xcb.cmap = cmap; | ||
107 | buf->priv.x11.xcb.depth = xdepth; | ||
108 | buf->priv.mask_dither = shape_dither; | ||
109 | buf->priv.destination_alpha = alpha; | ||
110 | buf->priv.x11.xcb.shm = evas_software_xcb_can_do_shm(conn, screen); | ||
111 | |||
112 | #ifdef WORDS_BIGENDIAN | ||
113 | if (setup->image_byte_order == XCB_IMAGE_ORDER_LSB_FIRST) | ||
114 | buf->priv.x11.xcb.swap = EINA_TRUE; | ||
115 | #else | ||
116 | if (setup->image_byte_order == XCB_IMAGE_ORDER_MSB_FIRST) | ||
117 | buf->priv.x11.xcb.swap = EINA_TRUE; | ||
118 | #endif | ||
119 | if (setup->bitmap_format_bit_order == XCB_IMAGE_ORDER_MSB_FIRST) | ||
120 | buf->priv.x11.xcb.bit_swap = EINA_TRUE; | ||
121 | |||
122 | if (((vis->_class == XCB_VISUAL_CLASS_TRUE_COLOR) || | ||
123 | (vis->_class == XCB_VISUAL_CLASS_DIRECT_COLOR)) && (xdepth > 8)) | ||
124 | { | ||
125 | buf->priv.mask.r = (DATA32)vis->red_mask; | ||
126 | buf->priv.mask.g = (DATA32)vis->green_mask; | ||
127 | buf->priv.mask.b = (DATA32)vis->blue_mask; | ||
128 | if (buf->priv.x11.xcb.swap) | ||
129 | { | ||
130 | SWAP32(buf->priv.mask.r); | ||
131 | SWAP32(buf->priv.mask.g); | ||
132 | SWAP32(buf->priv.mask.b); | ||
133 | } | ||
134 | } | ||
135 | else if ((vis->_class == XCB_VISUAL_CLASS_PSEUDO_COLOR) || | ||
136 | (vis->_class == XCB_VISUAL_CLASS_STATIC_COLOR) || | ||
137 | (vis->_class == XCB_VISUAL_CLASS_GRAY_SCALE) || | ||
138 | (vis->_class == XCB_VISUAL_CLASS_STATIC_GRAY) || | ||
139 | (xdepth <= 8)) | ||
140 | { | ||
141 | Convert_Pal_Mode pm = PAL_MODE_RGB332; | ||
142 | |||
143 | if ((vis->_class == XCB_VISUAL_CLASS_GRAY_SCALE) || | ||
144 | (vis->_class == XCB_VISUAL_CLASS_STATIC_GRAY)) | ||
145 | grayscale = EINA_TRUE; | ||
146 | if (grayscale) | ||
147 | { | ||
148 | if (max_colors >= 256) | ||
149 | pm = PAL_MODE_GRAY256; | ||
150 | else if (max_colors >= 64) | ||
151 | pm = PAL_MODE_GRAY64; | ||
152 | else if (max_colors >= 16) | ||
153 | pm = PAL_MODE_GRAY16; | ||
154 | else if (max_colors >= 4) | ||
155 | pm = PAL_MODE_GRAY4; | ||
156 | else | ||
157 | pm = PAL_MODE_MONO; | ||
158 | } | ||
159 | else | ||
160 | { | ||
161 | if (max_colors >= 256) | ||
162 | pm = PAL_MODE_RGB332; | ||
163 | else if (max_colors >= 216) | ||
164 | pm = PAL_MODE_RGB666; | ||
165 | else if (max_colors >= 128) | ||
166 | pm = PAL_MODE_RGB232; | ||
167 | else if (max_colors >= 64) | ||
168 | pm = PAL_MODE_RGB222; | ||
169 | else if (max_colors >= 32) | ||
170 | pm = PAL_MODE_RGB221; | ||
171 | else if (max_colors >= 16) | ||
172 | pm = PAL_MODE_RGB121; | ||
173 | else if (max_colors >= 8) | ||
174 | pm = PAL_MODE_RGB111; | ||
175 | else if (max_colors >= 4) | ||
176 | pm = PAL_MODE_GRAY4; | ||
177 | else | ||
178 | pm = PAL_MODE_MONO; | ||
179 | } | ||
180 | /* FIXME: Only allocate once per display & colormap */ | ||
181 | buf->priv.pal = | ||
182 | evas_software_xcb_color_allocate(conn, cmap, vis, pm); | ||
183 | if (!buf->priv.pal) | ||
184 | { | ||
185 | free(buf); | ||
186 | return NULL; | ||
187 | } | ||
188 | } | ||
189 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
190 | { | ||
191 | w = buf->w; | ||
192 | h = buf->h; | ||
193 | } | ||
194 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
195 | { | ||
196 | w = buf->h; | ||
197 | h = buf->w; | ||
198 | } | ||
199 | |||
200 | if (buf->priv.pal) | ||
201 | { | ||
202 | func_conv = | ||
203 | evas_common_convert_func_get(0, w, h, xdepth, | ||
204 | buf->priv.mask.r, | ||
205 | buf->priv.mask.g, | ||
206 | buf->priv.mask.b, | ||
207 | buf->priv.pal->colors, buf->rot); | ||
208 | } | ||
209 | else | ||
210 | { | ||
211 | func_conv = | ||
212 | evas_common_convert_func_get(0, w, h, xdepth, | ||
213 | buf->priv.mask.r, | ||
214 | buf->priv.mask.g, | ||
215 | buf->priv.mask.b, | ||
216 | PAL_MODE_NONE, buf->rot); | ||
217 | } | ||
218 | if (!func_conv) | ||
219 | { | ||
220 | ERR("XCB Engine" | ||
221 | " {" | ||
222 | " At depth %i:" | ||
223 | " RGB format mask: %08x, %08x, %08x" | ||
224 | " Palette mode: %i" | ||
225 | " Not supported by any compiled in converters!" | ||
226 | " }", buf->priv.x11.xcb.depth, buf->priv.mask.r, | ||
227 | buf->priv.mask.g, buf->priv.mask.b, | ||
228 | buf->priv.pal ? (int)buf->priv.pal->colors : -1); | ||
229 | } | ||
230 | |||
231 | evas_software_xcb_outbuf_drawable_set(buf, draw); | ||
232 | evas_software_xcb_outbuf_mask_set(buf, mask); | ||
233 | |||
234 | #ifdef EVAS_FRAME_QUEUING | ||
235 | LKI(buf->priv.lock); | ||
236 | #endif | ||
237 | |||
238 | return buf; | ||
239 | } | ||
240 | |||
241 | RGBA_Image * | ||
242 | 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) | ||
243 | { | ||
244 | RGBA_Image *im = NULL; | ||
245 | Outbuf_Region *obr = NULL; | ||
246 | Eina_Bool use_shm = EINA_TRUE; | ||
247 | Eina_Bool alpha = EINA_FALSE; | ||
248 | int bpl = 0; | ||
249 | |||
250 | if ((buf->onebuf) && (buf->priv.x11.xcb.shm)) | ||
251 | { | ||
252 | Eina_Rectangle *rect; | ||
253 | |||
254 | RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h); | ||
255 | |||
256 | if (!(obr = calloc(1, sizeof(Outbuf_Region)))) | ||
257 | return NULL; | ||
258 | |||
259 | if (!(rect = eina_rectangle_new(x, y, w, h))) | ||
260 | { | ||
261 | free(obr); | ||
262 | return NULL; | ||
263 | } | ||
264 | |||
265 | buf->priv.onebuf_regions = | ||
266 | eina_list_append(buf->priv.onebuf_regions, rect); | ||
267 | if (buf->priv.onebuf) | ||
268 | { | ||
269 | if (cx) *cx = x; | ||
270 | if (cy) *cy = y; | ||
271 | if (cw) *cw = w; | ||
272 | if (ch) *ch = h; | ||
273 | if (!buf->priv.synced) | ||
274 | { | ||
275 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
276 | buf->priv.synced = EINA_TRUE; | ||
277 | } | ||
278 | return buf->priv.onebuf; | ||
279 | } | ||
280 | obr->x = 0; | ||
281 | obr->y = 0; | ||
282 | obr->w = buf->w; | ||
283 | obr->h = buf->h; | ||
284 | if (cx) *cx = x; | ||
285 | if (cy) *cy = y; | ||
286 | if (cw) *cw = w; | ||
287 | if (ch) *ch = h; | ||
288 | |||
289 | alpha = ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha)); | ||
290 | use_shm = buf->priv.x11.xcb.shm; | ||
291 | |||
292 | if ((buf->rot == 0) && (buf->priv.mask.r == 0xff0000) && | ||
293 | (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff)) | ||
294 | { | ||
295 | obr->xcbob = | ||
296 | evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, | ||
297 | buf->priv.x11.xcb.visual, | ||
298 | buf->priv.x11.xcb.depth, | ||
299 | buf->w, buf->h, use_shm, | ||
300 | NULL); | ||
301 | if (!obr->xcbob) | ||
302 | { | ||
303 | free(obr); | ||
304 | return NULL; | ||
305 | } | ||
306 | im = | ||
307 | (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), | ||
308 | buf->w, buf->h, | ||
309 | (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl), | ||
310 | alpha, EVAS_COLORSPACE_ARGB8888); | ||
311 | if (!im) | ||
312 | { | ||
313 | evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE); | ||
314 | free(obr); | ||
315 | return NULL; | ||
316 | } | ||
317 | im->extended_info = obr; | ||
318 | if (buf->priv.x11.xcb.mask) | ||
319 | { | ||
320 | obr->mask = | ||
321 | evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, | ||
322 | buf->priv.x11.xcb.visual, | ||
323 | 1, buf->w, buf->h, | ||
324 | use_shm, NULL); | ||
325 | } | ||
326 | } | ||
327 | else | ||
328 | { | ||
329 | int bw = 0, bh = 0; | ||
330 | |||
331 | im = | ||
332 | (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
333 | if (!im) | ||
334 | { | ||
335 | free(obr); | ||
336 | return NULL; | ||
337 | } | ||
338 | im->cache_entry.flags.alpha |= (alpha ? 1 : 0); | ||
339 | evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h); | ||
340 | im->extended_info = obr; | ||
341 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
342 | { | ||
343 | bw = buf->w; | ||
344 | bh = buf->h; | ||
345 | } | ||
346 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
347 | { | ||
348 | bw = buf->h; | ||
349 | bh = buf->w; | ||
350 | } | ||
351 | obr->xcbob = | ||
352 | evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, | ||
353 | buf->priv.x11.xcb.visual, | ||
354 | buf->priv.x11.xcb.depth, | ||
355 | bw, bh, use_shm, NULL); | ||
356 | if (!obr->xcbob) | ||
357 | { | ||
358 | evas_cache_image_drop(&im->cache_entry); | ||
359 | free(obr); | ||
360 | return NULL; | ||
361 | } | ||
362 | if (buf->priv.x11.xcb.mask) | ||
363 | { | ||
364 | obr->mask = | ||
365 | evas_software_xcb_output_buffer_new(buf->priv.x11.xcb.conn, | ||
366 | buf->priv.x11.xcb.visual, | ||
367 | 1, bw, bh, use_shm, | ||
368 | NULL); | ||
369 | } | ||
370 | } | ||
371 | /* FIXME: We should be able to remove this memset. */ | ||
372 | if ((alpha) && (im->image.data)) | ||
373 | { | ||
374 | /* FIXME: Faster memset */ | ||
375 | // memset(im->image.data, 0, (w * h * sizeof(DATA32))); | ||
376 | } | ||
377 | buf->priv.onebuf = im; | ||
378 | return im; | ||
379 | } | ||
380 | |||
381 | if (!(obr = calloc(1, sizeof(Outbuf_Region)))) | ||
382 | return NULL; | ||
383 | |||
384 | obr->x = x; | ||
385 | obr->y = y; | ||
386 | obr->w = w; | ||
387 | obr->h = h; | ||
388 | if (cx) *cx = 0; | ||
389 | if (cy) *cy = 0; | ||
390 | if (cw) *cw = w; | ||
391 | if (ch) *ch = h; | ||
392 | |||
393 | use_shm = buf->priv.x11.xcb.shm; | ||
394 | alpha = ((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha)); | ||
395 | if ((buf->rot == 0) && (buf->priv.mask.r == 0xff0000) && | ||
396 | (buf->priv.mask.g == 0x00ff00) && (buf->priv.mask.b == 0x0000ff)) | ||
397 | { | ||
398 | obr->xcbob = | ||
399 | _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, | ||
400 | buf->priv.x11.xcb.depth, w, h, use_shm, NULL); | ||
401 | if (!obr->xcbob) | ||
402 | { | ||
403 | free(obr); | ||
404 | return NULL; | ||
405 | } | ||
406 | im = | ||
407 | (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), | ||
408 | w, h, | ||
409 | (DATA32 *)evas_software_xcb_output_buffer_data(obr->xcbob, &bpl), | ||
410 | alpha, EVAS_COLORSPACE_ARGB8888); | ||
411 | if (!im) | ||
412 | { | ||
413 | _unfind_xcbob(obr->xcbob, EINA_FALSE); | ||
414 | free(obr); | ||
415 | return NULL; | ||
416 | } | ||
417 | im->extended_info = obr; | ||
418 | if (buf->priv.x11.xcb.mask) | ||
419 | { | ||
420 | obr->mask = | ||
421 | _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, | ||
422 | 1, w, h, use_shm, NULL); | ||
423 | } | ||
424 | } | ||
425 | else | ||
426 | { | ||
427 | int bw = 0, bh = 0; | ||
428 | |||
429 | im = | ||
430 | (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
431 | if (!im) | ||
432 | { | ||
433 | free(obr); | ||
434 | return NULL; | ||
435 | } | ||
436 | im->cache_entry.flags.alpha |= (alpha ? 1 : 0); | ||
437 | evas_cache_image_surface_alloc(&im->cache_entry, w, h); | ||
438 | im->extended_info = obr; | ||
439 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
440 | { | ||
441 | bw = w; | ||
442 | bh = h; | ||
443 | } | ||
444 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
445 | { | ||
446 | bw = h; | ||
447 | bh = w; | ||
448 | } | ||
449 | obr->xcbob = | ||
450 | _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, | ||
451 | buf->priv.x11.xcb.depth, bw, bh, use_shm, NULL); | ||
452 | if (!obr->xcbob) | ||
453 | { | ||
454 | evas_cache_image_drop(&im->cache_entry); | ||
455 | free(obr); | ||
456 | return NULL; | ||
457 | } | ||
458 | if (buf->priv.x11.xcb.mask) | ||
459 | { | ||
460 | obr->mask = | ||
461 | _find_xcbob(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.visual, 1, | ||
462 | bw, bh, use_shm, NULL); | ||
463 | } | ||
464 | } | ||
465 | /* FIXME: We should be able to remove this memset. */ | ||
466 | if (((buf->priv.x11.xcb.mask) || (buf->priv.destination_alpha)) && | ||
467 | (im->image.data)) | ||
468 | { | ||
469 | /* FIXME: Faster memset */ | ||
470 | // memset(im->image.data, 0, (w * h * sizeof(DATA32))); | ||
471 | } | ||
472 | |||
473 | #ifdef EVAS_FRAME_QUEUING | ||
474 | if (!evas_common_frameq_enabled()) | ||
475 | #endif | ||
476 | buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im); | ||
477 | |||
478 | return im; | ||
479 | } | ||
480 | |||
481 | void | ||
482 | evas_software_xcb_outbuf_free_region_for_update(Outbuf *buf __UNUSED__, RGBA_Image *update __UNUSED__) | ||
483 | { | ||
484 | /* NOOP: Cleaned up on flush */ | ||
485 | } | ||
486 | |||
487 | void | ||
488 | evas_software_xcb_outbuf_flush(Outbuf *buf) | ||
489 | { | ||
490 | Eina_List *l = NULL; | ||
491 | RGBA_Image *im = NULL; | ||
492 | Outbuf_Region *obr = NULL; | ||
493 | |||
494 | if ((buf->priv.onebuf) && (buf->priv.onebuf_regions)) | ||
495 | { | ||
496 | pixman_region16_t tmpr; | ||
497 | |||
498 | im = buf->priv.onebuf; | ||
499 | obr = im->extended_info; | ||
500 | pixman_region_init(&tmpr); | ||
501 | while (buf->priv.onebuf_regions) | ||
502 | { | ||
503 | Eina_Rectangle *rect, xr = { 0, 0, 0, 0 }; | ||
504 | |||
505 | rect = buf->priv.onebuf_regions->data; | ||
506 | buf->priv.onebuf_regions = | ||
507 | eina_list_remove_list(buf->priv.onebuf_regions, | ||
508 | buf->priv.onebuf_regions); | ||
509 | if (buf->rot == 0) | ||
510 | { | ||
511 | xr.x = rect->x; | ||
512 | xr.y = rect->y; | ||
513 | xr.w = rect->w; | ||
514 | xr.h = rect->h; | ||
515 | } | ||
516 | else if (buf->rot == 90) | ||
517 | { | ||
518 | xr.x = rect->y; | ||
519 | xr.y = buf->w - rect->x - rect->w; | ||
520 | xr.w = rect->h; | ||
521 | xr.h = rect->w; | ||
522 | } | ||
523 | else if (buf->rot == 180) | ||
524 | { | ||
525 | xr.x = buf->w - rect->x - rect->w; | ||
526 | xr.y = buf->h - rect->y - rect->h; | ||
527 | xr.w = rect->w; | ||
528 | xr.h = rect->h; | ||
529 | } | ||
530 | else if (buf->rot == 270) | ||
531 | { | ||
532 | xr.x = buf->h - rect->y - rect->h; | ||
533 | xr.y = rect->x; | ||
534 | xr.w = rect->h; | ||
535 | xr.h = rect->w; | ||
536 | } | ||
537 | pixman_region_union_rect(&tmpr, &tmpr, xr.x, xr.y, xr.w, xr.h); | ||
538 | if (buf->priv.debug) | ||
539 | evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win, | ||
540 | xr.x, xr.y, xr.w, xr.h); | ||
541 | eina_rectangle_free(rect); | ||
542 | } | ||
543 | xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, | ||
544 | XCB_CLIP_ORDERING_YX_BANDED, | ||
545 | buf->priv.x11.xcb.gc, 0, 0, | ||
546 | pixman_region_n_rects(&tmpr), | ||
547 | (const xcb_rectangle_t *)pixman_region_rectangles(&tmpr, NULL)); | ||
548 | if (obr->xcbob) | ||
549 | evas_software_xcb_output_buffer_paste(obr->xcbob, | ||
550 | buf->priv.x11.xcb.win, | ||
551 | buf->priv.x11.xcb.gc, 0, 0, 0); | ||
552 | if (obr->mask) | ||
553 | { | ||
554 | xcb_set_clip_rectangles(buf->priv.x11.xcb.conn, | ||
555 | XCB_CLIP_ORDERING_YX_BANDED, | ||
556 | buf->priv.x11.xcb.gcm, 0, 0, | ||
557 | pixman_region_n_rects(&tmpr), | ||
558 | (const xcb_rectangle_t *)pixman_region_rectangles(&tmpr, NULL)); | ||
559 | evas_software_xcb_output_buffer_paste(obr->mask, | ||
560 | buf->priv.x11.xcb.mask, | ||
561 | buf->priv.x11.xcb.gcm, | ||
562 | 0, 0, 0); | ||
563 | } | ||
564 | pixman_region_fini(&tmpr); | ||
565 | buf->priv.synced = EINA_FALSE; | ||
566 | } | ||
567 | else | ||
568 | { | ||
569 | #if 1 | ||
570 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
571 | EINA_LIST_FOREACH(buf->priv.pending_writes, l, im) | ||
572 | { | ||
573 | obr = im->extended_info; | ||
574 | if (buf->priv.debug) | ||
575 | evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win, | ||
576 | obr->x, obr->y, obr->w, obr->h); | ||
577 | if (obr->xcbob) | ||
578 | evas_software_xcb_output_buffer_paste(obr->xcbob, | ||
579 | buf->priv.x11.xcb.win, | ||
580 | buf->priv.x11.xcb.gc, | ||
581 | obr->x, obr->y, 0); | ||
582 | if (obr->mask) | ||
583 | evas_software_xcb_output_buffer_paste(obr->mask, | ||
584 | buf->priv.x11.xcb.mask, | ||
585 | buf->priv.x11.xcb.gcm, | ||
586 | obr->x, obr->y, 0); | ||
587 | } | ||
588 | # ifdef EVAS_FRAME_QUEUING | ||
589 | LKL(buf->priv.lock); | ||
590 | # endif | ||
591 | while (buf->priv.prev_pending_writes) | ||
592 | { | ||
593 | im = buf->priv.prev_pending_writes->data; | ||
594 | buf->priv.prev_pending_writes = | ||
595 | eina_list_remove_list(buf->priv.prev_pending_writes, | ||
596 | buf->priv.prev_pending_writes); | ||
597 | obr = im->extended_info; | ||
598 | evas_cache_image_drop(&im->cache_entry); | ||
599 | if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); | ||
600 | if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); | ||
601 | free(obr); | ||
602 | } | ||
603 | buf->priv.prev_pending_writes = buf->priv.pending_writes; | ||
604 | # ifdef EVAS_FRAME_QUEUING | ||
605 | LKU(buf->priv.lock); | ||
606 | # endif | ||
607 | buf->priv.pending_writes = NULL; | ||
608 | xcb_flush(buf->priv.x11.xcb.conn); | ||
609 | #else | ||
610 | /* FIXME: Async Push Disabled */ | ||
611 | |||
612 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
613 | while (buf->priv.pending_writes) | ||
614 | { | ||
615 | im = eina_list_data_get(buf->priv.pending_writes); | ||
616 | buf->priv.pending_writes = | ||
617 | eina_list_remove_list(buf->priv.pending_writes, | ||
618 | buf->priv.pending_writes); | ||
619 | obr = im->extended_info; | ||
620 | evas_cache_image_drop(&im->cache_entry); | ||
621 | if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); | ||
622 | if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); | ||
623 | free(obr); | ||
624 | evas_cache_image_drop(&im->cache_entry); | ||
625 | } | ||
626 | #endif | ||
627 | } | ||
628 | evas_common_cpu_end_opt(); | ||
629 | } | ||
630 | |||
631 | void | ||
632 | evas_software_xcb_outbuf_idle_flush(Outbuf *buf) | ||
633 | { | ||
634 | if (buf->priv.onebuf) | ||
635 | { | ||
636 | RGBA_Image *im; | ||
637 | Outbuf_Region *obr; | ||
638 | |||
639 | im = buf->priv.onebuf; | ||
640 | buf->priv.onebuf = NULL; | ||
641 | obr = im->extended_info; | ||
642 | if (obr->xcbob) | ||
643 | evas_software_xcb_output_buffer_free(obr->xcbob, EINA_FALSE); | ||
644 | if (obr->mask) | ||
645 | evas_software_xcb_output_buffer_free(obr->mask, EINA_FALSE); | ||
646 | free(obr); | ||
647 | evas_cache_image_drop(&im->cache_entry); | ||
648 | } | ||
649 | else | ||
650 | { | ||
651 | #ifdef EVAS_FRAME_QUEUING | ||
652 | LKL(buf->priv.lock); | ||
653 | #endif | ||
654 | if (buf->priv.prev_pending_writes) | ||
655 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
656 | while (buf->priv.prev_pending_writes) | ||
657 | { | ||
658 | RGBA_Image *im; | ||
659 | Outbuf_Region *obr; | ||
660 | |||
661 | im = buf->priv.prev_pending_writes->data; | ||
662 | buf->priv.prev_pending_writes = | ||
663 | eina_list_remove_list(buf->priv.prev_pending_writes, | ||
664 | buf->priv.prev_pending_writes); | ||
665 | obr = im->extended_info; | ||
666 | evas_cache_image_drop(&im->cache_entry); | ||
667 | if (obr->xcbob) _unfind_xcbob(obr->xcbob, EINA_FALSE); | ||
668 | if (obr->mask) _unfind_xcbob(obr->mask, EINA_FALSE); | ||
669 | free(obr); | ||
670 | } | ||
671 | #ifdef EVAS_FRAME_QUEUING | ||
672 | LKU(buf->priv.lock); | ||
673 | #endif | ||
674 | _clear_xcbob(EINA_FALSE); | ||
675 | } | ||
676 | } | ||
677 | |||
678 | void | ||
679 | evas_software_xcb_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) | ||
680 | { | ||
681 | Gfx_Func_Convert func_conv = NULL; | ||
682 | Outbuf_Region *obr = NULL; | ||
683 | DATA32 *src_data = NULL; | ||
684 | unsigned char *data = NULL; | ||
685 | int bpl = 0, yy = 0; | ||
686 | int bw = 0, bh = 0; | ||
687 | |||
688 | obr = update->extended_info; | ||
689 | if (!obr->xcbob) return; | ||
690 | |||
691 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
692 | { | ||
693 | bw = w; | ||
694 | bh = h; | ||
695 | } | ||
696 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
697 | { | ||
698 | bw = h; | ||
699 | bh = w; | ||
700 | } | ||
701 | if (buf->priv.pal) | ||
702 | { | ||
703 | func_conv = | ||
704 | evas_common_convert_func_get(0, bw, bh, buf->depth, buf->priv.mask.r, | ||
705 | buf->priv.mask.g, buf->priv.mask.b, | ||
706 | buf->priv.pal->colors, buf->rot); | ||
707 | } | ||
708 | else | ||
709 | { | ||
710 | func_conv = | ||
711 | evas_common_convert_func_get(0, bw, bh, buf->depth, buf->priv.mask.r, | ||
712 | buf->priv.mask.g, buf->priv.mask.b, | ||
713 | PAL_MODE_NONE, buf->rot); | ||
714 | } | ||
715 | if (!func_conv) return; | ||
716 | |||
717 | if (!(data = evas_software_xcb_output_buffer_data(obr->xcbob, &bpl))) | ||
718 | return; | ||
719 | if (!(src_data = update->image.data)) return; | ||
720 | if (buf->rot == 0) | ||
721 | { | ||
722 | obr->x = x; | ||
723 | obr->y = y; | ||
724 | obr->w = w; | ||
725 | obr->h = h; | ||
726 | } | ||
727 | else if (buf->rot == 90) | ||
728 | { | ||
729 | obr->x = y; | ||
730 | obr->y = (buf->w - x - w); | ||
731 | obr->w = h; | ||
732 | obr->h = w; | ||
733 | } | ||
734 | else if (buf->rot == 180) | ||
735 | { | ||
736 | obr->x = (buf->w - x - w); | ||
737 | obr->y = (buf->h - y - h); | ||
738 | obr->w = w; | ||
739 | obr->h = h; | ||
740 | } | ||
741 | else if (buf->rot == 270) | ||
742 | { | ||
743 | obr->x = (buf->h - y - h); | ||
744 | obr->y = x; | ||
745 | obr->w = h; | ||
746 | obr->h = w; | ||
747 | } | ||
748 | if (buf->onebuf) | ||
749 | { | ||
750 | src_data += x + (y * update->cache_entry.w); | ||
751 | data += (bpl * obr->y) + (obr->x * (buf->depth / 8)); | ||
752 | } | ||
753 | if (data != (unsigned char *)src_data) | ||
754 | { | ||
755 | if (buf->priv.pal) | ||
756 | func_conv(src_data, data, update->cache_entry.w - w, | ||
757 | (bpl / (buf->depth / 8)) - obr->w, | ||
758 | obr->w, obr->h, x, y, buf->priv.pal->lookup); | ||
759 | else | ||
760 | func_conv(src_data, data, update->cache_entry.w - w, | ||
761 | (bpl / (buf->depth / 8)) - obr->w, | ||
762 | obr->w, obr->h, x, y, NULL); | ||
763 | } | ||
764 | #if 1 | ||
765 | #else | ||
766 | /* Async Push */ | ||
767 | if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) | ||
768 | { | ||
769 | if (buf->priv.debug) | ||
770 | evas_software_xcb_outbuf_debug_show(buf, buf->priv.x11.xcb.win, | ||
771 | obr->x, obr->y, obr->w, obr->h); | ||
772 | if (obr->xcbob) | ||
773 | evas_software_xcb_output_buffer_paste(obr->xcbob, | ||
774 | buf->priv.x11.xcb.win, | ||
775 | buf->priv.x11.xcb.gc, | ||
776 | obr->x, obr->y, 0); | ||
777 | } | ||
778 | #endif | ||
779 | if (obr->mask) | ||
780 | { | ||
781 | if (buf->rot == 0) | ||
782 | { | ||
783 | for (yy = 0; yy < obr->h; yy++) | ||
784 | evas_software_xcb_write_mask_line(buf, obr->mask, | ||
785 | src_data + (yy * obr->w), | ||
786 | obr->w, yy); | ||
787 | } | ||
788 | else if (buf->rot == 90) | ||
789 | { | ||
790 | for (yy = 0; yy < obr->h; yy++) | ||
791 | evas_software_xcb_write_mask_line_vert(buf, obr->mask, | ||
792 | src_data + yy, | ||
793 | h, (obr->h - yy - 1), w); | ||
794 | } | ||
795 | else if (buf->rot == 180) | ||
796 | { | ||
797 | for (yy = 0; yy < obr->h; yy++) | ||
798 | evas_software_xcb_write_mask_line_rev(buf, obr->mask, | ||
799 | src_data + (yy * obr->w), | ||
800 | obr->w, (obr->h - yy - 1)); | ||
801 | } | ||
802 | else if (buf->rot == 270) | ||
803 | { | ||
804 | for (yy = 0; yy < obr->h; yy++) | ||
805 | evas_software_xcb_write_mask_line_vert_rev(buf, obr->mask, | ||
806 | src_data + yy, | ||
807 | h, yy, w); | ||
808 | } | ||
809 | #if 1 | ||
810 | #else | ||
811 | /* Async Push */ | ||
812 | if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) | ||
813 | evas_software_xcb_output_buffer_paste(obr->mask, | ||
814 | buf->priv.x11.xcb.mask, | ||
815 | buf->priv.x11.xcb.gcm, | ||
816 | obr->x, obr->y, 0); | ||
817 | #endif | ||
818 | } | ||
819 | #if 1 | ||
820 | #else | ||
821 | xcb_flush(buf->priv.x11.xcb.conn); | ||
822 | #endif | ||
823 | } | ||
824 | |||
825 | void | ||
826 | evas_software_xcb_outbuf_reconfigure(Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth) | ||
827 | { | ||
828 | if ((w == buf->w) && (h == buf->h) && (rot == buf->rot) && | ||
829 | (depth == buf->depth)) return; | ||
830 | buf->w = w; | ||
831 | buf->h = h; | ||
832 | buf->rot = rot; | ||
833 | evas_software_xcb_outbuf_idle_flush(buf); | ||
834 | } | ||
835 | |||
836 | int | ||
837 | evas_software_xcb_outbuf_width_get(Outbuf *buf) | ||
838 | { | ||
839 | return buf->w; | ||
840 | } | ||
841 | |||
842 | int | ||
843 | evas_software_xcb_outbuf_height_get(Outbuf *buf) | ||
844 | { | ||
845 | return buf->h; | ||
846 | } | ||
847 | |||
848 | Outbuf_Depth | ||
849 | evas_software_xcb_outbuf_depth_get(Outbuf *buf) | ||
850 | { | ||
851 | return buf->depth; | ||
852 | } | ||
853 | |||
854 | void | ||
855 | evas_software_xcb_outbuf_drawable_set(Outbuf *buf, xcb_drawable_t drawable) | ||
856 | { | ||
857 | if (buf->priv.x11.xcb.win == drawable) return; | ||
858 | if (buf->priv.x11.xcb.gc) | ||
859 | { | ||
860 | xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc); | ||
861 | buf->priv.x11.xcb.gc = 0; | ||
862 | } | ||
863 | buf->priv.x11.xcb.win = drawable; | ||
864 | buf->priv.x11.xcb.gc = xcb_generate_id(buf->priv.x11.xcb.conn); | ||
865 | xcb_create_gc(buf->priv.x11.xcb.conn, | ||
866 | buf->priv.x11.xcb.gc, buf->priv.x11.xcb.win, 0, NULL); | ||
867 | } | ||
868 | |||
869 | void | ||
870 | evas_software_xcb_outbuf_mask_set(Outbuf *buf, xcb_drawable_t mask) | ||
871 | { | ||
872 | if (buf->priv.x11.xcb.mask == mask) return; | ||
873 | if (buf->priv.x11.xcb.gcm) | ||
874 | { | ||
875 | xcb_free_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gcm); | ||
876 | buf->priv.x11.xcb.gcm = 0; | ||
877 | } | ||
878 | buf->priv.x11.xcb.mask = mask; | ||
879 | if (buf->priv.x11.xcb.mask) | ||
880 | { | ||
881 | buf->priv.x11.xcb.gcm = xcb_generate_id(buf->priv.x11.xcb.conn); | ||
882 | xcb_create_gc(buf->priv.x11.xcb.conn, | ||
883 | buf->priv.x11.xcb.gcm, buf->priv.x11.xcb.mask, 0, NULL); | ||
884 | } | ||
885 | } | ||
886 | |||
887 | int | ||
888 | evas_software_xcb_outbuf_rotation_get(Outbuf *buf) | ||
889 | { | ||
890 | return buf->rot; | ||
891 | } | ||
892 | |||
893 | void | ||
894 | evas_software_xcb_outbuf_rotation_set(Outbuf *buf, int rotation) | ||
895 | { | ||
896 | buf->rot = rotation; | ||
897 | } | ||
898 | |||
899 | Eina_Bool | ||
900 | evas_software_xcb_outbuf_alpha_get(Outbuf *buf) | ||
901 | { | ||
902 | return buf->priv.x11.xcb.mask; | ||
903 | } | ||
904 | |||
905 | void | ||
906 | evas_software_xcb_outbuf_debug_set(Outbuf *buf, Eina_Bool debug) | ||
907 | { | ||
908 | buf->priv.debug = debug; | ||
909 | } | ||
910 | |||
911 | void | ||
912 | evas_software_xcb_outbuf_debug_show(Outbuf *buf, xcb_drawable_t drawable, int x, int y, int w, int h) | ||
913 | { | ||
914 | int i; | ||
915 | xcb_screen_t *screen = NULL; | ||
916 | xcb_get_geometry_reply_t *geom; | ||
917 | xcb_drawable_t root; | ||
918 | xcb_screen_iterator_t si; | ||
919 | |||
920 | geom = | ||
921 | xcb_get_geometry_reply(buf->priv.x11.xcb.conn, | ||
922 | xcb_get_geometry_unchecked(buf->priv.x11.xcb.conn, | ||
923 | drawable), 0); | ||
924 | root = geom->root; | ||
925 | free(geom); | ||
926 | geom = | ||
927 | xcb_get_geometry_reply(buf->priv.x11.xcb.conn, | ||
928 | xcb_get_geometry_unchecked(buf->priv.x11.xcb.conn, | ||
929 | root), 0); | ||
930 | |||
931 | si = xcb_setup_roots_iterator((xcb_setup_t *)xcb_get_setup(buf->priv.x11.xcb.conn)); | ||
932 | for (; si.rem; xcb_screen_next(&si)) | ||
933 | { | ||
934 | if (si.data->root == geom->root) | ||
935 | { | ||
936 | screen = si.data; | ||
937 | break; | ||
938 | } | ||
939 | } | ||
940 | free(geom); | ||
941 | |||
942 | for (i = 0; i < 20; i++) | ||
943 | { | ||
944 | xcb_rectangle_t rect = { x, y, w, h}; | ||
945 | uint32_t mask; | ||
946 | uint32_t value[2]; | ||
947 | |||
948 | mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; | ||
949 | value[0] = screen->black_pixel; | ||
950 | value[1] = XCB_EXPOSURES_NOT_ALLOWED; | ||
951 | xcb_change_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc, | ||
952 | mask, value); | ||
953 | xcb_poly_fill_rectangle(buf->priv.x11.xcb.conn, drawable, | ||
954 | buf->priv.x11.xcb.gc, 1, &rect); | ||
955 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
956 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
957 | |||
958 | mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES; | ||
959 | value[0] = screen->white_pixel; | ||
960 | value[1] = XCB_EXPOSURES_NOT_ALLOWED; | ||
961 | xcb_change_gc(buf->priv.x11.xcb.conn, buf->priv.x11.xcb.gc, | ||
962 | mask, value); | ||
963 | xcb_poly_fill_rectangle(buf->priv.x11.xcb.conn, drawable, | ||
964 | buf->priv.x11.xcb.gc, 1, &rect); | ||
965 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
966 | _xcbob_sync(buf->priv.x11.xcb.conn); | ||
967 | } | ||
968 | } | ||
969 | |||
970 | #ifdef EVAS_FRAME_QUEUING | ||
971 | void | ||
972 | evas_software_xcb_outbuf_priv_set(Outbuf *buf, void *cur, void *prev __UNUSED__) | ||
973 | { | ||
974 | buf->priv.pending_writes = (Eina_List *)cur; | ||
975 | } | ||
976 | #endif | ||
977 | |||
978 | /* local functions */ | ||
979 | static Xcb_Output_Buffer * | ||
980 | _find_xcbob(xcb_connection_t *conn, xcb_visualtype_t *vis, int depth, int w, int h, Eina_Bool shm, void *data) | ||
981 | { | ||
982 | Eina_List *l = NULL, *xl = NULL; | ||
983 | Xcb_Output_Buffer *xcbob = NULL, *xcbob2 = NULL; | ||
984 | int lbytes = 0, bpp = 0, sz = 0; | ||
985 | int fitness = 0x7fffffff; | ||
986 | |||
987 | if (!shm) | ||
988 | return evas_software_xcb_output_buffer_new(conn, vis, depth, w, h, | ||
989 | shm, data); | ||
990 | |||
991 | lbytes = (((w + 31) / 32) * 4); | ||
992 | if (depth > 1) | ||
993 | { | ||
994 | bpp = (depth / 8); | ||
995 | if (bpp == 3) bpp = 4; | ||
996 | lbytes = ((((w * bpp) + 3) / 4) * 4); | ||
997 | } | ||
998 | |||
999 | sz = (lbytes * h); | ||
1000 | SHMPOOL_LOCK(); | ||
1001 | EINA_LIST_FOREACH(_shmpool, l, xcbob2) | ||
1002 | { | ||
1003 | int szdif = 0; | ||
1004 | |||
1005 | if ((xcbob2->xim->depth != depth) || (xcbob2->visual != vis) || | ||
1006 | (xcbob2->connection != conn)) continue; | ||
1007 | szdif = (xcbob2->psize - sz); | ||
1008 | if (szdif < 0) continue; | ||
1009 | if (szdif == 0) | ||
1010 | { | ||
1011 | xcbob = xcbob2; | ||
1012 | xl = l; | ||
1013 | goto have_xcbob; | ||
1014 | } | ||
1015 | if (szdif < fitness) | ||
1016 | { | ||
1017 | xcbob = xcbob2; | ||
1018 | xl = l; | ||
1019 | fitness = szdif; | ||
1020 | } | ||
1021 | } | ||
1022 | if ((fitness > (100 * 100)) || (!xcbob)) | ||
1023 | { | ||
1024 | SHMPOOL_UNLOCK(); | ||
1025 | return evas_software_xcb_output_buffer_new(conn, vis, depth, | ||
1026 | w, h, shm, data); | ||
1027 | } | ||
1028 | |||
1029 | have_xcbob: | ||
1030 | _shmpool = eina_list_remove_list(_shmpool, xl); | ||
1031 | xcbob->w = w; | ||
1032 | xcbob->h = h; | ||
1033 | xcbob->bpl = lbytes; | ||
1034 | xcbob->xim->width = xcbob->w; | ||
1035 | xcbob->xim->height = xcbob->h; | ||
1036 | xcbob->xim->stride = xcbob->bpl; | ||
1037 | _shmsize -= (xcbob->psize * (xcbob->xim->depth / 8)); | ||
1038 | SHMPOOL_UNLOCK(); | ||
1039 | return xcbob; | ||
1040 | } | ||
1041 | |||
1042 | static void | ||
1043 | _unfind_xcbob(Xcb_Output_Buffer *xcbob, Eina_Bool sync) | ||
1044 | { | ||
1045 | if (xcbob->shm_info) | ||
1046 | { | ||
1047 | SHMPOOL_LOCK(); | ||
1048 | _shmpool = eina_list_prepend(_shmpool, xcbob); | ||
1049 | _shmsize += xcbob->psize * xcbob->xim->depth / 8; | ||
1050 | while ((_shmsize > _shmlimit) || | ||
1051 | (eina_list_count(_shmpool) > _shmcountlimit)) | ||
1052 | { | ||
1053 | Eina_List *xl = NULL; | ||
1054 | |||
1055 | if (!(xl = eina_list_last(_shmpool))) | ||
1056 | { | ||
1057 | _shmsize = 0; | ||
1058 | break; | ||
1059 | } | ||
1060 | xcbob = xl->data; | ||
1061 | _shmpool = eina_list_remove_list(_shmpool, xl); | ||
1062 | _shmsize -= xcbob->psize * xcbob->xim->depth / 8; | ||
1063 | evas_software_xcb_output_buffer_free(xcbob, sync); | ||
1064 | } | ||
1065 | SHMPOOL_UNLOCK(); | ||
1066 | } | ||
1067 | else | ||
1068 | evas_software_xcb_output_buffer_free(xcbob, sync); | ||
1069 | } | ||
1070 | |||
1071 | static void | ||
1072 | _clear_xcbob(Eina_Bool sync) | ||
1073 | { | ||
1074 | SHMPOOL_LOCK(); | ||
1075 | while (_shmpool) | ||
1076 | { | ||
1077 | Xcb_Output_Buffer *xcbob; | ||
1078 | |||
1079 | xcbob = _shmpool->data; | ||
1080 | _shmpool = eina_list_remove_list(_shmpool, _shmpool); | ||
1081 | evas_software_xcb_output_buffer_free(xcbob, sync); | ||
1082 | } | ||
1083 | _shmsize = 0; | ||
1084 | SHMPOOL_UNLOCK(); | ||
1085 | } | ||
1086 | |||
1087 | static void | ||
1088 | _xcbob_sync(xcb_connection_t *conn) | ||
1089 | { | ||
1090 | free(xcb_get_input_focus_reply(conn, | ||
1091 | xcb_get_input_focus_unchecked(conn), NULL)); | ||
1092 | } | ||
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 @@ | |||
1 | #ifndef EVAS_XCB_OUTBUF_H | ||
2 | # define EVAS_XCB_OUTBUF_H | ||
3 | |||
4 | # include "evas_engine.h" | ||
5 | |||
6 | void evas_software_xcb_outbuf_init(void); | ||
7 | void evas_software_xcb_outbuf_free(Outbuf *buf); | ||
8 | 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); | ||
9 | 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); | ||
10 | void evas_software_xcb_outbuf_free_region_for_update(Outbuf *buf, RGBA_Image *update); | ||
11 | void evas_software_xcb_outbuf_flush(Outbuf *buf); | ||
12 | void evas_software_xcb_outbuf_idle_flush(Outbuf *buf); | ||
13 | void evas_software_xcb_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h); | ||
14 | void evas_software_xcb_outbuf_reconfigure(Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth); | ||
15 | int evas_software_xcb_outbuf_width_get(Outbuf *buf); | ||
16 | int evas_software_xcb_outbuf_height_get(Outbuf *buf); | ||
17 | Outbuf_Depth evas_software_xcb_outbuf_depth_get(Outbuf *buf); | ||
18 | void evas_software_xcb_outbuf_drawable_set(Outbuf *buf, xcb_drawable_t drawable); | ||
19 | void evas_software_xcb_outbuf_mask_set(Outbuf *buf, xcb_drawable_t mask); | ||
20 | int evas_software_xcb_outbuf_rotation_get(Outbuf *buf); | ||
21 | void evas_software_xcb_outbuf_rotation_set(Outbuf *buf, int rotation); | ||
22 | Eina_Bool evas_software_xcb_outbuf_alpha_get(Outbuf *buf); | ||
23 | void evas_software_xcb_outbuf_debug_set(Outbuf *buf, Eina_Bool debug); | ||
24 | void evas_software_xcb_outbuf_debug_show(Outbuf *buf, xcb_drawable_t drawable, int x, int y, int w, int h); | ||
25 | |||
26 | # ifdef EVAS_FRAME_QUEUING | ||
27 | void evas_software_xcb_outbuf_priv_set(Outbuf *buf, void *cur, void *prev); | ||
28 | # endif | ||
29 | |||
30 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_xcb_xdefaults.h" | ||
3 | #include <fnmatch.h> | ||
4 | |||
5 | /* local function prototypes */ | ||
6 | static Eina_Bool _evas_xcb_xdefaults_glob_match(const char *str, const char *glob); | ||
7 | |||
8 | /* local variables */ | ||
9 | static Eina_File *_evas_xcb_xdefaults_file = NULL; | ||
10 | static char *_evas_xcb_xdefaults_data = NULL; | ||
11 | |||
12 | void | ||
13 | _evas_xcb_xdefaults_init(void) | ||
14 | { | ||
15 | char buff[PATH_MAX]; | ||
16 | |||
17 | snprintf(buff, sizeof(buff), "%s/.Xdefaults", getenv("HOME")); | ||
18 | if ((_evas_xcb_xdefaults_file = eina_file_open(buff, EINA_FALSE))) | ||
19 | { | ||
20 | eina_mmap_safety_enabled_set(EINA_TRUE); | ||
21 | |||
22 | _evas_xcb_xdefaults_data = | ||
23 | eina_file_map_all(_evas_xcb_xdefaults_file, EINA_FILE_SEQUENTIAL); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | void | ||
28 | _evas_xcb_xdefaults_shutdown(void) | ||
29 | { | ||
30 | if (!_evas_xcb_xdefaults_file) return; | ||
31 | if (_evas_xcb_xdefaults_data) | ||
32 | eina_file_map_free(_evas_xcb_xdefaults_file, _evas_xcb_xdefaults_data); | ||
33 | if (_evas_xcb_xdefaults_file) eina_file_close(_evas_xcb_xdefaults_file); | ||
34 | } | ||
35 | |||
36 | char * | ||
37 | _evas_xcb_xdefaults_string_get(const char *prog, const char *param) | ||
38 | { | ||
39 | char buff[1024], ret[1024]; | ||
40 | char *str = NULL; | ||
41 | char **ea = NULL; | ||
42 | unsigned int count = 0, i = 0; | ||
43 | |||
44 | if ((!_evas_xcb_xdefaults_data) || (!_evas_xcb_xdefaults_file)) | ||
45 | return NULL; | ||
46 | |||
47 | snprintf(buff, sizeof(buff), "*%s*.*%s*", prog, param); | ||
48 | |||
49 | str = _evas_xcb_xdefaults_data; | ||
50 | ea = eina_str_split_full(str, "\n", -1, &count); | ||
51 | for (i = 0; i < count; i++) | ||
52 | { | ||
53 | if (_evas_xcb_xdefaults_glob_match(ea[i], buff)) | ||
54 | sscanf(ea[i], "%*[^:]:%*[ ]%s", ret); | ||
55 | } | ||
56 | if ((ea) && (ea[0])) | ||
57 | { | ||
58 | free(ea[0]); | ||
59 | free(ea); | ||
60 | } | ||
61 | |||
62 | return strdup(ret); | ||
63 | } | ||
64 | |||
65 | int | ||
66 | _evas_xcb_xdefaults_int_get(const char *prog, const char *param) | ||
67 | { | ||
68 | char buff[1024]; | ||
69 | char *str = NULL; | ||
70 | char **ea = NULL; | ||
71 | unsigned int count = 0, i = 0; | ||
72 | int ret = -1; | ||
73 | |||
74 | if ((!_evas_xcb_xdefaults_data) || (!_evas_xcb_xdefaults_file)) | ||
75 | return 0; | ||
76 | |||
77 | snprintf(buff, sizeof(buff), "*%s*.*%s*", prog, param); | ||
78 | |||
79 | str = _evas_xcb_xdefaults_data; | ||
80 | ea = eina_str_split_full(str, "\n", -1, &count); | ||
81 | for (i = 0; i < count; i++) | ||
82 | { | ||
83 | if (_evas_xcb_xdefaults_glob_match(ea[i], buff)) | ||
84 | sscanf(ea[i], "%*[^:]:%*[ ]%d", &ret); | ||
85 | } | ||
86 | if ((ea) && (ea[0])) | ||
87 | { | ||
88 | free(ea[0]); | ||
89 | free(ea); | ||
90 | } | ||
91 | |||
92 | return ret; | ||
93 | } | ||
94 | |||
95 | /* local functions */ | ||
96 | static Eina_Bool | ||
97 | _evas_xcb_xdefaults_glob_match(const char *str, const char *glob) | ||
98 | { | ||
99 | if ((!str) || (!glob)) return EINA_FALSE; | ||
100 | if (glob[0] == 0) | ||
101 | { | ||
102 | if (str[0] == 0) return EINA_TRUE; | ||
103 | return EINA_FALSE; | ||
104 | } | ||
105 | if (!strcmp(glob, "*")) return EINA_TRUE; | ||
106 | if (!fnmatch(glob, str, 0)) return EINA_TRUE; | ||
107 | return EINA_FALSE; | ||
108 | } | ||
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 @@ | |||
1 | #ifndef EVAS_XCB_XDEFAULTS_H | ||
2 | # define EVAS_XCB_XDEFAULTS_H | ||
3 | |||
4 | # include "evas_engine.h" | ||
5 | |||
6 | void _evas_xcb_xdefaults_init(void); | ||
7 | void _evas_xcb_xdefaults_shutdown(void); | ||
8 | char *_evas_xcb_xdefaults_string_get(const char *prog, const char *param); | ||
9 | int _evas_xcb_xdefaults_int_get(const char *prog, const char *param); | ||
10 | |||
11 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | |||
3 | #include "evas_xlib_buffer.h" | ||
4 | |||
5 | static int _x_err = 0; | ||
6 | |||
7 | void | ||
8 | evas_software_xlib_x_write_mask_line(Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y) | ||
9 | { | ||
10 | int x; | ||
11 | DATA32 *src_ptr; | ||
12 | DATA8 *dst_ptr; | ||
13 | int bpl = 0; | ||
14 | |||
15 | src_ptr = src; | ||
16 | dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); | ||
17 | dst_ptr = dst_ptr + (bpl * y); | ||
18 | w -= 7; | ||
19 | if (buf->priv.x11.xlib.bit_swap) | ||
20 | { | ||
21 | for (x = 0; x < w; x += 8) | ||
22 | { | ||
23 | *dst_ptr = | ||
24 | ((A_VAL(&(src_ptr[0])) >> 7) << 7) | | ||
25 | ((A_VAL(&(src_ptr[1])) >> 7) << 6) | | ||
26 | ((A_VAL(&(src_ptr[2])) >> 7) << 5) | | ||
27 | ((A_VAL(&(src_ptr[3])) >> 7) << 4) | | ||
28 | ((A_VAL(&(src_ptr[4])) >> 7) << 3) | | ||
29 | ((A_VAL(&(src_ptr[5])) >> 7) << 2) | | ||
30 | ((A_VAL(&(src_ptr[6])) >> 7) << 1) | | ||
31 | ((A_VAL(&(src_ptr[7])) >> 7) << 0); | ||
32 | src_ptr += 8; | ||
33 | dst_ptr++; | ||
34 | } | ||
35 | } | ||
36 | else | ||
37 | { | ||
38 | for (x = 0; x < w; x += 8) | ||
39 | { | ||
40 | *dst_ptr = | ||
41 | ((A_VAL(&(src_ptr[0])) >> 7) << 0) | | ||
42 | ((A_VAL(&(src_ptr[1])) >> 7) << 1) | | ||
43 | ((A_VAL(&(src_ptr[2])) >> 7) << 2) | | ||
44 | ((A_VAL(&(src_ptr[3])) >> 7) << 3) | | ||
45 | ((A_VAL(&(src_ptr[4])) >> 7) << 4) | | ||
46 | ((A_VAL(&(src_ptr[5])) >> 7) << 5) | | ||
47 | ((A_VAL(&(src_ptr[6])) >> 7) << 6) | | ||
48 | ((A_VAL(&(src_ptr[7])) >> 7) << 7); | ||
49 | src_ptr += 8; | ||
50 | dst_ptr++; | ||
51 | } | ||
52 | } | ||
53 | w += 7; | ||
54 | for (; x < w; x ++) | ||
55 | { | ||
56 | XPutPixel(xob->xim, x, y, A_VAL(src_ptr) >> 7); | ||
57 | src_ptr++; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | void | ||
62 | evas_software_xlib_x_write_mask_line_rev(Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y) | ||
63 | { | ||
64 | int x; | ||
65 | DATA32 *src_ptr; | ||
66 | DATA8 *dst_ptr; | ||
67 | int bpl = 0; | ||
68 | |||
69 | src_ptr = src + w - 1; | ||
70 | dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); | ||
71 | dst_ptr = dst_ptr + (bpl * y); | ||
72 | w -= 7; | ||
73 | if (buf->priv.x11.xlib.bit_swap) | ||
74 | { | ||
75 | for (x = 0; x < w; x += 8) | ||
76 | { | ||
77 | *dst_ptr = | ||
78 | ((A_VAL(&(src_ptr[ 0])) >> 7) << 7) | | ||
79 | ((A_VAL(&(src_ptr[-1])) >> 7) << 6) | | ||
80 | ((A_VAL(&(src_ptr[-2])) >> 7) << 5) | | ||
81 | ((A_VAL(&(src_ptr[-3])) >> 7) << 4) | | ||
82 | ((A_VAL(&(src_ptr[-4])) >> 7) << 3) | | ||
83 | ((A_VAL(&(src_ptr[-5])) >> 7) << 2) | | ||
84 | ((A_VAL(&(src_ptr[-6])) >> 7) << 1) | | ||
85 | ((A_VAL(&(src_ptr[-7])) >> 7) << 0); | ||
86 | src_ptr -= 8; | ||
87 | dst_ptr++; | ||
88 | } | ||
89 | } | ||
90 | else | ||
91 | { | ||
92 | for (x = 0; x < w; x += 8) | ||
93 | { | ||
94 | *dst_ptr = | ||
95 | ((A_VAL(&(src_ptr[ 0])) >> 7) << 0) | | ||
96 | ((A_VAL(&(src_ptr[-1])) >> 7) << 1) | | ||
97 | ((A_VAL(&(src_ptr[-2])) >> 7) << 2) | | ||
98 | ((A_VAL(&(src_ptr[-3])) >> 7) << 3) | | ||
99 | ((A_VAL(&(src_ptr[-4])) >> 7) << 4) | | ||
100 | ((A_VAL(&(src_ptr[-5])) >> 7) << 5) | | ||
101 | ((A_VAL(&(src_ptr[-6])) >> 7) << 6) | | ||
102 | ((A_VAL(&(src_ptr[-7])) >> 7) << 7); | ||
103 | src_ptr -= 8; | ||
104 | dst_ptr++; | ||
105 | } | ||
106 | } | ||
107 | w += 7; | ||
108 | for (; x < w; x ++) | ||
109 | { | ||
110 | XPutPixel(xob->xim, x, y, A_VAL(src_ptr) >> 7); | ||
111 | src_ptr--; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | void | ||
116 | evas_software_xlib_x_write_mask_line_vert(Outbuf *buf, X_Output_Buffer *xob, | ||
117 | DATA32 *src, | ||
118 | int h, int ym, int w) | ||
119 | { | ||
120 | int y; | ||
121 | DATA32 *src_ptr; | ||
122 | DATA8 *dst_ptr; | ||
123 | int bpl = 0; | ||
124 | |||
125 | src_ptr = src; | ||
126 | dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); | ||
127 | dst_ptr = dst_ptr + (bpl * ym); | ||
128 | h -= 7; | ||
129 | if (buf->priv.x11.xlib.bit_swap) | ||
130 | { | ||
131 | for (y = 0; y < h; y += 8) | ||
132 | { | ||
133 | *dst_ptr = | ||
134 | ((A_VAL(&(src_ptr[0 * w])) >> 7) << 7) | | ||
135 | ((A_VAL(&(src_ptr[1 * w])) >> 7) << 6) | | ||
136 | ((A_VAL(&(src_ptr[2 * w])) >> 7) << 5) | | ||
137 | ((A_VAL(&(src_ptr[3 * w])) >> 7) << 4) | | ||
138 | ((A_VAL(&(src_ptr[4 * w])) >> 7) << 3) | | ||
139 | ((A_VAL(&(src_ptr[5 * w])) >> 7) << 2) | | ||
140 | ((A_VAL(&(src_ptr[6 * w])) >> 7) << 1) | | ||
141 | ((A_VAL(&(src_ptr[7 * w])) >> 7) << 0); | ||
142 | src_ptr += 8 * w; | ||
143 | dst_ptr++; | ||
144 | } | ||
145 | } | ||
146 | else | ||
147 | { | ||
148 | for (y = 0; y < h; y += 8) | ||
149 | { | ||
150 | *dst_ptr = | ||
151 | ((A_VAL(&(src_ptr[0 * w])) >> 7) << 0) | | ||
152 | ((A_VAL(&(src_ptr[1 * w])) >> 7) << 1) | | ||
153 | ((A_VAL(&(src_ptr[2 * w])) >> 7) << 2) | | ||
154 | ((A_VAL(&(src_ptr[3 * w])) >> 7) << 3) | | ||
155 | ((A_VAL(&(src_ptr[4 * w])) >> 7) << 4) | | ||
156 | ((A_VAL(&(src_ptr[5 * w])) >> 7) << 5) | | ||
157 | ((A_VAL(&(src_ptr[6 * w])) >> 7) << 6) | | ||
158 | ((A_VAL(&(src_ptr[7 * w])) >> 7) << 7); | ||
159 | src_ptr += 8 * w; | ||
160 | dst_ptr++; | ||
161 | } | ||
162 | } | ||
163 | h += 7; | ||
164 | for (; y < h; y ++) | ||
165 | { | ||
166 | XPutPixel(xob->xim, y, ym, A_VAL(src_ptr) >> 7); | ||
167 | src_ptr += w; | ||
168 | } | ||
169 | } | ||
170 | |||
171 | void | ||
172 | evas_software_xlib_x_write_mask_line_vert_rev(Outbuf *buf, X_Output_Buffer *xob, | ||
173 | DATA32 *src, | ||
174 | int h, int ym, int w) | ||
175 | { | ||
176 | int y; | ||
177 | DATA32 *src_ptr; | ||
178 | DATA8 *dst_ptr; | ||
179 | int bpl = 0; | ||
180 | |||
181 | src_ptr = src + ((h - 1) * w); | ||
182 | dst_ptr = evas_software_xlib_x_output_buffer_data(xob, &bpl); | ||
183 | dst_ptr = dst_ptr + (bpl * ym); | ||
184 | h -= 7; | ||
185 | if (buf->priv.x11.xlib.bit_swap) | ||
186 | { | ||
187 | for (y = 0; y < h; y += 8) | ||
188 | { | ||
189 | *dst_ptr = | ||
190 | ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 7) | | ||
191 | ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 6) | | ||
192 | ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 5) | | ||
193 | ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 4) | | ||
194 | ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 3) | | ||
195 | ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 2) | | ||
196 | ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 1) | | ||
197 | ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 0); | ||
198 | src_ptr -= 8 * w; | ||
199 | dst_ptr++; | ||
200 | } | ||
201 | } | ||
202 | else | ||
203 | { | ||
204 | for (y = 0; y < h; y += 8) | ||
205 | { | ||
206 | *dst_ptr = | ||
207 | ((A_VAL(&(src_ptr[ 0 * w])) >> 7) << 0) | | ||
208 | ((A_VAL(&(src_ptr[-1 * w])) >> 7) << 1) | | ||
209 | ((A_VAL(&(src_ptr[-2 * w])) >> 7) << 2) | | ||
210 | ((A_VAL(&(src_ptr[-3 * w])) >> 7) << 3) | | ||
211 | ((A_VAL(&(src_ptr[-4 * w])) >> 7) << 4) | | ||
212 | ((A_VAL(&(src_ptr[-5 * w])) >> 7) << 5) | | ||
213 | ((A_VAL(&(src_ptr[-6 * w])) >> 7) << 6) | | ||
214 | ((A_VAL(&(src_ptr[-7 * w])) >> 7) << 7); | ||
215 | src_ptr -= 8 * w; | ||
216 | dst_ptr++; | ||
217 | } | ||
218 | } | ||
219 | h += 7; | ||
220 | for (; y < h; y ++) | ||
221 | { | ||
222 | XPutPixel(xob->xim, y, ym, A_VAL(src_ptr) >> 7); | ||
223 | src_ptr -= w; | ||
224 | } | ||
225 | } | ||
226 | |||
227 | int | ||
228 | evas_software_xlib_x_can_do_shm(Display *d) | ||
229 | { | ||
230 | static Display *cached_d = NULL; | ||
231 | static int cached_result = 0; | ||
232 | |||
233 | if (d == cached_d) return cached_result; | ||
234 | cached_d = d; | ||
235 | if (XShmQueryExtension(d)) | ||
236 | { | ||
237 | X_Output_Buffer *xob; | ||
238 | |||
239 | xob = evas_software_xlib_x_output_buffer_new | ||
240 | (d, DefaultVisual(d, DefaultScreen(d)), | ||
241 | DefaultDepth(d, DefaultScreen(d)), 16, 16, 2, NULL); | ||
242 | if (!xob) | ||
243 | { | ||
244 | cached_result = 0; | ||
245 | return 0; | ||
246 | } | ||
247 | evas_software_xlib_x_output_buffer_free(xob, 1); | ||
248 | cached_result = 1; | ||
249 | return 1; | ||
250 | } | ||
251 | cached_result = 0; | ||
252 | return 0; | ||
253 | } | ||
254 | |||
255 | static void | ||
256 | x_output_tmp_x_err(Display *d __UNUSED__, XErrorEvent *ev __UNUSED__) | ||
257 | { | ||
258 | _x_err = 1; | ||
259 | return; | ||
260 | } | ||
261 | |||
262 | //static int creates = 0; | ||
263 | |||
264 | X_Output_Buffer * | ||
265 | evas_software_xlib_x_output_buffer_new(Display *d, Visual *v, int depth, int w, int h, int try_shm, void *data) | ||
266 | { | ||
267 | X_Output_Buffer *xob; | ||
268 | |||
269 | xob = calloc(1, sizeof(X_Output_Buffer)); | ||
270 | if (!xob) return NULL; | ||
271 | |||
272 | xob->display = d; | ||
273 | xob->visual = v; | ||
274 | xob->xim = NULL; | ||
275 | xob->shm_info = NULL; | ||
276 | xob->w = w; | ||
277 | xob->h = h; | ||
278 | |||
279 | if (try_shm > 0) | ||
280 | { | ||
281 | xob->shm_info = malloc(sizeof(XShmSegmentInfo)); | ||
282 | if (xob->shm_info) | ||
283 | { | ||
284 | xob->xim = XShmCreateImage(d, v, depth, ZPixmap, NULL, | ||
285 | xob->shm_info, w, h); | ||
286 | if (xob->xim) | ||
287 | { | ||
288 | xob->shm_info->shmid = shmget(IPC_PRIVATE, | ||
289 | xob->xim->bytes_per_line * | ||
290 | xob->xim->height, | ||
291 | IPC_CREAT | 0777); | ||
292 | if (xob->shm_info->shmid >= 0) | ||
293 | { | ||
294 | xob->shm_info->readOnly = False; | ||
295 | xob->shm_info->shmaddr = xob->xim->data = | ||
296 | shmat(xob->shm_info->shmid, 0, 0); | ||
297 | if (xob->shm_info->shmaddr != ((void *)-1)) | ||
298 | { | ||
299 | XErrorHandler ph; | ||
300 | |||
301 | if (try_shm == 2) // only needed during testing | ||
302 | { | ||
303 | XSync(d, False); | ||
304 | _x_err = 0; | ||
305 | ph = XSetErrorHandler((XErrorHandler) | ||
306 | x_output_tmp_x_err); | ||
307 | } | ||
308 | #if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) | ||
309 | /* workaround for libXext of lower then 1.1.1 */ | ||
310 | if (evas_common_frameq_enabled()) | ||
311 | XLockDisplay(d); | ||
312 | #endif | ||
313 | XShmAttach(d, xob->shm_info); | ||
314 | #if defined(EVAS_FRAME_QUEUING) && defined(LIBXEXT_VERSION_LOW) | ||
315 | /* workaround for libXext of lower then 1.1.1 */ | ||
316 | if (evas_common_frameq_enabled()) | ||
317 | XUnlockDisplay(d); | ||
318 | #endif | ||
319 | |||
320 | if (try_shm == 2) // only needed during testing | ||
321 | { | ||
322 | XSync(d, False); | ||
323 | XSetErrorHandler((XErrorHandler)ph); | ||
324 | } | ||
325 | if (!_x_err) | ||
326 | { | ||
327 | xob->bpl = xob->xim->bytes_per_line; | ||
328 | xob->psize = xob->bpl * xob->h; | ||
329 | return xob; | ||
330 | } | ||
331 | } | ||
332 | shmdt(xob->shm_info->shmaddr); | ||
333 | shmctl(xob->shm_info->shmid, IPC_RMID, 0); | ||
334 | } | ||
335 | if (xob->xim) XDestroyImage(xob->xim); | ||
336 | xob->xim = NULL; | ||
337 | } | ||
338 | if (xob->shm_info) free(xob->shm_info); | ||
339 | xob->shm_info = NULL; | ||
340 | } | ||
341 | } | ||
342 | |||
343 | if (try_shm > 1) return NULL; | ||
344 | |||
345 | xob->xim = XCreateImage(d, v, depth, ZPixmap, 0, data, w, h, 32, 0); | ||
346 | if (!xob->xim) | ||
347 | { | ||
348 | free(xob); | ||
349 | return NULL; | ||
350 | } | ||
351 | |||
352 | xob->data = data; | ||
353 | |||
354 | if (!xob->xim->data) | ||
355 | { | ||
356 | xob->xim->data = malloc(xob->xim->bytes_per_line * xob->xim->height); | ||
357 | if (!xob->xim->data) | ||
358 | { | ||
359 | XDestroyImage(xob->xim); | ||
360 | free(xob); | ||
361 | return NULL; | ||
362 | } | ||
363 | } | ||
364 | xob->bpl = xob->xim->bytes_per_line; | ||
365 | xob->psize = xob->bpl * xob->h; | ||
366 | return xob; | ||
367 | } | ||
368 | |||
369 | void | ||
370 | evas_software_xlib_x_output_buffer_free(X_Output_Buffer *xob, int psync) | ||
371 | { | ||
372 | if (xob->shm_info) | ||
373 | { | ||
374 | if (psync) XSync(xob->display, False); | ||
375 | XShmDetach(xob->display, xob->shm_info); | ||
376 | XDestroyImage(xob->xim); | ||
377 | shmdt(xob->shm_info->shmaddr); | ||
378 | shmctl(xob->shm_info->shmid, IPC_RMID, 0); | ||
379 | free(xob->shm_info); | ||
380 | } | ||
381 | else | ||
382 | { | ||
383 | if (xob->data) xob->xim->data = NULL; | ||
384 | XDestroyImage(xob->xim); | ||
385 | } | ||
386 | free(xob); | ||
387 | } | ||
388 | |||
389 | void | ||
390 | evas_software_xlib_x_output_buffer_paste(X_Output_Buffer *xob, Drawable d, GC gc, int x, int y, int psync) | ||
391 | { | ||
392 | if (xob->shm_info) | ||
393 | { | ||
394 | XShmPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y, | ||
395 | xob->w, xob->h, False); | ||
396 | if (psync) XSync(xob->display, False); | ||
397 | } | ||
398 | else | ||
399 | { | ||
400 | XPutImage(xob->display, d, gc, xob->xim, 0, 0, x, y, | ||
401 | xob->w, xob->h); | ||
402 | } | ||
403 | } | ||
404 | |||
405 | DATA8 * | ||
406 | evas_software_xlib_x_output_buffer_data(X_Output_Buffer *xob, int *bytes_per_line_ret) | ||
407 | { | ||
408 | if (bytes_per_line_ret) *bytes_per_line_ret = xob->xim->bytes_per_line; | ||
409 | return (DATA8 *)xob->xim->data; | ||
410 | } | ||
411 | |||
412 | int | ||
413 | evas_software_xlib_x_output_buffer_depth(X_Output_Buffer *xob) | ||
414 | { | ||
415 | return xob->xim->bits_per_pixel; | ||
416 | } | ||
417 | |||
418 | int | ||
419 | evas_software_xlib_x_output_buffer_byte_order(X_Output_Buffer *xob) | ||
420 | { | ||
421 | return xob->xim->byte_order; | ||
422 | } | ||
423 | |||
424 | int | ||
425 | evas_software_xlib_x_output_buffer_bit_order(X_Output_Buffer *xob) | ||
426 | { | ||
427 | return xob->xim->bitmap_bit_order; | ||
428 | } | ||
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 @@ | |||
1 | #ifndef EVAS_XLIB_BUFFER_H | ||
2 | #define EVAS_XLIB_BUFFER_H | ||
3 | |||
4 | |||
5 | #include "evas_engine.h" | ||
6 | |||
7 | |||
8 | typedef struct _X_Output_Buffer X_Output_Buffer; | ||
9 | |||
10 | struct _X_Output_Buffer | ||
11 | { | ||
12 | Display *display; | ||
13 | XImage *xim; | ||
14 | XShmSegmentInfo *shm_info; | ||
15 | Visual *visual; | ||
16 | void *data; | ||
17 | int w; | ||
18 | int h; | ||
19 | int bpl; | ||
20 | int psize; | ||
21 | }; | ||
22 | |||
23 | void evas_software_xlib_x_write_mask_line (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y); | ||
24 | void evas_software_xlib_x_write_mask_line_rev (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y); | ||
25 | void evas_software_xlib_x_write_mask_line_vert (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int h, int ym, int w); | ||
26 | void evas_software_xlib_x_write_mask_line_vert_rev (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int h, int ym, int w); | ||
27 | |||
28 | int evas_software_xlib_x_can_do_shm (Display *d); | ||
29 | |||
30 | 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); | ||
31 | |||
32 | void evas_software_xlib_x_output_buffer_free (X_Output_Buffer *xob, int sync); | ||
33 | |||
34 | void evas_software_xlib_x_output_buffer_paste (X_Output_Buffer *xob, Drawable d, GC gc, int x, int y, int sync); | ||
35 | |||
36 | DATA8 *evas_software_xlib_x_output_buffer_data (X_Output_Buffer *xob, int *bytes_per_line_ret); | ||
37 | |||
38 | int evas_software_xlib_x_output_buffer_depth (X_Output_Buffer *xob); | ||
39 | |||
40 | int evas_software_xlib_x_output_buffer_byte_order (X_Output_Buffer *xob); | ||
41 | |||
42 | int evas_software_xlib_x_output_buffer_bit_order (X_Output_Buffer *xob); | ||
43 | |||
44 | |||
45 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | |||
3 | #include "evas_engine.h" | ||
4 | |||
5 | #include <X11/Xlib.h> | ||
6 | #include <X11/Xutil.h> | ||
7 | |||
8 | typedef struct _Convert_Pal_Priv Convert_Pal_Priv; | ||
9 | |||
10 | struct _Convert_Pal_Priv | ||
11 | { | ||
12 | Display *disp; | ||
13 | Colormap cmap; | ||
14 | Visual *vis; | ||
15 | }; | ||
16 | |||
17 | typedef DATA8 * (*X_Func_Alloc_Colors) (Display *d, Colormap cmap, Visual *v); | ||
18 | |||
19 | static X_Func_Alloc_Colors x_color_alloc[PAL_MODE_LAST + 1]; | ||
20 | static int x_color_count[PAL_MODE_LAST + 1]; | ||
21 | static Eina_List *palettes = NULL; | ||
22 | |||
23 | static DATA8 * x_color_alloc_rgb(int nr, int ng, int nb, Display *d, Colormap cmap, Visual *v); | ||
24 | static DATA8 * x_color_alloc_gray(int ng, Display *d, Colormap cmap, Visual *v); | ||
25 | |||
26 | static DATA8 * x_color_alloc_rgb_332(Display *d, Colormap cmap, Visual *v); | ||
27 | static DATA8 * x_color_alloc_rgb_666(Display *d, Colormap cmap, Visual *v); | ||
28 | static DATA8 * x_color_alloc_rgb_232(Display *d, Colormap cmap, Visual *v); | ||
29 | static DATA8 * x_color_alloc_rgb_222(Display *d, Colormap cmap, Visual *v); | ||
30 | static DATA8 * x_color_alloc_rgb_221(Display *d, Colormap cmap, Visual *v); | ||
31 | static DATA8 * x_color_alloc_rgb_121(Display *d, Colormap cmap, Visual *v); | ||
32 | static DATA8 * x_color_alloc_rgb_111(Display *d, Colormap cmap, Visual *v); | ||
33 | static DATA8 * x_color_alloc_gray_256(Display *d, Colormap cmap, Visual *v); | ||
34 | static DATA8 * x_color_alloc_gray_64(Display *d, Colormap cmap, Visual *v); | ||
35 | static DATA8 * x_color_alloc_gray_16(Display *d, Colormap cmap, Visual *v); | ||
36 | static DATA8 * x_color_alloc_gray_4(Display *d, Colormap cmap, Visual *v); | ||
37 | static DATA8 * x_color_alloc_mono(Display *d, Colormap cmap, Visual *v); | ||
38 | |||
39 | static DATA8 * | ||
40 | x_color_alloc_rgb(int nr, int ng, int nb, Display *d, Colormap cmap, Visual *v) | ||
41 | { | ||
42 | int r, g, b, i; | ||
43 | DATA8 *color_lut; | ||
44 | int sig_mask = 0, delt = 0; | ||
45 | |||
46 | for (i = 0; i < v->bits_per_rgb; i++) sig_mask |= (0x1 << i); | ||
47 | sig_mask <<= (16 - v->bits_per_rgb); | ||
48 | i = 0; | ||
49 | color_lut = malloc((nr) * (ng) * (nb)); | ||
50 | if (!color_lut) return NULL; | ||
51 | delt = 0x0101 * 3; | ||
52 | for (r = 0; r < (nr); r++) | ||
53 | { | ||
54 | for (g = 0; g < (ng); g++) | ||
55 | { | ||
56 | for (b = 0; b < (nb); b++) | ||
57 | { | ||
58 | XColor xcl; | ||
59 | XColor xcl_in; | ||
60 | int val; | ||
61 | Status ret; | ||
62 | int dr, dg, db; | ||
63 | |||
64 | val = (int)((((double)r) / ((nr) - 1)) * 255); | ||
65 | val = (val << 8) | val; | ||
66 | xcl.red = (unsigned short)(val); | ||
67 | val = (int)((((double)g) / ((ng) - 1)) * 255); | ||
68 | val = (val << 8) | val; | ||
69 | xcl.green = (unsigned short)(val); | ||
70 | val = (int)((((double)b) / ((nb) - 1)) * 255); | ||
71 | val = (val << 8) | val; | ||
72 | xcl.blue = (unsigned short)(val); | ||
73 | xcl_in = xcl; | ||
74 | ret = XAllocColor(d, cmap, &xcl); | ||
75 | dr = (int)xcl_in.red - (int)xcl.red; | ||
76 | if (dr < 0) dr = -dr; | ||
77 | dg = (int)xcl_in.green - (int)xcl.green; | ||
78 | if (dg < 0) dg = -dg; | ||
79 | db = (int)xcl_in.blue - (int)xcl.blue; | ||
80 | if (db < 0) db = -db; | ||
81 | /* | ||
82 | printf("ASK [%i]: %04x %04x %04x = %04x %04x %04x | dif = %04x / %04x\n", | ||
83 | ret, | ||
84 | xcl_in.red, xcl_in.green, xcl_in.blue, | ||
85 | xcl.red, xcl.green, xcl.blue, | ||
86 | (dr + dg +db), delt); | ||
87 | */ | ||
88 | if ((ret == 0) || | ||
89 | ((dr + dg + db) > delt) | ||
90 | /* | ||
91 | || | ||
92 | ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || | ||
93 | ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || | ||
94 | ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask)) | ||
95 | */ | ||
96 | ) | ||
97 | { | ||
98 | unsigned long pixels[256]; | ||
99 | int j; | ||
100 | |||
101 | if (i > 0) | ||
102 | { | ||
103 | for (j = 0; j < i; j++) | ||
104 | pixels[j] = (unsigned long) color_lut[j]; | ||
105 | XFreeColors(d, cmap, pixels, i, 0); | ||
106 | } | ||
107 | free(color_lut); | ||
108 | return NULL; | ||
109 | } | ||
110 | color_lut[i] = xcl.pixel; | ||
111 | i++; | ||
112 | } | ||
113 | } | ||
114 | } | ||
115 | return color_lut; | ||
116 | } | ||
117 | |||
118 | static DATA8 * | ||
119 | x_color_alloc_gray(int ng, Display *d, Colormap cmap, Visual *v) | ||
120 | { | ||
121 | int g, i; | ||
122 | DATA8 *color_lut; | ||
123 | int sig_mask = 0; | ||
124 | |||
125 | for (i = 0; i < v->bits_per_rgb; i++) sig_mask |= (0x1 << i); | ||
126 | sig_mask <<= (16 - v->bits_per_rgb); | ||
127 | i = 0; | ||
128 | color_lut = malloc(ng); | ||
129 | if (!color_lut) return NULL; | ||
130 | for (g = 0; g < (ng); g++) | ||
131 | { | ||
132 | XColor xcl; | ||
133 | XColor xcl_in; | ||
134 | int val; | ||
135 | Status ret; | ||
136 | |||
137 | val = (int)((((double)g) / ((ng) - 1)) * 255); | ||
138 | val = (val << 8) | val; | ||
139 | xcl.red = (unsigned short)(val); | ||
140 | xcl.green = (unsigned short)(val); | ||
141 | xcl.blue = (unsigned short)(val); | ||
142 | xcl_in = xcl; | ||
143 | ret = XAllocColor(d, cmap, &xcl); | ||
144 | if ((ret == 0) || | ||
145 | ((xcl_in.red & sig_mask) != (xcl.red & sig_mask)) || | ||
146 | ((xcl_in.green & sig_mask) != (xcl.green & sig_mask)) || | ||
147 | ((xcl_in.blue & sig_mask) != (xcl.blue & sig_mask))) | ||
148 | { | ||
149 | unsigned long pixels[256]; | ||
150 | int j; | ||
151 | |||
152 | if (i > 0) | ||
153 | { | ||
154 | for (j = 0; j < i; j++) | ||
155 | pixels[j] = (unsigned long) color_lut[j]; | ||
156 | XFreeColors(d, cmap, pixels, i, 0); | ||
157 | } | ||
158 | free(color_lut); | ||
159 | return NULL; | ||
160 | } | ||
161 | color_lut[i] = xcl.pixel; | ||
162 | i++; | ||
163 | } | ||
164 | return color_lut; | ||
165 | } | ||
166 | |||
167 | static DATA8 * | ||
168 | x_color_alloc_rgb_332(Display *d, Colormap cmap, Visual *v) | ||
169 | { | ||
170 | return x_color_alloc_rgb(8, 8, 4, d, cmap, v); | ||
171 | } | ||
172 | |||
173 | static DATA8 * | ||
174 | x_color_alloc_rgb_666(Display *d, Colormap cmap, Visual *v) | ||
175 | { | ||
176 | return x_color_alloc_rgb(6, 6, 6, d, cmap, v); | ||
177 | } | ||
178 | |||
179 | static DATA8 * | ||
180 | x_color_alloc_rgb_232(Display *d, Colormap cmap, Visual *v) | ||
181 | { | ||
182 | return x_color_alloc_rgb(4, 8, 4, d, cmap, v); | ||
183 | } | ||
184 | |||
185 | static DATA8 * | ||
186 | x_color_alloc_rgb_222(Display *d, Colormap cmap, Visual *v) | ||
187 | { | ||
188 | return x_color_alloc_rgb(4, 4, 4, d, cmap, v); | ||
189 | } | ||
190 | |||
191 | static DATA8 * | ||
192 | x_color_alloc_rgb_221(Display *d, Colormap cmap, Visual *v) | ||
193 | { | ||
194 | return x_color_alloc_rgb(4, 4, 2, d, cmap, v); | ||
195 | } | ||
196 | |||
197 | static DATA8 * | ||
198 | x_color_alloc_rgb_121(Display *d, Colormap cmap, Visual *v) | ||
199 | { | ||
200 | return x_color_alloc_rgb(2, 4, 2, d, cmap, v); | ||
201 | } | ||
202 | |||
203 | static DATA8 * | ||
204 | x_color_alloc_rgb_111(Display *d, Colormap cmap, Visual *v) | ||
205 | { | ||
206 | return x_color_alloc_rgb(2, 2, 2, d, cmap, v); | ||
207 | } | ||
208 | |||
209 | static DATA8 * | ||
210 | x_color_alloc_gray_256(Display *d, Colormap cmap, Visual *v) | ||
211 | { | ||
212 | return x_color_alloc_gray(256, d, cmap, v); | ||
213 | } | ||
214 | |||
215 | static DATA8 * | ||
216 | x_color_alloc_gray_64(Display *d, Colormap cmap, Visual *v) | ||
217 | { | ||
218 | return x_color_alloc_gray(64, d, cmap, v); | ||
219 | } | ||
220 | |||
221 | static DATA8 * | ||
222 | x_color_alloc_gray_16(Display *d, Colormap cmap, Visual *v) | ||
223 | { | ||
224 | return x_color_alloc_gray(32, d, cmap, v); | ||
225 | } | ||
226 | |||
227 | static DATA8 * | ||
228 | x_color_alloc_gray_4(Display *d, Colormap cmap, Visual *v) | ||
229 | { | ||
230 | return x_color_alloc_gray(16, d, cmap, v); | ||
231 | } | ||
232 | |||
233 | static DATA8 * | ||
234 | x_color_alloc_mono(Display *d, Colormap cmap, Visual *v) | ||
235 | { | ||
236 | return x_color_alloc_gray(2, d, cmap, v); | ||
237 | } | ||
238 | |||
239 | void | ||
240 | evas_software_xlib_x_color_init(void) | ||
241 | { | ||
242 | static int initialised = 0; | ||
243 | |||
244 | if (initialised) return; | ||
245 | x_color_alloc[PAL_MODE_NONE] = NULL; | ||
246 | x_color_count[PAL_MODE_NONE] = 0; | ||
247 | |||
248 | x_color_alloc[PAL_MODE_MONO] = x_color_alloc_mono; | ||
249 | x_color_count[PAL_MODE_MONO] = 2; | ||
250 | |||
251 | x_color_alloc[PAL_MODE_GRAY4] = x_color_alloc_gray_4; | ||
252 | x_color_count[PAL_MODE_GRAY4] = 4; | ||
253 | |||
254 | x_color_alloc[PAL_MODE_GRAY16] = x_color_alloc_gray_16; | ||
255 | x_color_count[PAL_MODE_GRAY16] = 16; | ||
256 | |||
257 | x_color_alloc[PAL_MODE_GRAY64] = x_color_alloc_gray_64; | ||
258 | x_color_count[PAL_MODE_GRAY64] = 64; | ||
259 | |||
260 | x_color_alloc[PAL_MODE_GRAY256] = x_color_alloc_gray_256; | ||
261 | x_color_count[PAL_MODE_GRAY256] = 256; | ||
262 | |||
263 | x_color_alloc[PAL_MODE_RGB111] = x_color_alloc_rgb_111; | ||
264 | x_color_count[PAL_MODE_RGB111] = 2 * 2 * 2; | ||
265 | |||
266 | x_color_alloc[PAL_MODE_RGB121] = x_color_alloc_rgb_121; | ||
267 | x_color_count[PAL_MODE_RGB121] = 2 * 4 * 2; | ||
268 | |||
269 | x_color_alloc[PAL_MODE_RGB221] = x_color_alloc_rgb_221; | ||
270 | x_color_count[PAL_MODE_RGB221] = 4 * 4 * 2; | ||
271 | |||
272 | x_color_alloc[PAL_MODE_RGB222] = x_color_alloc_rgb_222; | ||
273 | x_color_count[PAL_MODE_RGB222] = 4 * 4 * 4; | ||
274 | |||
275 | x_color_alloc[PAL_MODE_RGB232] = x_color_alloc_rgb_232; | ||
276 | x_color_count[PAL_MODE_RGB232] = 4 * 8 * 4; | ||
277 | |||
278 | x_color_alloc[PAL_MODE_RGB666] = x_color_alloc_rgb_666; | ||
279 | x_color_count[PAL_MODE_RGB666] = 6 * 6 * 6; | ||
280 | |||
281 | x_color_alloc[PAL_MODE_RGB332] = x_color_alloc_rgb_332; | ||
282 | x_color_count[PAL_MODE_RGB332] = 8 * 8 * 4; | ||
283 | |||
284 | x_color_alloc[PAL_MODE_LAST] = NULL; | ||
285 | x_color_count[PAL_MODE_LAST] = 0; | ||
286 | initialised = 1; | ||
287 | } | ||
288 | |||
289 | Convert_Pal * | ||
290 | evas_software_xlib_x_color_allocate(Display *disp, | ||
291 | Colormap cmap, | ||
292 | Visual *vis, | ||
293 | Convert_Pal_Mode colors) | ||
294 | { | ||
295 | Convert_Pal_Priv *palpriv; | ||
296 | Convert_Pal *pal; | ||
297 | Convert_Pal_Mode c; | ||
298 | Eina_List *l; | ||
299 | |||
300 | /* printf("ALLOC cmap=%i vis=%p\n", cmap, vis);*/ | ||
301 | EINA_LIST_FOREACH(palettes, l, pal) | ||
302 | { | ||
303 | palpriv = pal->data; | ||
304 | if ((disp == palpriv->disp) && | ||
305 | (vis == palpriv->vis) && | ||
306 | (cmap == palpriv->cmap)) | ||
307 | { | ||
308 | pal->references++; | ||
309 | return pal; | ||
310 | } | ||
311 | } | ||
312 | pal = calloc(1, sizeof(struct _Convert_Pal)); | ||
313 | if (!pal) return NULL; | ||
314 | for (c = colors; c > PAL_MODE_NONE; c--) | ||
315 | { | ||
316 | if (x_color_alloc[c]) | ||
317 | { | ||
318 | /* printf("TRY PAL %i\n", c);*/ | ||
319 | pal->lookup = (x_color_alloc[c])(disp, cmap, vis); | ||
320 | if (pal->lookup) break; | ||
321 | } | ||
322 | } | ||
323 | pal->references = 1; | ||
324 | pal->colors = c; | ||
325 | pal->count = x_color_count[c]; | ||
326 | palpriv = calloc(1, sizeof(Convert_Pal_Priv)); | ||
327 | pal->data = palpriv; | ||
328 | if (!palpriv) | ||
329 | { | ||
330 | if (pal->lookup) free(pal->lookup); | ||
331 | free(pal); | ||
332 | return NULL; | ||
333 | } | ||
334 | palpriv->disp = disp; | ||
335 | palpriv->vis = vis; | ||
336 | palpriv->cmap = cmap; | ||
337 | if (pal->colors == PAL_MODE_NONE) | ||
338 | { | ||
339 | if (pal->lookup) free(pal->lookup); | ||
340 | free(pal); | ||
341 | return NULL; | ||
342 | } | ||
343 | palettes = eina_list_append(palettes, pal); | ||
344 | return pal; | ||
345 | } | ||
346 | |||
347 | void | ||
348 | evas_software_xlib_x_color_deallocate(Display *disp, | ||
349 | Colormap cmap, | ||
350 | Visual *vis __UNUSED__, | ||
351 | Convert_Pal *pal) | ||
352 | { | ||
353 | unsigned long pixels[256]; | ||
354 | int j; | ||
355 | |||
356 | pal->references--; | ||
357 | if (pal->references > 0) return; | ||
358 | if (pal->lookup) | ||
359 | { | ||
360 | for(j = 0; j < pal->count; j++) | ||
361 | pixels[j] = (unsigned long) pal->lookup[j]; | ||
362 | XFreeColors(disp, cmap, pixels, pal->count, 0); | ||
363 | free(pal->lookup); | ||
364 | } | ||
365 | free(pal->data); | ||
366 | palettes = eina_list_remove(palettes, pal); | ||
367 | free(pal); | ||
368 | } | ||
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 @@ | |||
1 | #ifndef EVAS_XLIB_COLOR_H | ||
2 | #define EVAS_XLIB_COLOR_H | ||
3 | |||
4 | void evas_software_xlib_x_color_init (void); | ||
5 | |||
6 | Convert_Pal *evas_software_xlib_x_color_allocate (Display *disp, | ||
7 | Colormap cmap, | ||
8 | Visual *vis, | ||
9 | Convert_Pal_Mode colors); | ||
10 | |||
11 | void evas_software_xlib_x_color_deallocate (Display *disp, | ||
12 | Colormap cmap, | ||
13 | Visual *vis, | ||
14 | Convert_Pal *pal); | ||
15 | |||
16 | #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 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_engine.h" | ||
3 | |||
4 | void | ||
5 | evas_software_xlib_x_init(void) | ||
6 | { | ||
7 | } | ||
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 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include <sys/time.h> | ||
6 | #include <sys/utsname.h> | ||
7 | |||
8 | #include "evas_common.h" | ||
9 | #include "evas_macros.h" | ||
10 | #include "evas_xlib_outbuf.h" | ||
11 | #include "evas_xlib_buffer.h" | ||
12 | #include "evas_xlib_color.h" | ||
13 | |||
14 | |||
15 | typedef struct _Outbuf_Region Outbuf_Region; | ||
16 | |||
17 | struct _Outbuf_Region | ||
18 | { | ||
19 | X_Output_Buffer *xob; | ||
20 | X_Output_Buffer *mxob; | ||
21 | int x; | ||
22 | int y; | ||
23 | int w; | ||
24 | int h; | ||
25 | }; | ||
26 | |||
27 | static Eina_List *shmpool = NULL; | ||
28 | static int shmsize = 0; | ||
29 | static int shmmemlimit = 10 * 1024 * 1024; | ||
30 | static const unsigned int shmcountlimit = 32; | ||
31 | |||
32 | #ifdef EVAS_FRAME_QUEUING | ||
33 | static LK(lock_shmpool); | ||
34 | #define SHMPOOL_LOCK() LKL(lock_shmpool) | ||
35 | #define SHMPOOL_UNLOCK() LKU(lock_shmpool) | ||
36 | #else | ||
37 | #define SHMPOOL_LOCK() | ||
38 | #define SHMPOOL_UNLOCK() | ||
39 | #endif | ||
40 | |||
41 | static X_Output_Buffer * | ||
42 | _find_xob(Display *d, Visual *v, int depth, int w, int h, int shm, void *data) | ||
43 | { | ||
44 | Eina_List *l, *xl = NULL; | ||
45 | X_Output_Buffer *xob = NULL; | ||
46 | X_Output_Buffer *xob2; | ||
47 | int fitness = 0x7fffffff; | ||
48 | int sz, lbytes, bpp; | ||
49 | |||
50 | if (!shm) | ||
51 | return evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data); | ||
52 | if (depth > 1) | ||
53 | { | ||
54 | bpp = depth / 8; | ||
55 | if (bpp == 3) bpp = 4; | ||
56 | lbytes = (((w * bpp) + 3) / 4) * 4; | ||
57 | } | ||
58 | else | ||
59 | lbytes = ((w + 31) / 32) * 4; | ||
60 | sz = lbytes * h; | ||
61 | SHMPOOL_LOCK(); | ||
62 | EINA_LIST_FOREACH(shmpool, l, xob2) | ||
63 | { | ||
64 | int szdif; | ||
65 | |||
66 | if ((xob2->xim->depth != depth) || (xob2->visual != v) || | ||
67 | (xob2->display != d)) | ||
68 | continue; | ||
69 | szdif = xob2->psize - sz; | ||
70 | if (szdif < 0) continue; | ||
71 | if (szdif == 0) | ||
72 | { | ||
73 | xob = xob2; | ||
74 | xl = l; | ||
75 | goto have_xob; | ||
76 | } | ||
77 | if (szdif < fitness) | ||
78 | { | ||
79 | fitness = szdif; | ||
80 | xob = xob2; | ||
81 | xl = l; | ||
82 | } | ||
83 | } | ||
84 | if ((fitness > (100 * 100)) || (!xob)) | ||
85 | { | ||
86 | SHMPOOL_UNLOCK(); | ||
87 | xob = evas_software_xlib_x_output_buffer_new(d, v, depth, w, h, shm, data); | ||
88 | return xob; | ||
89 | } | ||
90 | |||
91 | have_xob: | ||
92 | shmpool = eina_list_remove_list(shmpool, xl); | ||
93 | xob->w = w; | ||
94 | xob->h = h; | ||
95 | xob->bpl = lbytes; | ||
96 | xob->xim->width = xob->w; | ||
97 | xob->xim->height = xob->h; | ||
98 | xob->xim->bytes_per_line = xob->bpl; | ||
99 | shmsize -= xob->psize * (xob->xim->depth / 8); | ||
100 | SHMPOOL_UNLOCK(); | ||
101 | return xob; | ||
102 | } | ||
103 | |||
104 | static void | ||
105 | _unfind_xob(X_Output_Buffer *xob, int psync) | ||
106 | { | ||
107 | if (xob->shm_info) | ||
108 | { | ||
109 | SHMPOOL_LOCK(); | ||
110 | shmpool = eina_list_prepend(shmpool, xob); | ||
111 | shmsize += xob->psize * xob->xim->depth / 8; | ||
112 | while ((shmsize > (shmmemlimit)) || | ||
113 | (eina_list_count(shmpool) > shmcountlimit)) | ||
114 | { | ||
115 | Eina_List *xl; | ||
116 | |||
117 | xl = eina_list_last(shmpool); | ||
118 | if (!xl) | ||
119 | { | ||
120 | shmsize = 0; | ||
121 | break; | ||
122 | } | ||
123 | xob = xl->data; | ||
124 | shmpool = eina_list_remove_list(shmpool, xl); | ||
125 | shmsize -= xob->psize * xob->xim->depth / 8; | ||
126 | evas_software_xlib_x_output_buffer_free(xob, psync); | ||
127 | } | ||
128 | SHMPOOL_UNLOCK(); | ||
129 | } | ||
130 | else | ||
131 | evas_software_xlib_x_output_buffer_free(xob, psync); | ||
132 | } | ||
133 | |||
134 | static void | ||
135 | _clear_xob(int psync) | ||
136 | { | ||
137 | SHMPOOL_LOCK(); | ||
138 | while (shmpool) | ||
139 | { | ||
140 | X_Output_Buffer *xob; | ||
141 | |||
142 | xob = shmpool->data; | ||
143 | shmpool = eina_list_remove_list(shmpool, shmpool); | ||
144 | evas_software_xlib_x_output_buffer_free(xob, psync); | ||
145 | } | ||
146 | shmsize = 0; | ||
147 | SHMPOOL_UNLOCK(); | ||
148 | } | ||
149 | |||
150 | void | ||
151 | evas_software_xlib_outbuf_init(void) | ||
152 | { | ||
153 | #ifdef EVAS_FRAME_QUEUING | ||
154 | LKI(lock_shmpool); | ||
155 | #endif | ||
156 | } | ||
157 | |||
158 | void | ||
159 | evas_software_xlib_outbuf_free(Outbuf *buf) | ||
160 | { | ||
161 | #ifdef EVAS_FRAME_QUEUING | ||
162 | LKL(buf->priv.lock); | ||
163 | #endif | ||
164 | while (buf->priv.pending_writes) | ||
165 | { | ||
166 | RGBA_Image *im; | ||
167 | Outbuf_Region *obr; | ||
168 | |||
169 | im = buf->priv.pending_writes->data; | ||
170 | buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes); | ||
171 | obr = im->extended_info; | ||
172 | evas_cache_image_drop(&im->cache_entry); | ||
173 | if (obr->xob) _unfind_xob(obr->xob, 0); | ||
174 | if (obr->mxob) _unfind_xob(obr->mxob, 0); | ||
175 | free(obr); | ||
176 | } | ||
177 | #ifdef EVAS_FRAME_QUEUING | ||
178 | LKU(buf->priv.lock); | ||
179 | #endif | ||
180 | evas_software_xlib_outbuf_idle_flush(buf); | ||
181 | evas_software_xlib_outbuf_flush(buf); | ||
182 | if (buf->priv.x11.xlib.gc) | ||
183 | XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc); | ||
184 | if (buf->priv.x11.xlib.gcm) | ||
185 | XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm); | ||
186 | if (buf->priv.pal) | ||
187 | evas_software_xlib_x_color_deallocate(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.cmap, | ||
188 | buf->priv.x11.xlib.vis, buf->priv.pal); | ||
189 | #ifdef EVAS_FRAME_QUEUING | ||
190 | LKD(buf->priv.lock); | ||
191 | #endif | ||
192 | free(buf); | ||
193 | _clear_xob(0); | ||
194 | } | ||
195 | |||
196 | Outbuf * | ||
197 | evas_software_xlib_outbuf_setup_x(int w, int h, int rot, Outbuf_Depth depth, | ||
198 | Display *disp, Drawable draw, Visual *vis, | ||
199 | Colormap cmap, int x_depth, | ||
200 | int grayscale, int max_colors, Pixmap mask, | ||
201 | int shape_dither, int destination_alpha) | ||
202 | { | ||
203 | Outbuf *buf; | ||
204 | |||
205 | buf = calloc(1, sizeof(Outbuf)); | ||
206 | if (!buf) | ||
207 | return NULL; | ||
208 | |||
209 | buf->w = w; | ||
210 | buf->h = h; | ||
211 | buf->depth = depth; | ||
212 | buf->rot = rot; | ||
213 | |||
214 | buf->priv.x11.xlib.disp = disp; | ||
215 | buf->priv.x11.xlib.vis = vis; | ||
216 | buf->priv.x11.xlib.cmap = cmap; | ||
217 | buf->priv.x11.xlib.depth = x_depth; | ||
218 | |||
219 | buf->priv.mask_dither = shape_dither; | ||
220 | buf->priv.destination_alpha = destination_alpha; | ||
221 | |||
222 | { | ||
223 | Gfx_Func_Convert conv_func; | ||
224 | X_Output_Buffer *xob; | ||
225 | |||
226 | buf->priv.x11.xlib.shm = evas_software_xlib_x_can_do_shm(buf->priv.x11.xlib.disp); | ||
227 | xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
228 | buf->priv.x11.xlib.vis, | ||
229 | buf->priv.x11.xlib.depth, | ||
230 | 1, 1, buf->priv.x11.xlib.shm, NULL); | ||
231 | |||
232 | conv_func = NULL; | ||
233 | if (xob) | ||
234 | { | ||
235 | #ifdef WORDS_BIGENDIAN | ||
236 | if (evas_software_xlib_x_output_buffer_byte_order(xob) == LSBFirst) | ||
237 | buf->priv.x11.xlib.swap = 1; | ||
238 | if (evas_software_xlib_x_output_buffer_bit_order(xob) == MSBFirst) | ||
239 | buf->priv.x11.xlib.bit_swap = 1; | ||
240 | #else | ||
241 | if (evas_software_xlib_x_output_buffer_byte_order(xob) == MSBFirst) | ||
242 | buf->priv.x11.xlib.swap = 1; | ||
243 | if (evas_software_xlib_x_output_buffer_bit_order(xob) == MSBFirst) | ||
244 | buf->priv.x11.xlib.bit_swap = 1; | ||
245 | #endif | ||
246 | if (((vis->class == TrueColor) || (vis->class == DirectColor)) && | ||
247 | (x_depth > 8)) | ||
248 | { | ||
249 | buf->priv.mask.r = (DATA32) vis->red_mask; | ||
250 | buf->priv.mask.g = (DATA32) vis->green_mask; | ||
251 | buf->priv.mask.b = (DATA32) vis->blue_mask; | ||
252 | if (buf->priv.x11.xlib.swap) | ||
253 | { | ||
254 | SWAP32(buf->priv.mask.r); | ||
255 | SWAP32(buf->priv.mask.g); | ||
256 | SWAP32(buf->priv.mask.b); | ||
257 | } | ||
258 | } | ||
259 | else if ((vis->class == PseudoColor) || | ||
260 | (vis->class == StaticColor) || | ||
261 | (vis->class == GrayScale) || | ||
262 | (vis->class == StaticGray) || | ||
263 | (x_depth <= 8)) | ||
264 | { | ||
265 | Convert_Pal_Mode pm = PAL_MODE_RGB332; | ||
266 | |||
267 | if ((vis->class == GrayScale) || (vis->class == StaticGray)) | ||
268 | grayscale = 1; | ||
269 | if (grayscale) | ||
270 | { | ||
271 | if (max_colors >= 256) | ||
272 | pm = PAL_MODE_GRAY256; | ||
273 | else if (max_colors >= 64) | ||
274 | pm = PAL_MODE_GRAY64; | ||
275 | else if (max_colors >= 16) | ||
276 | pm = PAL_MODE_GRAY16; | ||
277 | else if (max_colors >= 4) | ||
278 | pm = PAL_MODE_GRAY4; | ||
279 | else | ||
280 | pm = PAL_MODE_MONO; | ||
281 | } | ||
282 | else | ||
283 | { | ||
284 | if (max_colors >= 256) | ||
285 | pm = PAL_MODE_RGB332; | ||
286 | else if (max_colors >= 216) | ||
287 | pm = PAL_MODE_RGB666; | ||
288 | else if (max_colors >= 128) | ||
289 | pm = PAL_MODE_RGB232; | ||
290 | else if (max_colors >= 64) | ||
291 | pm = PAL_MODE_RGB222; | ||
292 | else if (max_colors >= 32) | ||
293 | pm = PAL_MODE_RGB221; | ||
294 | else if (max_colors >= 16) | ||
295 | pm = PAL_MODE_RGB121; | ||
296 | else if (max_colors >= 8) | ||
297 | pm = PAL_MODE_RGB111; | ||
298 | else if (max_colors >= 4) | ||
299 | pm = PAL_MODE_GRAY4; | ||
300 | else | ||
301 | pm = PAL_MODE_MONO; | ||
302 | } | ||
303 | /* FIXME: only alloc once per display+cmap */ | ||
304 | buf->priv.pal = evas_software_xlib_x_color_allocate(disp, cmap, vis, | ||
305 | pm); | ||
306 | if (!buf->priv.pal) | ||
307 | { | ||
308 | free(buf); | ||
309 | return NULL; | ||
310 | } | ||
311 | } | ||
312 | if (buf->priv.pal) | ||
313 | { | ||
314 | if (buf->rot == 0 || buf->rot == 180) | ||
315 | conv_func = evas_common_convert_func_get(0, buf->w, buf->h, | ||
316 | evas_software_xlib_x_output_buffer_depth | ||
317 | (xob), buf->priv.mask.r, | ||
318 | buf->priv.mask.g, | ||
319 | buf->priv.mask.b, | ||
320 | buf->priv.pal->colors, | ||
321 | buf->rot); | ||
322 | else if (buf->rot == 90 || buf->rot == 270) | ||
323 | conv_func = evas_common_convert_func_get(0, buf->h, buf->w, | ||
324 | evas_software_xlib_x_output_buffer_depth | ||
325 | (xob), buf->priv.mask.r, | ||
326 | buf->priv.mask.g, | ||
327 | buf->priv.mask.b, | ||
328 | buf->priv.pal->colors, | ||
329 | buf->rot); | ||
330 | } | ||
331 | else | ||
332 | { | ||
333 | if (buf->rot == 0 || buf->rot == 180) | ||
334 | conv_func = evas_common_convert_func_get(0, buf->w, buf->h, | ||
335 | evas_software_xlib_x_output_buffer_depth | ||
336 | (xob), buf->priv.mask.r, | ||
337 | buf->priv.mask.g, | ||
338 | buf->priv.mask.b, PAL_MODE_NONE, | ||
339 | buf->rot); | ||
340 | else if (buf->rot == 90 || buf->rot == 270) | ||
341 | conv_func = evas_common_convert_func_get(0, buf->h, buf->w, | ||
342 | evas_software_xlib_x_output_buffer_depth | ||
343 | (xob), buf->priv.mask.r, | ||
344 | buf->priv.mask.g, | ||
345 | buf->priv.mask.b, PAL_MODE_NONE, | ||
346 | buf->rot); | ||
347 | } | ||
348 | evas_software_xlib_x_output_buffer_free(xob, 1); | ||
349 | if (!conv_func) | ||
350 | { | ||
351 | ERR("At depth: %i, RGB format mask: %08x %08x %08x, " | ||
352 | "Palette mode: %i. " | ||
353 | "Not supported by compiled in converters!", | ||
354 | buf->priv.x11.xlib.depth, | ||
355 | buf->priv.mask.r, | ||
356 | buf->priv.mask.g, | ||
357 | buf->priv.mask.b, | ||
358 | buf->priv.pal ? (int)buf->priv.pal->colors : -1); | ||
359 | } | ||
360 | } | ||
361 | evas_software_xlib_outbuf_drawable_set(buf, draw); | ||
362 | evas_software_xlib_outbuf_mask_set(buf, mask); | ||
363 | } | ||
364 | #ifdef EVAS_FRAME_QUEUING | ||
365 | LKI(buf->priv.lock); | ||
366 | #endif | ||
367 | return buf; | ||
368 | } | ||
369 | |||
370 | RGBA_Image * | ||
371 | 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) | ||
372 | { | ||
373 | RGBA_Image *im; | ||
374 | Outbuf_Region *obr; | ||
375 | int bpl = 0; | ||
376 | int use_shm = 1; | ||
377 | int alpha; | ||
378 | |||
379 | if ((buf->onebuf) && (buf->priv.x11.xlib.shm)) | ||
380 | { | ||
381 | Eina_Rectangle *rect; | ||
382 | |||
383 | RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, buf->w, buf->h); | ||
384 | obr = calloc(1, sizeof(Outbuf_Region)); | ||
385 | if (!obr) return NULL; | ||
386 | rect = eina_rectangle_new(x, y, w, h); | ||
387 | if (!rect) | ||
388 | { | ||
389 | free(obr); | ||
390 | return NULL; | ||
391 | } | ||
392 | |||
393 | buf->priv.onebuf_regions = eina_list_append(buf->priv.onebuf_regions, rect); | ||
394 | if (buf->priv.onebuf) | ||
395 | { | ||
396 | *cx = x; | ||
397 | *cy = y; | ||
398 | *cw = w; | ||
399 | *ch = h; | ||
400 | if (!buf->priv.synced) | ||
401 | { | ||
402 | XSync(buf->priv.x11.xlib.disp, False); | ||
403 | buf->priv.synced = 1; | ||
404 | } | ||
405 | return buf->priv.onebuf; | ||
406 | } | ||
407 | obr->x = 0; | ||
408 | obr->y = 0; | ||
409 | obr->w = buf->w; | ||
410 | obr->h = buf->h; | ||
411 | *cx = x; | ||
412 | *cy = y; | ||
413 | *cw = w; | ||
414 | *ch = h; | ||
415 | |||
416 | alpha = ((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)); | ||
417 | |||
418 | use_shm = buf->priv.x11.xlib.shm; | ||
419 | if ((buf->rot == 0) && | ||
420 | (buf->priv.mask.r == 0xff0000) && | ||
421 | (buf->priv.mask.g == 0x00ff00) && | ||
422 | (buf->priv.mask.b == 0x0000ff)) | ||
423 | { | ||
424 | obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
425 | buf->priv.x11.xlib.vis, | ||
426 | buf->priv.x11.xlib.depth, | ||
427 | buf->w, buf->h, | ||
428 | use_shm, | ||
429 | NULL); | ||
430 | if (!obr->xob) | ||
431 | { | ||
432 | free(obr); | ||
433 | return NULL; | ||
434 | } | ||
435 | im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), | ||
436 | buf->w, buf->h, | ||
437 | (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl), | ||
438 | alpha, EVAS_COLORSPACE_ARGB8888); | ||
439 | if (!im) | ||
440 | { | ||
441 | evas_software_xlib_x_output_buffer_free(obr->xob, 0); | ||
442 | free(obr); | ||
443 | return NULL; | ||
444 | } | ||
445 | im->extended_info = obr; | ||
446 | if (buf->priv.x11.xlib.mask) | ||
447 | obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
448 | buf->priv.x11.xlib.vis, | ||
449 | 1, | ||
450 | buf->w, buf->h, | ||
451 | use_shm, | ||
452 | NULL); | ||
453 | } | ||
454 | else | ||
455 | { | ||
456 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
457 | if (!im) | ||
458 | { | ||
459 | free(obr); | ||
460 | return NULL; | ||
461 | } | ||
462 | im->cache_entry.flags.alpha |= alpha ? 1 : 0; | ||
463 | evas_cache_image_surface_alloc(&im->cache_entry, buf->w, buf->h); | ||
464 | im->extended_info = obr; | ||
465 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
466 | { | ||
467 | obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
468 | buf->priv.x11.xlib.vis, | ||
469 | buf->priv.x11.xlib.depth, | ||
470 | buf->w, buf->h, | ||
471 | use_shm, | ||
472 | NULL); | ||
473 | if (!obr->xob) | ||
474 | { | ||
475 | evas_cache_image_drop(&im->cache_entry); | ||
476 | free(obr); | ||
477 | return NULL; | ||
478 | } | ||
479 | if (buf->priv.x11.xlib.mask) | ||
480 | obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
481 | buf->priv.x11.xlib.vis, | ||
482 | 1, buf->w, buf->h, | ||
483 | use_shm, | ||
484 | NULL); | ||
485 | } | ||
486 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
487 | { | ||
488 | obr->xob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
489 | buf->priv.x11.xlib.vis, | ||
490 | buf->priv.x11.xlib.depth, | ||
491 | buf->h, buf->w, | ||
492 | use_shm, | ||
493 | NULL); | ||
494 | if (!obr->xob) | ||
495 | { | ||
496 | evas_cache_image_drop(&im->cache_entry); | ||
497 | free(obr); | ||
498 | return NULL; | ||
499 | } | ||
500 | if (buf->priv.x11.xlib.mask) | ||
501 | obr->mxob = evas_software_xlib_x_output_buffer_new(buf->priv.x11.xlib.disp, | ||
502 | buf->priv.x11.xlib.vis, | ||
503 | 1, buf->h, buf->w, | ||
504 | use_shm, | ||
505 | NULL); | ||
506 | } | ||
507 | } | ||
508 | /* FIXME: We should be able to remove this memset, but somewhere in the process | ||
509 | we copy too much to the destination surface and some area are not cleaned before copy. */ | ||
510 | if ((alpha) && (im->image.data)) | ||
511 | { | ||
512 | /* FIXME: faster memset! */ | ||
513 | // memset(im->image.data, 0, w * h * sizeof(DATA32)); | ||
514 | } | ||
515 | |||
516 | buf->priv.onebuf = im; | ||
517 | return im; | ||
518 | } | ||
519 | |||
520 | obr = calloc(1, sizeof(Outbuf_Region)); | ||
521 | if (!obr) return NULL; | ||
522 | obr->x = x; | ||
523 | obr->y = y; | ||
524 | obr->w = w; | ||
525 | obr->h = h; | ||
526 | *cx = 0; | ||
527 | *cy = 0; | ||
528 | *cw = w; | ||
529 | *ch = h; | ||
530 | |||
531 | use_shm = buf->priv.x11.xlib.shm; | ||
532 | /* FIXME: magic - i found if shm regions are smaller than 200x200 its | ||
533 | * faster to use ximages over unix sockets - trial and error | ||
534 | */ | ||
535 | // use_shm = 0; /* 630 -> 1006 fps */ | ||
536 | // if ((w * h) < (200 * 200)) use_shm = 0; /* 630 -> 962 fps */ | ||
537 | |||
538 | alpha = ((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)); | ||
539 | |||
540 | if ((buf->rot == 0) && | ||
541 | (buf->priv.mask.r == 0xff0000) && | ||
542 | (buf->priv.mask.g == 0x00ff00) && | ||
543 | (buf->priv.mask.b == 0x0000ff)) | ||
544 | { | ||
545 | obr->xob = _find_xob(buf->priv.x11.xlib.disp, | ||
546 | buf->priv.x11.xlib.vis, | ||
547 | buf->priv.x11.xlib.depth, | ||
548 | w, h, | ||
549 | use_shm, | ||
550 | NULL); | ||
551 | if (!obr->xob) | ||
552 | { | ||
553 | free(obr); | ||
554 | return NULL; | ||
555 | } | ||
556 | im = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), | ||
557 | w, h, | ||
558 | (DATA32 *) evas_software_xlib_x_output_buffer_data(obr->xob, &bpl), | ||
559 | alpha, EVAS_COLORSPACE_ARGB8888); | ||
560 | if (!im) | ||
561 | { | ||
562 | _unfind_xob(obr->xob, 0); | ||
563 | free(obr); | ||
564 | return NULL; | ||
565 | } | ||
566 | im->extended_info = obr; | ||
567 | if (buf->priv.x11.xlib.mask) | ||
568 | obr->mxob = _find_xob(buf->priv.x11.xlib.disp, | ||
569 | buf->priv.x11.xlib.vis, | ||
570 | 1, w, h, | ||
571 | use_shm, | ||
572 | NULL); | ||
573 | } | ||
574 | else | ||
575 | { | ||
576 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
577 | if (!im) | ||
578 | { | ||
579 | free(obr); | ||
580 | return NULL; | ||
581 | } | ||
582 | im->cache_entry.flags.alpha |= alpha ? 1 : 0; | ||
583 | evas_cache_image_surface_alloc(&im->cache_entry, w, h); | ||
584 | im->extended_info = obr; | ||
585 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
586 | { | ||
587 | obr->xob = _find_xob(buf->priv.x11.xlib.disp, | ||
588 | buf->priv.x11.xlib.vis, | ||
589 | buf->priv.x11.xlib.depth, | ||
590 | w, h, | ||
591 | use_shm, | ||
592 | NULL); | ||
593 | if (!obr->xob) | ||
594 | { | ||
595 | evas_cache_image_drop(&im->cache_entry); | ||
596 | free(obr); | ||
597 | return NULL; | ||
598 | } | ||
599 | if (buf->priv.x11.xlib.mask) | ||
600 | obr->mxob = _find_xob(buf->priv.x11.xlib.disp, | ||
601 | buf->priv.x11.xlib.vis, | ||
602 | 1, w, h, | ||
603 | use_shm, | ||
604 | NULL); | ||
605 | } | ||
606 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
607 | { | ||
608 | obr->xob = _find_xob(buf->priv.x11.xlib.disp, | ||
609 | buf->priv.x11.xlib.vis, | ||
610 | buf->priv.x11.xlib.depth, | ||
611 | h, w, | ||
612 | use_shm, | ||
613 | NULL); | ||
614 | if (!obr->xob) | ||
615 | { | ||
616 | evas_cache_image_drop(&im->cache_entry); | ||
617 | free(obr); | ||
618 | return NULL; | ||
619 | } | ||
620 | if (buf->priv.x11.xlib.mask) | ||
621 | obr->mxob = _find_xob(buf->priv.x11.xlib.disp, | ||
622 | buf->priv.x11.xlib.vis, | ||
623 | 1, h, w, | ||
624 | use_shm, | ||
625 | NULL); | ||
626 | } | ||
627 | } | ||
628 | /* FIXME: We should be able to remove this memset, but somewhere in the process | ||
629 | we copy too much to the destination surface and some area are not cleaned before copy. */ | ||
630 | if (((buf->priv.x11.xlib.mask) || (buf->priv.destination_alpha)) && | ||
631 | (im->image.data)) | ||
632 | { | ||
633 | /* FIXME: faster memset! */ | ||
634 | // memset(im->image.data, 0, w * h * sizeof(DATA32)); | ||
635 | } | ||
636 | |||
637 | #ifdef EVAS_FRAME_QUEUING | ||
638 | if (!evas_common_frameq_enabled()) | ||
639 | #endif | ||
640 | buf->priv.pending_writes = eina_list_append(buf->priv.pending_writes, im); | ||
641 | return im; | ||
642 | } | ||
643 | |||
644 | void | ||
645 | evas_software_xlib_outbuf_free_region_for_update(Outbuf *buf __UNUSED__, RGBA_Image *update __UNUSED__) | ||
646 | { | ||
647 | /* no need to do anything - they are cleaned up on flush */ | ||
648 | } | ||
649 | |||
650 | void | ||
651 | evas_software_xlib_outbuf_flush(Outbuf *buf) | ||
652 | { | ||
653 | Eina_List *l; | ||
654 | RGBA_Image *im; | ||
655 | Outbuf_Region *obr; | ||
656 | |||
657 | if ((buf->priv.onebuf) && (buf->priv.onebuf_regions)) | ||
658 | { | ||
659 | Region tmpr; | ||
660 | |||
661 | im = buf->priv.onebuf; | ||
662 | obr = im->extended_info; | ||
663 | tmpr = XCreateRegion(); | ||
664 | while (buf->priv.onebuf_regions) | ||
665 | { | ||
666 | Eina_Rectangle *rect; | ||
667 | XRectangle xr; | ||
668 | |||
669 | rect = buf->priv.onebuf_regions->data; | ||
670 | buf->priv.onebuf_regions = eina_list_remove_list(buf->priv.onebuf_regions, buf->priv.onebuf_regions); | ||
671 | if (buf->rot == 0) | ||
672 | { | ||
673 | xr.x = rect->x; | ||
674 | xr.y = rect->y; | ||
675 | xr.width = rect->w; | ||
676 | xr.height = rect->h; | ||
677 | } | ||
678 | else if (buf->rot == 90) | ||
679 | { | ||
680 | xr.x = rect->y; | ||
681 | xr.y = buf->w - rect->x - rect->w; | ||
682 | xr.width = rect->h; | ||
683 | xr.height = rect->w; | ||
684 | } | ||
685 | else if (buf->rot == 180) | ||
686 | { | ||
687 | xr.x = buf->w - rect->x - rect->w; | ||
688 | xr.y = buf->h - rect->y - rect->h; | ||
689 | xr.width = rect->w; | ||
690 | xr.height = rect->h; | ||
691 | } | ||
692 | else if (buf->rot == 270) | ||
693 | { | ||
694 | xr.x = buf->h - rect->y - rect->h; | ||
695 | xr.y = rect->x; | ||
696 | xr.width = rect->h; | ||
697 | xr.height = rect->w; | ||
698 | } | ||
699 | XUnionRectWithRegion(&xr, tmpr, tmpr); | ||
700 | if (buf->priv.debug) | ||
701 | evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, | ||
702 | xr.x, xr.y, xr.width, xr.height); | ||
703 | eina_rectangle_free(rect); | ||
704 | } | ||
705 | XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, tmpr); | ||
706 | if (obr->xob) | ||
707 | evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, | ||
708 | buf->priv.x11.xlib.gc, | ||
709 | 0, 0, 0); | ||
710 | if (obr->mxob) | ||
711 | { | ||
712 | XSetRegion(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm, tmpr); | ||
713 | evas_software_xlib_x_output_buffer_paste(obr->mxob, | ||
714 | buf->priv.x11.xlib.mask, | ||
715 | buf->priv.x11.xlib.gcm, | ||
716 | 0, 0, 0); | ||
717 | } | ||
718 | XDestroyRegion(tmpr); | ||
719 | buf->priv.synced = 0; | ||
720 | } | ||
721 | else | ||
722 | { | ||
723 | #if 1 | ||
724 | XSync(buf->priv.x11.xlib.disp, False); | ||
725 | EINA_LIST_FOREACH(buf->priv.pending_writes, l, im) | ||
726 | { | ||
727 | obr = im->extended_info; | ||
728 | if (buf->priv.debug) | ||
729 | evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, | ||
730 | obr->x, obr->y, obr->w, obr->h); | ||
731 | if (obr->xob) | ||
732 | evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, | ||
733 | buf->priv.x11.xlib.gc, | ||
734 | obr->x, obr->y, 0); | ||
735 | if (obr->mxob) | ||
736 | evas_software_xlib_x_output_buffer_paste(obr->mxob, | ||
737 | buf->priv.x11.xlib.mask, | ||
738 | buf->priv.x11.xlib.gcm, | ||
739 | obr->x, obr->y, 0); | ||
740 | } | ||
741 | #ifdef EVAS_FRAME_QUEUING | ||
742 | LKL(buf->priv.lock); | ||
743 | #endif | ||
744 | while (buf->priv.prev_pending_writes) | ||
745 | { | ||
746 | im = buf->priv.prev_pending_writes->data; | ||
747 | buf->priv.prev_pending_writes = | ||
748 | eina_list_remove_list(buf->priv.prev_pending_writes, | ||
749 | buf->priv.prev_pending_writes); | ||
750 | obr = im->extended_info; | ||
751 | evas_cache_image_drop(&im->cache_entry); | ||
752 | if (obr->xob) _unfind_xob(obr->xob, 0); | ||
753 | if (obr->mxob) _unfind_xob(obr->mxob, 0); | ||
754 | free(obr); | ||
755 | } | ||
756 | buf->priv.prev_pending_writes = buf->priv.pending_writes; | ||
757 | #ifdef EVAS_FRAME_QUEUING | ||
758 | LKU(buf->priv.lock); | ||
759 | #endif | ||
760 | buf->priv.pending_writes = NULL; | ||
761 | XFlush(buf->priv.x11.xlib.disp); | ||
762 | #else | ||
763 | /* XX async push - disable */ | ||
764 | /* | ||
765 | EINA_LIST_FOREACH(buf->priv.pending_writes, l, im) | ||
766 | { | ||
767 | obr = im->extended_info; | ||
768 | if (buf->priv.debug) | ||
769 | evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, | ||
770 | obr->x, obr->y, obr->w, obr->h); | ||
771 | evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, | ||
772 | buf->priv.x11.xlib.gc, | ||
773 | obr->x, obr->y, 0); | ||
774 | if (obr->mxob) | ||
775 | evas_software_xlib_x_output_buffer_paste(obr->mxob, | ||
776 | buf->priv.x11.xlib.mask, | ||
777 | buf->priv.x11.xlib.gcm, | ||
778 | obr->x, obr->y, 0); | ||
779 | } | ||
780 | */ | ||
781 | XSync(buf->priv.x11.xlib.disp, False); | ||
782 | |||
783 | while (buf->priv.pending_writes) | ||
784 | { | ||
785 | RGBA_Image *im; | ||
786 | Outbuf_Region *obr; | ||
787 | |||
788 | im = eina_list_data_get(buf->priv.pending_writes); | ||
789 | buf->priv.pending_writes = eina_list_remove_list(buf->priv.pending_writes, buf->priv.pending_writes); | ||
790 | obr = im->extended_info; | ||
791 | evas_cache_image_drop(&im->cache_entry); | ||
792 | if (obr->xob) _unfind_xob(obr->xob, 0); | ||
793 | if (obr->mxob) _unfind_xob(obr->mxob, 0); | ||
794 | free(obr); | ||
795 | evas_cache_image_drop(&im->cache_entry); | ||
796 | } | ||
797 | #endif | ||
798 | } | ||
799 | evas_common_cpu_end_opt(); | ||
800 | } | ||
801 | |||
802 | void | ||
803 | evas_software_xlib_outbuf_idle_flush(Outbuf *buf) | ||
804 | { | ||
805 | if (buf->priv.onebuf) | ||
806 | { | ||
807 | RGBA_Image *im; | ||
808 | Outbuf_Region *obr; | ||
809 | |||
810 | im = buf->priv.onebuf; | ||
811 | buf->priv.onebuf = NULL; | ||
812 | obr = im->extended_info; | ||
813 | if (obr->xob) evas_software_xlib_x_output_buffer_free(obr->xob, 0); | ||
814 | if (obr->mxob) evas_software_xlib_x_output_buffer_free(obr->mxob, 0); | ||
815 | free(obr); | ||
816 | evas_cache_image_drop(&im->cache_entry); | ||
817 | } | ||
818 | else | ||
819 | { | ||
820 | #ifdef EVAS_FRAME_QUEUING | ||
821 | LKL(buf->priv.lock); | ||
822 | #endif | ||
823 | if (buf->priv.prev_pending_writes) XSync(buf->priv.x11.xlib.disp, False); | ||
824 | while (buf->priv.prev_pending_writes) | ||
825 | { | ||
826 | RGBA_Image *im; | ||
827 | Outbuf_Region *obr; | ||
828 | |||
829 | im = buf->priv.prev_pending_writes->data; | ||
830 | buf->priv.prev_pending_writes = | ||
831 | eina_list_remove_list(buf->priv.prev_pending_writes, | ||
832 | buf->priv.prev_pending_writes); | ||
833 | obr = im->extended_info; | ||
834 | evas_cache_image_drop(&im->cache_entry); | ||
835 | if (obr->xob) _unfind_xob(obr->xob, 0); | ||
836 | if (obr->mxob) _unfind_xob(obr->mxob, 0); | ||
837 | free(obr); | ||
838 | } | ||
839 | #ifdef EVAS_FRAME_QUEUING | ||
840 | LKU(buf->priv.lock); | ||
841 | #endif | ||
842 | _clear_xob(0); | ||
843 | } | ||
844 | } | ||
845 | |||
846 | void | ||
847 | evas_software_xlib_outbuf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) | ||
848 | { | ||
849 | Gfx_Func_Convert conv_func = NULL; | ||
850 | Outbuf_Region *obr; | ||
851 | DATA32 *src_data; | ||
852 | unsigned char *data; | ||
853 | int bpl = 0, yy; | ||
854 | |||
855 | obr = update->extended_info; | ||
856 | if (buf->priv.pal) | ||
857 | { | ||
858 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
859 | conv_func = evas_common_convert_func_get(0, w, h, | ||
860 | evas_software_xlib_x_output_buffer_depth | ||
861 | (obr->xob), buf->priv.mask.r, | ||
862 | buf->priv.mask.g, buf->priv.mask.b, | ||
863 | buf->priv.pal->colors, buf->rot); | ||
864 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
865 | conv_func = evas_common_convert_func_get(0, h, w, | ||
866 | evas_software_xlib_x_output_buffer_depth | ||
867 | (obr->xob), buf->priv.mask.r, | ||
868 | buf->priv.mask.g, buf->priv.mask.b, | ||
869 | buf->priv.pal->colors, buf->rot); | ||
870 | } | ||
871 | else | ||
872 | { | ||
873 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
874 | conv_func = evas_common_convert_func_get(0, w, h, | ||
875 | evas_software_xlib_x_output_buffer_depth | ||
876 | (obr->xob), buf->priv.mask.r, | ||
877 | buf->priv.mask.g, buf->priv.mask.b, | ||
878 | PAL_MODE_NONE, buf->rot); | ||
879 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
880 | conv_func = evas_common_convert_func_get(0, h, w, | ||
881 | evas_software_xlib_x_output_buffer_depth | ||
882 | (obr->xob), buf->priv.mask.r, | ||
883 | buf->priv.mask.g, buf->priv.mask.b, | ||
884 | PAL_MODE_NONE, buf->rot); | ||
885 | } | ||
886 | if (!conv_func) return; | ||
887 | |||
888 | if (!obr->xob) return; | ||
889 | data = evas_software_xlib_x_output_buffer_data(obr->xob, &bpl); | ||
890 | if (!data) return; | ||
891 | src_data = update->image.data; | ||
892 | if (!src_data) return; | ||
893 | if (buf->rot == 0) | ||
894 | { | ||
895 | obr->x = x; | ||
896 | obr->y = y; | ||
897 | } | ||
898 | else if (buf->rot == 90) | ||
899 | { | ||
900 | obr->x = y; | ||
901 | obr->y = buf->w - x - w; | ||
902 | } | ||
903 | else if (buf->rot == 180) | ||
904 | { | ||
905 | obr->x = buf->w - x - w; | ||
906 | obr->y = buf->h - y - h; | ||
907 | } | ||
908 | else if (buf->rot == 270) | ||
909 | { | ||
910 | obr->x = buf->h - y - h; | ||
911 | obr->y = x; | ||
912 | } | ||
913 | if ((buf->rot == 0) || (buf->rot == 180)) | ||
914 | { | ||
915 | obr->w = w; | ||
916 | obr->h = h; | ||
917 | } | ||
918 | else if ((buf->rot == 90) || (buf->rot == 270)) | ||
919 | { | ||
920 | obr->w = h; | ||
921 | obr->h = w; | ||
922 | } | ||
923 | if (buf->onebuf) | ||
924 | { | ||
925 | src_data += x + (y * update->cache_entry.w); | ||
926 | data += (bpl * obr->y) + | ||
927 | (obr->x * (evas_software_xlib_x_output_buffer_depth(obr->xob) / 8)); | ||
928 | } | ||
929 | if (buf->priv.pal) | ||
930 | { | ||
931 | if (data != (unsigned char *)src_data) | ||
932 | conv_func(src_data, data, | ||
933 | update->cache_entry.w - w, | ||
934 | bpl / | ||
935 | ((evas_software_xlib_x_output_buffer_depth(obr->xob) / | ||
936 | 8)) - obr->w, obr->w, obr->h, x, y, | ||
937 | buf->priv.pal->lookup); | ||
938 | } | ||
939 | else | ||
940 | { | ||
941 | if (data != (unsigned char *)src_data) | ||
942 | conv_func(src_data, data, | ||
943 | update->cache_entry.w - w, | ||
944 | bpl / | ||
945 | ((evas_software_xlib_x_output_buffer_depth(obr->xob) / | ||
946 | 8)) - obr->w, obr->w, obr->h, x, y, NULL); | ||
947 | } | ||
948 | #if 1 | ||
949 | #else | ||
950 | /* XX async push */ | ||
951 | if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) | ||
952 | { | ||
953 | if (buf->priv.debug) | ||
954 | evas_software_xlib_outbuf_debug_show(buf, buf->priv.x11.xlib.win, | ||
955 | obr->x, obr->y, obr->w, obr->h); | ||
956 | if (obr->xob) | ||
957 | evas_software_xlib_x_output_buffer_paste(obr->xob, buf->priv.x11.xlib.win, | ||
958 | buf->priv.x11.xlib.gc, | ||
959 | obr->x, obr->y, 0); | ||
960 | } | ||
961 | #endif | ||
962 | if (obr->mxob) | ||
963 | { | ||
964 | if (buf->rot == 0) | ||
965 | { | ||
966 | for (yy = 0; yy < obr->h; yy++) | ||
967 | evas_software_xlib_x_write_mask_line(buf, obr->mxob, | ||
968 | src_data + | ||
969 | (yy * obr->w), obr->w, yy); | ||
970 | } | ||
971 | else if (buf->rot == 90) | ||
972 | { | ||
973 | for (yy = 0; yy < obr->h; yy++) | ||
974 | evas_software_xlib_x_write_mask_line_vert(buf, obr->mxob, | ||
975 | src_data + yy, | ||
976 | h, // h | ||
977 | obr->h - yy - 1, // ym | ||
978 | w); // w | ||
979 | } | ||
980 | else if (buf->rot == 180) | ||
981 | { | ||
982 | for (yy = 0; yy < obr->h; yy++) | ||
983 | { | ||
984 | evas_software_xlib_x_write_mask_line_rev(buf, obr->mxob, | ||
985 | src_data + | ||
986 | (yy * obr->w), | ||
987 | obr->w, obr->h - yy - 1); | ||
988 | } | ||
989 | } | ||
990 | else if (buf->rot == 270) | ||
991 | { | ||
992 | for (yy = 0; yy < obr->h; yy++) | ||
993 | evas_software_xlib_x_write_mask_line_vert_rev(buf, obr->mxob, | ||
994 | src_data + yy, | ||
995 | h, // h | ||
996 | yy, // ym | ||
997 | w); // w | ||
998 | } | ||
999 | #if 1 | ||
1000 | #else | ||
1001 | /* XX async push */ | ||
1002 | if (!((buf->priv.onebuf) && (buf->priv.onebuf_regions))) | ||
1003 | evas_software_xlib_x_output_buffer_paste(obr->mxob, | ||
1004 | buf->priv.x11.xlib.mask, | ||
1005 | buf->priv.x11.xlib.gcm, | ||
1006 | obr->x, obr->y, 0); | ||
1007 | #endif | ||
1008 | } | ||
1009 | #if 1 | ||
1010 | #else | ||
1011 | XFlush(buf->priv.x11.xlib.disp); | ||
1012 | #endif | ||
1013 | } | ||
1014 | |||
1015 | void | ||
1016 | evas_software_xlib_outbuf_reconfigure(Outbuf * buf, int w, int h, int rot, | ||
1017 | Outbuf_Depth depth) | ||
1018 | { | ||
1019 | if ((w == buf->w) && | ||
1020 | (h == buf->h) && | ||
1021 | (rot == buf->rot) && | ||
1022 | (depth == buf->depth)) return; | ||
1023 | buf->w = w; | ||
1024 | buf->h = h; | ||
1025 | buf->rot = rot; | ||
1026 | evas_software_xlib_outbuf_idle_flush(buf); | ||
1027 | } | ||
1028 | |||
1029 | int | ||
1030 | evas_software_xlib_outbuf_get_width(Outbuf * buf) | ||
1031 | { | ||
1032 | return buf->w; | ||
1033 | } | ||
1034 | |||
1035 | int | ||
1036 | evas_software_xlib_outbuf_get_height(Outbuf * buf) | ||
1037 | { | ||
1038 | return buf->h; | ||
1039 | } | ||
1040 | |||
1041 | Outbuf_Depth | ||
1042 | evas_software_xlib_outbuf_get_depth(Outbuf * buf) | ||
1043 | { | ||
1044 | return buf->depth; | ||
1045 | } | ||
1046 | |||
1047 | int | ||
1048 | evas_software_xlib_outbuf_get_rot(Outbuf * buf) | ||
1049 | { | ||
1050 | return buf->rot; | ||
1051 | } | ||
1052 | |||
1053 | void | ||
1054 | evas_software_xlib_outbuf_drawable_set(Outbuf * buf, Drawable draw) | ||
1055 | { | ||
1056 | XGCValues gcv; | ||
1057 | |||
1058 | if (buf->priv.x11.xlib.win == draw) return; | ||
1059 | if (buf->priv.x11.xlib.gc) | ||
1060 | { | ||
1061 | XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc); | ||
1062 | buf->priv.x11.xlib.gc = NULL; | ||
1063 | } | ||
1064 | buf->priv.x11.xlib.win = draw; | ||
1065 | buf->priv.x11.xlib.gc = XCreateGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.win, 0, &gcv); | ||
1066 | } | ||
1067 | |||
1068 | void | ||
1069 | evas_software_xlib_outbuf_mask_set(Outbuf * buf, Pixmap mask) | ||
1070 | { | ||
1071 | XGCValues gcv; | ||
1072 | |||
1073 | if (buf->priv.x11.xlib.mask == mask) return; | ||
1074 | if (buf->priv.x11.xlib.gcm) | ||
1075 | { | ||
1076 | XFreeGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gcm); | ||
1077 | buf->priv.x11.xlib.gcm = NULL; | ||
1078 | } | ||
1079 | buf->priv.x11.xlib.mask = mask; | ||
1080 | if (buf->priv.x11.xlib.mask) | ||
1081 | buf->priv.x11.xlib.gcm = XCreateGC(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.mask, 0, &gcv); | ||
1082 | } | ||
1083 | |||
1084 | void | ||
1085 | evas_software_xlib_outbuf_debug_set(Outbuf * buf, int debug) | ||
1086 | { | ||
1087 | buf->priv.debug = debug; | ||
1088 | } | ||
1089 | |||
1090 | void | ||
1091 | evas_software_xlib_outbuf_debug_show(Outbuf * buf, Drawable draw, int x, int y, int w, | ||
1092 | int h) | ||
1093 | { | ||
1094 | int i; | ||
1095 | int screen_num = 0; | ||
1096 | |||
1097 | { | ||
1098 | int wx, wy; | ||
1099 | unsigned int ww, wh, bd, dp; | ||
1100 | Window wdum, root; | ||
1101 | XWindowAttributes wattr; | ||
1102 | |||
1103 | XGetGeometry(buf->priv.x11.xlib.disp, draw, &root, &wx, &wy, &ww, &wh, &bd, &dp); | ||
1104 | XGetGeometry(buf->priv.x11.xlib.disp, root, &wdum, &wx, &wy, &ww, &wh, &bd, &dp); | ||
1105 | XGetWindowAttributes(buf->priv.x11.xlib.disp, root, &wattr); | ||
1106 | screen_num = XScreenNumberOfScreen(wattr.screen); | ||
1107 | } | ||
1108 | for (i = 0; i < 20; i++) | ||
1109 | { | ||
1110 | XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, | ||
1111 | BlackPixel(buf->priv.x11.xlib.disp, screen_num)); | ||
1112 | XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h); | ||
1113 | XSync(buf->priv.x11.xlib.disp, False); | ||
1114 | XSync(buf->priv.x11.xlib.disp, False); | ||
1115 | XSetForeground(buf->priv.x11.xlib.disp, buf->priv.x11.xlib.gc, | ||
1116 | WhitePixel(buf->priv.x11.xlib.disp, screen_num)); | ||
1117 | XFillRectangle(buf->priv.x11.xlib.disp, draw, buf->priv.x11.xlib.gc, x, y, w, h); | ||
1118 | XSync(buf->priv.x11.xlib.disp, False); | ||
1119 | XSync(buf->priv.x11.xlib.disp, False); | ||
1120 | } | ||
1121 | } | ||
1122 | |||
1123 | Eina_Bool | ||
1124 | evas_software_xlib_outbuf_alpha_get(Outbuf *buf) | ||
1125 | { | ||
1126 | return buf->priv.x11.xlib.mask; | ||
1127 | } | ||
1128 | |||
1129 | #ifdef EVAS_FRAME_QUEUING | ||
1130 | void | ||
1131 | evas_software_xlib_outbuf_set_priv(Outbuf *buf, void *cur, void *prev __UNUSED__) | ||
1132 | { | ||
1133 | buf->priv.pending_writes = (Eina_List *)cur; | ||
1134 | } | ||
1135 | #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 @@ | |||
1 | #ifndef EVAS_XLIB_OUTBUF_H | ||
2 | #define EVAS_XLIB_OUTBUF_H | ||
3 | |||
4 | |||
5 | #include "evas_engine.h" | ||
6 | |||
7 | |||
8 | void evas_software_xlib_outbuf_init (void); | ||
9 | |||
10 | void evas_software_xlib_outbuf_free (Outbuf *buf); | ||
11 | |||
12 | Outbuf *evas_software_xlib_outbuf_setup_x (int w, | ||
13 | int h, | ||
14 | int rot, | ||
15 | Outbuf_Depth depth, | ||
16 | Display *disp, | ||
17 | Drawable draw, | ||
18 | Visual *vis, | ||
19 | Colormap cmap, | ||
20 | int x_depth, | ||
21 | int grayscale, | ||
22 | int max_colors, | ||
23 | Pixmap mask, | ||
24 | int shape_dither, | ||
25 | int destination_alpha); | ||
26 | |||
27 | |||
28 | RGBA_Image *evas_software_xlib_outbuf_new_region_for_update (Outbuf *buf, | ||
29 | int x, | ||
30 | int y, | ||
31 | int w, | ||
32 | int h, | ||
33 | int *cx, | ||
34 | int *cy, | ||
35 | int *cw, | ||
36 | int *ch); | ||
37 | |||
38 | void evas_software_xlib_outbuf_free_region_for_update (Outbuf *buf, | ||
39 | RGBA_Image *update); | ||
40 | |||
41 | void evas_software_xlib_outbuf_flush (Outbuf *buf); | ||
42 | |||
43 | void evas_software_xlib_outbuf_idle_flush (Outbuf *buf); | ||
44 | |||
45 | void evas_software_xlib_outbuf_push_updated_region (Outbuf *buf, | ||
46 | RGBA_Image *update, | ||
47 | int x, | ||
48 | int y, | ||
49 | int w, | ||
50 | int h); | ||
51 | |||
52 | void evas_software_xlib_outbuf_reconfigure (Outbuf *buf, | ||
53 | int w, | ||
54 | int h, | ||
55 | int rot, | ||
56 | Outbuf_Depth depth); | ||
57 | |||
58 | int evas_software_xlib_outbuf_get_width (Outbuf *buf); | ||
59 | |||
60 | int evas_software_xlib_outbuf_get_height (Outbuf *buf); | ||
61 | |||
62 | Outbuf_Depth evas_software_xlib_outbuf_get_depth (Outbuf *buf); | ||
63 | |||
64 | int evas_software_xlib_outbuf_get_rot (Outbuf *buf); | ||
65 | |||
66 | void evas_software_xlib_outbuf_drawable_set (Outbuf *buf, | ||
67 | Drawable draw); | ||
68 | |||
69 | void evas_software_xlib_outbuf_mask_set (Outbuf *buf, | ||
70 | Pixmap mask); | ||
71 | |||
72 | void evas_software_xlib_outbuf_rotation_set (Outbuf *buf, | ||
73 | int rot); | ||
74 | |||
75 | void evas_software_xlib_outbuf_debug_set (Outbuf *buf, | ||
76 | int debug); | ||
77 | |||
78 | void evas_software_xlib_outbuf_debug_show (Outbuf *buf, | ||
79 | Drawable draw, | ||
80 | int x, | ||
81 | int y, | ||
82 | int w, | ||
83 | int h); | ||
84 | |||
85 | Eina_Bool evas_software_xlib_outbuf_alpha_get (Outbuf *buf); | ||
86 | #ifdef EVAS_FRAME_QUEUING | ||
87 | void evas_software_xlib_outbuf_set_priv (Outbuf *buf, | ||
88 | void *cur, | ||
89 | void *prev); | ||
90 | #endif | ||
91 | |||
92 | #endif | ||