From 07274513e984f0b5544586c74508ccd16e7dcafa Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 13 Jan 2013 17:29:19 +1000 Subject: Remove EFL, since it's been released now. --- libraries/evas/src/lib/cache/Makefile.am | 26 - libraries/evas/src/lib/cache/Makefile.in | 686 ---------- libraries/evas/src/lib/cache/evas_cache.h | 175 --- .../evas/src/lib/cache/evas_cache_engine_image.c | 703 ---------- libraries/evas/src/lib/cache/evas_cache_image.c | 1428 -------------------- libraries/evas/src/lib/cache/evas_preload.c | 266 ---- 6 files changed, 3284 deletions(-) delete mode 100644 libraries/evas/src/lib/cache/Makefile.am delete mode 100644 libraries/evas/src/lib/cache/Makefile.in delete mode 100644 libraries/evas/src/lib/cache/evas_cache.h delete mode 100644 libraries/evas/src/lib/cache/evas_cache_engine_image.c delete mode 100644 libraries/evas/src/lib/cache/evas_cache_image.c delete mode 100644 libraries/evas/src/lib/cache/evas_preload.c (limited to 'libraries/evas/src/lib/cache') diff --git a/libraries/evas/src/lib/cache/Makefile.am b/libraries/evas/src/lib/cache/Makefile.am deleted file mode 100644 index 78d58d2..0000000 --- a/libraries/evas/src/lib/cache/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ - -MAINTAINERCLEANFILES = Makefile.in - -AM_CPPFLAGS = -I. \ - -I$(top_srcdir)/src/lib \ - -I$(top_srcdir)/src/lib/include \ - -DPACKAGE_BIN_DIR=\"$(bindir)\" \ - -DPACKAGE_LIB_DIR=\"$(libdir)\" \ - -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ - @EVIL_CFLAGS@ \ - @FREETYPE_CFLAGS@ \ - @PIXMAN_CFLAGS@ \ - @EINA_CFLAGS@ \ - @PIXMAN_CFLAGS@ - -noinst_LTLIBRARIES = libevas_cache.la -libevas_cache_la_SOURCES = \ -evas_cache_image.c \ -evas_cache_engine_image.c \ -evas_preload.c - -libevas_cache_la_LIBAD = @EVIL_LIBS@ - -libevas_cache_la_DEPENDENCIES = $(top_builddir)/config.h - -EXTRA_DIST = evas_cache.h diff --git a/libraries/evas/src/lib/cache/Makefile.in b/libraries/evas/src/lib/cache/Makefile.in deleted file mode 100644 index fce77cc..0000000 --- a/libraries/evas/src/lib/cache/Makefile.in +++ /dev/null @@ -1,686 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/lib/cache -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/evas_check_engine.m4 \ - $(top_srcdir)/m4/evas_check_loader.m4 \ - $(top_srcdir)/m4/evas_converter.m4 \ - $(top_srcdir)/m4/evas_dither.m4 \ - $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libevas_cache_la_LIBADD = -am_libevas_cache_la_OBJECTS = evas_cache_image.lo \ - evas_cache_engine_image.lo evas_preload.lo -libevas_cache_la_OBJECTS = $(am_libevas_cache_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libevas_cache_la_SOURCES) -DIST_SOURCES = $(libevas_cache_la_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHECK_CFLAGS = @CHECK_CFLAGS@ -CHECK_LIBS = @CHECK_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ -DIRECTFB_LIBS = @DIRECTFB_LIBS@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ -ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ -EDB_CFLAGS = @EDB_CFLAGS@ -EDB_LIBS = @EDB_LIBS@ -EDJE_CFLAGS = @EDJE_CFLAGS@ -EDJE_LIBS = @EDJE_LIBS@ -EET_CFLAGS = @EET_CFLAGS@ -EET_LIBS = @EET_LIBS@ -EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ -EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ -EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ -EGREP = @EGREP@ -EINA_CFLAGS = @EINA_CFLAGS@ -EINA_LIBS = @EINA_LIBS@ -EVAS_CFLAGS = @EVAS_CFLAGS@ -EVAS_LIBS = @EVAS_LIBS@ -EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ -EVIL_CFLAGS = @EVIL_CFLAGS@ -EVIL_LIBS = @EVIL_LIBS@ -EXEEXT = @EXEEXT@ -EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ -EXOTIC_LIBS = @EXOTIC_LIBS@ -FGREP = @FGREP@ -FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ -FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ -FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ -FRIBIDI_LIBS = @FRIBIDI_LIBS@ -GL_EET_CFLAGS = @GL_EET_CFLAGS@ -GL_EET_LIBS = @GL_EET_LIBS@ -GREP = @GREP@ -HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ -HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ -LINEBREAK_LIBS = @LINEBREAK_LIBS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MODULE_ARCH = @MODULE_ARCH@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCDEPMODE = @OBJCDEPMODE@ -OBJCFLAGS = @OBJCFLAGS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ -PIXMAN_LIBS = @PIXMAN_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PNG_CFLAGS = @PNG_CFLAGS@ -PNG_LIBS = @PNG_LIBS@ -RANLIB = @RANLIB@ -SDL_CFLAGS = @SDL_CFLAGS@ -SDL_LIBS = @SDL_LIBS@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SHM_OPEN_LINK = @SHM_OPEN_LINK@ -STRIP = @STRIP@ -SVG_CFLAGS = @SVG_CFLAGS@ -SVG_LIBS = @SVG_LIBS@ -VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ -VALGRIND_LIBS = @VALGRIND_LIBS@ -VERSION = @VERSION@ -VMAJ = @VMAJ@ -WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ -WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ -XCB_GL_LIBS = @XCB_GL_LIBS@ -XCB_LIBS = @XCB_LIBS@ -XEXT_CFLAGS = @XEXT_CFLAGS@ -XEXT_LIBS = @XEXT_LIBS@ -XMKMF = @XMKMF@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_OBJC = @ac_ct_OBJC@ -altivec_cflags = @altivec_cflags@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -dlopen_libs = @dlopen_libs@ -docdir = @docdir@ -dvidir = @dvidir@ -edje_cc = @edje_cc@ -efl_doxygen = @efl_doxygen@ -efl_have_doxygen = @efl_have_doxygen@ -evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ -evas_engine_buffer_libs = @evas_engine_buffer_libs@ -evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ -evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ -evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ -evas_engine_directfb_libs = @evas_engine_directfb_libs@ -evas_engine_fb_cflags = @evas_engine_fb_cflags@ -evas_engine_fb_libs = @evas_engine_fb_libs@ -evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ -evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ -evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ -evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ -evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ -evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ -evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ -evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ -evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ -evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ -evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ -evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ -evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ -evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ -evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ -evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ -evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ -evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ -evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ -evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ -evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ -evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ -evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ -evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ -evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ -evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ -evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ -evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ -evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ -evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ -evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ -evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ -evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ -evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ -evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ -evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ -evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ -evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ -evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ -evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ -evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ -evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ -evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ -evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ -evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ -evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ -evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ -evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ -evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ -evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ -evas_image_loader_png_libs = @evas_image_loader_png_libs@ -evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ -evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ -evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ -evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ -evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ -evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ -evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ -evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ -evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ -evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ -evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ -evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ -exec_prefix = @exec_prefix@ -have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ -have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ -have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ -have_evas_engine_software_x11 = @have_evas_engine_software_x11@ -have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ -have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ -have_lcov = @have_lcov@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -lt_enable_auto_import = @lt_enable_auto_import@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgconfig_requires_private = @pkgconfig_requires_private@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pthread_cflags = @pthread_cflags@ -pthread_libs = @pthread_libs@ -release_info = @release_info@ -requirement_evas = @requirement_evas@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -version_info = @version_info@ -MAINTAINERCLEANFILES = Makefile.in -AM_CPPFLAGS = -I. \ - -I$(top_srcdir)/src/lib \ - -I$(top_srcdir)/src/lib/include \ - -DPACKAGE_BIN_DIR=\"$(bindir)\" \ - -DPACKAGE_LIB_DIR=\"$(libdir)\" \ - -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ - @EVIL_CFLAGS@ \ - @FREETYPE_CFLAGS@ \ - @PIXMAN_CFLAGS@ \ - @EINA_CFLAGS@ \ - @PIXMAN_CFLAGS@ - -noinst_LTLIBRARIES = libevas_cache.la -libevas_cache_la_SOURCES = \ -evas_cache_image.c \ -evas_cache_engine_image.c \ -evas_preload.c - -libevas_cache_la_LIBAD = @EVIL_LIBS@ -libevas_cache_la_DEPENDENCIES = $(top_builddir)/config.h -EXTRA_DIST = evas_cache.h -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cache/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/lib/cache/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libevas_cache.la: $(libevas_cache_la_OBJECTS) $(libevas_cache_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libevas_cache_la_OBJECTS) $(libevas_cache_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cache_engine_image.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cache_image.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_preload.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libraries/evas/src/lib/cache/evas_cache.h b/libraries/evas/src/lib/cache/evas_cache.h deleted file mode 100644 index 0947a6d..0000000 --- a/libraries/evas/src/lib/cache/evas_cache.h +++ /dev/null @@ -1,175 +0,0 @@ -#ifndef _EVAS_CACHE_H -#define _EVAS_CACHE_H - - -typedef struct _Evas_Cache_Image Evas_Cache_Image; -typedef struct _Evas_Cache_Image_Func Evas_Cache_Image_Func; -typedef struct _Evas_Cache_Engine_Image Evas_Cache_Engine_Image; -typedef struct _Evas_Cache_Engine_Image_Func Evas_Cache_Engine_Image_Func; - - -struct _Evas_Cache_Image_Func -{ - Image_Entry *(*alloc)(void); - void (*dealloc)(Image_Entry *im); - - /* The cache provide some helpers for surface manipulation. */ - int (*surface_alloc)(Image_Entry *im, unsigned int w, unsigned int h); - void (*surface_delete)(Image_Entry *im); - DATA32 *(*surface_pixels)(Image_Entry *im); - - /* The cache is doing the allocation and deallocation, you must just do the rest. */ - int (*constructor)(Image_Entry *im); /**< return is EVAS_LOAD_ERROR_* or EVAS_LOAD_ERROR_NONE! */ - void (*destructor)(Image_Entry *im); - - void (*dirty_region)(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h); - /* Only called when references > 0. Need to provide a fresh copie of im. */ - /* The destination surface does have a surface, but no allocated pixel data. */ - int (*dirty)(Image_Entry *dst, const Image_Entry *src); - /* Only called when references == 1. We will call drop on `im'. */ - /* The destination surface does not have any surface. */ - int (*size_set)(Image_Entry *dst, const Image_Entry *src, unsigned int w, unsigned int h); - - /* The destination surface does not have any surface. */ - int (*copied_data)(Image_Entry *dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace); - /* The destination surface does not have any surface. */ - int (*data)(Image_Entry *dst, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace); - int (*color_space)(Image_Entry *dst, int cspace); - - /* This function need to update im->w and im->h. */ - int (*load)(Image_Entry *im); /**< return is EVAS_LOAD_ERROR_* or EVAS_LOAD_ERROR_NONE! */ - int (*mem_size_get)(Image_Entry *im); - void (*debug)(const char *context, Image_Entry *im); -}; - -struct _Evas_Cache_Image -{ - Evas_Cache_Image_Func func; - - Eina_List *preload; - Eina_List *pending; - - Eina_Inlist *dirty; - - Eina_Inlist *lru; - Eina_Inlist *lru_nodata; - Eina_Hash *inactiv; - Eina_Hash *activ; - void *data; - - int usage; - unsigned int limit; - int references; -#ifdef EVAS_FRAME_QUEUING - LK(lock); -#endif -}; - -struct _Evas_Cache_Engine_Image_Func -{ - /* Must return a char* allocated with eina_stringshare_add. */ - char* (*key)(Image_Entry *im, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); - - Engine_Image_Entry* (*alloc)(void); - void (*dealloc)(Engine_Image_Entry *eim); - - int (*constructor)(Engine_Image_Entry *eim, void* data); - void (*destructor)(Engine_Image_Entry *eim); - - void (*dirty_region)(Engine_Image_Entry *eim, unsigned int x, unsigned int y, unsigned int w, unsigned int h); - /* Only called when references > 0. Need to provide a fresh copie of im. */ - int (*dirty)(Engine_Image_Entry *dst, const Engine_Image_Entry *src); - /* Only called when references == 1. We will call drop on `im'. */ - int (*size_set)(Engine_Image_Entry *dst, const Engine_Image_Entry *src); - - int (*update_data)(Engine_Image_Entry* dst, void* data); - - void (*load)(Engine_Image_Entry *eim, const Image_Entry* im); - int (*mem_size_get)(Engine_Image_Entry *eim); - void (*debug)(const char* context, Engine_Image_Entry *eim); -}; - -struct _Evas_Cache_Engine_Image -{ - Evas_Cache_Engine_Image_Func func; - - Eina_Inlist* dirty; - - Eina_Hash* activ; - Eina_Hash* inactiv; - Eina_Inlist* lru; - - Evas_Cache_Image* parent; - Evas_Cache_Engine_Image* brother; - - int usage; - int limit; - - int references; -}; - - -#ifdef __cplusplus -extern "C" { -#endif - - -EAPI Evas_Cache_Image* evas_cache_image_init(const Evas_Cache_Image_Func *cb); -EAPI void evas_cache_image_shutdown(Evas_Cache_Image *cache); -EAPI Image_Entry* evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); -EAPI void evas_cache_image_drop(Image_Entry *im); -EAPI void evas_cache_image_data_not_needed(Image_Entry *im); -EAPI int evas_cache_image_flush(Evas_Cache_Image *cache); -EAPI void evas_cache_private_set(Evas_Cache_Image *cache, const void *data); -EAPI void* evas_cache_private_get(Evas_Cache_Image *cache); -EAPI void* evas_cache_private_from_image_entry_get(Image_Entry *im); - -EAPI int evas_cache_image_usage_get(Evas_Cache_Image *cache); -EAPI int evas_cache_image_get(Evas_Cache_Image *cache); -EAPI void evas_cache_image_set(Evas_Cache_Image *cache, unsigned int size); - -EAPI Image_Entry* evas_cache_image_alone(Image_Entry *im); -EAPI Image_Entry* evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h); -EAPI int evas_cache_image_load_data(Image_Entry *im); -EAPI void evas_cache_image_unload_data(Image_Entry *im); -EAPI Eina_Bool evas_cache_image_is_loaded(Image_Entry *im); -EAPI void evas_cache_image_unload_all(Evas_Cache_Image *cache); -EAPI void evas_cache_image_surface_alloc(Image_Entry *im, unsigned int w, unsigned int h); -EAPI DATA32* evas_cache_image_pixels(Image_Entry *im); -EAPI Image_Entry* evas_cache_image_copied_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace); -EAPI Image_Entry* evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace); -EAPI void evas_cache_image_colorspace(Image_Entry *im, int cspace); -EAPI Image_Entry* evas_cache_image_empty(Evas_Cache_Image *cache); -EAPI Image_Entry* evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h); - -EAPI Evas_Cache_Engine_Image* evas_cache_engine_image_init(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Image *parent); -EAPI void evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache); - -EAPI int evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache); -EAPI int evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache); -EAPI void evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit); - -EAPI Engine_Image_Entry* evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, void *engine_data, int *error); -EAPI void evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim); -EAPI Engine_Image_Entry* evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data); -EAPI void evas_cache_engine_image_drop(Engine_Image_Entry *eim); -EAPI Engine_Image_Entry* evas_cache_engine_image_alone(Engine_Image_Entry *eim, void *data); -EAPI Engine_Image_Entry* evas_cache_engine_image_dirty(Engine_Image_Entry *eim, unsigned int x, unsigned int y, unsigned int w, unsigned int h); -EAPI Engine_Image_Entry* evas_cache_engine_image_copied_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data); -EAPI Engine_Image_Entry* evas_cache_engine_image_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data); -EAPI void evas_cache_engine_image_colorspace(Engine_Image_Entry *eim, int cspace, void *engine_data); -EAPI Engine_Image_Entry* evas_cache_engine_image_size_set(Engine_Image_Entry *eim, unsigned int w, unsigned int h); - -EAPI void evas_cache_engine_image_load_data(Engine_Image_Entry *eim); - -EAPI void evas_cache_image_preload_data(Image_Entry *im, const void *target); -EAPI void evas_cache_image_preload_cancel(Image_Entry *im, const void *target); - -EAPI void evas_cache_image_wakeup(void); - -#ifdef __cplusplus -} -#endif - - -#endif /* _EVAS_CACHE_H */ diff --git a/libraries/evas/src/lib/cache/evas_cache_engine_image.c b/libraries/evas/src/lib/cache/evas_cache_engine_image.c deleted file mode 100644 index 5ec1af2..0000000 --- a/libraries/evas/src/lib/cache/evas_cache_engine_image.c +++ /dev/null @@ -1,703 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "evas_common.h" -#include "evas_private.h" - -static void -_evas_cache_engine_image_make_dirty(Evas_Cache_Engine_Image *cache, - Engine_Image_Entry *eim) -{ - eim->flags.cached = 1; - eim->flags.dirty = 1; - eim->flags.loaded = 1; - eim->flags.activ = 0; - cache->dirty = eina_inlist_prepend(cache->dirty, EINA_INLIST_GET(eim)); -} - -static void -_evas_cache_engine_image_make_active(Evas_Cache_Engine_Image *cache, - Engine_Image_Entry *eim, - const char *key) -{ - eim->flags.cached = 1; - eim->flags.activ = 1; - eim->flags.dirty = 0; - eina_hash_add(cache->activ, key, eim); -} - -static void -_evas_cache_engine_image_make_inactive(Evas_Cache_Engine_Image *cache, - Engine_Image_Entry *eim, - const char *key) -{ - eim->flags.cached = 1; - eim->flags.dirty = 0; - eim->flags.activ = 0; - eina_hash_add(cache->inactiv, key, eim); - cache->lru = eina_inlist_prepend(cache->lru, EINA_INLIST_GET(eim)); - cache->usage += cache->func.mem_size_get(eim); -} - -static void -_evas_cache_engine_image_remove_activ(Evas_Cache_Engine_Image *cache, - Engine_Image_Entry *eim) -{ - if (eim->flags.cached) - { - if (eim->flags.dirty) - { - cache->dirty = eina_inlist_remove(cache->dirty, EINA_INLIST_GET(eim)); - } - else - if (eim->flags.activ) - { - eina_hash_del(cache->activ, eim->cache_key, eim); - } - else - { - cache->usage -= cache->func.mem_size_get(eim); - eina_hash_del(cache->inactiv, eim->cache_key, eim); - cache->lru = eina_inlist_remove(cache->lru, EINA_INLIST_GET(eim)); - } - eim->flags.cached = 0; - eim->flags.dirty = 0; - eim->flags.activ = 0; - } -} - -static Engine_Image_Entry * -_evas_cache_engine_image_alloc(Evas_Cache_Engine_Image *cache, - Image_Entry *ie, - const char *hkey) -{ - Engine_Image_Entry *eim; - - assert(cache); - - if (cache->func.alloc) - eim = cache->func.alloc(); - else - eim = malloc(sizeof (Engine_Image_Entry)); - - if (!eim) goto on_error; - memset(eim, 0, sizeof (Engine_Image_Entry)); - - eim->cache = cache; - if (ie) - { - eim->w = ie->w; - eim->h = ie->h; - eim->src = ie; - eim->flags.need_parent = 1; - } - else - { - eim->w = -1; - eim->h = -1; - eim->flags.need_parent = 0; - eim->src = NULL; - } - - eim->flags.cached = 0; - eim->references = 0; - eim->cache_key = hkey; - - if (hkey) - _evas_cache_engine_image_make_active(cache, eim, hkey); - else - _evas_cache_engine_image_make_dirty(cache, eim); - - return eim; - - on_error: - if (eim) - evas_cache_engine_image_drop(eim); - eina_stringshare_del(hkey); - evas_cache_image_drop(ie); - return NULL; -} - -static void -_evas_cache_engine_image_dealloc(Evas_Cache_Engine_Image *cache, Engine_Image_Entry *eim) -{ - Image_Entry *im; - - if (cache->func.debug) cache->func.debug("delete", eim); - - _evas_cache_engine_image_remove_activ(cache, eim); - - im = eim->src; - cache->func.destructor(eim); - if (im) evas_cache_image_drop(im); - - if (cache->func.dealloc) - { - cache->func.dealloc(eim); - } - else - { - memset(eim, 0, sizeof (Engine_Image_Entry)); - free(eim); - } -} - -EAPI int -evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache) -{ - assert(cache != NULL); - - return cache->usage; -} - -EAPI int -evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache) -{ - assert(cache != NULL); - - return cache->limit; -} - -EAPI void -evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit) -{ - assert(cache != NULL); - - cache->limit = limit; -} - -EAPI Evas_Cache_Engine_Image * -evas_cache_engine_image_init(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Image *parent) -{ - Evas_Cache_Engine_Image *new; - - new = malloc(sizeof (Evas_Cache_Engine_Image)); - if (!new) - return NULL; - - new->func = *cb; - - new->limit = 0; - new->usage = 0; - - new->dirty = NULL; - new->lru = NULL; - new->activ = eina_hash_string_superfast_new(NULL); - new->inactiv = eina_hash_string_superfast_new(NULL); - - new->parent = parent; - parent->references++; - - new->brother = NULL; - - return new; -} - -EAPI Evas_Cache_Engine_Image * -evas_cache_engine_image_dup(const Evas_Cache_Engine_Image_Func *cb, Evas_Cache_Engine_Image *brother) -{ - Evas_Cache_Engine_Image *new; - - new = calloc(1, sizeof (Evas_Cache_Engine_Image)); - if (!new) - return NULL; - - new->func = brother->func; - -#define ORD(Func) if (cb->Func) new->func.Func = cb->Func; - - ORD(key); - ORD(constructor); - ORD(destructor); - ORD(dirty_region); - ORD(dirty); - ORD(size_set); - ORD(update_data); - ORD(load); - ORD(mem_size_get); - ORD(debug); - -#undef ORD - - new->limit = -1; - new->usage = 0; - new->references = 1; - - new->dirty = NULL; - new->activ = NULL; - - new->parent = brother->parent; - new->parent->references++; - - new->brother = brother; - brother->references++; - - return new; -} - -static Eina_Bool -_evas_cache_engine_image_free_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, void *fdata) -{ - Eina_List **delete_list = fdata; - - *delete_list = eina_list_prepend(*delete_list, data); - - return EINA_TRUE; -} - -EAPI void -evas_cache_engine_image_flush(Evas_Cache_Engine_Image *cache) -{ - assert(cache != NULL); - - while ((cache->lru) && (cache->limit < cache->usage)) - { - Engine_Image_Entry *eim; - - eim = (Engine_Image_Entry *) cache->lru->last; - _evas_cache_engine_image_dealloc(cache, eim); - } -} - -EAPI void -evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache) -{ - Engine_Image_Entry *eim; - Eina_List *delete_list = NULL; - - assert(cache != NULL); - - if (cache->func.debug) cache->func.debug("shutdown-engine", NULL); - - eina_hash_foreach(cache->inactiv, _evas_cache_engine_image_free_cb, &delete_list); - eina_hash_foreach(cache->activ, _evas_cache_engine_image_free_cb, &delete_list); - - while (delete_list) - { - _evas_cache_engine_image_dealloc(cache, eina_list_data_get(delete_list)); - delete_list = eina_list_remove_list(delete_list, delete_list); - } - - eina_hash_free(cache->inactiv); - eina_hash_free(cache->activ); - - /* This is mad, I am about to destroy image still alive, but we need to prevent leak. */ - while (cache->dirty) - { - eim = (Engine_Image_Entry *) cache->dirty; - _evas_cache_engine_image_dealloc(cache, eim); - } - - - evas_cache_image_shutdown(cache->parent); - if (cache->brother) - evas_cache_engine_image_shutdown(cache->brother); - free(cache); -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, - const char *file, const char *key, - RGBA_Image_Loadopts *lo, void *data, int *error) -{ - Engine_Image_Entry *eim; - Image_Entry *im; - const char *ekey; - - assert(cache != NULL); - - *error = EVAS_LOAD_ERROR_NONE; - - ekey = NULL; - eim = NULL; - - im = evas_cache_image_request(cache->parent, file, key, lo, error); - if (!im) - goto on_error; - - if (cache->func.key) - ekey = cache->func.key(im, file, key, lo, data); - else - ekey = eina_stringshare_add(im->cache_key); - if (!ekey) - { - *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - goto on_error; - } - - eim = eina_hash_find(cache->activ, ekey); - if (eim) - { - evas_cache_image_drop(im); - goto on_ok; - } - - eim = eina_hash_find(cache->inactiv, ekey); - if (eim) - { - _evas_cache_engine_image_remove_activ(cache, eim); - _evas_cache_engine_image_make_active(cache, eim, ekey); - evas_cache_image_drop(im); - goto on_ok; - } - - eim = _evas_cache_engine_image_alloc(cache, im, ekey); - if (!eim) - { - *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - return NULL; - } - - *error = cache->func.constructor(eim, data); - if (*error != EVAS_LOAD_ERROR_NONE) goto on_error; - if (cache->func.debug) - cache->func.debug("constructor-engine", eim); - - on_ok: - eim->references++; - return eim; - - on_error: - if (!eim) - { - if (im) evas_cache_image_drop(im); - if (ekey) eina_stringshare_del(ekey); - } - else - { - _evas_cache_engine_image_dealloc(cache, eim); - } - - return NULL; -} - -EAPI void -evas_cache_engine_image_drop(Engine_Image_Entry *eim) -{ - Evas_Cache_Engine_Image *cache; - - assert(eim); - assert(eim->cache); - - eim->references--; - cache = eim->cache; - - if (eim->flags.dirty) - { - _evas_cache_engine_image_dealloc(cache, eim); - return ; - } - - if (eim->references == 0) - { - _evas_cache_engine_image_remove_activ(cache, eim); - _evas_cache_engine_image_make_inactive(cache, eim, eim->cache_key); - evas_cache_engine_image_flush(cache); - return ; - } -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_dirty(Engine_Image_Entry *eim, unsigned int x, unsigned int y, unsigned int w, unsigned int h) -{ - Engine_Image_Entry *eim_dirty = eim; - Image_Entry *im_dirty = NULL; - Image_Entry *im; - Evas_Cache_Engine_Image *cache; - unsigned char alloc_eim; - - assert(eim); - assert(eim->cache); - - cache = eim->cache; - if (!(eim->flags.dirty)) - { - alloc_eim = 0; - - if (eim->flags.need_parent == 1) - { - im = eim->src; - im_dirty = evas_cache_image_dirty(im, x, y, w, h); - - /* If im == im_dirty, this meens that we have only one reference to the eim. */ - if (im != im_dirty) - { - if (eim->references == 1) - { - _evas_cache_engine_image_remove_activ(cache, eim); - _evas_cache_engine_image_make_dirty(cache, eim); - - eim->src = im_dirty; - } - else - alloc_eim = 1; - } - } - else - if (eim->references > 1) - { - alloc_eim = 1; - } - else - { - _evas_cache_engine_image_remove_activ(cache, eim_dirty); - _evas_cache_engine_image_make_dirty(cache, eim_dirty); - } - - if (alloc_eim == 1) - { - int error; - - eim_dirty = _evas_cache_engine_image_alloc(cache, im_dirty, NULL); - if (!eim_dirty) goto on_error; - - eim_dirty->w = eim->w; - eim_dirty->h = eim->h; - eim_dirty->references = 1; - - error = cache->func.dirty(eim_dirty, eim); - if (cache->func.debug) - cache->func.debug("dirty-engine", eim_dirty); - - if (error != 0) goto on_error; - - evas_cache_engine_image_drop(eim); - } - } - - if (cache->func.dirty_region) - cache->func.dirty_region(eim_dirty, x, y, w, h); - if (cache->func.debug) - cache->func.debug("dirty-region-engine", eim_dirty); - - return eim_dirty; - - on_error: - if (eim) evas_cache_engine_image_drop(eim); - if (eim_dirty && eim_dirty != eim) - evas_cache_engine_image_drop(eim_dirty); - else - if (im_dirty) evas_cache_image_drop(im_dirty); - - return NULL; -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_alone(Engine_Image_Entry *eim, void *data) -{ - Evas_Cache_Engine_Image *cache; - Image_Entry *im; - - - assert(eim); - assert(eim->cache); - - cache = eim->cache; - im = evas_cache_image_alone(eim->src); - if (im != eim->src) - { - eim = _evas_cache_engine_image_alloc(cache, im, NULL); - if (!eim) goto on_error; - - eim->references = 1; - - if (cache->func.constructor(eim, data) != EVAS_LOAD_ERROR_NONE) - goto on_error; - } - /* FIXME */ - return eim; - - on_error: - evas_cache_image_drop(im); - return NULL; -} - -static Engine_Image_Entry * -_evas_cache_engine_image_push_dirty(Evas_Cache_Engine_Image *cache, Image_Entry *im, void *engine_data) -{ - Engine_Image_Entry *eim; - int error; - - eim = _evas_cache_engine_image_alloc(cache, im, NULL); - if (!eim) goto on_error; - eim->references = 1; - - error = cache->func.update_data(eim, engine_data); - if (cache->func.debug) - cache->func.debug("dirty-update_data-engine", eim); - if (error != 0) goto on_error; - - return eim; - - on_error: - if (eim) - evas_cache_engine_image_drop(eim); - return NULL; -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_copied_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data) -{ - Image_Entry *im; - - assert(cache); - - im = evas_cache_image_copied_data(cache->parent, w, h, image_data, alpha, cspace); - - return _evas_cache_engine_image_push_dirty(cache, im, engine_data); -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_data(Evas_Cache_Engine_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace, void *engine_data) -{ - Image_Entry *im; - - assert(cache); - - im = evas_cache_image_data(cache->parent, w, h, image_data, alpha, cspace); - - return _evas_cache_engine_image_push_dirty(cache, im, engine_data); -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_size_set(Engine_Image_Entry *eim, unsigned int w, unsigned int h) -{ - Evas_Cache_Engine_Image *cache; - Engine_Image_Entry *new; - Image_Entry *im; - const char *hkey; - int error; - - assert(eim); - assert(eim->cache); - assert(eim->references > 0); - - im = NULL; - cache = eim->cache; - - if (eim->flags.need_parent == 1) - { - assert(eim->src); - - if (eim->src->w == w - && eim->src->h == h) - return eim; - - im = evas_cache_image_size_set(eim->src, w, h); - /* FIXME: Good idea to call update_data ? */ - if (im == eim->src) return eim; - eim->src = NULL; - } - - hkey = (eim->references > 1 ) ? eina_stringshare_add(eim->cache_key) : NULL; - - new = _evas_cache_engine_image_alloc(cache, im, hkey); - if (!new) goto on_error; - - new->w = w; - new->h = h; - new->references = 1; - - error = cache->func.size_set(new, eim); - if (error) goto on_error; - - evas_cache_engine_image_drop(eim); - return new; - - on_error: - if (new) - evas_cache_engine_image_drop(new); - else - if (im) - evas_cache_image_drop(im); - evas_cache_engine_image_drop(eim); - - return NULL; -} - -EAPI void -evas_cache_engine_image_load_data(Engine_Image_Entry *eim) -{ - Evas_Cache_Engine_Image *cache; - int size = 0; - - assert(eim); - assert(eim->src); - assert(eim->cache); - - if (eim->flags.loaded) return; - - if (eim->src) - evas_cache_image_load_data(eim->src); - - cache = eim->cache; - if (cache->func.debug) - cache->func.debug("load-engine", eim); - - if (eim->flags.dirty) - size = cache->func.mem_size_get(eim); - cache = eim->cache; - cache->func.load(eim, eim->src); - if (eim->flags.dirty) - cache->usage += cache->func.mem_size_get(eim) - size; - - eim->flags.loaded = 1; -} - -EAPI Engine_Image_Entry * -evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data) -{ - Engine_Image_Entry *eim; - Image_Entry *ie; - int error; - - ie = evas_cache_image_empty(cache->parent); - if (!ie) return NULL; - - eim = _evas_cache_engine_image_alloc(cache, ie, NULL); - if (!eim) goto on_error; - eim->references = 1; - - error = cache->func.update_data(eim, engine_data); - if (cache->func.debug) - cache->func.debug("update_data-engine", eim); - - if (error != 0) goto on_error; - - return eim; - - on_error: - if (!eim) - evas_cache_image_drop(ie); - else - evas_cache_engine_image_drop(eim); - - return NULL; -} - -EAPI void -evas_cache_engine_image_colorspace(Engine_Image_Entry *eim, int cspace, void *engine_data) -{ - Evas_Cache_Engine_Image *cache = eim->cache; - - assert(cache); - - cache->func.destructor(eim); - evas_cache_image_colorspace(eim->src, cspace); - cache->func.constructor(eim, engine_data); - if (cache->func.debug) - cache->func.debug("cosntructor-colorspace-engine", eim); -} - -EAPI void -evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim) -{ - assert(eim); - assert(eim->cache); - - eim->flags.need_parent = 0; - evas_cache_image_data_not_needed(eim->src); -} diff --git a/libraries/evas/src/lib/cache/evas_cache_image.c b/libraries/evas/src/lib/cache/evas_cache_image.c deleted file mode 100644 index d5b72c5..0000000 --- a/libraries/evas/src/lib/cache/evas_cache_image.c +++ /dev/null @@ -1,1428 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_EVIL -# include -#endif - -#include "evas_common.h" -#include "evas_private.h" - -//#define CACHEDUMP 1 - -#ifdef EVAS_CSERVE -// FIXME: cache server and threaded preload clash badly atm - disable -//#undef BUILD_ASYNC_PRELOAD -#endif - -#ifdef BUILD_ASYNC_PRELOAD -typedef struct _Evas_Cache_Preload Evas_Cache_Preload; - -struct _Evas_Cache_Preload -{ - EINA_INLIST; - Image_Entry *ie; -}; - -static LK(engine_lock); -static LK(wakeup); -static int _evas_cache_mutex_init = 0; - -static Eina_Condition cond_wakeup; - -static void _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target); -#endif - -#define FREESTRC(Var) \ - if (Var) \ -{ \ - eina_stringshare_del(Var); \ - Var = NULL; \ -} - -static void _evas_cache_image_dirty_add(Image_Entry *im); -static void _evas_cache_image_dirty_del(Image_Entry *im); -static void _evas_cache_image_activ_add(Image_Entry *im); -static void _evas_cache_image_activ_del(Image_Entry *im); -static void _evas_cache_image_lru_add(Image_Entry *im); -static void _evas_cache_image_lru_del(Image_Entry *im); -static void _evas_cache_image_lru_nodata_add(Image_Entry *im); -static void _evas_cache_image_lru_nodata_del(Image_Entry *im); - -static void -_evas_cache_image_dirty_add(Image_Entry *im) -{ - if (im->flags.dirty) return; - _evas_cache_image_activ_del(im); - _evas_cache_image_lru_del(im); - _evas_cache_image_lru_nodata_del(im); - im->flags.dirty = 1; - im->flags.cached = 1; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - im->cache->dirty = eina_inlist_prepend(im->cache->dirty, EINA_INLIST_GET(im)); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif - if (im->cache_key) - { - eina_stringshare_del(im->cache_key); - im->cache_key = NULL; - } -} - -static void -_evas_cache_image_dirty_del(Image_Entry *im) -{ - if (!im->flags.dirty) return; - im->flags.dirty = 0; - im->flags.cached = 0; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - im->cache->dirty = eina_inlist_remove(im->cache->dirty, EINA_INLIST_GET(im)); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_activ_add(Image_Entry *im) -{ - if (im->flags.activ) return; - _evas_cache_image_dirty_del(im); - _evas_cache_image_lru_del(im); - _evas_cache_image_lru_nodata_del(im); - if (!im->cache_key) return; - im->flags.activ = 1; - im->flags.cached = 1; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - eina_hash_direct_add(im->cache->activ, im->cache_key, im); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_activ_del(Image_Entry *im) -{ - if (!im->flags.activ) return; - if (!im->cache_key) return; - im->flags.activ = 0; - im->flags.cached = 0; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - eina_hash_del(im->cache->activ, im->cache_key, im); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_lru_add(Image_Entry *im) -{ - if (im->flags.lru) return; - _evas_cache_image_dirty_del(im); - _evas_cache_image_activ_del(im); - _evas_cache_image_lru_nodata_del(im); - if (!im->cache_key) return; - im->flags.lru = 1; - im->flags.cached = 1; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - eina_hash_direct_add(im->cache->inactiv, im->cache_key, im); - im->cache->lru = eina_inlist_prepend(im->cache->lru, EINA_INLIST_GET(im)); - im->cache->usage += im->cache->func.mem_size_get(im); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_lru_del(Image_Entry *im) -{ - if (!im->flags.lru) return; - if (!im->cache_key) return; - im->flags.lru = 0; - im->flags.cached = 0; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - eina_hash_del(im->cache->inactiv, im->cache_key, im); - im->cache->lru = eina_inlist_remove(im->cache->lru, EINA_INLIST_GET(im)); - im->cache->usage -= im->cache->func.mem_size_get(im); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_lru_nodata_add(Image_Entry *im) -{ - if (im->flags.lru_nodata) return; - _evas_cache_image_dirty_del(im); - _evas_cache_image_activ_del(im); - _evas_cache_image_lru_del(im); - im->flags.lru = 1; - im->flags.cached = 1; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - im->cache->lru_nodata = eina_inlist_prepend(im->cache->lru_nodata, EINA_INLIST_GET(im)); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_lru_nodata_del(Image_Entry *im) -{ - if (!im->flags.lru_nodata) return; - im->flags.lru = 0; - im->flags.cached = 0; -#ifdef EVAS_FRAME_QUEUING - LKL(im->cache->lock); -#endif - im->cache->lru_nodata = eina_inlist_remove(im->cache->lru_nodata, EINA_INLIST_GET(im)); -#ifdef EVAS_FRAME_QUEUING - LKU(im->cache->lock); -#endif -} - -static void -_evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie) -{ - if (!ie) return; - if (cache->func.debug) cache->func.debug("deleting", ie); -#ifdef BUILD_ASYNC_PRELOAD - if (ie->flags.delete_me == 1) return; - if (ie->preload) - { - ie->flags.delete_me = 1; - _evas_cache_image_entry_preload_remove(ie, NULL); - return; - } -#endif - - _evas_cache_image_dirty_del(ie); - _evas_cache_image_activ_del(ie); - _evas_cache_image_lru_del(ie); - _evas_cache_image_lru_nodata_del(ie); - - cache->func.destructor(ie); - FREESTRC(ie->cache_key); - FREESTRC(ie->file); - FREESTRC(ie->key); - ie->cache = NULL; - cache->func.surface_delete(ie); - -#ifdef BUILD_ASYNC_PRELOAD - LKD(ie->lock); - LKD(ie->lock_cancel); -#endif -#ifdef EVAS_FRAME_QUEUING - LKD(ie->lock_references); -#endif - cache->func.dealloc(ie); -} - -static Eina_Bool -_timestamp_compare(Image_Timestamp *tstamp, struct stat *st) -{ - if (tstamp->mtime != st->st_mtime) return EINA_FALSE; - if (tstamp->size != st->st_size) return EINA_FALSE; - if (tstamp->ino != st->st_ino) return EINA_FALSE; -#ifdef _STAT_VER_LINUX -#if (defined __USE_MISC && defined st_mtime) - if (tstamp->mtime_nsec != (unsigned long int)st->st_mtim.tv_nsec) - return EINA_FALSE; -#else - if (tstamp->mtime_nsec != (unsigned long int)st->st_mtimensec) - return EINA_FALSE; -#endif -#endif - return EINA_TRUE; -} - -static void -_timestamp_build(Image_Timestamp *tstamp, struct stat *st) -{ - tstamp->mtime = st->st_mtime; - tstamp->size = st->st_size; - tstamp->ino = st->st_ino; -#ifdef _STAT_VER_LINUX -#if (defined __USE_MISC && defined st_mtime) - tstamp->mtime_nsec = (unsigned long int)st->st_mtim.tv_nsec; -#else - tstamp->mtime_nsec = (unsigned long int)st->st_mtimensec; -#endif -#endif -} - -static Image_Entry * -_evas_cache_image_entry_new(Evas_Cache_Image *cache, - const char *hkey, - Image_Timestamp *tstamp, - const char *file, - const char *key, - RGBA_Image_Loadopts *lo, - int *error) -{ - Image_Entry *ie; - - ie = cache->func.alloc(); - if (!ie) - { - *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - return NULL; - } - ie->cache = cache; - if (hkey) ie->cache_key = eina_stringshare_add(hkey); - ie->flags.need_data = 1; - ie->space = EVAS_COLORSPACE_ARGB8888; - ie->w = -1; - ie->h = -1; - ie->scale = 1; - if (file) ie->file = eina_stringshare_add(file); - if (key) ie->key = eina_stringshare_add(key); - if (tstamp) ie->tstamp = *tstamp; - else memset(&ie->tstamp, 0, sizeof(Image_Timestamp)); - -#ifdef EVAS_FRAME_QUEUING - LKI(ie->lock_references); -#endif -#ifdef BUILD_ASYNC_PRELOAD - LKI(ie->lock); - LKI(ie->lock_cancel); -#endif - - if (lo) ie->load_opts = *lo; - if (ie->file) - { - *error = cache->func.constructor(ie); - if (*error != EVAS_LOAD_ERROR_NONE) - { - _evas_cache_image_entry_delete(cache, ie); - return NULL; - } - } - if (cache->func.debug) cache->func.debug("build", ie); - if (ie->cache_key) _evas_cache_image_activ_add(ie); - else _evas_cache_image_dirty_add(ie); - return ie; -} - -static void -_evas_cache_image_entry_surface_alloc__locked(Evas_Cache_Image *cache, - Image_Entry *ie, - unsigned int wmin, - unsigned int hmin) -{ - if ((ie->allocated.w == wmin) && (ie->allocated.h == hmin)) return; - if (cache->func.surface_alloc(ie, wmin, hmin)) - { - wmin = 0; - hmin = 0; - } - ie->w = wmin; - ie->h = hmin; - ie->allocated.w = wmin; - ie->allocated.h = hmin; -} - -static void -_evas_cache_image_entry_surface_alloc(Evas_Cache_Image *cache, - Image_Entry *ie, int w, int h) -{ - int wmin = w > 0 ? w : 1; - int hmin = h > 0 ? h : 1; -#ifdef BUILD_ASYNC_PRELOAD - LKL(engine_lock); -#endif - _evas_cache_image_entry_surface_alloc__locked(cache, ie, wmin, hmin); -#ifdef BUILD_ASYNC_PRELOAD - LKU(engine_lock); -#endif -} - -#ifdef BUILD_ASYNC_PRELOAD -static void -_evas_cache_image_async_heavy(void *data) -{ - Evas_Cache_Image *cache; - Image_Entry *current; - int error; - int pchannel; - - current = data; - - LKL(current->lock); - pchannel = current->channel; - current->channel++; - cache = current->cache; - - if ((!current->flags.loaded) && - ((Evas_Image_Load_Func*) current->info.module)->threadable) - { - error = cache->func.load(current); - if (cache->func.debug) cache->func.debug("load", current); - current->load_error = error; - if (error != EVAS_LOAD_ERROR_NONE) - { - current->flags.loaded = 0; - _evas_cache_image_entry_surface_alloc(cache, current, - current->w, current->h); - } - else - { - current->flags.loaded = 1; - } - } - current->channel = pchannel; - // check the unload cancel flag - LKL(current->lock_cancel); - if (current->unload_cancel) - { - current->unload_cancel = EINA_FALSE; - cache->func.surface_delete(current); - current->flags.loaded = 0; - current->flags.preload_done = 0; - } - LKU(current->lock_cancel); - LKU(current->lock); -} - -static void -_evas_cache_image_async_end(void *data) -{ - Image_Entry *ie = (Image_Entry *)data; - Evas_Cache_Target *tmp; - - ie->cache->preload = eina_list_remove(ie->cache->preload, ie); - ie->cache->pending = eina_list_remove(ie->cache->pending, ie); - ie->preload = NULL; - ie->flags.preload_done = ie->flags.loaded; - while ((tmp = ie->targets)) - { - evas_object_inform_call_image_preloaded((Evas_Object*) tmp->target); - ie->targets = (Evas_Cache_Target *) - eina_inlist_remove(EINA_INLIST_GET(ie->targets), - EINA_INLIST_GET(ie->targets)); - free(tmp); - } -} - -static void -_evas_cache_image_async_cancel(void *data) -{ - Evas_Cache_Image *cache = NULL; - Image_Entry *ie = (Image_Entry *)data; - - ie->preload = NULL; - ie->cache->pending = eina_list_remove(ie->cache->pending, ie); - if ((ie->flags.delete_me) || (ie->flags.dirty)) - { - ie->flags.delete_me = 0; - _evas_cache_image_entry_delete(ie->cache, ie); - return; - } - if (ie->flags.loaded) _evas_cache_image_async_end(ie); -#ifdef EVAS_FRAME_QUEUING - LKL(ie->lock_references); -#endif - if (ie->references == 0) - { - _evas_cache_image_lru_add(ie); - cache = ie->cache; - } -#ifdef EVAS_FRAME_QUEUING - LKU(ie->lock_references); -#endif - if (cache) evas_cache_image_flush(cache); -} - -// note - preload_add assumes a target is ONLY added ONCE to the image -// entry. make sure you only add once, or remove first, then add -static int -_evas_cache_image_entry_preload_add(Image_Entry *ie, const void *target) -{ - Evas_Cache_Target *tg; - - if (ie->flags.preload_done) return 0; - - tg = malloc(sizeof (Evas_Cache_Target)); - if (!tg) return 0; - - tg->target = target; - ie->targets = (Evas_Cache_Target *) - eina_inlist_append(EINA_INLIST_GET(ie->targets), EINA_INLIST_GET(tg)); - if (!ie->preload) - { - ie->cache->preload = eina_list_append(ie->cache->preload, ie); - ie->flags.pending = 0; - ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy, - _evas_cache_image_async_end, - _evas_cache_image_async_cancel, - ie); - } - return 1; -} - -static void -_evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target) -{ - if (target) - { - Evas_Cache_Target *tg; - - EINA_INLIST_FOREACH(ie->targets, tg) - { - if (tg->target == target) - { - // FIXME: No callback when we cancel only for one target ? - ie->targets = (Evas_Cache_Target *) - eina_inlist_remove(EINA_INLIST_GET(ie->targets), - EINA_INLIST_GET(tg)); - free(tg); - break; - } - } - } - else - { - Evas_Cache_Target *tg; - - while (ie->targets) - { - tg = ie->targets; - ie->targets = (Evas_Cache_Target *) - eina_inlist_remove(EINA_INLIST_GET(ie->targets), - EINA_INLIST_GET(tg)); - free(tg); - } - } - - if ((!ie->targets) && (ie->preload) && (!ie->flags.pending)) - { - ie->cache->preload = eina_list_remove(ie->cache->preload, ie); - ie->cache->pending = eina_list_append(ie->cache->pending, ie); - ie->flags.pending = 1; - evas_preload_thread_cancel(ie->preload); - } -} -#endif - -EAPI int -evas_cache_image_usage_get(Evas_Cache_Image *cache) -{ - return cache->usage; -} - -EAPI int -evas_cache_image_get(Evas_Cache_Image *cache) -{ - return cache->limit; -} - -EAPI void -evas_cache_image_set(Evas_Cache_Image *cache, unsigned int limit) -{ -#ifdef EVAS_FRAME_QUEUING - LKL(cache->lock); -#endif - if (cache->limit == limit) - { -#ifdef EVAS_FRAME_QUEUING - LKU(cache->lock); -#endif - return; - } - cache->limit = limit; -#ifdef EVAS_FRAME_QUEUING - LKU(cache->lock); -#endif - evas_cache_image_flush(cache); -} - -EAPI Evas_Cache_Image * -evas_cache_image_init(const Evas_Cache_Image_Func *cb) -{ - Evas_Cache_Image *cache; - -#ifdef BUILD_ASYNC_PRELOAD - if (_evas_cache_mutex_init++ == 0) - { - LKI(engine_lock); - LKI(wakeup); - eina_condition_new(&cond_wakeup, &wakeup); - } -#endif - - cache = calloc(1, sizeof(Evas_Cache_Image)); - if (!cache) return NULL; - cache->func = *cb; - cache->inactiv = eina_hash_string_superfast_new(NULL); - cache->activ = eina_hash_string_superfast_new(NULL); - cache->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKI(cache->lock); -#endif - return cache; -} - -static Eina_Bool -_evas_cache_image_free_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, void *fdata) -{ - Eina_List **delete_list = fdata; - *delete_list = eina_list_prepend(*delete_list, data); - return EINA_TRUE; -} - -EAPI void -evas_cache_image_shutdown(Evas_Cache_Image *cache) -{ - Eina_List *delete_list; - Image_Entry *im; - -#ifdef EVAS_FRAME_QUEUING - LKL(cache->lock); -#endif - cache->references--; - if (cache->references != 0) - { -#ifdef EVAS_FRAME_QUEUING - LKU(cache->lock); -#endif - return; - } -#ifdef EVAS_FRAME_QUEUING - /* Release and destroy lock early ! */ - LKU(cache->lock); - LKD(cache->lock); -#endif - -#ifdef BUILD_ASYNC_PRELOAD - EINA_LIST_FREE(cache->preload, im) - { - /* By doing that we are protecting us from destroying image when the cache is no longer available. */ - im->flags.delete_me = 1; - _evas_cache_image_entry_preload_remove(im, NULL); - } - evas_async_events_process(); -#endif - while (cache->lru) - { - im = (Image_Entry *)cache->lru; - _evas_cache_image_entry_delete(cache, im); - } - while (cache->lru_nodata) - { - im = (Image_Entry *)cache->lru_nodata; - _evas_cache_image_entry_delete(cache, im); - } - /* This is mad, I am about to destroy image still alive, but we need to prevent leak. */ - while (cache->dirty) - { - im = (Image_Entry *)cache->dirty; - _evas_cache_image_entry_delete(cache, im); - } - delete_list = NULL; - eina_hash_foreach(cache->activ, _evas_cache_image_free_cb, &delete_list); - while (delete_list) - { - _evas_cache_image_entry_delete(cache, eina_list_data_get(delete_list)); - delete_list = eina_list_remove_list(delete_list, delete_list); - } - -#ifdef BUILD_ASYNC_PRELOAD - /* Now wait for all pending image to die */ - while (cache->pending) - { - evas_async_events_process(); - LKL(wakeup); - // the lazy bum who did eain threads and converted this code - // didn't bother to worry about Eina_Lock being a different type - // to a pthread mutex. - if (cache->pending) eina_condition_wait(&cond_wakeup); - LKU(wakeup); - } -#endif - eina_hash_free(cache->activ); - eina_hash_free(cache->inactiv); - free(cache); - -#ifdef BUILD_ASYNC_PRELOAD - if (--_evas_cache_mutex_init == 0) - { - eina_condition_free(&cond_wakeup); - LKD(engine_lock); - LKD(wakeup); - } -#endif -} - -EAPI Image_Entry * -evas_cache_image_request(Evas_Cache_Image *cache, const char *file, - const char *key, RGBA_Image_Loadopts *lo, int *error) -{ - const char *ckey = "(null)"; - char *hkey; - Image_Entry *im; - Evas_Image_Load_Opts prevent = { 0, 0.0, 0, 0, 0, { 0, 0, 0, 0 }, EINA_FALSE }; - size_t size; - int stat_done = 0, stat_failed = 0; - size_t file_length; - size_t key_length; - struct stat st; - Image_Timestamp tstamp; - - if ((!file) || ((!file) && (!key))) - { - *error = EVAS_LOAD_ERROR_GENERIC; - return NULL; - } - - /* generate hkey from file+key+load opts */ - file_length = strlen(file); - key_length = key ? strlen(key) : 6; - size = file_length + key_length + 132; - hkey = alloca(sizeof (char) * size); - memcpy(hkey, file, file_length); - size = file_length; - memcpy(hkey + size, "//://", 5); - size += 5; - if (key) ckey = key; - memcpy(hkey + size, ckey, key_length); - size += key_length; - if ((!lo) || - (lo && - (lo->scale_down_by == 0) && - (lo->dpi == 0.0) && - ((lo->w == 0) || (lo->h == 0)) && - ((lo->region.w == 0) || (lo->region.h == 0)) && - (lo->orientation == 0) - )) - { - lo = &prevent; - } - else - { - memcpy(hkey + size, "//@/", 4); - size += 4; - size += eina_convert_xtoa(lo->scale_down_by, hkey + size); - hkey[size] = '/'; - size += 1; - size += eina_convert_dtoa(lo->dpi, hkey + size); - hkey[size] = '/'; - size += 1; - size += eina_convert_xtoa(lo->w, hkey + size); - hkey[size] = 'x'; - size += 1; - size += eina_convert_xtoa(lo->h, hkey + size); - hkey[size] = '/'; - size += 1; - size += eina_convert_xtoa(lo->region.x, hkey + size); - hkey[size] = '+'; - size += 1; - size += eina_convert_xtoa(lo->region.y, hkey + size); - hkey[size] = '.'; - size += 1; - size += eina_convert_xtoa(lo->region.w, hkey + size); - hkey[size] = 'x'; - size += 1; - size += eina_convert_xtoa(lo->region.h, hkey + size); - - if (lo->orientation) - { - hkey[size] = '/'; - size += 1; - hkey[size] = 'o'; - size += 1; - } - } - hkey[size] = '\0'; - - /* find image by key in active hash */ -#ifdef EVAS_FRAME_QUEUING - LKL(cache->lock); -#endif - im = eina_hash_find(cache->activ, hkey); -#ifdef EVAS_FRAME_QUEUING - LKU(cache->lock); -#endif - if (im) - { - int ok = 1; - - stat_done = 1; - if (stat(file, &st) < 0) - { - stat_failed = 1; - ok = 0; - } - else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0; - if (ok) goto on_ok; - /* image we found doesn't match what's on disk (stat info wise) - * so dirty the active cache entry so we never find it again. this - * also implicitly guarantees that we only have 1 active copy - * of an image at a given key. we wither find it and keep re-reffing - * it or we dirty it and get it out */ - _evas_cache_image_dirty_add(im); - im = NULL; - } - - /* find image by key in inactive/lru hash */ -#ifdef EVAS_FRAME_QUEUING - LKL(cache->lock); -#endif - im = eina_hash_find(cache->inactiv, hkey); -#ifdef EVAS_FRAME_QUEUING - LKU(cache->lock); -#endif - if (im) - { - int ok = 1; - - if (!stat_done) - { - stat_done = 1; - if (stat(file, &st) < 0) - { - stat_failed = 1; - ok = 0; - } - else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0; - } - else if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0; - - if (ok) - { - /* remove from lru and make it active again */ - _evas_cache_image_lru_del(im); - _evas_cache_image_activ_add(im); - goto on_ok; - } - /* as avtive cache find - if we match in lru and its invalid, dirty */ - _evas_cache_image_dirty_add(im); - /* this image never used, so it have to be deleted */ - _evas_cache_image_entry_delete(cache, im); - im = NULL; - } - if (stat_failed) goto on_stat_error; - - if (!stat_done) - { - if (stat(file, &st) < 0) goto on_stat_error; - } - _timestamp_build(&tstamp, &st); - im = _evas_cache_image_entry_new(cache, hkey, &tstamp, file, key, - lo, error); - if (!im) goto on_stat_error; - if (cache->func.debug) cache->func.debug("request", im); - -on_ok: - *error = EVAS_LOAD_ERROR_NONE; -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - im->references++; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - return im; - -on_stat_error: -#ifndef _WIN32 - if ((errno == ENOENT) || (errno == ENOTDIR) || - (errno == ENAMETOOLONG) || (errno == ELOOP)) -#else - if (errno == ENOENT) -#endif - *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; -#ifndef _WIN32 - else if ((errno == ENOMEM) || (errno == EOVERFLOW)) -#else - else if (errno == ENOMEM) -#endif - *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; - else if (errno == EACCES) - *error = EVAS_LOAD_ERROR_PERMISSION_DENIED; - else - *error = EVAS_LOAD_ERROR_GENERIC; - - if (im) _evas_cache_image_entry_delete(cache, im); - return NULL; -} - -EAPI void -evas_cache_image_drop(Image_Entry *im) -{ - Evas_Cache_Image *cache; - int references; - -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - im->references--; - if (im->references < 0) im->references = 0; - references = im->references; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - - cache = im->cache; - - if (references == 0) - { -#ifdef EVAS_FRAME_QUEUING - LKL(im->ref_fq_add); - LKL(im->ref_fq_del); - if (im->ref_fq[0] != im->ref_fq[1]) - { - LKU(im->ref_fq_add); - LKU(im->ref_fq_del); - return; - } - LKU(im->ref_fq_add); - LKU(im->ref_fq_del); -#endif - -#ifdef BUILD_ASYNC_PRELOAD - if (im->preload) - { - _evas_cache_image_entry_preload_remove(im, NULL); - return; - } -#endif - - if (im->flags.dirty) - { - _evas_cache_image_entry_delete(cache, im); - return; - } - _evas_cache_image_lru_add(im); - if (cache) evas_cache_image_flush(cache); - } -} - -EAPI void -evas_cache_image_data_not_needed(Image_Entry *im) -{ - int references; - -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - references = im->references; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - if (references > 1) return; - if ((im->flags.dirty) || (!im->flags.need_data)) return; - _evas_cache_image_lru_nodata_add(im); -} - -EAPI Image_Entry * -evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h) -{ - Image_Entry *im_dirty = im; - Evas_Cache_Image *cache; - - cache = im->cache; - if (!(im->flags.dirty)) - { -#ifndef EVAS_CSERVE - int references; -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - references = im->references; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - // if ref 1 also copy if using shared cache as its read-only - if (references == 1) im_dirty = im; - else -#endif - { - im_dirty = - evas_cache_image_copied_data(cache, im->w, im->h, - evas_cache_image_pixels(im), - im->flags.alpha, im->space); - if (!im_dirty) goto on_error; - if (cache->func.debug) cache->func.debug("dirty-src", im); - cache->func.dirty(im_dirty, im); - if (cache->func.debug) cache->func.debug("dirty-out", im_dirty); -#ifdef EVAS_FRAME_QUEUING - LKL(im_dirty->lock_references); -#endif - im_dirty->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKU(im_dirty->lock_references); -#endif - evas_cache_image_drop(im); - } - _evas_cache_image_dirty_add(im_dirty); - } - - if (cache->func.debug) cache->func.debug("dirty-region", im_dirty); - if (cache->func.dirty_region) - cache->func.dirty_region(im_dirty, x, y, w, h); - return im_dirty; - -on_error: - if (im_dirty) _evas_cache_image_entry_delete(cache, im_dirty); - evas_cache_image_drop(im); - return NULL; -} - -EAPI Image_Entry * -evas_cache_image_alone(Image_Entry *im) -{ - Evas_Cache_Image *cache; - Image_Entry *im_dirty = im; - int references; - - cache = im->cache; -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - references = im->references; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - - if (references <= 1) - { - if (!im->flags.dirty) _evas_cache_image_dirty_add(im); - } - else - { - im_dirty = evas_cache_image_copied_data(cache, im->w, im->h, - evas_cache_image_pixels(im), - im->flags.alpha, - im->space); - if (!im_dirty) goto on_error; - if (cache->func.debug) cache->func.debug("dirty-src", im); - cache->func.dirty(im_dirty, im); - if (cache->func.debug) cache->func.debug("dirty-out", im_dirty); -#ifdef EVAS_FRAME_QUEUING - LKL(im_dirty->lock_references); -#endif - im_dirty->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKU(im_dirty->lock_references); -#endif - evas_cache_image_drop(im); - } - return im_dirty; - -on_error: - if (im_dirty) _evas_cache_image_entry_delete(cache, im_dirty); - evas_cache_image_drop(im); - return NULL; -} - -EAPI Image_Entry * -evas_cache_image_copied_data(Evas_Cache_Image *cache, - unsigned int w, unsigned int h, - DATA32 *image_data, int alpha, int cspace) -{ - Image_Entry *im; - - if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) || - (cspace == EVAS_COLORSPACE_YCBCR422P709_PL) || - (cspace == EVAS_COLORSPACE_YCBCR422601_PL)) - w &= ~0x1; - - im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL); - if (!im) return NULL; - im->space = cspace; - im->flags.alpha = alpha; - _evas_cache_image_entry_surface_alloc(cache, im, w, h); - if (cache->func.copied_data(im, w, h, image_data, alpha, cspace) != 0) - { - _evas_cache_image_entry_delete(cache, im); - return NULL; - } -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - im->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - if (cache->func.debug) cache->func.debug("copied-data", im); - return im; -} - -EAPI Image_Entry * -evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, int cspace) -{ - Image_Entry *im; - - if ((cspace == EVAS_COLORSPACE_YCBCR422P601_PL) || - (cspace == EVAS_COLORSPACE_YCBCR422P709_PL) || - (cspace == EVAS_COLORSPACE_YCBCR422601_PL)) - w &= ~0x1; - - im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL); - if (!im) return NULL; - im->w = w; - im->h = h; - im->flags.alpha = alpha; - if (cache->func.data(im, w, h, image_data, alpha, cspace) != 0) - { - _evas_cache_image_entry_delete(cache, im); - return NULL; - } -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - im->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - if (cache->func.debug) cache->func.debug("data", im); - return im; -} - -EAPI void -evas_cache_image_surface_alloc(Image_Entry *im, unsigned int w, unsigned int h) -{ - Evas_Cache_Image *cache = im->cache; - - if ((im->space == EVAS_COLORSPACE_YCBCR422P601_PL) || - (im->space == EVAS_COLORSPACE_YCBCR422P709_PL) || - (im->space == EVAS_COLORSPACE_YCBCR422601_PL)) - w &= ~0x1; - - _evas_cache_image_entry_surface_alloc(cache, im, w, h); - if (cache->func.debug) cache->func.debug("surface-alloc", im); -} - -EAPI Image_Entry * -evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h) -{ - Evas_Cache_Image *cache; - Image_Entry *im2 = NULL; - int error; - - if ((im->space == EVAS_COLORSPACE_YCBCR422P601_PL) || - (im->space == EVAS_COLORSPACE_YCBCR422P709_PL) || - (im->space == EVAS_COLORSPACE_YCBCR422601_PL)) - w &= ~0x1; - if ((im->w == w) && (im->h == h)) return im; - - cache = im->cache; - im2 = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, &error); - if (!im2) goto on_error; - - im2->flags.alpha = im->flags.alpha; - im2->space = im->space; - im2->load_opts = im->load_opts; - _evas_cache_image_entry_surface_alloc(cache, im2, w, h); - error = cache->func.size_set(im2, im, w, h); - if (error != 0) goto on_error; -#ifdef EVAS_FRAME_QUEUING - LKL(im2->lock_references); -#endif - im2->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKU(im2->lock_references); -#endif - evas_cache_image_drop(im); - if (cache->func.debug) cache->func.debug("size_set", im2); - return im2; - -on_error: - if (im2) _evas_cache_image_entry_delete(cache, im2); - evas_cache_image_drop(im); - return NULL; -} - -EAPI int -evas_cache_image_load_data(Image_Entry *im) -{ -#ifdef BUILD_ASYNC_PRELOAD - Eina_Bool preload = EINA_FALSE; -#endif - int error = EVAS_LOAD_ERROR_NONE; - - if ((im->flags.loaded) && (!im->flags.animated)) return error; -#ifdef BUILD_ASYNC_PRELOAD - if (im->preload) - { - preload = EINA_TRUE; - if (!im->flags.pending) - { - im->cache->preload = eina_list_remove(im->cache->preload, im); - im->cache->pending = eina_list_append(im->cache->pending, im); - im->flags.pending = 1; - evas_preload_thread_cancel(im->preload); - } - evas_async_events_process(); - LKL(wakeup); - while (im->preload) - { - eina_condition_wait(&cond_wakeup); - LKU(wakeup); - evas_async_events_process(); - LKL(wakeup); - } - LKU(wakeup); - } - - if ((im->flags.loaded) && (!im->flags.animated)) return error; - LKL(im->lock); -#endif - im->flags.in_progress = EINA_TRUE; - error = im->cache->func.load(im); - im->flags.in_progress = EINA_FALSE; -#ifdef BUILD_ASYNC_PRELOAD - LKU(im->lock); -#endif - im->flags.loaded = 1; - if (im->cache->func.debug) im->cache->func.debug("load", im); - if (error != EVAS_LOAD_ERROR_NONE) - { - _evas_cache_image_entry_surface_alloc(im->cache, im, im->w, im->h); - im->flags.loaded = 0; - } -#ifdef BUILD_ASYNC_PRELOAD - if (preload) _evas_cache_image_async_end(im); -#endif - return error; -} - -EAPI void -evas_cache_image_unload_data(Image_Entry *im) -{ - if (im->flags.in_progress) return; - evas_cache_image_preload_cancel(im, NULL); -#ifdef BUILD_ASYNC_PRELOAD - LKL(im->lock_cancel); - if (LKT(im->lock) == EINA_FALSE) /* can't get image lock - busy async load */ - { - im->unload_cancel = EINA_TRUE; - LKU(im->lock_cancel); - return; - } - LKU(im->lock_cancel); -#endif - if ((!im->flags.loaded) || (!im->file) || (!im->info.module) || - (im->flags.dirty)) - { -#ifdef BUILD_ASYNC_PRELOAD - LKU(im->lock); -#endif - return; - } - im->cache->func.destructor(im); -#ifdef BUILD_ASYNC_PRELOAD - LKU(im->lock); -#endif - //FIXME: imagedataunload - inform owners -} - -static Eina_Bool -_evas_cache_image_unload_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, __UNUSED__ void *fdata) -{ - evas_cache_image_unload_data(data); - return EINA_TRUE; -} - -EAPI void -evas_cache_image_unload_all(Evas_Cache_Image *cache) -{ - Image_Entry *im; - - EINA_INLIST_FOREACH(cache->lru, im) evas_cache_image_unload_data(im); - EINA_INLIST_FOREACH(cache->lru_nodata, im) evas_cache_image_unload_data(im); - eina_hash_foreach(cache->activ, _evas_cache_image_unload_cb, NULL); - eina_hash_foreach(cache->inactiv, _evas_cache_image_unload_cb, NULL); -} - -EAPI Eina_Bool -evas_cache_image_is_loaded(Image_Entry *im) -{ - if (im->flags.loaded) return EINA_TRUE; - return EINA_FALSE; -} - -EAPI void -evas_cache_image_preload_data(Image_Entry *im, const void *target) -{ -#ifdef BUILD_ASYNC_PRELOAD - RGBA_Image *img = (RGBA_Image *)im; - - if ((im->flags.loaded) && (img->image.data)) - { - evas_object_inform_call_image_preloaded((Evas_Object *)target); - return; - } - im->flags.loaded = 0; - if (!_evas_cache_image_entry_preload_add(im, target)) - evas_object_inform_call_image_preloaded((Evas_Object *)target); -#else - evas_cache_image_load_data(im); - evas_object_inform_call_image_preloaded((Evas_Object *)target); -#endif -} - -EAPI void -evas_cache_image_preload_cancel(Image_Entry *im, const void *target) -{ -#ifdef BUILD_ASYNC_PRELOAD - if (!target) return; - _evas_cache_image_entry_preload_remove(im, target); -#else - (void)im; - (void)target; -#endif -} - -#ifdef CACHEDUMP -static int total = 0; - -static void -_dump_img(Image_Entry *im, const char *type) -{ - total += im->cache->func.mem_size_get(im); - printf("%s: %4i: %4ib, %4ix%4i alloc[%4ix%4i] [%s] [%s]\n", - type, - im->references, - im->cache->func.mem_size_get(im), - im->w, im->h, im->allocated.w, im->allocated.h, - im->file, im->key); -} - -static Eina_Bool -_dump_cache_active(__UNUSED__ const Eina_Hash *hash, __UNUSED__ const void *key, void *data, void *fdata __UNUSED__) -{ - Image_Entry *im = data; - _dump_img(im, "ACTIVE"); - return EINA_TRUE; -} - -static void -_dump_cache(Evas_Cache_Image *cache) -{ - Image_Entry *im; - - printf("--CACHE DUMP----------------------------------------------------\n"); - printf("cache: %ikb / %ikb\n", - cache->usage / 1024, - cache->limit / 1024); - printf("................................................................\n"); - total = 0; - EINA_INLIST_FOREACH(cache->lru_nodata, im) - _dump_img(im, "NODATA"); - EINA_INLIST_FOREACH(cache->lru, im) - _dump_img(im, "DATA "); - printf("tot: %i\n" - "usg: %i\n", - total, - cache->usage); - eina_hash_foreach(cache->activ, _dump_cache_active, NULL); -} -#endif - -EAPI int -evas_cache_image_flush(Evas_Cache_Image *cache) -{ -#ifdef CACHEDUMP - _dump_cache(cache); -#endif - if (cache->limit == (unsigned int)-1) return -1; - - while ((cache->lru) && (cache->limit < (unsigned int)cache->usage)) - { - Image_Entry *im; - - im = (Image_Entry *)cache->lru->last; - _evas_cache_image_entry_delete(cache, im); - } - - while ((cache->lru_nodata) && (cache->limit < (unsigned int)cache->usage)) - { - Image_Entry *im; - - im = (Image_Entry *) cache->lru_nodata->last; - _evas_cache_image_lru_nodata_del(im); - cache->func.surface_delete(im); - im->flags.loaded = 0; - } - - return cache->usage; -} - -EAPI Image_Entry * -evas_cache_image_empty(Evas_Cache_Image *cache) -{ - Image_Entry *im; - - im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL); - if (!im) return NULL; -#ifdef EVAS_FRAME_QUEUING - LKL(im->lock_references); -#endif - im->references = 1; -#ifdef EVAS_FRAME_QUEUING - LKU(im->lock_references); -#endif - return im; -} - -EAPI void -evas_cache_image_colorspace(Image_Entry *im, int cspace) -{ - if (im->space == cspace) return; - im->space = cspace; - im->cache->func.color_space(im, cspace); -} - -EAPI void * -evas_cache_private_from_image_entry_get(Image_Entry *im) -{ - return (void *)im->cache->data; -} - -EAPI void * -evas_cache_private_get(Evas_Cache_Image *cache) -{ - return cache->data; -} - -EAPI void -evas_cache_private_set(Evas_Cache_Image *cache, const void *data) -{ - cache->data = (void *)data; -} - -EAPI DATA32 * -evas_cache_image_pixels(Image_Entry *im) -{ - return im->cache->func.surface_pixels(im); -} - -EAPI void -evas_cache_image_wakeup(void) -{ -#ifdef BUILD_ASYNC_PRELOAD - if (_evas_cache_mutex_init > 0) - eina_condition_broadcast(&cond_wakeup); -#endif -} diff --git a/libraries/evas/src/lib/cache/evas_preload.c b/libraries/evas/src/lib/cache/evas_preload.c deleted file mode 100644 index 5eebaed..0000000 --- a/libraries/evas/src/lib/cache/evas_preload.c +++ /dev/null @@ -1,266 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#ifdef HAVE_EVIL -# include -#endif - -#ifdef BUILD_ASYNC_PRELOAD -# include -# ifdef __linux__ -# include -# endif -#endif - -#include "evas_common.h" -#include "evas_private.h" -#include "Evas.h" - -#ifdef BUILD_ASYNC_PRELOAD - -static int _threads_max = 0; - -typedef struct _Evas_Preload_Pthread_Worker Evas_Preload_Pthread_Worker; -typedef struct _Evas_Preload_Pthread_Data Evas_Preload_Pthread_Data; - -typedef void (*_evas_preload_pthread_func)(void *data); - -struct _Evas_Preload_Pthread_Worker -{ - EINA_INLIST; - - _evas_preload_pthread_func func_heavy; - _evas_preload_pthread_func func_end; - _evas_preload_pthread_func func_cancel; - void *data; - Eina_Bool cancel : 1; -}; - -struct _Evas_Preload_Pthread_Data -{ - pthread_t thread; -}; - -static int _threads_count = 0; -static Evas_Preload_Pthread_Worker *_workers = NULL; - -static LK(_mutex); - -static void -_evas_preload_thread_end(void *data) -{ - Evas_Preload_Pthread_Data *pth = data; - Evas_Preload_Pthread_Data *p = NULL; - - if (pthread_join(pth->thread, (void **)&p) == 0) free(p); - else return; - eina_threads_shutdown(); -} - -static void -_evas_preload_thread_done(void *target __UNUSED__, Evas_Callback_Type type __UNUSED__, void *event_info) -{ - Evas_Preload_Pthread_Worker *work = event_info; - if (work->cancel) - { - if (work->func_cancel) work->func_cancel(work->data); - } - else - work->func_end(work->data); - - free(work); -} - -static void * -_evas_preload_thread_worker(void *data) -{ - Evas_Preload_Pthread_Data *pth = data; - Evas_Preload_Pthread_Worker *work; - - eina_sched_prio_drop(); - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); -on_error: - for (;;) - { - LKL(_mutex); - if (!_workers) - { - LKU(_mutex); - break; - } - - work = _workers; - _workers = EINA_INLIST_CONTAINER_GET(eina_inlist_remove(EINA_INLIST_GET(_workers), - EINA_INLIST_GET(_workers)), - Evas_Preload_Pthread_Worker); - LKU(_mutex); - - if (work->func_heavy) work->func_heavy(work->data); - evas_async_events_put(pth, 0, work, _evas_preload_thread_done); - } - - LKL(_mutex); - if (_workers) - { - LKU(_mutex); - goto on_error; - } - _threads_count--; - LKU(_mutex); - - // dummy worker to wake things up - work = malloc(sizeof(Evas_Preload_Pthread_Worker)); - if (!work) return NULL; - - work->data = pth; - work->func_heavy = NULL; - work->func_end = (_evas_preload_pthread_func) _evas_preload_thread_end; - work->func_cancel = NULL; - work->cancel = EINA_FALSE; - - evas_async_events_put(pth, 0, work, _evas_preload_thread_done); - return pth; -} -#endif - -void -_evas_preload_thread_init(void) -{ -#ifdef BUILD_ASYNC_PRELOAD - _threads_max = eina_cpu_count(); - if (_threads_max < 1) _threads_max = 1; - - LKI(_mutex); -#endif -} - -void -_evas_preload_thread_shutdown(void) -{ - /* FIXME: If function are still running in the background, should we kill them ? */ -#ifdef BUILD_ASYNC_PRELOAD - Evas_Preload_Pthread_Worker *work; - - /* Force processing of async events. */ - evas_async_events_process(); - LKL(_mutex); - while (_workers) - { - work = _workers; - _workers = EINA_INLIST_CONTAINER_GET(eina_inlist_remove(EINA_INLIST_GET(_workers), - EINA_INLIST_GET(_workers)), - Evas_Preload_Pthread_Worker); - if (work->func_cancel) work->func_cancel(work->data); - free(work); - } - LKU(_mutex); - - LKD(_mutex); -#endif -} - -Evas_Preload_Pthread * -evas_preload_thread_run(void (*func_heavy) (void *data), - void (*func_end) (void *data), - void (*func_cancel) (void *data), - const void *data) -{ -#ifdef BUILD_ASYNC_PRELOAD - Evas_Preload_Pthread_Worker *work; - Evas_Preload_Pthread_Data *pth; - - work = malloc(sizeof(Evas_Preload_Pthread_Worker)); - if (!work) - { - func_cancel((void *)data); - return NULL; - } - - work->func_heavy = func_heavy; - work->func_end = func_end; - work->func_cancel = func_cancel; - work->cancel = EINA_FALSE; - work->data = (void *)data; - - LKL(_mutex); - _workers = (Evas_Preload_Pthread_Worker *)eina_inlist_append(EINA_INLIST_GET(_workers), EINA_INLIST_GET(work)); - if (_threads_count == _threads_max) - { - LKU(_mutex); - return (Evas_Preload_Pthread *)work; - } - LKU(_mutex); - - /* One more thread could be created. */ - pth = malloc(sizeof(Evas_Preload_Pthread_Data)); - if (!pth) goto on_error; - - eina_threads_init(); - - if (pthread_create(&pth->thread, NULL, _evas_preload_thread_worker, pth) == 0) - { - LKL(_mutex); - _threads_count++; - LKU(_mutex); - return (Evas_Preload_Pthread*)work; - } - - eina_threads_shutdown(); - - on_error: - LKL(_mutex); - if (_threads_count == 0) - { - LKU(_mutex); - if (work->func_cancel) work->func_cancel(work->data); - free(work); - return NULL; - } - LKU(_mutex); - return NULL; -#else - /* - If no thread and as we don't want to break app that rely on this - facility, we will lock the interface until we are done. - */ - (void)func_cancel; - func_heavy((void *)data); - func_end((void *)data); - return (void *)1; -#endif -} - -Eina_Bool -evas_preload_thread_cancel(Evas_Preload_Pthread *thread) -{ -#ifdef BUILD_ASYNC_PRELOAD - Evas_Preload_Pthread_Worker *work; - - if (!thread) return EINA_TRUE; - LKL(_mutex); - EINA_INLIST_FOREACH(_workers, work) - { - if (work == (Evas_Preload_Pthread_Worker *)thread) - { - _workers = EINA_INLIST_CONTAINER_GET(eina_inlist_remove(EINA_INLIST_GET(_workers), - EINA_INLIST_GET(work)), - Evas_Preload_Pthread_Worker); - LKU(_mutex); - if (work->func_cancel) work->func_cancel(work->data); - free(work); - return EINA_TRUE; - } - } - LKU(_mutex); - - /* Delay the destruction */ - work = (Evas_Preload_Pthread_Worker *)thread; - work->cancel = EINA_TRUE; - return EINA_FALSE; -#else - (void) thread; - return EINA_TRUE; -#endif -} -- cgit v1.1