diff options
author | Carsten Haitzler <raster@rasterman.com> | 2012-10-16 08:57:18 +0000 |
---|---|---|
committer | Carsten Haitzler <raster@rasterman.com> | 2012-10-16 08:57:18 +0000 |
commit | 800279c23bdb0e925f112c96516dcc96a5487684 (patch) | |
tree | 1fe206b4245ec11b3be67bff7a5100c61c6a4818 /legacy/evas | |
parent | 4c8e4957e79ad572a28b8378b7c45496460693ce (diff) |
pthread stuff is no longer optional at all in evas - smae with preload
and async events, but pthread_attr_setaffinity_np is optionally
detected and used if there. it's an opti8mization anyway.
SVN revision: 78041
Diffstat (limited to '')
-rw-r--r-- | legacy/evas/configure.ac | 100 | ||||
-rw-r--r-- | legacy/evas/src/lib/cache/evas_cache_image.c | 85 | ||||
-rw-r--r-- | legacy/evas/src/lib/cache/evas_preload.c | 32 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/Makefile.am | 12 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/evas_async_events.c | 29 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/evas_main.c | 16 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/evas_object_textblock.c | 43 | ||||
-rw-r--r-- | legacy/evas/src/lib/canvas/evas_stats.c | 146 | ||||
-rw-r--r-- | legacy/evas/src/lib/engines/common/evas_convert_gry_1.c | 4 | ||||
-rw-r--r-- | legacy/evas/src/lib/engines/common/evas_font_private.h | 12 | ||||
-rw-r--r-- | legacy/evas/src/lib/engines/common/evas_image_data.c | 2 | ||||
-rw-r--r-- | legacy/evas/src/lib/engines/common/evas_image_load.c | 33 | ||||
-rw-r--r-- | legacy/evas/src/lib/engines/common/evas_image_main.c | 51 | ||||
-rw-r--r-- | legacy/evas/src/lib/engines/common/evas_pipe.c | 33 | ||||
-rw-r--r-- | legacy/evas/src/lib/file/evas_module.c | 12 | ||||
-rw-r--r-- | legacy/evas/src/lib/include/evas_common.h | 22 | ||||
-rw-r--r-- | legacy/evas/src/static_deps/Makefile.am | 6 |
17 files changed, 77 insertions, 561 deletions
diff --git a/legacy/evas/configure.ac b/legacy/evas/configure.ac index 3dc64a2322..6cf13dbc29 100644 --- a/legacy/evas/configure.ac +++ b/legacy/evas/configure.ac | |||
@@ -277,32 +277,10 @@ if test "x${want_fontconfig}" = "xyes"; then | |||
277 | [AC_MSG_ERROR([Fontconfig not found])]) | 277 | [AC_MSG_ERROR([Fontconfig not found])]) |
278 | fi | 278 | fi |
279 | 279 | ||
280 | # linebreak | 280 | LINEBREAK_CFLAGS='-I$(top_srcdir)/src/static_deps/liblinebreak' |
281 | have_linebreak="no" | 281 | LINEBREAK_LIBS='$(top_builddir)/src/static_deps/liblinebreak/liblinebreak.la' |
282 | want_linebreak="yes" | 282 | AC_SUBST(LINEBREAK_CFLAGS) |
283 | AC_ARG_ENABLE([liblinebreak], | 283 | AC_SUBST(LINEBREAK_LIBS) |
284 | AC_HELP_STRING([--disable-liblinebreak], | ||
285 | [disable linking against liblinebreak. @<:@default=enabled@:>@]), | ||
286 | [ | ||
287 | if test "x${enableval}" = "xyes" ; then | ||
288 | want_linebreak="yes" | ||
289 | else | ||
290 | want_linebreak="no" | ||
291 | fi | ||
292 | ]) | ||
293 | |||
294 | |||
295 | AM_CONDITIONAL(EVAS_USE_LINEBREAK, test "x${want_linebreak}" = "xyes") | ||
296 | if test "x${want_linebreak}" = "xyes" ; then | ||
297 | have_linebreak="yes" | ||
298 | LINEBREAK_CFLAGS='-I$(top_srcdir)/src/static_deps/liblinebreak' | ||
299 | LINEBREAK_LIBS='$(top_builddir)/src/static_deps/liblinebreak/liblinebreak.la' | ||
300 | AC_SUBST(LINEBREAK_CFLAGS) | ||
301 | AC_SUBST(LINEBREAK_LIBS) | ||
302 | AC_DEFINE(HAVE_LINEBREAK, 1, [have liblinebreak support]) | ||
303 | else | ||
304 | have_linebreak="no" | ||
305 | fi | ||
306 | 284 | ||
307 | # fribidi support | 285 | # fribidi support |
308 | have_fribidi="no" | 286 | have_fribidi="no" |
@@ -329,9 +307,7 @@ if test "x${want_fribidi}" = "xyes"; then | |||
329 | AC_CHECK_SIZEOF(FriBidiChar,, [#include <fribidi/fribidi.h>]) | 307 | AC_CHECK_SIZEOF(FriBidiChar,, [#include <fribidi/fribidi.h>]) |
330 | CPPFLAGS="$CPPFLAGS_SAVE" | 308 | CPPFLAGS="$CPPFLAGS_SAVE" |
331 | ], | 309 | ], |
332 | [ | 310 | [AC_MSG_ERROR([Fribidi not found])]) |
333 | AC_MSG_ERROR([Fribidi not found]) | ||
334 | ]) | ||
335 | fi | 311 | fi |
336 | 312 | ||
337 | # harfbuzz support | 313 | # harfbuzz support |
@@ -814,7 +790,7 @@ fi | |||
814 | ##################################################################### | 790 | ##################################################################### |
815 | ## Font Loaders | 791 | ## Font Loaders |
816 | 792 | ||
817 | PKG_CHECK_MODULES([EET], [eet >= 1.7.0], [], [AC_MSG_ERROR([EET not found])]) | 793 | PKG_CHECK_MODULES([EET], [eet >= 1.7.0]) |
818 | requirement_evas="eet >= 1.7.0 ${requirement_evas}" | 794 | requirement_evas="eet >= 1.7.0 ${requirement_evas}" |
819 | 795 | ||
820 | ##################################################################### | 796 | ##################################################################### |
@@ -897,8 +873,6 @@ AM_CONDITIONAL(EVAS_STATIC_BUILD_WBMP, [${do_static}]) | |||
897 | AC_DEFINE(BUILD_LOADER_WBMP, [1], [WBMP Loader]) | 873 | AC_DEFINE(BUILD_LOADER_WBMP, [1], [WBMP Loader]) |
898 | 874 | ||
899 | ##################################################################### | 875 | ##################################################################### |
900 | PKG_CHECK_MODULES([EET], [eet >= 1.7.0], [requirement="eet >= 1.7.0"], [AC_MSG_ERROR([Eet not found])]) | ||
901 | dnl requirement_evas="${requirement} ${requirement_evas}" | ||
902 | evas_image_loader_eet_cflags="${EET_CFLAGS}" | 876 | evas_image_loader_eet_cflags="${EET_CFLAGS}" |
903 | evas_image_loader_eet_libs="${EET_LIBS}" | 877 | evas_image_loader_eet_libs="${EET_LIBS}" |
904 | AC_SUBST([evas_image_loader_eet_cflags]) | 878 | AC_SUBST([evas_image_loader_eet_cflags]) |
@@ -974,7 +948,7 @@ EVAS_CHECK_IMAGE_LOADER([SVG], [${want_evas_image_loader_svg}]) | |||
974 | # basic pthread support | 948 | # basic pthread support |
975 | AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([Pthread support missing.])]) | 949 | AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([Pthread support missing.])]) |
976 | # sched_getaffinity pthread_attr_setaffinity_np | 950 | # sched_getaffinity pthread_attr_setaffinity_np |
977 | AC_CHECK_HEADERS([pthread.h sched.h], | 951 | AC_CHECK_HEADERS([pthread.h], |
978 | [ | 952 | [ |
979 | CFLAGS_save="${CFLAGS}" | 953 | CFLAGS_save="${CFLAGS}" |
980 | CFLAGS="${CFLAGS} -pthread" | 954 | CFLAGS="${CFLAGS} -pthread" |
@@ -982,18 +956,29 @@ AC_CHECK_HEADERS([pthread.h sched.h], | |||
982 | LIBS="${LIBS} -pthread" | 956 | LIBS="${LIBS} -pthread" |
983 | AC_LINK_IFELSE( | 957 | AC_LINK_IFELSE( |
984 | [AC_LANG_PROGRAM([[ | 958 | [AC_LANG_PROGRAM([[ |
959 | #include <stdlib.h> | ||
960 | #include <pthread.h> | ||
961 | ]], | ||
962 | [[ | ||
963 | pthread_barrier_wait(NULL); | ||
964 | ]])], | ||
965 | [], | ||
966 | [AC_MSG_ERROR([Your pthread implementation does not have pthread_barrier_wait])]) | ||
967 | AC_LINK_IFELSE( | ||
968 | [AC_LANG_PROGRAM([[ | ||
969 | #include <stdlib.h> | ||
985 | #include <pthread.h> | 970 | #include <pthread.h> |
986 | #include <sched.h> | 971 | #include <sched.h> |
987 | ]], | 972 | ]], |
988 | [[ | 973 | [[ |
989 | pthread_attr_setaffinity_np(NULL, 0, NULL); | 974 | pthread_attr_setaffinity_np(NULL, 0, NULL); |
990 | pthread_barrier_wait(NULL); | 975 | ]])], |
991 | ]])], [], | 976 | [AC_DEFINE(HAVE_PTHREAD_AFFINITY, 1, [Pthread pthread_attr_setaffinity_np])], |
992 | [AC_MSG_ERROR([Missing pthread_attr_setaffinity_np or pthread_barrier_wait.])]) | 977 | []) |
993 | CFLAGS=${CFLAGS_save} | 978 | CFLAGS=${CFLAGS_save} |
994 | LIBS=${LIBS_save} | 979 | LIBS=${LIBS_save} |
995 | ], | 980 | ], |
996 | [AC_MSG_ERROR([Missing sched.h])]) | 981 | [AC_MSG_ERROR([Missing pthread.h])]) |
997 | pthread_cflags="-pthread" | 982 | pthread_cflags="-pthread" |
998 | pthread_libs="-pthread" | 983 | pthread_libs="-pthread" |
999 | AC_DEFINE(BUILD_ASYNC_EVENTS, 1, [Build async events support]) | 984 | AC_DEFINE(BUILD_ASYNC_EVENTS, 1, [Build async events support]) |
@@ -1175,40 +1160,6 @@ EVAS_CHECK_DITHER([line-dither-mask], [line dither mask], [conv_line_dither="yes | |||
1175 | EVAS_CHECK_DITHER([no-dither-mask], [conversion to 16bpp without dither mask], [conv_no_dither="yes"], [conv_no_dither="no"]) | 1160 | EVAS_CHECK_DITHER([no-dither-mask], [conversion to 16bpp without dither mask], [conv_no_dither="yes"], [conv_no_dither="no"]) |
1176 | 1161 | ||
1177 | ##################################################################### | 1162 | ##################################################################### |
1178 | ## no longer options - turn on. | ||
1179 | |||
1180 | AC_DEFINE(BUILD_CONVERT_8_RGB_332, 1, [8bpp RGB 332]) | ||
1181 | AC_DEFINE(BUILD_CONVERT_8_RGB_666, 1, [8bpp RGB 666]) | ||
1182 | AC_DEFINE(BUILD_CONVERT_8_RGB_232, 1, [8bpp RGB 232]) | ||
1183 | AC_DEFINE(BUILD_CONVERT_8_RGB_222, 1, [8bpp RGB 222]) | ||
1184 | AC_DEFINE(BUILD_CONVERT_8_RGB_221, 1, [8bpp RGB 221]) | ||
1185 | AC_DEFINE(BUILD_CONVERT_8_RGB_121, 1, [8bpp RGB 121]) | ||
1186 | AC_DEFINE(BUILD_CONVERT_8_RGB_111, 1, [8bpp RGB 111]) | ||
1187 | AC_DEFINE(BUILD_CONVERT_16_BGR_565, 1, [16bpp BGR 565]) | ||
1188 | AC_DEFINE(BUILD_CONVERT_16_RGB_565, 1, [16bpp RGB 565]) | ||
1189 | AC_DEFINE(BUILD_CONVERT_16_RGB_555, 1, [16bpp RGB 555]) | ||
1190 | AC_DEFINE(BUILD_CONVERT_16_RGB_444, 1, [16bpp RGB 444]) | ||
1191 | AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp RGB 565 (444 ipaq)]) | ||
1192 | AC_DEFINE(BUILD_CONVERT_16_RGB_ROT0, 1, [16bpp 0 dgeree rotation]) | ||
1193 | AC_DEFINE(BUILD_CONVERT_16_RGB_ROT90, 1, [16bpp 90 dgeree rotation]) | ||
1194 | AC_DEFINE(BUILD_CONVERT_16_RGB_ROT180, 1, [16bpp 180 dgeree rotation]) | ||
1195 | AC_DEFINE(BUILD_CONVERT_16_RGB_ROT270, 1, [16bpp 270 dgeree rotation]) | ||
1196 | AC_DEFINE(BUILD_CONVERT_24_RGB_888, 1, [24bpp RGB 888]) | ||
1197 | AC_DEFINE(BUILD_CONVERT_24_BGR_888, 1, [24bpp BGR 888]) | ||
1198 | AC_DEFINE(BUILD_CONVERT_32_RGB_8888, 1, [32bpp RGB 8888]) | ||
1199 | AC_DEFINE(BUILD_CONVERT_32_RGBX_8888, 1, [32bpp RGBX 8888]) | ||
1200 | AC_DEFINE(BUILD_CONVERT_32_BGR_8888, 1, [32bpp BGR 8888]) | ||
1201 | AC_DEFINE(BUILD_CONVERT_32_BGRX_8888, 1, [32bpp BGRX 8888]) | ||
1202 | AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp RGB 666 (666 ezx)]) | ||
1203 | AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp RGB 666 (666 ezx)]) | ||
1204 | AC_DEFINE(BUILD_CONVERT_32_RGB_ROT0, 1, [32bpp 0 dgeree rotation]) | ||
1205 | AC_DEFINE(BUILD_CONVERT_32_RGB_ROT90, 1, [32bpp 90 dgeree rotation]) | ||
1206 | AC_DEFINE(BUILD_CONVERT_32_RGB_ROT180, 1, [32bpp 180 dgeree rotation]) | ||
1207 | AC_DEFINE(BUILD_CONVERT_32_RGB_ROT270, 1, [32bpp 270 dgeree rotation]) | ||
1208 | AC_DEFINE(BUILD_CONVERT_8_GRY_1, 1, [1bpp Mono]) | ||
1209 | AC_DEFINE(BUILD_CONVERT_8_GRY_16, 1, [4bpp Greyscale]) | ||
1210 | AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [32bpp Grayscale 64 palette]) | ||
1211 | |||
1212 | ## valgrind | 1163 | ## valgrind |
1213 | want_valgrind="no" | 1164 | want_valgrind="no" |
1214 | have_valgrind="no" | 1165 | have_valgrind="no" |
@@ -1262,7 +1213,7 @@ AC_ARG_ENABLE([build-examples], | |||
1262 | # put in here the dependencies for Evas' examples. they are | 1213 | # put in here the dependencies for Evas' examples. they are |
1263 | # meant to be 'real world' usage examples, thus one will be | 1214 | # meant to be 'real world' usage examples, thus one will be |
1264 | # using higher level libraries on these programs | 1215 | # using higher level libraries on these programs |
1265 | PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas ecore], [], [build_examples="no"]) | 1216 | PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas ecore], [build_examples="no"]) |
1266 | PKG_CHECK_MODULES([EDJE], [edje], | 1217 | PKG_CHECK_MODULES([EDJE], [edje], |
1267 | [edje_cc=$($PKG_CONFIG --variable=prefix edje)/bin/edje_cc], | 1218 | [edje_cc=$($PKG_CONFIG --variable=prefix edje)/bin/edje_cc], |
1268 | [build_examples="no"]) | 1219 | [build_examples="no"]) |
@@ -1452,7 +1403,6 @@ echo | |||
1452 | echo "Font Rendering Helpers:" | 1403 | echo "Font Rendering Helpers:" |
1453 | echo " Fribidi.................: $have_fribidi" | 1404 | echo " Fribidi.................: $have_fribidi" |
1454 | echo " Harfbuzz................: $have_harfbuzz" | 1405 | echo " Harfbuzz................: $have_harfbuzz" |
1455 | echo " liblinebreak............: $have_linebreak" | ||
1456 | # FIXME: add non freetype2 font engine support | 1406 | # FIXME: add non freetype2 font engine support |
1457 | # FIXME: make freetype2 optional | 1407 | # FIXME: make freetype2 optional |
1458 | echo | 1408 | echo |
@@ -1467,6 +1417,7 @@ echo " MAGIC_DEBUG.............: $want_evas_magic_debug" | |||
1467 | echo " Cache Server 2..........: $want_evas_cserve2" | 1417 | echo " Cache Server 2..........: $want_evas_cserve2" |
1468 | echo " Threaded Pipe Rendering.: $build_pipe_render" | 1418 | echo " Threaded Pipe Rendering.: $build_pipe_render" |
1469 | echo | 1419 | echo |
1420 | echo "Optional pixman rendering path:" | ||
1470 | echo " Pixman..................: $have_pixman" | 1421 | echo " Pixman..................: $have_pixman" |
1471 | echo " Pixman Fonts............: $have_pixman_font" | 1422 | echo " Pixman Fonts............: $have_pixman_font" |
1472 | echo " Pixman Rects............: $have_pixman_rect" | 1423 | echo " Pixman Rects............: $have_pixman_rect" |
@@ -1475,12 +1426,11 @@ echo " Pixman Polygons.........: $have_pixman_poly" | |||
1475 | echo " Pixman Images...........: $have_pixman_image" | 1426 | echo " Pixman Images...........: $have_pixman_image" |
1476 | echo " Pixman Image ScaleSample: $have_pixman_image_scale_sample" | 1427 | echo " Pixman Image ScaleSample: $have_pixman_image_scale_sample" |
1477 | echo | 1428 | echo |
1478 | echo " Tiled 32BPP rotate......: $have_tile_rotate" | ||
1479 | echo | ||
1480 | echo "Conversion Options:" | 1429 | echo "Conversion Options:" |
1481 | echo " Smaller Dither Mask.....: $conv_small_dither" | 1430 | echo " Smaller Dither Mask.....: $conv_small_dither" |
1482 | echo " Line Dither Mask........: $conv_line_dither" | 1431 | echo " Line Dither Mask........: $conv_line_dither" |
1483 | echo " No Dither Mask for 16bpp: $conv_no_dither" | 1432 | echo " No Dither Mask for 16bpp: $conv_no_dither" |
1433 | echo " Tiled 32BPP rotate......: $have_tile_rotate" | ||
1484 | echo | 1434 | echo |
1485 | echo "Documentation.............: ${build_doc}" | 1435 | echo "Documentation.............: ${build_doc}" |
1486 | echo "Examples..................: install:${install_examples} build:${build_examples}" | 1436 | echo "Examples..................: install:${install_examples} build:${build_examples}" |
diff --git a/legacy/evas/src/lib/cache/evas_cache_image.c b/legacy/evas/src/lib/cache/evas_cache_image.c index 8d96964604..a8bafd764b 100644 --- a/legacy/evas/src/lib/cache/evas_cache_image.c +++ b/legacy/evas/src/lib/cache/evas_cache_image.c | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | //#define CACHEDUMP 1 | 18 | //#define CACHEDUMP 1 |
19 | 19 | ||
20 | #ifdef BUILD_ASYNC_PRELOAD | ||
21 | typedef struct _Evas_Cache_Preload Evas_Cache_Preload; | 20 | typedef struct _Evas_Cache_Preload Evas_Cache_Preload; |
22 | 21 | ||
23 | struct _Evas_Cache_Preload | 22 | struct _Evas_Cache_Preload |
@@ -33,7 +32,6 @@ static int _evas_cache_mutex_init = 0; | |||
33 | static Eina_Condition cond_wakeup; | 32 | static Eina_Condition cond_wakeup; |
34 | 33 | ||
35 | static void _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target); | 34 | static void _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target); |
36 | #endif | ||
37 | 35 | ||
38 | #define FREESTRC(Var) \ | 36 | #define FREESTRC(Var) \ |
39 | if (Var) \ | 37 | if (Var) \ |
@@ -153,7 +151,6 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie) | |||
153 | { | 151 | { |
154 | if (!ie) return; | 152 | if (!ie) return; |
155 | if (cache->func.debug) cache->func.debug("deleting", ie); | 153 | if (cache->func.debug) cache->func.debug("deleting", ie); |
156 | #ifdef BUILD_ASYNC_PRELOAD | ||
157 | if (ie->flags.delete_me == 1) return; | 154 | if (ie->flags.delete_me == 1) return; |
158 | if (ie->preload) | 155 | if (ie->preload) |
159 | { | 156 | { |
@@ -161,7 +158,6 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie) | |||
161 | _evas_cache_image_entry_preload_remove(ie, NULL); | 158 | _evas_cache_image_entry_preload_remove(ie, NULL); |
162 | return; | 159 | return; |
163 | } | 160 | } |
164 | #endif | ||
165 | 161 | ||
166 | _evas_cache_image_dirty_del(ie); | 162 | _evas_cache_image_dirty_del(ie); |
167 | _evas_cache_image_activ_del(ie); | 163 | _evas_cache_image_activ_del(ie); |
@@ -175,10 +171,8 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie) | |||
175 | ie->cache = NULL; | 171 | ie->cache = NULL; |
176 | cache->func.surface_delete(ie); | 172 | cache->func.surface_delete(ie); |
177 | 173 | ||
178 | #ifdef BUILD_ASYNC_PRELOAD | ||
179 | LKD(ie->lock); | 174 | LKD(ie->lock); |
180 | LKD(ie->lock_cancel); | 175 | LKD(ie->lock_cancel); |
181 | #endif | ||
182 | cache->func.dealloc(ie); | 176 | cache->func.dealloc(ie); |
183 | } | 177 | } |
184 | 178 | ||
@@ -244,10 +238,8 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache, | |||
244 | if (tstamp) ie->tstamp = *tstamp; | 238 | if (tstamp) ie->tstamp = *tstamp; |
245 | else memset(&ie->tstamp, 0, sizeof(Image_Timestamp)); | 239 | else memset(&ie->tstamp, 0, sizeof(Image_Timestamp)); |
246 | 240 | ||
247 | #ifdef BUILD_ASYNC_PRELOAD | ||
248 | LKI(ie->lock); | 241 | LKI(ie->lock); |
249 | LKI(ie->lock_cancel); | 242 | LKI(ie->lock_cancel); |
250 | #endif | ||
251 | 243 | ||
252 | if (lo) ie->load_opts = *lo; | 244 | if (lo) ie->load_opts = *lo; |
253 | if (ie->file) | 245 | if (ie->file) |
@@ -289,16 +281,11 @@ _evas_cache_image_entry_surface_alloc(Evas_Cache_Image *cache, | |||
289 | { | 281 | { |
290 | int wmin = w > 0 ? w : 1; | 282 | int wmin = w > 0 ? w : 1; |
291 | int hmin = h > 0 ? h : 1; | 283 | int hmin = h > 0 ? h : 1; |
292 | #ifdef BUILD_ASYNC_PRELOAD | ||
293 | LKL(engine_lock); | 284 | LKL(engine_lock); |
294 | #endif | ||
295 | _evas_cache_image_entry_surface_alloc__locked(cache, ie, wmin, hmin); | 285 | _evas_cache_image_entry_surface_alloc__locked(cache, ie, wmin, hmin); |
296 | #ifdef BUILD_ASYNC_PRELOAD | ||
297 | LKU(engine_lock); | 286 | LKU(engine_lock); |
298 | #endif | ||
299 | } | 287 | } |
300 | 288 | ||
301 | #ifdef BUILD_ASYNC_PRELOAD | ||
302 | static void | 289 | static void |
303 | _evas_cache_image_async_heavy(void *data) | 290 | _evas_cache_image_async_heavy(void *data) |
304 | { | 291 | { |
@@ -457,7 +444,6 @@ _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target) | |||
457 | evas_preload_thread_cancel(ie->preload); | 444 | evas_preload_thread_cancel(ie->preload); |
458 | } | 445 | } |
459 | } | 446 | } |
460 | #endif | ||
461 | 447 | ||
462 | EAPI int | 448 | EAPI int |
463 | evas_cache_image_usage_get(Evas_Cache_Image *cache) | 449 | evas_cache_image_usage_get(Evas_Cache_Image *cache) |
@@ -487,14 +473,12 @@ evas_cache_image_init(const Evas_Cache_Image_Func *cb) | |||
487 | { | 473 | { |
488 | Evas_Cache_Image *cache; | 474 | Evas_Cache_Image *cache; |
489 | 475 | ||
490 | #ifdef BUILD_ASYNC_PRELOAD | ||
491 | if (_evas_cache_mutex_init++ == 0) | 476 | if (_evas_cache_mutex_init++ == 0) |
492 | { | 477 | { |
493 | LKI(engine_lock); | 478 | LKI(engine_lock); |
494 | LKI(wakeup); | 479 | LKI(wakeup); |
495 | eina_condition_new(&cond_wakeup, &wakeup); | 480 | eina_condition_new(&cond_wakeup, &wakeup); |
496 | } | 481 | } |
497 | #endif | ||
498 | 482 | ||
499 | cache = calloc(1, sizeof(Evas_Cache_Image)); | 483 | cache = calloc(1, sizeof(Evas_Cache_Image)); |
500 | if (!cache) return NULL; | 484 | if (!cache) return NULL; |
@@ -525,7 +509,6 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache) | |||
525 | return; | 509 | return; |
526 | } | 510 | } |
527 | 511 | ||
528 | #ifdef BUILD_ASYNC_PRELOAD | ||
529 | EINA_LIST_FREE(cache->preload, im) | 512 | EINA_LIST_FREE(cache->preload, im) |
530 | { | 513 | { |
531 | /* By doing that we are protecting us from destroying image when the cache is no longer available. */ | 514 | /* By doing that we are protecting us from destroying image when the cache is no longer available. */ |
@@ -533,7 +516,6 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache) | |||
533 | _evas_cache_image_entry_preload_remove(im, NULL); | 516 | _evas_cache_image_entry_preload_remove(im, NULL); |
534 | } | 517 | } |
535 | evas_async_events_process(); | 518 | evas_async_events_process(); |
536 | #endif | ||
537 | while (cache->lru) | 519 | while (cache->lru) |
538 | { | 520 | { |
539 | im = (Image_Entry *)cache->lru; | 521 | im = (Image_Entry *)cache->lru; |
@@ -558,7 +540,6 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache) | |||
558 | delete_list = eina_list_remove_list(delete_list, delete_list); | 540 | delete_list = eina_list_remove_list(delete_list, delete_list); |
559 | } | 541 | } |
560 | 542 | ||
561 | #ifdef BUILD_ASYNC_PRELOAD | ||
562 | /* Now wait for all pending image to die */ | 543 | /* Now wait for all pending image to die */ |
563 | while (cache->pending) | 544 | while (cache->pending) |
564 | { | 545 | { |
@@ -570,19 +551,16 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache) | |||
570 | if (cache->pending) eina_condition_wait(&cond_wakeup); | 551 | if (cache->pending) eina_condition_wait(&cond_wakeup); |
571 | LKU(wakeup); | 552 | LKU(wakeup); |
572 | } | 553 | } |
573 | #endif | ||
574 | eina_hash_free(cache->activ); | 554 | eina_hash_free(cache->activ); |
575 | eina_hash_free(cache->inactiv); | 555 | eina_hash_free(cache->inactiv); |
576 | free(cache); | 556 | free(cache); |
577 | 557 | ||
578 | #ifdef BUILD_ASYNC_PRELOAD | ||
579 | if (--_evas_cache_mutex_init == 0) | 558 | if (--_evas_cache_mutex_init == 0) |
580 | { | 559 | { |
581 | eina_condition_free(&cond_wakeup); | 560 | eina_condition_free(&cond_wakeup); |
582 | LKD(engine_lock); | 561 | LKD(engine_lock); |
583 | LKD(wakeup); | 562 | LKD(wakeup); |
584 | } | 563 | } |
585 | #endif | ||
586 | } | 564 | } |
587 | 565 | ||
588 | EAPI Image_Entry * | 566 | EAPI Image_Entry * |
@@ -774,14 +752,11 @@ evas_cache_image_drop(Image_Entry *im) | |||
774 | 752 | ||
775 | if (references == 0) | 753 | if (references == 0) |
776 | { | 754 | { |
777 | #ifdef BUILD_ASYNC_PRELOAD | ||
778 | if (im->preload) | 755 | if (im->preload) |
779 | { | 756 | { |
780 | _evas_cache_image_entry_preload_remove(im, NULL); | 757 | _evas_cache_image_entry_preload_remove(im, NULL); |
781 | return; | 758 | return; |
782 | } | 759 | } |
783 | #endif | ||
784 | |||
785 | if (im->flags.dirty) | 760 | if (im->flags.dirty) |
786 | { | 761 | { |
787 | _evas_cache_image_entry_delete(cache, im); | 762 | _evas_cache_image_entry_delete(cache, im); |
@@ -812,25 +787,16 @@ evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned | |||
812 | cache = im->cache; | 787 | cache = im->cache; |
813 | if (!(im->flags.dirty)) | 788 | if (!(im->flags.dirty)) |
814 | { | 789 | { |
815 | #ifndef EVAS_CSERVE | 790 | im_dirty = |
816 | int references; | 791 | evas_cache_image_copied_data(cache, im->w, im->h, |
817 | references = im->references; | 792 | evas_cache_image_pixels(im), |
818 | // if ref 1 also copy if using shared cache as its read-only | 793 | im->flags.alpha, im->space); |
819 | if (references == 1) im_dirty = im; | 794 | if (!im_dirty) goto on_error; |
820 | else | 795 | if (cache->func.debug) cache->func.debug("dirty-src", im); |
821 | #endif | 796 | cache->func.dirty(im_dirty, im); |
822 | { | 797 | if (cache->func.debug) cache->func.debug("dirty-out", im_dirty); |
823 | im_dirty = | 798 | im_dirty->references = 1; |
824 | evas_cache_image_copied_data(cache, im->w, im->h, | 799 | evas_cache_image_drop(im); |
825 | evas_cache_image_pixels(im), | ||
826 | im->flags.alpha, im->space); | ||
827 | if (!im_dirty) goto on_error; | ||
828 | if (cache->func.debug) cache->func.debug("dirty-src", im); | ||
829 | cache->func.dirty(im_dirty, im); | ||
830 | if (cache->func.debug) cache->func.debug("dirty-out", im_dirty); | ||
831 | im_dirty->references = 1; | ||
832 | evas_cache_image_drop(im); | ||
833 | } | ||
834 | _evas_cache_image_dirty_add(im_dirty); | 800 | _evas_cache_image_dirty_add(im_dirty); |
835 | } | 801 | } |
836 | 802 | ||
@@ -983,13 +949,10 @@ on_error: | |||
983 | EAPI int | 949 | EAPI int |
984 | evas_cache_image_load_data(Image_Entry *im) | 950 | evas_cache_image_load_data(Image_Entry *im) |
985 | { | 951 | { |
986 | #ifdef BUILD_ASYNC_PRELOAD | ||
987 | Eina_Bool preload = EINA_FALSE; | 952 | Eina_Bool preload = EINA_FALSE; |
988 | #endif | ||
989 | int error = EVAS_LOAD_ERROR_NONE; | 953 | int error = EVAS_LOAD_ERROR_NONE; |
990 | 954 | ||
991 | if ((im->flags.loaded) && (!im->flags.animated)) return error; | 955 | if ((im->flags.loaded) && (!im->flags.animated)) return error; |
992 | #ifdef BUILD_ASYNC_PRELOAD | ||
993 | if (im->preload) | 956 | if (im->preload) |
994 | { | 957 | { |
995 | preload = EINA_TRUE; | 958 | preload = EINA_TRUE; |
@@ -1001,6 +964,7 @@ evas_cache_image_load_data(Image_Entry *im) | |||
1001 | evas_preload_thread_cancel(im->preload); | 964 | evas_preload_thread_cancel(im->preload); |
1002 | } | 965 | } |
1003 | evas_async_events_process(); | 966 | evas_async_events_process(); |
967 | |||
1004 | LKL(wakeup); | 968 | LKL(wakeup); |
1005 | while (im->preload) | 969 | while (im->preload) |
1006 | { | 970 | { |
@@ -1013,14 +977,13 @@ evas_cache_image_load_data(Image_Entry *im) | |||
1013 | } | 977 | } |
1014 | 978 | ||
1015 | if ((im->flags.loaded) && (!im->flags.animated)) return error; | 979 | if ((im->flags.loaded) && (!im->flags.animated)) return error; |
980 | |||
1016 | LKL(im->lock); | 981 | LKL(im->lock); |
1017 | #endif | ||
1018 | im->flags.in_progress = EINA_TRUE; | 982 | im->flags.in_progress = EINA_TRUE; |
1019 | error = im->cache->func.load(im); | 983 | error = im->cache->func.load(im); |
1020 | im->flags.in_progress = EINA_FALSE; | 984 | im->flags.in_progress = EINA_FALSE; |
1021 | #ifdef BUILD_ASYNC_PRELOAD | ||
1022 | LKU(im->lock); | 985 | LKU(im->lock); |
1023 | #endif | 986 | |
1024 | im->flags.loaded = 1; | 987 | im->flags.loaded = 1; |
1025 | if (im->cache->func.debug) im->cache->func.debug("load", im); | 988 | if (im->cache->func.debug) im->cache->func.debug("load", im); |
1026 | if (error != EVAS_LOAD_ERROR_NONE) | 989 | if (error != EVAS_LOAD_ERROR_NONE) |
@@ -1028,9 +991,7 @@ evas_cache_image_load_data(Image_Entry *im) | |||
1028 | _evas_cache_image_entry_surface_alloc(im->cache, im, im->w, im->h); | 991 | _evas_cache_image_entry_surface_alloc(im->cache, im, im->w, im->h); |
1029 | im->flags.loaded = 0; | 992 | im->flags.loaded = 0; |
1030 | } | 993 | } |
1031 | #ifdef BUILD_ASYNC_PRELOAD | ||
1032 | if (preload) _evas_cache_image_async_end(im); | 994 | if (preload) _evas_cache_image_async_end(im); |
1033 | #endif | ||
1034 | return error; | 995 | return error; |
1035 | } | 996 | } |
1036 | 997 | ||
@@ -1039,7 +1000,7 @@ evas_cache_image_unload_data(Image_Entry *im) | |||
1039 | { | 1000 | { |
1040 | if (im->flags.in_progress) return; | 1001 | if (im->flags.in_progress) return; |
1041 | evas_cache_image_preload_cancel(im, NULL); | 1002 | evas_cache_image_preload_cancel(im, NULL); |
1042 | #ifdef BUILD_ASYNC_PRELOAD | 1003 | |
1043 | LKL(im->lock_cancel); | 1004 | LKL(im->lock_cancel); |
1044 | if (LKT(im->lock) == EINA_FALSE) /* can't get image lock - busy async load */ | 1005 | if (LKT(im->lock) == EINA_FALSE) /* can't get image lock - busy async load */ |
1045 | { | 1006 | { |
@@ -1048,19 +1009,15 @@ evas_cache_image_unload_data(Image_Entry *im) | |||
1048 | return; | 1009 | return; |
1049 | } | 1010 | } |
1050 | LKU(im->lock_cancel); | 1011 | LKU(im->lock_cancel); |
1051 | #endif | 1012 | |
1052 | if ((!im->flags.loaded) || (!im->file) || (!im->info.module) || | 1013 | if ((!im->flags.loaded) || (!im->file) || (!im->info.module) || |
1053 | (im->flags.dirty)) | 1014 | (im->flags.dirty)) |
1054 | { | 1015 | { |
1055 | #ifdef BUILD_ASYNC_PRELOAD | ||
1056 | LKU(im->lock); | 1016 | LKU(im->lock); |
1057 | #endif | ||
1058 | return; | 1017 | return; |
1059 | } | 1018 | } |
1060 | im->cache->func.destructor(im); | 1019 | im->cache->func.destructor(im); |
1061 | #ifdef BUILD_ASYNC_PRELOAD | ||
1062 | LKU(im->lock); | 1020 | LKU(im->lock); |
1063 | #endif | ||
1064 | //FIXME: imagedataunload - inform owners | 1021 | //FIXME: imagedataunload - inform owners |
1065 | } | 1022 | } |
1066 | 1023 | ||
@@ -1092,7 +1049,6 @@ evas_cache_image_is_loaded(Image_Entry *im) | |||
1092 | EAPI void | 1049 | EAPI void |
1093 | evas_cache_image_preload_data(Image_Entry *im, const void *target) | 1050 | evas_cache_image_preload_data(Image_Entry *im, const void *target) |
1094 | { | 1051 | { |
1095 | #ifdef BUILD_ASYNC_PRELOAD | ||
1096 | RGBA_Image *img = (RGBA_Image *)im; | 1052 | RGBA_Image *img = (RGBA_Image *)im; |
1097 | 1053 | ||
1098 | if ((im->flags.loaded) && (img->image.data)) | 1054 | if ((im->flags.loaded) && (img->image.data)) |
@@ -1103,22 +1059,13 @@ evas_cache_image_preload_data(Image_Entry *im, const void *target) | |||
1103 | im->flags.loaded = 0; | 1059 | im->flags.loaded = 0; |
1104 | if (!_evas_cache_image_entry_preload_add(im, target)) | 1060 | if (!_evas_cache_image_entry_preload_add(im, target)) |
1105 | evas_object_inform_call_image_preloaded((Evas_Object *)target); | 1061 | evas_object_inform_call_image_preloaded((Evas_Object *)target); |
1106 | #else | ||
1107 | evas_cache_image_load_data(im); | ||
1108 | evas_object_inform_call_image_preloaded((Evas_Object *)target); | ||
1109 | #endif | ||
1110 | } | 1062 | } |
1111 | 1063 | ||
1112 | EAPI void | 1064 | EAPI void |
1113 | evas_cache_image_preload_cancel(Image_Entry *im, const void *target) | 1065 | evas_cache_image_preload_cancel(Image_Entry *im, const void *target) |
1114 | { | 1066 | { |
1115 | #ifdef BUILD_ASYNC_PRELOAD | ||
1116 | if (!target) return; | 1067 | if (!target) return; |
1117 | _evas_cache_image_entry_preload_remove(im, target); | 1068 | _evas_cache_image_entry_preload_remove(im, target); |
1118 | #else | ||
1119 | (void)im; | ||
1120 | (void)target; | ||
1121 | #endif | ||
1122 | } | 1069 | } |
1123 | 1070 | ||
1124 | #ifdef CACHEDUMP | 1071 | #ifdef CACHEDUMP |
@@ -1242,8 +1189,6 @@ evas_cache_image_pixels(Image_Entry *im) | |||
1242 | EAPI void | 1189 | EAPI void |
1243 | evas_cache_image_wakeup(void) | 1190 | evas_cache_image_wakeup(void) |
1244 | { | 1191 | { |
1245 | #ifdef BUILD_ASYNC_PRELOAD | ||
1246 | if (_evas_cache_mutex_init > 0) | 1192 | if (_evas_cache_mutex_init > 0) |
1247 | eina_condition_broadcast(&cond_wakeup); | 1193 | eina_condition_broadcast(&cond_wakeup); |
1248 | #endif | ||
1249 | } | 1194 | } |
diff --git a/legacy/evas/src/lib/cache/evas_preload.c b/legacy/evas/src/lib/cache/evas_preload.c index 5eebaedc80..6909d5c9f6 100644 --- a/legacy/evas/src/lib/cache/evas_preload.c +++ b/legacy/evas/src/lib/cache/evas_preload.c | |||
@@ -1,24 +1,17 @@ | |||
1 | #ifdef HAVE_CONFIG_H | 1 | #ifdef HAVE_CONFIG_H |
2 | # include <config.h> | 2 | # include <config.h> |
3 | #endif | 3 | #endif |
4 | |||
5 | #ifdef HAVE_EVIL | 4 | #ifdef HAVE_EVIL |
6 | # include <Evil.h> | 5 | # include <Evil.h> |
7 | #endif | 6 | #endif |
8 | 7 | #include <pthread.h> | |
9 | #ifdef BUILD_ASYNC_PRELOAD | 8 | #ifdef __linux__ |
10 | # include <pthread.h> | ||
11 | # ifdef __linux__ | ||
12 | # include <sys/syscall.h> | 9 | # include <sys/syscall.h> |
13 | # endif | ||
14 | #endif | 10 | #endif |
15 | |||
16 | #include "evas_common.h" | 11 | #include "evas_common.h" |
17 | #include "evas_private.h" | 12 | #include "evas_private.h" |
18 | #include "Evas.h" | 13 | #include "Evas.h" |
19 | 14 | ||
20 | #ifdef BUILD_ASYNC_PRELOAD | ||
21 | |||
22 | static int _threads_max = 0; | 15 | static int _threads_max = 0; |
23 | 16 | ||
24 | typedef struct _Evas_Preload_Pthread_Worker Evas_Preload_Pthread_Worker; | 17 | typedef struct _Evas_Preload_Pthread_Worker Evas_Preload_Pthread_Worker; |
@@ -123,24 +116,20 @@ on_error: | |||
123 | evas_async_events_put(pth, 0, work, _evas_preload_thread_done); | 116 | evas_async_events_put(pth, 0, work, _evas_preload_thread_done); |
124 | return pth; | 117 | return pth; |
125 | } | 118 | } |
126 | #endif | ||
127 | 119 | ||
128 | void | 120 | void |
129 | _evas_preload_thread_init(void) | 121 | _evas_preload_thread_init(void) |
130 | { | 122 | { |
131 | #ifdef BUILD_ASYNC_PRELOAD | ||
132 | _threads_max = eina_cpu_count(); | 123 | _threads_max = eina_cpu_count(); |
133 | if (_threads_max < 1) _threads_max = 1; | 124 | if (_threads_max < 1) _threads_max = 1; |
134 | 125 | ||
135 | LKI(_mutex); | 126 | LKI(_mutex); |
136 | #endif | ||
137 | } | 127 | } |
138 | 128 | ||
139 | void | 129 | void |
140 | _evas_preload_thread_shutdown(void) | 130 | _evas_preload_thread_shutdown(void) |
141 | { | 131 | { |
142 | /* FIXME: If function are still running in the background, should we kill them ? */ | 132 | /* FIXME: If function are still running in the background, should we kill them ? */ |
143 | #ifdef BUILD_ASYNC_PRELOAD | ||
144 | Evas_Preload_Pthread_Worker *work; | 133 | Evas_Preload_Pthread_Worker *work; |
145 | 134 | ||
146 | /* Force processing of async events. */ | 135 | /* Force processing of async events. */ |
@@ -158,7 +147,6 @@ _evas_preload_thread_shutdown(void) | |||
158 | LKU(_mutex); | 147 | LKU(_mutex); |
159 | 148 | ||
160 | LKD(_mutex); | 149 | LKD(_mutex); |
161 | #endif | ||
162 | } | 150 | } |
163 | 151 | ||
164 | Evas_Preload_Pthread * | 152 | Evas_Preload_Pthread * |
@@ -167,7 +155,6 @@ evas_preload_thread_run(void (*func_heavy) (void *data), | |||
167 | void (*func_cancel) (void *data), | 155 | void (*func_cancel) (void *data), |
168 | const void *data) | 156 | const void *data) |
169 | { | 157 | { |
170 | #ifdef BUILD_ASYNC_PRELOAD | ||
171 | Evas_Preload_Pthread_Worker *work; | 158 | Evas_Preload_Pthread_Worker *work; |
172 | Evas_Preload_Pthread_Data *pth; | 159 | Evas_Preload_Pthread_Data *pth; |
173 | 160 | ||
@@ -220,22 +207,11 @@ evas_preload_thread_run(void (*func_heavy) (void *data), | |||
220 | } | 207 | } |
221 | LKU(_mutex); | 208 | LKU(_mutex); |
222 | return NULL; | 209 | return NULL; |
223 | #else | ||
224 | /* | ||
225 | If no thread and as we don't want to break app that rely on this | ||
226 | facility, we will lock the interface until we are done. | ||
227 | */ | ||
228 | (void)func_cancel; | ||
229 | func_heavy((void *)data); | ||
230 | func_end((void *)data); | ||
231 | return (void *)1; | ||
232 | #endif | ||
233 | } | 210 | } |
234 | 211 | ||
235 | Eina_Bool | 212 | Eina_Bool |
236 | evas_preload_thread_cancel(Evas_Preload_Pthread *thread) | 213 | evas_preload_thread_cancel(Evas_Preload_Pthread *thread) |
237 | { | 214 | { |
238 | #ifdef BUILD_ASYNC_PRELOAD | ||
239 | Evas_Preload_Pthread_Worker *work; | 215 | Evas_Preload_Pthread_Worker *work; |
240 | 216 | ||
241 | if (!thread) return EINA_TRUE; | 217 | if (!thread) return EINA_TRUE; |
@@ -259,8 +235,4 @@ evas_preload_thread_cancel(Evas_Preload_Pthread *thread) | |||
259 | work = (Evas_Preload_Pthread_Worker *)thread; | 235 | work = (Evas_Preload_Pthread_Worker *)thread; |
260 | work->cancel = EINA_TRUE; | 236 | work->cancel = EINA_TRUE; |
261 | return EINA_FALSE; | 237 | return EINA_FALSE; |
262 | #else | ||
263 | (void) thread; | ||
264 | return EINA_TRUE; | ||
265 | #endif | ||
266 | } | 238 | } |
diff --git a/legacy/evas/src/lib/canvas/Makefile.am b/legacy/evas/src/lib/canvas/Makefile.am index b5c27408b8..c9ac48a51a 100644 --- a/legacy/evas/src/lib/canvas/Makefile.am +++ b/legacy/evas/src/lib/canvas/Makefile.am | |||
@@ -16,7 +16,8 @@ AM_CPPFLAGS = \ | |||
16 | @EVAS_GENERAL_CFLAGS@ \ | 16 | @EVAS_GENERAL_CFLAGS@ \ |
17 | @EVIL_CFLAGS@ \ | 17 | @EVIL_CFLAGS@ \ |
18 | @PIXMAN_CFLAGS@ \ | 18 | @PIXMAN_CFLAGS@ \ |
19 | @FRIBIDI_CFLAGS@ | 19 | @FRIBIDI_CFLAGS@ \ |
20 | @LINEBREAK_CFLAGS@ | ||
20 | 21 | ||
21 | noinst_LTLIBRARIES = libevas_canvas.la | 22 | noinst_LTLIBRARIES = libevas_canvas.la |
22 | libevas_canvas_la_SOURCES = \ | 23 | libevas_canvas_la_SOURCES = \ |
@@ -60,14 +61,7 @@ evas_touch_point.c \ | |||
60 | evas_map.c \ | 61 | evas_map.c \ |
61 | evas_gl.c | 62 | evas_gl.c |
62 | 63 | ||
63 | #evas_object_textgrid.c | 64 | libevas_canvas_la_LIBADD = @EVAS_LIBS@ @EVIL_LIBS@ @LINEBREAK_LIBS@ |
64 | |||
65 | libevas_canvas_la_LIBADD = @EVAS_LIBS@ @EVIL_LIBS@ | ||
66 | |||
67 | if EVAS_USE_LINEBREAK | ||
68 | AM_CPPFLAGS += @LINEBREAK_CFLAGS@ | ||
69 | libevas_canvas_la_LIBADD += @LINEBREAK_LIBS@ | ||
70 | endif | ||
71 | 65 | ||
72 | clean-local: | 66 | clean-local: |
73 | rm -rf *.gcno | 67 | rm -rf *.gcno |
diff --git a/legacy/evas/src/lib/canvas/evas_async_events.c b/legacy/evas/src/lib/canvas/evas_async_events.c index 1002d3d53b..c8f114e484 100644 --- a/legacy/evas/src/lib/canvas/evas_async_events.c +++ b/legacy/evas/src/lib/canvas/evas_async_events.c | |||
@@ -2,21 +2,15 @@ | |||
2 | # include <config.h> | 2 | # include <config.h> |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | #ifdef BUILD_ASYNC_EVENTS | 5 | #ifndef _MSC_VER |
6 | 6 | # include <unistd.h> | |
7 | # ifndef _MSC_VER | ||
8 | # include <unistd.h> | ||
9 | # endif | ||
10 | # include <fcntl.h> | ||
11 | # include <errno.h> | ||
12 | |||
13 | #endif | 7 | #endif |
8 | #include <fcntl.h> | ||
9 | #include <errno.h> | ||
14 | 10 | ||
15 | #include "evas_common.h" | 11 | #include "evas_common.h" |
16 | #include "evas_private.h" | 12 | #include "evas_private.h" |
17 | 13 | ||
18 | #ifdef BUILD_ASYNC_EVENTS | ||
19 | |||
20 | static int _fd_write = -1; | 14 | static int _fd_write = -1; |
21 | static int _fd_read = -1; | 15 | static int _fd_read = -1; |
22 | static pid_t _fd_pid = 0; | 16 | static pid_t _fd_pid = 0; |
@@ -81,23 +75,16 @@ _evas_async_events_fork_handle(void) | |||
81 | for (i = 0; i < count; i++) evas_async_events_init(); | 75 | for (i = 0; i < count; i++) evas_async_events_init(); |
82 | } | 76 | } |
83 | 77 | ||
84 | #endif | ||
85 | |||
86 | EAPI int | 78 | EAPI int |
87 | evas_async_events_fd_get(void) | 79 | evas_async_events_fd_get(void) |
88 | { | 80 | { |
89 | #ifdef BUILD_ASYNC_EVENTS | ||
90 | _evas_async_events_fork_handle(); | 81 | _evas_async_events_fork_handle(); |
91 | return _fd_read; | 82 | return _fd_read; |
92 | #else | ||
93 | return -1; | ||
94 | #endif | ||
95 | } | 83 | } |
96 | 84 | ||
97 | EAPI int | 85 | EAPI int |
98 | evas_async_events_process(void) | 86 | evas_async_events_process(void) |
99 | { | 87 | { |
100 | #ifdef BUILD_ASYNC_EVENTS | ||
101 | Evas_Event_Async *ev; | 88 | Evas_Event_Async *ev; |
102 | int check; | 89 | int check; |
103 | int count = 0; | 90 | int count = 0; |
@@ -134,15 +121,11 @@ evas_async_events_process(void) | |||
134 | } | 121 | } |
135 | 122 | ||
136 | return count; | 123 | return count; |
137 | #else | ||
138 | return 0; | ||
139 | #endif | ||
140 | } | 124 | } |
141 | 125 | ||
142 | EAPI Eina_Bool | 126 | EAPI Eina_Bool |
143 | evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) | 127 | evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) |
144 | { | 128 | { |
145 | #ifdef BUILD_ASYNC_EVENTS | ||
146 | Evas_Event_Async *ev; | 129 | Evas_Event_Async *ev; |
147 | ssize_t check; | 130 | ssize_t check; |
148 | Eina_Bool result = EINA_FALSE; | 131 | Eina_Bool result = EINA_FALSE; |
@@ -184,8 +167,4 @@ evas_async_events_put(const void *target, Evas_Callback_Type type, void *event_i | |||
184 | } | 167 | } |
185 | 168 | ||
186 | return result; | 169 | return result; |
187 | #else | ||
188 | func((void*) target, type, event_info); | ||
189 | return EINA_TRUE; | ||
190 | #endif | ||
191 | } | 170 | } |
diff --git a/legacy/evas/src/lib/canvas/evas_main.c b/legacy/evas/src/lib/canvas/evas_main.c index b8d12662a3..9fc8aab0a3 100644 --- a/legacy/evas/src/lib/canvas/evas_main.c +++ b/legacy/evas/src/lib/canvas/evas_main.c | |||
@@ -51,27 +51,18 @@ evas_init(void) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | evas_module_init(); | 53 | evas_module_init(); |
54 | #ifdef BUILD_ASYNC_EVENTS | ||
55 | if (!evas_async_events_init()) | 54 | if (!evas_async_events_init()) |
56 | goto shutdown_module; | 55 | goto shutdown_module; |
57 | #endif | ||
58 | #ifdef EVAS_CSERVE | ||
59 | if (getenv("EVAS_CSERVE")) evas_cserve_init(); | ||
60 | #endif | ||
61 | #ifdef EVAS_CSERVE2 | 56 | #ifdef EVAS_CSERVE2 |
62 | if (getenv("EVAS_CSERVE2")) evas_cserve2_init(); | 57 | if (getenv("EVAS_CSERVE2")) evas_cserve2_init(); |
63 | #endif | 58 | #endif |
64 | #ifdef BUILD_ASYNC_PRELOAD | ||
65 | _evas_preload_thread_init(); | 59 | _evas_preload_thread_init(); |
66 | #endif | ||
67 | 60 | ||
68 | return _evas_init_count; | 61 | return _evas_init_count; |
69 | 62 | ||
70 | #ifdef BUILD_ASYNC_EVENTS | ||
71 | shutdown_module: | 63 | shutdown_module: |
72 | evas_module_shutdown(); | 64 | evas_module_shutdown(); |
73 | eina_log_domain_unregister(_evas_log_dom_global); | 65 | eina_log_domain_unregister(_evas_log_dom_global); |
74 | #endif | ||
75 | shutdown_eina: | 66 | shutdown_eina: |
76 | eina_shutdown(); | 67 | eina_shutdown(); |
77 | shutdown_evil: | 68 | shutdown_evil: |
@@ -93,15 +84,8 @@ evas_shutdown(void) | |||
93 | if (--_evas_init_count != 0) | 84 | if (--_evas_init_count != 0) |
94 | return _evas_init_count; | 85 | return _evas_init_count; |
95 | 86 | ||
96 | #ifdef BUILD_ASYNC_EVENTS | ||
97 | _evas_preload_thread_shutdown(); | 87 | _evas_preload_thread_shutdown(); |
98 | #endif | ||
99 | #ifdef EVAS_CSERVE | ||
100 | if (getenv("EVAS_CSERVE")) evas_cserve_shutdown(); | ||
101 | #endif | ||
102 | #ifdef BUILD_ASYNC_EVENTS | ||
103 | evas_async_events_shutdown(); | 88 | evas_async_events_shutdown(); |
104 | #endif | ||
105 | evas_font_dir_cache_free(); | 89 | evas_font_dir_cache_free(); |
106 | evas_common_shutdown(); | 90 | evas_common_shutdown(); |
107 | evas_module_shutdown(); | 91 | evas_module_shutdown(); |
diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index f8a59bda57..638692aa59 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c | |||
@@ -71,10 +71,8 @@ EAPI Eo_Op EVAS_OBJ_TEXTBLOCK_BASE_ID = EO_NOOP; | |||
71 | 71 | ||
72 | #define MY_CLASS EVAS_OBJ_TEXTBLOCK_CLASS | 72 | #define MY_CLASS EVAS_OBJ_TEXTBLOCK_CLASS |
73 | 73 | ||
74 | #ifdef HAVE_LINEBREAK | ||
75 | #include "linebreak.h" | 74 | #include "linebreak.h" |
76 | #include "wordbreak.h" | 75 | #include "wordbreak.h" |
77 | #endif | ||
78 | 76 | ||
79 | /* save typing */ | 77 | /* save typing */ |
80 | #define ENFN obj->layer->evas->engine.func | 78 | #define ENFN obj->layer->evas->engine.func |
@@ -3330,18 +3328,10 @@ _layout_get_charwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3330 | } | 3328 | } |
3331 | 3329 | ||
3332 | /* -1 means no wrap */ | 3330 | /* -1 means no wrap */ |
3333 | #ifdef HAVE_LINEBREAK | ||
3334 | |||
3335 | /* Allow break means: if we can break after the current char */ | 3331 | /* Allow break means: if we can break after the current char */ |
3336 | #define ALLOW_BREAK(i) \ | 3332 | #define ALLOW_BREAK(i) \ |
3337 | (breaks[i] <= LINEBREAK_ALLOWBREAK) | 3333 | (breaks[i] <= LINEBREAK_ALLOWBREAK) |
3338 | 3334 | ||
3339 | #else | ||
3340 | |||
3341 | #define ALLOW_BREAK(i) \ | ||
3342 | (_is_white(str[i])) | ||
3343 | |||
3344 | #endif | ||
3345 | static int | 3335 | static int |
3346 | _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, | 3336 | _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, |
3347 | const Evas_Object_Textblock_Item *it, Eina_Bool mixed_wrap, | 3337 | const Evas_Object_Textblock_Item *it, Eina_Bool mixed_wrap, |
@@ -3354,10 +3344,6 @@ _layout_get_word_mixwrap_common(Ctxt *c, Evas_Object_Textblock_Format *fmt, | |||
3354 | it->text_node->unicode); | 3344 | it->text_node->unicode); |
3355 | int item_start = it->text_pos; | 3345 | int item_start = it->text_pos; |
3356 | size_t len = eina_ustrbuf_length_get(it->text_node->unicode); | 3346 | size_t len = eina_ustrbuf_length_get(it->text_node->unicode); |
3357 | #ifndef HAVE_LINEBREAK | ||
3358 | /* Not used without liblinebreak ATM. */ | ||
3359 | (void) breaks; | ||
3360 | #endif | ||
3361 | 3347 | ||
3362 | { | 3348 | { |
3363 | int swrap = -1; | 3349 | int swrap = -1; |
@@ -3754,7 +3740,6 @@ _layout_par(Ctxt *c) | |||
3754 | 1 : _ITEM_TEXT(it)->text_props.text_len; | 3740 | 1 : _ITEM_TEXT(it)->text_props.text_len; |
3755 | 3741 | ||
3756 | 3742 | ||
3757 | #ifdef HAVE_LINEBREAK | ||
3758 | /* If we haven't calculated the linebreaks yet, | 3743 | /* If we haven't calculated the linebreaks yet, |
3759 | * do */ | 3744 | * do */ |
3760 | if (!line_breaks) | 3745 | if (!line_breaks) |
@@ -3775,7 +3760,6 @@ _layout_par(Ctxt *c) | |||
3775 | len, lang, line_breaks); | 3760 | len, lang, line_breaks); |
3776 | } | 3761 | } |
3777 | } | 3762 | } |
3778 | #endif | ||
3779 | if (c->ln->items) | 3763 | if (c->ln->items) |
3780 | line_start = c->ln->items->text_pos; | 3764 | line_start = c->ln->items->text_pos; |
3781 | else | 3765 | else |
@@ -3912,10 +3896,8 @@ _layout_par(Ctxt *c) | |||
3912 | } | 3896 | } |
3913 | 3897 | ||
3914 | end: | 3898 | end: |
3915 | #ifdef HAVE_LINEBREAK | ||
3916 | if (line_breaks) | 3899 | if (line_breaks) |
3917 | free(line_breaks); | 3900 | free(line_breaks); |
3918 | #endif | ||
3919 | 3901 | ||
3920 | return ret; | 3902 | return ret; |
3921 | } | 3903 | } |
@@ -6323,44 +6305,29 @@ evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) | |||
6323 | return EINA_FALSE; | 6305 | return EINA_FALSE; |
6324 | } | 6306 | } |
6325 | 6307 | ||
6326 | #ifdef HAVE_LINEBREAK | ||
6327 | |||
6328 | /* BREAK_AFTER: true if we can break after the current char. | 6308 | /* BREAK_AFTER: true if we can break after the current char. |
6329 | * Both macros assume str[i] is not the terminating nul */ | 6309 | * Both macros assume str[i] is not the terminating nul */ |
6330 | #define BREAK_AFTER(i) \ | 6310 | #define BREAK_AFTER(i) \ |
6331 | (breaks[i] == WORDBREAK_BREAK) | 6311 | (breaks[i] == WORDBREAK_BREAK) |
6332 | 6312 | ||
6333 | #else | ||
6334 | |||
6335 | #define BREAK_AFTER(i) \ | ||
6336 | ((!text[i + 1]) || \ | ||
6337 | (_is_white(text[i]) && !_is_white(text[i + 1])) || \ | ||
6338 | (!_is_white(text[i]) && _is_white(text[i + 1]))) | ||
6339 | |||
6340 | #endif | ||
6341 | |||
6342 | EAPI Eina_Bool | 6313 | EAPI Eina_Bool |
6343 | evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) | 6314 | evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) |
6344 | { | 6315 | { |
6345 | const Eina_Unicode *text; | 6316 | const Eina_Unicode *text; |
6346 | size_t i; | 6317 | size_t i; |
6347 | #ifdef HAVE_LINEBREAK | ||
6348 | char *breaks; | 6318 | char *breaks; |
6349 | #endif | ||
6350 | 6319 | ||
6351 | if (!cur) return EINA_FALSE; | 6320 | if (!cur) return EINA_FALSE; |
6352 | TB_NULL_CHECK(cur->node, EINA_FALSE); | 6321 | TB_NULL_CHECK(cur->node, EINA_FALSE); |
6353 | 6322 | ||
6354 | text = eina_ustrbuf_string_get(cur->node->unicode); | 6323 | text = eina_ustrbuf_string_get(cur->node->unicode); |
6355 | 6324 | ||
6356 | #ifdef HAVE_LINEBREAK | ||
6357 | { | 6325 | { |
6358 | const char *lang = ""; /* FIXME: get lang */ | 6326 | const char *lang = ""; /* FIXME: get lang */ |
6359 | size_t len = eina_ustrbuf_length_get(cur->node->unicode); | 6327 | size_t len = eina_ustrbuf_length_get(cur->node->unicode); |
6360 | breaks = malloc(len); | 6328 | breaks = malloc(len); |
6361 | set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); | 6329 | set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); |
6362 | } | 6330 | } |
6363 | #endif | ||
6364 | 6331 | ||
6365 | i = cur->pos; | 6332 | i = cur->pos; |
6366 | 6333 | ||
@@ -6374,9 +6341,7 @@ evas_textblock_cursor_word_start(Evas_Textblock_Cursor *cur) | |||
6374 | 6341 | ||
6375 | cur->pos = i; | 6342 | cur->pos = i; |
6376 | 6343 | ||
6377 | #ifdef HAVE_LINEBREAK | ||
6378 | free(breaks); | 6344 | free(breaks); |
6379 | #endif | ||
6380 | return EINA_TRUE; | 6345 | return EINA_TRUE; |
6381 | } | 6346 | } |
6382 | 6347 | ||
@@ -6385,23 +6350,19 @@ evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) | |||
6385 | { | 6350 | { |
6386 | const Eina_Unicode *text; | 6351 | const Eina_Unicode *text; |
6387 | size_t i; | 6352 | size_t i; |
6388 | #ifdef HAVE_LINEBREAK | ||
6389 | char *breaks; | 6353 | char *breaks; |
6390 | #endif | ||
6391 | 6354 | ||
6392 | if (!cur) return EINA_FALSE; | 6355 | if (!cur) return EINA_FALSE; |
6393 | TB_NULL_CHECK(cur->node, EINA_FALSE); | 6356 | TB_NULL_CHECK(cur->node, EINA_FALSE); |
6394 | 6357 | ||
6395 | text = eina_ustrbuf_string_get(cur->node->unicode); | 6358 | text = eina_ustrbuf_string_get(cur->node->unicode); |
6396 | 6359 | ||
6397 | #ifdef HAVE_LINEBREAK | ||
6398 | { | 6360 | { |
6399 | const char *lang = ""; /* FIXME: get lang */ | 6361 | const char *lang = ""; /* FIXME: get lang */ |
6400 | size_t len = eina_ustrbuf_length_get(cur->node->unicode); | 6362 | size_t len = eina_ustrbuf_length_get(cur->node->unicode); |
6401 | breaks = malloc(len); | 6363 | breaks = malloc(len); |
6402 | set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); | 6364 | set_wordbreaks_utf32((const utf32_t *) text, len, lang, breaks); |
6403 | } | 6365 | } |
6404 | #endif | ||
6405 | 6366 | ||
6406 | i = cur->pos; | 6367 | i = cur->pos; |
6407 | 6368 | ||
@@ -6416,9 +6377,7 @@ evas_textblock_cursor_word_end(Evas_Textblock_Cursor *cur) | |||
6416 | 6377 | ||
6417 | cur->pos = i; | 6378 | cur->pos = i; |
6418 | 6379 | ||
6419 | #ifdef HAVE_LINEBREAK | ||
6420 | free(breaks); | 6380 | free(breaks); |
6421 | #endif | ||
6422 | return EINA_TRUE; | 6381 | return EINA_TRUE; |
6423 | } | 6382 | } |
6424 | 6383 | ||
@@ -9571,7 +9530,6 @@ evas_object_textblock_init(Evas_Object *eo_obj) | |||
9571 | { | 9530 | { |
9572 | Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); | 9531 | Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); |
9573 | Evas_Object_Textblock *o = eo_data_get(eo_obj, MY_CLASS); | 9532 | Evas_Object_Textblock *o = eo_data_get(eo_obj, MY_CLASS); |
9574 | #ifdef HAVE_LINEBREAK | ||
9575 | static Eina_Bool linebreak_init = EINA_FALSE; | 9533 | static Eina_Bool linebreak_init = EINA_FALSE; |
9576 | if (!linebreak_init) | 9534 | if (!linebreak_init) |
9577 | { | 9535 | { |
@@ -9579,7 +9537,6 @@ evas_object_textblock_init(Evas_Object *eo_obj) | |||
9579 | init_linebreak(); | 9537 | init_linebreak(); |
9580 | init_wordbreak(); | 9538 | init_wordbreak(); |
9581 | } | 9539 | } |
9582 | #endif | ||
9583 | 9540 | ||
9584 | /* set up default settings for this kind of object */ | 9541 | /* set up default settings for this kind of object */ |
9585 | obj->cur.color.r = 255; | 9542 | obj->cur.color.r = 255; |
diff --git a/legacy/evas/src/lib/canvas/evas_stats.c b/legacy/evas/src/lib/canvas/evas_stats.c index cdb4ece7ed..3e057d06f0 100644 --- a/legacy/evas/src/lib/canvas/evas_stats.c +++ b/legacy/evas/src/lib/canvas/evas_stats.c | |||
@@ -5,181 +5,45 @@ | |||
5 | EAPI Eina_Bool | 5 | EAPI Eina_Bool |
6 | evas_cserve_want_get(void) | 6 | evas_cserve_want_get(void) |
7 | { | 7 | { |
8 | #ifdef EVAS_CSERVE | ||
9 | return evas_cserve_use_get(); | ||
10 | #endif | ||
11 | return 0; | 8 | return 0; |
12 | } | 9 | } |
13 | 10 | ||
14 | EAPI Eina_Bool | 11 | EAPI Eina_Bool |
15 | evas_cserve_connected_get(void) | 12 | evas_cserve_connected_get(void) |
16 | { | 13 | { |
17 | #ifdef EVAS_CSERVE | ||
18 | return evas_cserve_have_get(); | ||
19 | #endif | ||
20 | return 0; | 14 | return 0; |
21 | } | 15 | } |
22 | 16 | ||
23 | EAPI Eina_Bool | 17 | EAPI Eina_Bool |
24 | evas_cserve_stats_get(Evas_Cserve_Stats *stats) | 18 | evas_cserve_stats_get(Evas_Cserve_Stats *stats __UNUSED__) |
25 | { | 19 | { |
26 | #ifdef EVAS_CSERVE | ||
27 | Op_Getstats_Reply st; | ||
28 | |||
29 | if (!evas_cserve_raw_stats_get(&st)) return 0; | ||
30 | if (!stats) return 1; | ||
31 | stats->saved_memory = st.saved_memory; | ||
32 | stats->wasted_memory = st.wasted_memory; | ||
33 | stats->saved_memory_peak = st.saved_memory_peak; | ||
34 | stats->wasted_memory_peak = st.wasted_memory_peak; | ||
35 | stats->saved_time_image_header_load = st.saved_time_image_header_load; | ||
36 | stats->saved_time_image_data_load = st.saved_time_image_data_load; | ||
37 | // may expand this in future | ||
38 | return 1; | ||
39 | #else | ||
40 | (void) stats; | ||
41 | return 0; | 20 | return 0; |
42 | #endif | ||
43 | } | 21 | } |
44 | 22 | ||
45 | EAPI Eina_Bool | 23 | EAPI Eina_Bool |
46 | evas_cserve_image_cache_contents_get(Evas_Cserve_Image_Cache *cache) | 24 | evas_cserve_image_cache_contents_get(Evas_Cserve_Image_Cache *cache __UNUSED__) |
47 | { | 25 | { |
48 | #ifdef EVAS_CSERVE | ||
49 | Op_Getinfo_Reply *info; | ||
50 | unsigned char *p; | ||
51 | int i, j; | ||
52 | |||
53 | if (!(info = evas_cserve_raw_info_get())) return 0; | ||
54 | if (!cache) | ||
55 | { | ||
56 | free(info); | ||
57 | return 1; | ||
58 | } | ||
59 | cache->active.mem_total = info->active.mem_total; | ||
60 | cache->active.count = info->active.count; | ||
61 | cache->cached.mem_total = info->cached.mem_total; | ||
62 | cache->cached.count = info->cached.count; | ||
63 | cache->images = NULL; | ||
64 | j = info->active.count + info->cached.count; | ||
65 | p = (unsigned char *)info; | ||
66 | p += sizeof(Op_Getinfo_Reply); | ||
67 | for (i = 0; i < j; i++) | ||
68 | { | ||
69 | Evas_Cserve_Image *im; | ||
70 | Op_Getinfo_Item it; | ||
71 | char *file, *key; | ||
72 | |||
73 | memcpy(&it, p, sizeof(Op_Getinfo_Item)); | ||
74 | file = (char*) (p + sizeof(Op_Getinfo_Item)); | ||
75 | key = file + strlen(file) + 1; | ||
76 | im = calloc(1, sizeof(Evas_Cserve_Image)); | ||
77 | if (!im) continue; | ||
78 | if (file[0] != 0) | ||
79 | { | ||
80 | file = (char *)eina_stringshare_add(file); | ||
81 | if (!file) | ||
82 | { | ||
83 | free(im); | ||
84 | continue; | ||
85 | } | ||
86 | } | ||
87 | else | ||
88 | file = NULL; | ||
89 | if (key[0] != 0) | ||
90 | { | ||
91 | key = (char *)eina_stringshare_add(key); | ||
92 | if (!key) | ||
93 | { | ||
94 | if (file) eina_stringshare_del(file); | ||
95 | free(im); | ||
96 | continue; | ||
97 | } | ||
98 | } | ||
99 | else key = NULL; | ||
100 | cache->images = eina_list_append(cache->images, im); | ||
101 | im->file = file; | ||
102 | im->key = key; | ||
103 | im->w = it.w; | ||
104 | im->h = it.h; | ||
105 | im->cached_time = it.cached_time; | ||
106 | im->file_mod_time = it.file_mod_time; | ||
107 | im->file_checked_time = it.file_checked_time; | ||
108 | im->refcount = it.refcount; | ||
109 | im->data_refcount = it.data_refcount; | ||
110 | im->memory_footprint = it.memory_footprint; | ||
111 | im->head_load_time = it.head_load_time; | ||
112 | im->data_load_time = it.data_load_time; | ||
113 | im->active = it.active; | ||
114 | im->alpha = it.alpha; | ||
115 | im->data_loaded = it.data_loaded; | ||
116 | im->dead = it.dead; | ||
117 | im->useless = it.useless; | ||
118 | } | ||
119 | free(info); | ||
120 | return 1; | ||
121 | #else | ||
122 | (void) cache; | ||
123 | return 0; | 26 | return 0; |
124 | #endif | ||
125 | } | 27 | } |
126 | 28 | ||
127 | EAPI void | 29 | EAPI void |
128 | evas_cserve_image_cache_contents_clean(Evas_Cserve_Image_Cache *cache) | 30 | evas_cserve_image_cache_contents_clean(Evas_Cserve_Image_Cache *cache __UNUSED__) |
129 | { | 31 | { |
130 | #ifdef EVAS_CSERVE | ||
131 | Evas_Cserve_Image *im; | ||
132 | |||
133 | EINA_LIST_FREE(cache->images, im) | ||
134 | { | ||
135 | if (im->file) eina_stringshare_del(im->file); | ||
136 | if (im->key) eina_stringshare_del(im->key); | ||
137 | free(im); | ||
138 | } | ||
139 | #else | ||
140 | (void) cache; | ||
141 | #endif | ||
142 | } | 32 | } |
143 | 33 | ||
144 | EAPI Eina_Bool | 34 | EAPI Eina_Bool |
145 | evas_cserve_config_get(Evas_Cserve_Config *config) | 35 | evas_cserve_config_get(Evas_Cserve_Config *config __UNUSED__) |
146 | { | 36 | { |
147 | #ifdef EVAS_CSERVE | ||
148 | Op_Getconfig_Reply conf; | ||
149 | |||
150 | if (!evas_cserve_raw_config_get(&conf)) return 0; | ||
151 | if (!config) return 1; | ||
152 | config->cache_max_usage = conf.cache_max_usage; | ||
153 | config->cache_item_timeout = conf.cache_item_timeout; | ||
154 | config->cache_item_timeout_check = conf.cache_item_timeout_check; | ||
155 | return 1; | ||
156 | #else | ||
157 | (void) config; | ||
158 | return 0; | 37 | return 0; |
159 | #endif | ||
160 | } | 38 | } |
161 | 39 | ||
162 | EAPI Eina_Bool | 40 | EAPI Eina_Bool |
163 | evas_cserve_config_set(const Evas_Cserve_Config *config) | 41 | evas_cserve_config_set(const Evas_Cserve_Config *config __UNUSED__) |
164 | { | 42 | { |
165 | #ifdef EVAS_CSERVE | ||
166 | Op_Setconfig conf; | ||
167 | |||
168 | if (!config) return 1; | ||
169 | conf.cache_max_usage = config->cache_max_usage; | ||
170 | conf.cache_item_timeout = config->cache_item_timeout; | ||
171 | conf.cache_item_timeout_check = config->cache_item_timeout_check; | ||
172 | return evas_cserve_raw_config_set(&conf); | ||
173 | #else | ||
174 | (void) config; | ||
175 | return 0; | 43 | return 0; |
176 | #endif | ||
177 | } | 44 | } |
178 | 45 | ||
179 | EAPI void | 46 | EAPI void |
180 | evas_cserve_disconnect(void) | 47 | evas_cserve_disconnect(void) |
181 | { | 48 | { |
182 | #ifdef EVAS_CSERVE | ||
183 | evas_cserve_discon(); | ||
184 | #endif | ||
185 | } | 49 | } |
diff --git a/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c b/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c index be7128071b..1899fb278c 100644 --- a/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c +++ b/legacy/evas/src/lib/engines/common/evas_convert_gry_1.c | |||
@@ -1,4 +1,6 @@ | |||
1 | #include "evas_common.h" | 1 | #include "evas_common.h" |
2 | #include "evas_convert_gry_1.h" | 2 | #include "evas_convert_gry_1.h" |
3 | 3 | ||
4 | void evas_common_convert_rgba_to_1bpp_gry_1_dith (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal){} | 4 | void evas_common_convert_rgba_to_1bpp_gry_1_dith(DATA32 *src __UNUSED__, DATA8 *dst __UNUSED__, int src_jump __UNUSED__, int dst_jump __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dith_x __UNUSED__, int dith_y __UNUSED__, DATA8 *pal __UNUSED__) |
5 | { | ||
6 | } | ||
diff --git a/legacy/evas/src/lib/engines/common/evas_font_private.h b/legacy/evas/src/lib/engines/common/evas_font_private.h index bbc4675bf5..904a01e4bf 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_private.h +++ b/legacy/evas/src/lib/engines/common/evas_font_private.h | |||
@@ -2,7 +2,6 @@ | |||
2 | # define _EVAS_FONT_PRIVATE_H | 2 | # define _EVAS_FONT_PRIVATE_H |
3 | #include "evas_font_ot.h" | 3 | #include "evas_font_ot.h" |
4 | 4 | ||
5 | #ifdef BUILD_PTHREAD | ||
6 | extern LK(lock_font_draw); // for freetype2 API calls | 5 | extern LK(lock_font_draw); // for freetype2 API calls |
7 | extern LK(lock_bidi); // for fribidi API calls | 6 | extern LK(lock_bidi); // for fribidi API calls |
8 | extern LK(lock_ot); // for harfbuzz calls | 7 | extern LK(lock_ot); // for harfbuzz calls |
@@ -15,17 +14,6 @@ extern LK(lock_ot); // for harfbuzz calls | |||
15 | /* Macros for text walking */ | 14 | /* Macros for text walking */ |
16 | # define OTLOCK() LKL(lock_ot) | 15 | # define OTLOCK() LKL(lock_ot) |
17 | # define OTUNLOCK() LKU(lock_ot) | 16 | # define OTUNLOCK() LKU(lock_ot) |
18 | #else | ||
19 | # define FTLOCK() | ||
20 | # define FTUNLOCK() | ||
21 | |||
22 | # define BIDILOCK() | ||
23 | # define BIDIUNLOCK() | ||
24 | |||
25 | /* Macros for text walking */ | ||
26 | # define OTLOCK() | ||
27 | # define OTUNLOCK() | ||
28 | #endif | ||
29 | 17 | ||
30 | void evas_common_font_source_unload(RGBA_Font_Source *fs); | 18 | void evas_common_font_source_unload(RGBA_Font_Source *fs); |
31 | void evas_common_font_source_reload(RGBA_Font_Source *fs); | 19 | void evas_common_font_source_reload(RGBA_Font_Source *fs); |
diff --git a/legacy/evas/src/lib/engines/common/evas_image_data.c b/legacy/evas/src/lib/engines/common/evas_image_data.c index 2815ff8dfb..ca09d1e8cc 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_data.c +++ b/legacy/evas/src/lib/engines/common/evas_image_data.c | |||
@@ -124,9 +124,7 @@ evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace) | |||
124 | { | 124 | { |
125 | ie_dst->allocated.w = 0; | 125 | ie_dst->allocated.w = 0; |
126 | ie_dst->allocated.h = 0; | 126 | ie_dst->allocated.h = 0; |
127 | #ifdef BUILD_ASYNC_PRELOAD | ||
128 | ie_dst->flags.preload_done = 0; | 127 | ie_dst->flags.preload_done = 0; |
129 | #endif | ||
130 | ie_dst->flags.loaded = 0; | 128 | ie_dst->flags.loaded = 0; |
131 | dst->image.data = NULL; | 129 | dst->image.data = NULL; |
132 | dst->image.no_free = 0; | 130 | dst->image.no_free = 0; |
diff --git a/legacy/evas/src/lib/engines/common/evas_image_load.c b/legacy/evas/src/lib/engines/common/evas_image_load.c index 489cbb0660..0c39495f8a 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_load.c +++ b/legacy/evas/src/lib/engines/common/evas_image_load.c | |||
@@ -172,21 +172,6 @@ evas_common_load_rgba_image_module_from_file(Image_Entry *ie) | |||
172 | int len, ret = EVAS_LOAD_ERROR_NONE; | 172 | int len, ret = EVAS_LOAD_ERROR_NONE; |
173 | struct evas_image_foreach_loader_data fdata; | 173 | struct evas_image_foreach_loader_data fdata; |
174 | 174 | ||
175 | |||
176 | #ifdef EVAS_CSERVE | ||
177 | if (evas_cserve_use_get()) | ||
178 | { | ||
179 | // TODO: handle errors from server and return them? | ||
180 | DBG("try cserve '%s' '%s'", ie->file, ie->key ? ie->key : ""); | ||
181 | if (evas_cserve_image_load(ie, ie->file, ie->key, &(ie->load_opts))) | ||
182 | { | ||
183 | DBG("try cserve '%s' '%s' loaded!", | ||
184 | ie->file, ie->key ? ie->key : ""); | ||
185 | return EVAS_LOAD_ERROR_NONE; | ||
186 | } | ||
187 | } | ||
188 | #endif | ||
189 | |||
190 | #ifdef EVAS_CSERVE2 | 175 | #ifdef EVAS_CSERVE2 |
191 | if (evas_cserve2_use_get()) | 176 | if (evas_cserve2_use_get()) |
192 | { | 177 | { |
@@ -332,24 +317,6 @@ evas_common_load_rgba_image_data_from_file(Image_Entry *ie) | |||
332 | 317 | ||
333 | if ((ie->flags.loaded) && (!ie->flags.animated)) return EVAS_LOAD_ERROR_GENERIC; | 318 | if ((ie->flags.loaded) && (!ie->flags.animated)) return EVAS_LOAD_ERROR_GENERIC; |
334 | 319 | ||
335 | #ifdef EVAS_CSERVE | ||
336 | if (ie->data1) | ||
337 | { | ||
338 | if (evas_cserve_image_data_load(ie)) | ||
339 | { | ||
340 | RGBA_Image *im = (RGBA_Image *)ie; | ||
341 | Mem *mem = ie->data2; | ||
342 | if (mem) | ||
343 | { | ||
344 | im->image.data = (void*) (mem->data + mem->offset); | ||
345 | im->image.no_free = 1; | ||
346 | return EVAS_LOAD_ERROR_NONE; | ||
347 | } | ||
348 | } | ||
349 | return EVAS_LOAD_ERROR_GENERIC; | ||
350 | } | ||
351 | #endif | ||
352 | |||
353 | #ifdef EVAS_CSERVE2 | 320 | #ifdef EVAS_CSERVE2 |
354 | if (ie->data1) | 321 | if (ie->data1) |
355 | { | 322 | { |
diff --git a/legacy/evas/src/lib/engines/common/evas_image_main.c b/legacy/evas/src/lib/engines/common/evas_image_main.c index e47cc9646c..62e6a361bd 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_main.c +++ b/legacy/evas/src/lib/engines/common/evas_image_main.c | |||
@@ -196,9 +196,6 @@ _evas_common_rgba_image_delete(Image_Entry *ie) | |||
196 | * going to empty this struct out in case this happens again so i know | 196 | * going to empty this struct out in case this happens again so i know |
197 | * that something else is overwritign this struct - or not */ | 197 | * that something else is overwritign this struct - or not */ |
198 | // memset(im, 0x99, sizeof(im)); | 198 | // memset(im, 0x99, sizeof(im)); |
199 | #ifdef EVAS_CSERVE | ||
200 | if (ie->data1) evas_cserve_image_free(ie); | ||
201 | #endif | ||
202 | #ifdef EVAS_CSERVE2 | 199 | #ifdef EVAS_CSERVE2 |
203 | if (ie->data1) | 200 | if (ie->data1) |
204 | ERR("Shouldn't reach this point since we are using cache2: '%s' '%s'", | 201 | ERR("Shouldn't reach this point since we are using cache2: '%s' '%s'", |
@@ -291,21 +288,6 @@ evas_common_rgba_image_unload(Image_Entry *ie) | |||
291 | } | 288 | } |
292 | im->cs.data = NULL; | 289 | im->cs.data = NULL; |
293 | 290 | ||
294 | #ifdef EVAS_CSERVE | ||
295 | if (ie->data1) | ||
296 | { | ||
297 | evas_cserve_image_useless(ie); | ||
298 | im->image.data = NULL; | ||
299 | ie->allocated.w = 0; | ||
300 | ie->allocated.h = 0; | ||
301 | ie->flags.loaded = 0; | ||
302 | #ifdef BUILD_ASYNC_PRELOAD | ||
303 | ie->flags.preload_done = 0; | ||
304 | #endif | ||
305 | return; | ||
306 | } | ||
307 | #endif | ||
308 | |||
309 | #ifdef EVAS_CSERVE2 | 291 | #ifdef EVAS_CSERVE2 |
310 | if (ie->data1) | 292 | if (ie->data1) |
311 | { | 293 | { |
@@ -315,9 +297,7 @@ evas_common_rgba_image_unload(Image_Entry *ie) | |||
315 | // ie->allocated.w = 0; | 297 | // ie->allocated.w = 0; |
316 | // ie->allocated.h = 0; | 298 | // ie->allocated.h = 0; |
317 | // ie->flags.loaded = 0; | 299 | // ie->flags.loaded = 0; |
318 | #ifdef BUILD_ASYNC_PRELOAD | ||
319 | ie->flags.preload_done = 0; | 300 | ie->flags.preload_done = 0; |
320 | #endif | ||
321 | return; | 301 | return; |
322 | } | 302 | } |
323 | #endif | 303 | #endif |
@@ -333,9 +313,7 @@ evas_common_rgba_image_unload(Image_Entry *ie) | |||
333 | ie->allocated.w = 0; | 313 | ie->allocated.w = 0; |
334 | ie->allocated.h = 0; | 314 | ie->allocated.h = 0; |
335 | ie->flags.loaded = 0; | 315 | ie->flags.loaded = 0; |
336 | #ifdef BUILD_ASYNC_PRELOAD | ||
337 | ie->flags.preload_done = 0; | 316 | ie->flags.preload_done = 0; |
338 | #endif | ||
339 | #ifdef SURFDBG | 317 | #ifdef SURFDBG |
340 | surf_debug(); | 318 | surf_debug(); |
341 | #endif | 319 | #endif |
@@ -387,9 +365,6 @@ _evas_common_rgba_image_surface_alloc(Image_Entry *ie, unsigned int w, unsigned | |||
387 | RGBA_Image *im = (RGBA_Image *) ie; | 365 | RGBA_Image *im = (RGBA_Image *) ie; |
388 | size_t siz = 0; | 366 | size_t siz = 0; |
389 | 367 | ||
390 | #ifdef EVAS_CSERVE | ||
391 | if (ie->data1) return 0; | ||
392 | #endif | ||
393 | #ifdef EVAS_CSERVE2 | 368 | #ifdef EVAS_CSERVE2 |
394 | if (ie->data1) return 0; | 369 | if (ie->data1) return 0; |
395 | #endif | 370 | #endif |
@@ -466,10 +441,6 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie) | |||
466 | surfs = eina_list_remove(surfs, ie); | 441 | surfs = eina_list_remove(surfs, ie); |
467 | #endif | 442 | #endif |
468 | } | 443 | } |
469 | #ifdef EVAS_CSERVE | ||
470 | else if (ie->data1) | ||
471 | evas_cserve_image_free(ie); | ||
472 | #endif | ||
473 | // #ifdef EVAS_CSERVE2 | 444 | // #ifdef EVAS_CSERVE2 |
474 | // else if (ie->data1) | 445 | // else if (ie->data1) |
475 | // ERR("Shouldn't reach this point since we are using cache2."); | 446 | // ERR("Shouldn't reach this point since we are using cache2."); |
@@ -479,9 +450,7 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie) | |||
479 | im->image.data = NULL; | 450 | im->image.data = NULL; |
480 | ie->allocated.w = 0; | 451 | ie->allocated.w = 0; |
481 | ie->allocated.h = 0; | 452 | ie->allocated.h = 0; |
482 | #ifdef BUILD_ASYNC_PRELOAD | ||
483 | ie->flags.preload_done = 0; | 453 | ie->flags.preload_done = 0; |
484 | #endif | ||
485 | ie->flags.loaded = 0; | 454 | ie->flags.loaded = 0; |
486 | evas_common_rgba_image_scalecache_dirty(&im->cache_entry); | 455 | evas_common_rgba_image_scalecache_dirty(&im->cache_entry); |
487 | #ifdef SURFDBG | 456 | #ifdef SURFDBG |
@@ -502,9 +471,6 @@ _evas_common_rgba_image_dirty_region(Image_Entry* ie, unsigned int x __UNUSED__, | |||
502 | { | 471 | { |
503 | RGBA_Image *im = (RGBA_Image *) ie; | 472 | RGBA_Image *im = (RGBA_Image *) ie; |
504 | 473 | ||
505 | #ifdef EVAS_CSERVE | ||
506 | if (ie->data1) evas_cserve_image_free(ie); | ||
507 | #endif | ||
508 | #ifdef EVAS_CSERVE2 | 474 | #ifdef EVAS_CSERVE2 |
509 | // if (ie->data1) evas_cserve2_image_free(ie); | 475 | // if (ie->data1) evas_cserve2_image_free(ie); |
510 | if (ie->data1) ERR("Shouldn't reach this point since we are using cache2."); | 476 | if (ie->data1) ERR("Shouldn't reach this point since we are using cache2."); |
@@ -526,9 +492,6 @@ _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src) | |||
526 | if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry, | 492 | if (_evas_common_rgba_image_surface_alloc(&dst->cache_entry, |
527 | src->cache_entry.w, src->cache_entry.h)) | 493 | src->cache_entry.w, src->cache_entry.h)) |
528 | { | 494 | { |
529 | #ifdef EVAS_CSERVE | ||
530 | if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); | ||
531 | #endif | ||
532 | #ifdef EVAS_CSERVE2 | 495 | #ifdef EVAS_CSERVE2 |
533 | // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src); | 496 | // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src); |
534 | if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2."); | 497 | if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2."); |
@@ -536,12 +499,9 @@ _evas_common_rgba_image_dirty(Image_Entry *ie_dst, const Image_Entry *ie_src) | |||
536 | return 1; | 499 | return 1; |
537 | } | 500 | } |
538 | 501 | ||
539 | #ifdef EVAS_CSERVE | ||
540 | if (ie_src->data1) evas_cserve_image_free((Image_Entry*) ie_src); | ||
541 | #endif | ||
542 | #ifdef EVAS_CSERVE2 | 502 | #ifdef EVAS_CSERVE2 |
543 | // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src); | 503 | // if (ie_src->data1) evas_cserve2_image_free((Image_Entry*) ie_src); |
544 | if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2."); | 504 | if (ie_src->data1) ERR("Shouldn't reach this point since we are using cache2."); |
545 | #endif | 505 | #endif |
546 | evas_common_image_colorspace_normalize(src); | 506 | evas_common_image_colorspace_normalize(src); |
547 | evas_common_image_colorspace_normalize(dst); | 507 | evas_common_image_colorspace_normalize(dst); |
@@ -563,9 +523,7 @@ _evas_common_rgba_image_ram_usage(Image_Entry *ie) | |||
563 | 523 | ||
564 | if (im->image.data) | 524 | if (im->image.data) |
565 | { | 525 | { |
566 | #if defined(EVAS_CSERVE) | 526 | #ifdef EVAS_CSERVE2 |
567 | if ((!im->image.no_free) || (ie->data1)) | ||
568 | #elif defined(EVAS_CSERVE2) | ||
569 | if ((!im->image.no_free) || (ie->data1)) | 527 | if ((!im->image.no_free) || (ie->data1)) |
570 | #else | 528 | #else |
571 | if ((!im->image.no_free)) | 529 | if ((!im->image.no_free)) |
@@ -715,9 +673,6 @@ evas_common_image_colorspace_normalize(RGBA_Image *im) | |||
715 | case EVAS_COLORSPACE_ARGB8888: | 673 | case EVAS_COLORSPACE_ARGB8888: |
716 | if (im->image.data != im->cs.data) | 674 | if (im->image.data != im->cs.data) |
717 | { | 675 | { |
718 | #ifdef EVAS_CSERVE | ||
719 | if (((Image_Entry *)im)->data1) evas_cserve_image_free(&im->cache_entry); | ||
720 | #endif | ||
721 | #ifdef EVAS_CSERVE2 | 676 | #ifdef EVAS_CSERVE2 |
722 | // if (((Image_Entry *)im)->data1) evas_cserve2_image_free(&im->cache_entry); | 677 | // if (((Image_Entry *)im)->data1) evas_cserve2_image_free(&im->cache_entry); |
723 | if (((Image_Entry *)im)->data1) ERR("Shouldn't reach this point since we are using cache2."); | 678 | if (((Image_Entry *)im)->data1) ERR("Shouldn't reach this point since we are using cache2."); |
diff --git a/legacy/evas/src/lib/engines/common/evas_pipe.c b/legacy/evas/src/lib/engines/common/evas_pipe.c index 1cba912606..6803154246 100644 --- a/legacy/evas/src/lib/engines/common/evas_pipe.c +++ b/legacy/evas/src/lib/engines/common/evas_pipe.c | |||
@@ -1,9 +1,12 @@ | |||
1 | #include "evas_common.h" | 1 | #include "evas_common.h" |
2 | #include <unistd.h> | 2 | #include <unistd.h> |
3 | #include <pthread.h> | ||
4 | #ifdef HAVE_PTHREAD_AFFINITY | ||
5 | #include <sched.h> | ||
6 | #endif | ||
3 | 7 | ||
4 | #ifdef BUILD_PIPE_RENDER | 8 | #ifdef BUILD_PIPE_RENDER |
5 | 9 | ||
6 | # ifdef BUILD_PTHREAD | ||
7 | typedef struct _Thinfo | 10 | typedef struct _Thinfo |
8 | { | 11 | { |
9 | RGBA_Image *im; | 12 | RGBA_Image *im; |
@@ -14,7 +17,6 @@ typedef struct _Thinfo | |||
14 | Eina_Array cutout_trash; | 17 | Eina_Array cutout_trash; |
15 | Eina_Array rects_task; | 18 | Eina_Array rects_task; |
16 | } Thinfo; | 19 | } Thinfo; |
17 | #endif | ||
18 | 20 | ||
19 | static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op); | 21 | static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op); |
20 | static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op); | 22 | static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op); |
@@ -71,7 +73,6 @@ evas_common_pipe_op_free(RGBA_Pipe_Op *op) | |||
71 | evas_common_draw_context_apply_clean_cutouts(&op->context.cutout); | 73 | evas_common_draw_context_apply_clean_cutouts(&op->context.cutout); |
72 | } | 74 | } |
73 | 75 | ||
74 | #ifdef BUILD_PTHREAD | ||
75 | /* main api calls */ | 76 | /* main api calls */ |
76 | static void * | 77 | static void * |
77 | evas_common_pipe_thread(void *data) | 78 | evas_common_pipe_thread(void *data) |
@@ -109,9 +110,7 @@ evas_common_pipe_thread(void *data) | |||
109 | } | 110 | } |
110 | return NULL; | 111 | return NULL; |
111 | } | 112 | } |
112 | #endif | ||
113 | 113 | ||
114 | #ifdef BUILD_PTHREAD | ||
115 | static Eina_List *im_task = NULL; | 114 | static Eina_List *im_task = NULL; |
116 | static Eina_List *text_task = NULL; | 115 | static Eina_List *text_task = NULL; |
117 | static Thinfo task_thinfo[TH_MAX]; | 116 | static Thinfo task_thinfo[TH_MAX]; |
@@ -164,13 +163,10 @@ evas_pipe_prepare_push(RGBA_Pipe_Op *op) | |||
164 | current++; | 163 | current++; |
165 | } | 164 | } |
166 | 165 | ||
167 | #endif | ||
168 | |||
169 | static void | 166 | static void |
170 | evas_common_pipe_begin(RGBA_Image *im) | 167 | evas_common_pipe_begin(RGBA_Image *im) |
171 | { | 168 | { |
172 | #define SZ 128 | 169 | #define SZ 128 |
173 | #ifdef BUILD_PTHREAD | ||
174 | unsigned int x, y, cpu; | 170 | unsigned int x, y, cpu; |
175 | RGBA_Pipe_Thread_Info *info; | 171 | RGBA_Pipe_Thread_Info *info; |
176 | unsigned int estimatex, estimatey; | 172 | unsigned int estimatex, estimatey; |
@@ -217,21 +213,18 @@ evas_common_pipe_begin(RGBA_Image *im) | |||
217 | 213 | ||
218 | /* tell worker threads to start */ | 214 | /* tell worker threads to start */ |
219 | pthread_barrier_wait(&(thbarrier[0])); | 215 | pthread_barrier_wait(&(thbarrier[0])); |
220 | #endif | ||
221 | } | 216 | } |
222 | 217 | ||
223 | EAPI void | 218 | EAPI void |
224 | evas_common_pipe_flush(RGBA_Image *im) | 219 | evas_common_pipe_flush(RGBA_Image *im) |
225 | { | 220 | { |
226 | if (!im->cache_entry.pipe) return; | 221 | if (!im->cache_entry.pipe) return; |
227 | #ifdef BUILD_PTHREAD | ||
228 | if (thread_num > 1) | 222 | if (thread_num > 1) |
229 | { | 223 | { |
230 | /* sync worker threads */ | 224 | /* sync worker threads */ |
231 | pthread_barrier_wait(&(thbarrier[1])); | 225 | pthread_barrier_wait(&(thbarrier[1])); |
232 | } | 226 | } |
233 | else | 227 | else |
234 | #endif | ||
235 | { | 228 | { |
236 | RGBA_Pipe_Thread_Info info; | 229 | RGBA_Pipe_Thread_Info info; |
237 | RGBA_Pipe *p; | 230 | RGBA_Pipe *p; |
@@ -698,7 +691,6 @@ evas_common_pipe_map_render(RGBA_Image *root) | |||
698 | evas_common_pipe_flush(root); | 691 | evas_common_pipe_flush(root); |
699 | } | 692 | } |
700 | 693 | ||
701 | #ifdef BUILD_PTHREAD | ||
702 | static void* | 694 | static void* |
703 | evas_common_pipe_load(void *data) | 695 | evas_common_pipe_load(void *data) |
704 | { | 696 | { |
@@ -765,14 +757,12 @@ evas_common_pipe_load(void *data) | |||
765 | 757 | ||
766 | return NULL; | 758 | return NULL; |
767 | } | 759 | } |
768 | #endif | ||
769 | 760 | ||
770 | static volatile int bval = 0; | 761 | static volatile int bval = 0; |
771 | 762 | ||
772 | static void | 763 | static void |
773 | evas_common_pipe_load_do(RGBA_Image *im) | 764 | evas_common_pipe_load_do(RGBA_Image *im) |
774 | { | 765 | { |
775 | #ifdef BUILD_PTHREAD | ||
776 | int i; | 766 | int i; |
777 | 767 | ||
778 | for (i = 0; i < thread_num; i++) | 768 | for (i = 0; i < thread_num; i++) |
@@ -783,7 +773,6 @@ evas_common_pipe_load_do(RGBA_Image *im) | |||
783 | 773 | ||
784 | /* sync worker threads */ | 774 | /* sync worker threads */ |
785 | pthread_barrier_wait(&(task_thbarrier[1])); | 775 | pthread_barrier_wait(&(task_thbarrier[1])); |
786 | #endif | ||
787 | } | 776 | } |
788 | 777 | ||
789 | EAPI void | 778 | EAPI void |
@@ -884,12 +873,16 @@ evas_common_pipe_init(void) | |||
884 | for (i = 0; i < thread_num; i++) | 873 | for (i = 0; i < thread_num; i++) |
885 | { | 874 | { |
886 | pthread_attr_t attr; | 875 | pthread_attr_t attr; |
876 | #ifdef HAVE_PTHREAD_AFFINITY | ||
887 | cpu_set_t cpu; | 877 | cpu_set_t cpu; |
888 | 878 | #endif | |
879 | |||
889 | pthread_attr_init(&attr); | 880 | pthread_attr_init(&attr); |
881 | #ifdef HAVE_PTHREAD_AFFINITY | ||
890 | CPU_ZERO(&cpu); | 882 | CPU_ZERO(&cpu); |
891 | CPU_SET(i % cpunum, &cpu); | 883 | CPU_SET(i % cpunum, &cpu); |
892 | pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu); | 884 | pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu); |
885 | #endif | ||
893 | thinfo[i].thread_num = i; | 886 | thinfo[i].thread_num = i; |
894 | thinfo[i].tasks = NULL; | 887 | thinfo[i].tasks = NULL; |
895 | thinfo[i].barrier = thbarrier; | 888 | thinfo[i].barrier = thbarrier; |
@@ -904,12 +897,16 @@ evas_common_pipe_init(void) | |||
904 | for (i = 0; i < thread_num; i++) | 897 | for (i = 0; i < thread_num; i++) |
905 | { | 898 | { |
906 | pthread_attr_t attr; | 899 | pthread_attr_t attr; |
900 | #ifdef HAVE_PTHREAD_AFFINITY | ||
907 | cpu_set_t cpu; | 901 | cpu_set_t cpu; |
908 | 902 | #endif | |
909 | pthread_attr_init(&attr); | 903 | |
904 | pthread_attr_init(&attr); | ||
905 | #ifdef HAVE_PTHREAD_AFFINITY | ||
910 | CPU_ZERO(&cpu); | 906 | CPU_ZERO(&cpu); |
911 | CPU_SET(i % cpunum, &cpu); | 907 | CPU_SET(i % cpunum, &cpu); |
912 | pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu); | 908 | pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu); |
909 | #endif | ||
913 | task_thinfo[i].thread_num = i; | 910 | task_thinfo[i].thread_num = i; |
914 | task_thinfo[i].tasks = NULL; | 911 | task_thinfo[i].tasks = NULL; |
915 | task_thinfo[i].barrier = task_thbarrier; | 912 | task_thinfo[i].barrier = task_thbarrier; |
diff --git a/legacy/evas/src/lib/file/evas_module.c b/legacy/evas/src/lib/file/evas_module.c index 52421adbd7..de20035374 100644 --- a/legacy/evas/src/lib/file/evas_module.c +++ b/legacy/evas/src/lib/file/evas_module.c | |||
@@ -446,9 +446,7 @@ evas_module_load(Evas_Module *em) | |||
446 | if (!em->definition->func.open(em)) return 0; | 446 | if (!em->definition->func.open(em)) return 0; |
447 | em->loaded = 1; | 447 | em->loaded = 1; |
448 | 448 | ||
449 | #ifdef BUILD_ASYNC_PRELOAD | ||
450 | LKI(em->lock); | 449 | LKI(em->lock); |
451 | #endif | ||
452 | return 1; | 450 | return 1; |
453 | } | 451 | } |
454 | 452 | ||
@@ -464,33 +462,23 @@ evas_module_unload(Evas_Module *em) | |||
464 | // em->definition->func.close(em); | 462 | // em->definition->func.close(em); |
465 | // em->loaded = 0; | 463 | // em->loaded = 0; |
466 | 464 | ||
467 | #ifdef BUILD_ASYNC_PRELOAD | ||
468 | LKD(em->lock); | 465 | LKD(em->lock); |
469 | #endif | ||
470 | } | 466 | } |
471 | 467 | ||
472 | void | 468 | void |
473 | evas_module_ref(Evas_Module *em) | 469 | evas_module_ref(Evas_Module *em) |
474 | { | 470 | { |
475 | #ifdef BUILD_ASYNC_PRELOAD | ||
476 | LKL(em->lock); | 471 | LKL(em->lock); |
477 | #endif | ||
478 | em->ref++; | 472 | em->ref++; |
479 | #ifdef BUILD_ASYNC_PRELOAD | ||
480 | LKU(em->lock); | 473 | LKU(em->lock); |
481 | #endif | ||
482 | } | 474 | } |
483 | 475 | ||
484 | void | 476 | void |
485 | evas_module_unref(Evas_Module *em) | 477 | evas_module_unref(Evas_Module *em) |
486 | { | 478 | { |
487 | #ifdef BUILD_ASYNC_PRELOAD | ||
488 | LKL(em->lock); | 479 | LKL(em->lock); |
489 | #endif | ||
490 | em->ref--; | 480 | em->ref--; |
491 | #ifdef BUILD_ASYNC_PRELOAD | ||
492 | LKU(em->lock); | 481 | LKU(em->lock); |
493 | #endif | ||
494 | } | 482 | } |
495 | 483 | ||
496 | static int use_count = 0; | 484 | static int use_count = 0; |
diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h index 838870f6d8..85a455d93e 100644 --- a/legacy/evas/src/lib/include/evas_common.h +++ b/legacy/evas/src/lib/include/evas_common.h | |||
@@ -173,14 +173,6 @@ extern EAPI int _evas_log_dom_global; | |||
173 | # define __ARM_ARCH__ 73 | 173 | # define __ARM_ARCH__ 73 |
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | #ifndef BUILD_PTHREAD | ||
177 | # undef BUILD_PIPE_RENDER | ||
178 | #endif | ||
179 | |||
180 | #if defined(BUILD_ASYNC_PRELOAD) && !defined(BUILD_PTHREAD) | ||
181 | # define BUILD_PTHREAD | ||
182 | #endif | ||
183 | |||
184 | #define LK(x) Eina_Lock x | 176 | #define LK(x) Eina_Lock x |
185 | #define LKI(x) eina_lock_new(&(x)) | 177 | #define LKI(x) eina_lock_new(&(x)) |
186 | #define LKD(x) eina_lock_free(&(x)) | 178 | #define LKD(x) eina_lock_free(&(x)) |
@@ -197,19 +189,10 @@ extern EAPI int _evas_log_dom_global; | |||
197 | #define WRLKL(x) eina_rwlock_take_write(&(x)) | 189 | #define WRLKL(x) eina_rwlock_take_write(&(x)) |
198 | #define RWLKU(x) eina_rwlock_release(&(x)) | 190 | #define RWLKU(x) eina_rwlock_release(&(x)) |
199 | 191 | ||
200 | #ifdef BUILD_PTHREAD | ||
201 | |||
202 | # define TH(x) pthread_t x | 192 | # define TH(x) pthread_t x |
203 | # define THI(x) int x | 193 | # define THI(x) int x |
204 | # define TH_MAX 8 | 194 | # define TH_MAX 8 |
205 | 195 | ||
206 | #else | ||
207 | # define TH(x) | ||
208 | # define THI(x) | ||
209 | # define TH_MAX 0 | ||
210 | |||
211 | #endif | ||
212 | |||
213 | #include <ft2build.h> | 196 | #include <ft2build.h> |
214 | #include FT_FREETYPE_H | 197 | #include FT_FREETYPE_H |
215 | #include FT_GLYPH_H | 198 | #include FT_GLYPH_H |
@@ -535,11 +518,10 @@ struct _Image_Entry_Flags | |||
535 | 518 | ||
536 | Eina_Bool lru : 1; | 519 | Eina_Bool lru : 1; |
537 | Eina_Bool alpha_sparse : 1; | 520 | Eina_Bool alpha_sparse : 1; |
538 | #ifdef BUILD_ASYNC_PRELOAD | ||
539 | Eina_Bool preload_done : 1; | 521 | Eina_Bool preload_done : 1; |
540 | Eina_Bool delete_me : 1; | 522 | Eina_Bool delete_me : 1; |
523 | |||
541 | Eina_Bool pending : 1; | 524 | Eina_Bool pending : 1; |
542 | #endif | ||
543 | Eina_Bool animated : 1; | 525 | Eina_Bool animated : 1; |
544 | Eina_Bool rotated : 1; | 526 | Eina_Bool rotated : 1; |
545 | }; | 527 | }; |
@@ -613,11 +595,9 @@ struct _Image_Entry | |||
613 | void *loader; | 595 | void *loader; |
614 | } info; | 596 | } info; |
615 | 597 | ||
616 | #ifdef BUILD_ASYNC_PRELOAD | ||
617 | LK(lock); | 598 | LK(lock); |
618 | LK(lock_cancel); | 599 | LK(lock_cancel); |
619 | Eina_Bool unload_cancel : 1; | 600 | Eina_Bool unload_cancel : 1; |
620 | #endif | ||
621 | 601 | ||
622 | Image_Entry_Flags flags; | 602 | Image_Entry_Flags flags; |
623 | Evas_Image_Scale_Hint scale_hint; | 603 | Evas_Image_Scale_Hint scale_hint; |
diff --git a/legacy/evas/src/static_deps/Makefile.am b/legacy/evas/src/static_deps/Makefile.am index 08a0f5ba3d..5222db440b 100644 --- a/legacy/evas/src/static_deps/Makefile.am +++ b/legacy/evas/src/static_deps/Makefile.am | |||
@@ -1,7 +1,3 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | 1 | MAINTAINERCLEANFILES = Makefile.in |
2 | 2 | ||
3 | SUBDIRS = | 3 | SUBDIRS = liblinebreak |
4 | |||
5 | if EVAS_USE_LINEBREAK | ||
6 | SUBDIRS += liblinebreak | ||
7 | endif | ||