svn update: 58227 (latest:58227)
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 5 Apr 2011 04:32:24 +0000 (13:32 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 5 Apr 2011 04:32:24 +0000 (13:32 +0900)
78 files changed:
AUTHORS
ChangeLog
README.in
configure.ac
doc/evas.dox.in
evas.rebase.complete [new file with mode: 0644]
evas.spec.in
m4/evas_check_loader.m4
src/lib/Evas.h
src/lib/Makefile.am
src/lib/cache/evas_cache_image.c
src/lib/canvas/evas_clip.c
src/lib/canvas/evas_object_image.c
src/lib/canvas/evas_object_line.c
src/lib/canvas/evas_object_main.c
src/lib/canvas/evas_object_text.c
src/lib/canvas/evas_object_textblock.c
src/lib/canvas/evas_render.c
src/lib/engines/common/Makefile.am
src/lib/engines/common/evas_font.h
src/lib/engines/common/evas_font_draw.c
src/lib/engines/common/evas_font_ot.c
src/lib/engines/common/evas_font_private.h
src/lib/engines/common/evas_font_query.c
src/lib/engines/common/evas_image_load.c
src/lib/engines/common/evas_pipe.c
src/lib/engines/common/evas_text_utils.c
src/lib/engines/common_16/evas_soft16_line.c
src/lib/file/evas_module.c
src/lib/include/evas_cairo_common.h
src/lib/include/evas_common.h
src/lib/include/evas_inline.x
src/lib/include/evas_private.h
src/modules/engines/Makefile.am
src/modules/engines/buffer/Makefile.am
src/modules/engines/cairo_x11/Makefile.am
src/modules/engines/cairo_x11/evas_engine.c
src/modules/engines/direct3d/Makefile.am
src/modules/engines/directfb/Makefile.am
src/modules/engines/fb/Makefile.am
src/modules/engines/gl_common/evas_gl_common.h
src/modules/engines/gl_common/evas_gl_context.c
src/modules/engines/gl_common/evas_gl_font.c
src/modules/engines/gl_common/evas_gl_image.c
src/modules/engines/gl_common/evas_gl_line.c
src/modules/engines/gl_common/evas_gl_polygon.c
src/modules/engines/gl_common/evas_gl_rectangle.c
src/modules/engines/gl_common/evas_gl_shader.c
src/modules/engines/gl_common/evas_gl_texture.c
src/modules/engines/gl_glew/Makefile.am
src/modules/engines/gl_glew/evas_engine.h
src/modules/engines/gl_sdl/Makefile.am
src/modules/engines/gl_sdl/evas_engine.h
src/modules/engines/gl_x11/Makefile.am
src/modules/engines/gl_x11/evas_engine.c
src/modules/engines/gl_x11/evas_engine.h
src/modules/engines/gl_x11/evas_x_main.c
src/modules/engines/quartz/Makefile.am
src/modules/engines/quartz/evas_quartz_private.h
src/modules/engines/software_16/Makefile.am
src/modules/engines/software_16/evas_engine.c
src/modules/engines/software_16_ddraw/Makefile.am
src/modules/engines/software_16_sdl/Makefile.am
src/modules/engines/software_16_wince/Makefile.am
src/modules/engines/software_16_x11/Makefile.am
src/modules/engines/software_8/Makefile.am
src/modules/engines/software_8/evas_engine.c
src/modules/engines/software_8_x11/Makefile.am
src/modules/engines/software_ddraw/Makefile.am
src/modules/engines/software_gdi/Makefile.am
src/modules/engines/software_generic/Makefile.am
src/modules/engines/software_generic/evas_engine.c
src/modules/engines/software_qtopia/Makefile.am
src/modules/engines/software_sdl/Makefile.am
src/modules/engines/software_x11/Makefile.am
src/modules/engines/xrender_x11/Makefile.am
src/modules/loaders/Makefile.am
src/modules/loaders/bmp/evas_image_load_bmp.c

diff --git a/AUTHORS b/AUTHORS
index d9c7f7b..75b5960 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -18,5 +18,7 @@ Tom Hacohen <tom@stosb.com>
 Mathieu Taillefumier <mathieu.taillefumier@free.fr>
 Iván Briano <ivan@profusion.mobi>
 Gustavo Lima Chaves <glima@profusion.mobi>
-Saumsung Electronics <tbd>
+Samsung Electronics <tbd>
 Samsung SAIT <tbd>
+Sung W. Park <sungwoo@gmail.com>
+Jiyoun Park <jy0703.park@samsung.com>
index 3e796e7..bdefc25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2011-02-27  Vincent Torri
 
        * Fixed static linking of the bmp, wbmp and tga loaders
+
+2011-03-07  Mike Blumenkrantz
+
+        * Fix segv when trying to set gl viewpoint with NULL ctx
+
+2011-03-08  Carsten Haitzler (The Rasterman)
+
+       * Fix problem with different x vsync api between SGI and EXT flavor
+        as they have the same base name, but different prototypes
+        * Add evas_object_ref() and evas_object_unref() to defer
+        deletion of objects until all references are removed
+
+2011-03-09  Carsten Haitzler (The Rasterman)
+
+       * Fix bug with evas_object_del() calling DEL callback BEFORE
+        the HIDE one.
+
+2011-03-10  Sung W. Park
+
+       * Fix bug with yinvert handling of native surfaces.
+
+2011-03-10  Carsten Haitzler (The Rasterman)
+
+       * Fix issue with loading alpha BMP's with "check if all pixel alpha
+        are 0 or not and then force alpha off if all are 0". This
+        means you can never have a 100% empty/transparent BMP though
+        in 32bpp mode.
+
+2011-03-11  Carsten Haitzler (The Rasterman)
+
+       * Add ICO loader to evas (also can load CUR cursor files in theory)
+
+2011-03-14  Carsten Haitzler (The Rasterman)
+
+       * Add "load from memory" API: evas_object_image_memfile_set() by
+        popular demand. Can load an image format from a memory address.
+
+2011-03-15  Cedric BAIL
+
+       * Fix issues with clipping and map.
+
+2011-03-18  Jiyoun Park
+
+       * Fix wrong call to free when using mempool for Evas_Object.
+
+2011-03-19  Carsten Haitzler (The Rasterman)
+
+       * Caching and timestamp checker for image files made much more
+        pedantic and it checks not just modified timestamp but also
+        inode number, size, and on linux, the nanonsecond resolution
+        timestamp as well.
+
+2011-03-19  Brett Nash (nash)
+
+       * Proxy: Bypass the clip on smart clipped objects.  This is probably
+       what you want if you are using proxies, as it means clips don't cause
+       the object to be invisible by the proxy.
+
+2011-03-22  Gustavo Sverzut Barbieri (k-s)
+
+       * Fix build of GL and static modules.
+       * Fix ico loader static build.
+
+2011-03-30  Tom Hacohen (TAsn) and Carsten Haitzler (The Rasterman)
+
+       * Added vertical alignment support to textblock.
+         API: evas_object_textblock_valign_set/get
index 29a581d..bfcfaba 100644 (file)
--- a/README.in
+++ b/README.in
@@ -1,4 +1,4 @@
-Evas @VERSION@ BETA
+Evas @VERSION@
 
 ******************************************************************************
 
@@ -799,7 +799,8 @@ draw large runs effectively.
 
 However it is useless on GL and similar back-ends as the cost in
 sending a word sized texture kills the performance gain (and GL is
-pretty good at drawing lots of small things anyway).
+pretty good at drawing lots of small things anyway).  If it detects a GL
+backend is in use, it disables itself.
 
 By default words (strings) of more then 50 characters are not cached.
 The system caches 40 words by default, but this can be changed by
@@ -820,14 +821,15 @@ Metric caching saves character metrics between characters in words.
 This enables it to render words much quicker as it avoids things like
 space calculations and kerning calculation.
 
-The cache size is also controlled by  EVAS_WORD_CACHE_MAX_WORDS
+The cache size is also controlled by EVAS_WORD_CACHE_MAX_WORDS.
 
 It is useful for GL in particular, although software engines do get
 some gain.
 
-Generally it is recommended you enable either word or metric caching,
-depending on your engine use.  If you are using software, enable word
+Generally it is recommended you enable one or both of word or metric caching,
+depending on your engine use.  If you are only using software, enable word
 caching (and neon on arm if you can), for GL, turn on metric caching.
+A simple solution is enable both, and let the engine sort it out at run time.
 
 If you have any issues with metric caching, please report them to either
 the e-devel mailing list or Brett Nash <nash@nash.id.uau>
index d986ce2..344847c 100644 (file)
@@ -12,8 +12,8 @@ dnl m4_define([relname], [ver-pre-svn-07])
 dnl m4_define([v_rel], [-release relname])
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
-m4_define([lt_rev], m4_eval(v_maj + v_min))
-m4_define([lt_cur], v_mic)
+m4_define([lt_cur], m4_eval(v_maj + v_min))
+m4_define([lt_rev], v_mic)
 m4_define([lt_age], v_min)
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
@@ -62,7 +62,7 @@ AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
-version_info="lt_rev:lt_cur:lt_age"
+version_info="lt_cur:lt_rev:lt_age"
 release_info="v_rel"
 AC_SUBST(version_info)
 AC_SUBST(release_info)
@@ -126,6 +126,7 @@ want_evas_image_loader_xpm="yes"
 want_evas_image_loader_bmp="yes"
 want_evas_image_loader_tga="yes"
 want_evas_image_loader_wbmp="yes"
+want_evas_image_loader_ico="yes"
 
 want_evas_font_loader_eet="yes"
 
@@ -632,13 +633,17 @@ EVAS_CHECK_ENGINE([software-16-wince], [${want_evas_engine_software_16_wince}],
 
 # common gl
 have_evas_engine_gl_common="no"
+have_static_evas_engine_gl_common="no"
 if test "x$have_evas_engine_gl_x11" = "xyes" \
-   || test "x$have_evas_engine_gl_x11" = "xstatic" \
    || test "x$have_evas_engine_gl_glew" = "xyes" \
+   || test "x$have_evas_engine_gl_sdl" = "xyes"; then
+   have_evas_engine_gl_common="yes"
+fi
+if test "x$have_evas_engine_gl_x11" = "xstatic" \
    || test "x$have_evas_engine_gl_glew" = "xstatic" \
-   || test "x$have_evas_engine_gl_sdl" = "xyes" \
    || test "x$have_evas_engine_gl_sdl" = "xstatic"; then
    have_evas_engine_gl_common="yes"
+   have_static_evas_engine_gl_common="yes"
 fi
 
 if test "x$have_evas_engine_gl_common" = "xyes"; then
@@ -650,6 +655,11 @@ AC_SUBST([evas_engine_gl_common_libs])
 
 AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, [test "x$have_evas_engine_gl_common" = "xyes"])
 
+AM_CONDITIONAL(EVAS_STATIC_BUILD_GL_COMMON, test "x${have_static_evas_engine_gl_common}" = "xyes")
+if test "x${have_static_evas_engine_gl_common}" = "xyes"; then
+   AC_DEFINE(EVAS_STATIC_BUILD_GL_COMMON, [1], [Build GL generic engine as part of libevas])
+fi
+
 # gl_sdl
 if test "x$have_evas_engine_gl_sdl" = "xyes" || test "x$have_evas_engine_gl_sdl" = "xstatic" ; then
    AC_CHECK_DECL(SDL_GL_CONTEXT_MAJOR_VERSION,
@@ -686,6 +696,11 @@ AC_ARG_ENABLE([static-software-generic],
 AC_MSG_CHECKING([Whether to build software generic engine as part of libevas])
 AC_MSG_RESULT([${have_static_software_generic}])
 
+if test "x${have_static_module}" = "xyes" -a "x${have_static_software_generic}" = "xno"; then
+   AC_MSG_WARN([Forcing --enable-static-software-generic as engines must be compiled statically])
+   have_static_software_generic="yes"
+fi
+
 AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_GENERIC, test "x${have_static_software_generic}" = "xyes")
 if test "x${have_static_software_generic}" = "xyes"; then
    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_GENERIC, [1], [Build software generic engine as part of libevas])
@@ -820,6 +835,7 @@ EVAS_CHECK_IMAGE_LOADER([TGA], [${want_evas_image_loader_tga}])
 
 EVAS_CHECK_IMAGE_LOADER([WBMP], [${want_evas_image_loader_wbmp}])
 
+EVAS_CHECK_IMAGE_LOADER([ICO], [${want_evas_image_loader_ico}])
 
 #####################################################################
 ## Cpu based optimizations
@@ -1595,6 +1611,7 @@ src/modules/loaders/png/Makefile
 src/modules/loaders/tiff/Makefile
 src/modules/loaders/xpm/Makefile
 src/modules/loaders/bmp/Makefile
+src/modules/loaders/ico/Makefile
 src/modules/loaders/tga/Makefile
 src/modules/loaders/svg/Makefile
 src/modules/loaders/pmaps/Makefile
@@ -1690,18 +1707,19 @@ echo "  Software 16bit WinCE.......: $have_evas_engine_software_16_wince"
 echo "  Software 16bit SDL.........: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
 echo
 echo "Image Loaders:"
+echo "  BMP.....................: $have_evas_image_loader_bmp"
 echo "  EDB.....................: $have_evas_image_loader_edb"
 echo "  EET.....................: $have_evas_image_loader_eet"
 echo "  GIF.....................: $have_evas_image_loader_gif"
+echo "  ICO.....................: $have_evas_image_loader_ico"
 echo "  JPEG....................: $have_evas_image_loader_jpeg (region: $have_jpeg_region)"
 echo "  PMAPS...................: $have_evas_image_loader_pmaps"
 echo "  PNG.....................: $have_evas_image_loader_png"
 echo "  SVG.....................: $have_evas_image_loader_svg"
-echo "  TIFF....................: $have_evas_image_loader_tiff"
-echo "  XPM.....................: $have_evas_image_loader_xpm"
-echo "  BMP.....................: $have_evas_image_loader_bmp"
 echo "  TGA.....................: $have_evas_image_loader_tga"
+echo "  TIFF....................: $have_evas_image_loader_tiff"
 echo "  WBMP....................: $have_evas_image_loader_wbmp"
+echo "  XPM.....................: $have_evas_image_loader_xpm"
 echo
 echo "Font Sourcing Systems:"
 echo "  EET.....................: $have_evas_font_loader_eet"
@@ -1803,8 +1821,8 @@ echo "  prefix...............: $prefix"
 echo
 if test "x${have_static_module}" = "xyes" ; then
 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Evas."
-echo "         You must know what you are doing, or else you will have a lot of problems."
-echo "         And Kenny will be killed."
+echo "         You must know what you are doing, or else you will have a lot of"
+echo "         problems. And Kenny will be killed."
 echo "         Think about that."
 echo
 fi
index 9ec03a0..2721361 100644 (file)
@@ -27,6 +27,8 @@
 @author Gustavo Lima Chaves <glima@@profusion.mobi>
 @author Samsung Electronics <tbd>
 @author Samsung SAIT <tbd>
+@author Sung W. Park <sungwoo@@gmail.com>
+@author Jiyoun Park <jy0703.park@@samsung.com>
 @date 2000-2011
 
 @section toc Table of Contents
diff --git a/evas.rebase.complete b/evas.rebase.complete
new file mode 100644 (file)
index 0000000..429083f
--- /dev/null
@@ -0,0 +1 @@
+[evas] Rebase is completed.
index 58d59bf..ff110f1 100644 (file)
@@ -44,6 +44,7 @@
 %bcond_without module_saver_eet
 %bcond_without module_loader_xpm
 %bcond_without module_loader_bmp
+%bcond_without module_loader_wbmp
 %bcond_without module_loader_tga
 
 # This just keeps a missing doxygen from killing the build.
@@ -60,6 +61,7 @@
 %define ac_with_module_loader_xpm --%{?with_module_loader_xpm:en}%{!?with_module_loader_xpm:dis}able-image-loader-xpm
 %define ac_with_module_loader_svg --%{?with_module_loader_svg:en}%{!?with_module_loader_svg:dis}able-image-loader-svg
 %define ac_with_module_loader_bmp --%{?with_module_loader_bmp:en}%{!?with_module_loader_bmp:dis}able-image-loader-bmp
+%define ac_with_module_loader_wbmp --%{?with_module_loader_wbmp:en}%{!?with_module_loader_wbmp:dis}able-image-loader-wbmp
 %define ac_with_module_loader_tga --%{?with_module_loader_tga:en}%{!?with_module_loader_tga:dis}able-image-loader-tga
 %define ac_with_module_saver_eet --%{?with_module_saver_eet:en}%{!?with_module_saver_eet:dis}able-image-saver-eet
 %define ac_with_module_saver_jpeg --%{?with_module_saver_jpeg:en}%{!?with_module_saver_jpeg:dis}able-image-saver-jpeg
@@ -247,6 +249,15 @@ BuildRequires: libjpeg-devel
 BMP Image loader module for Evas
 %endif
 
+%if %{with module_loader_wbmp}
+%package module_loader_wbmp
+Summary: WBMP Image loader module for Evas
+Group: System Environment/Libraries
+BuildRequires: libjpeg-devel
+%description module_loader_wbmp
+WBMP Image loader module for Evas
+%endif
+
 %if %{with module_loader_tga}
 %package module_loader_tga
 Summary: TGA Image loader module for Evas
@@ -547,6 +558,12 @@ test "x$RPM_BUILD_ROOT" != "x/" && rm -rf $RPM_BUILD_ROOT
 %{_libdir}/evas/modules/loaders/bmp/*/module.so
 %endif
 
+%if %{with module_loader_wbmp}
+%files module_loader_wbmp
+%defattr(-, root, root)
+%{_libdir}/evas/modules/loaders/wbmp/*/module.so
+%endif
+
 %if %{with module_loader_tga}
 %files module_loader_tga
 %defattr(-, root, root)
index 00a9618..d03ce09 100644 (file)
@@ -113,18 +113,20 @@ if test "x${have_dep}"  = "xyes" ; then
    AC_CHECK_LIB([jpeg],
       [jpeg_CreateDecompress],
       [
-        evas_image_loader_[]$1[]_libs="-ljpeg"
-        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-                          #include <stdio.h>
-                          #include <jpeglib.h>
-                          #include <setjmp.h>
-                          int main(int argc, char **argv) {
-                          struct jpeg_decompress_struct decomp;
-                          decomp.region_x = 0;
-                          }
-                        ])],
-                        [have_jpeg_region="yes"],
-                        [have_jpeg_region="no"])
+       evas_image_loader_[]$1[]_libs="-ljpeg"
+       AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM(
+              [[
+#include <stdio.h>
+#include <jpeglib.h>
+#include <setjmp.h>
+              ]],
+              [[
+struct jpeg_decompress_struct decomp;
+decomp.region_x = 0;
+              ]])],
+          [have_jpeg_region="yes"],
+          [have_jpeg_region="no"])
       ],
       [have_dep="no"]
    )
@@ -328,6 +330,26 @@ fi
 
 ])
 
+dnl use: EVAS_CHECK_LOADER_DEP_ICO(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+
+AC_DEFUN([EVAS_CHECK_LOADER_DEP_ICO],
+[
+
+have_dep="yes"
+evas_image_loader_[]$1[]_cflags=""
+evas_image_loader_[]$1[]_libs=""
+
+AC_SUBST([evas_image_loader_$1_cflags])
+AC_SUBST([evas_image_loader_$1_libs])
+
+if test "x${have_dep}" = "xyes" ; then
+  m4_default([$3], [:])
+else
+  m4_default([$4], [:])
+fi
+
+])
+
 dnl use: EVAS_CHECK_LOADER_DEP_TGA(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
 
 AC_DEFUN([EVAS_CHECK_LOADER_DEP_TGA],
index d9fd805..6e5156e 100644 (file)
@@ -898,6 +898,9 @@ typedef void      (*Evas_Async_Events_Put_Cb)(void *target, Evas_Callback_Type t
    EAPI void              evas_object_name_set              (Evas_Object *obj, const char *name) EINA_ARG_NONNULL(1);
    EAPI const char       *evas_object_name_get              (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
 
+   EAPI void              evas_object_ref                   (Evas_Object *obj);
+   EAPI void              evas_object_unref                 (Evas_Object *obj);
+   
    EAPI void              evas_object_del                   (Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI void              evas_object_move                  (Evas_Object *obj, Evas_Coord x, Evas_Coord y) EINA_ARG_NONNULL(1);
    EAPI void              evas_object_resize                (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
@@ -1242,6 +1245,7 @@ typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
    EAPI Evas_Object             *evas_object_image_add                    (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
    EAPI Evas_Object             *evas_object_image_filled_add             (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
 
+   EAPI void                     evas_object_image_memfile_set            (Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2);
    EAPI void                     evas_object_image_file_set               (Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1);
    EAPI void                     evas_object_image_file_get               (const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1, 2);
    EAPI void                     evas_object_image_border_set             (Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1);
@@ -1405,6 +1409,9 @@ typedef void (*Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o);
    EAPI const Evas_Textblock_Style  *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
    EAPI void                         evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch) EINA_ARG_NONNULL(1);
    EAPI const char                  *evas_object_textblock_replace_char_get(Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
+   EAPI void                         evas_object_textblock_valign_set(Evas_Object *obj, double align);
+   EAPI double                       evas_object_textblock_valign_get(const Evas_Object *obj);
+         
    EAPI void                         evas_object_textblock_newline_mode_set(Evas_Object *obj, Eina_Bool mode) EINA_ARG_NONNULL(1);
    EAPI Eina_Bool                    evas_object_textblock_newline_mode_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
 
index 382e26e..be84a2b 100644 (file)
@@ -133,6 +133,11 @@ SUBDIRS += ../modules/loaders/gif
 EVAS_STATIC_MODULE += ../modules/loaders/gif/libevas_loader_gif.la
 EVAS_STATIC_LIBADD += @evas_image_loader_gif_libs@
 endif
+if EVAS_STATIC_BUILD_ICO
+SUBDIRS += ../modules/loaders/ico
+EVAS_STATIC_MODULE += ../modules/loaders/ico/libevas_loader_ico.la
+EVAS_STATIC_LIBADD += @evas_image_loader_ico_libs@
+endif
 if EVAS_STATIC_BUILD_JPEG
 SUBDIRS += ../modules/loaders/jpeg
 EVAS_STATIC_MODULE += ../modules/loaders/jpeg/libevas_loader_jpeg.la
index b75261d..5dcbd9b 100644 (file)
@@ -281,10 +281,41 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
    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,
-                            time_t timestamp,
+                            Image_Timestamp *tstamp,
                             const char *file,
                             const char *key,
                             RGBA_Image_Loadopts *lo,
@@ -322,8 +353,8 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache,
    ie->file = file ? eina_stringshare_add(file) : NULL;
    ie->key = key ? eina_stringshare_add(key) : NULL;
 
-   ie->timestamp = timestamp;
-   ie->laststat = time(NULL);
+   if (tstamp) ie->tstamp = *tstamp;
+   else memset(&ie->tstamp, 0, sizeof(Image_Timestamp));
 
    ie->load_opts.scale_down_by = 0;
    ie->load_opts.dpi = 0;
@@ -738,8 +769,6 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache)
    free(cache);
 }
 
-#define STAT_GAP 2
-
 EAPI Image_Entry *
 evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error)
 {
@@ -752,6 +781,7 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *
    size_t                file_length;
    size_t                key_length;
    struct stat           st;
+   Image_Timestamp       tstamp;
 
    assert(cache != NULL);
 
@@ -845,18 +875,12 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *
 #endif
    if (im)
      {
-        time_t t;
-        int ok;
-
-        ok = 1;
-        t = time(NULL);
-        if ((t - im->laststat) > STAT_GAP)
+        int ok = 1;
+        
+        stat_done = 1;
+        if (stat(file, &st) < 0) goto on_stat_error;
           {
-             stat_done = 1;
-             if (stat(file, &st) < 0) goto on_stat_error;
-
-             im->laststat = t;
-             if (st.st_mtime != im->timestamp) ok = 0;
+             if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
           }
         if (ok) goto on_ok;
 
@@ -873,25 +897,16 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *
 #endif
    if (im)
      {
-        int     ok;
+        int ok = 1;
 
-        ok = 1;
         if (!stat_done)
           {
-             time_t  t;
-
-             t = time(NULL);
-             if ((t - im->laststat) > STAT_GAP)
-               {
-                  stat_done = 1;
-                  if (stat(file, &st) < 0) goto on_stat_error;
-
-                  im->laststat = t;
-                  if (st.st_mtime != im->timestamp) ok = 0;
-               }
+             stat_done = 1;
+             if (stat(file, &st) < 0) goto on_stat_error;
+             if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
           }
         else
-          if (st.st_mtime != im->timestamp) ok = 0;
+           if (!_timestamp_compare(&(im->tstamp), &st)) ok = 0;
 
         if (ok)
           {
@@ -907,8 +922,8 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *
      {
         if (stat(file, &st) < 0) goto on_stat_error;
      }
-
-   im = _evas_cache_image_entry_new(cache, hkey, st.st_mtime, file, key, lo, error);
+   _timestamp_build(&tstamp, &st);
+   im = _evas_cache_image_entry_new(cache, hkey, &tstamp, file, key, lo, error);
    if (!im) return NULL;
 
    if (cache->func.debug)
@@ -964,6 +979,7 @@ evas_cache_image_drop(Image_Entry *im)
    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);
@@ -1070,18 +1086,6 @@ evas_cache_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigned
              error = cache->func.dirty(im_dirty, im);
              if (cache->func.debug)
                cache->func.debug("dirty-out", im_dirty);
-/*             
-             im_dirty = _evas_cache_image_entry_new(cache, NULL, im->timestamp, im->file, im->key, &im->load_opts, &error);
-             if (!im_dirty) goto on_error;
-
-             if (cache->func.debug)
-               cache->func.debug("dirty-src", im);
-             error = cache->func.dirty(im_dirty, im);
-             if (cache->func.debug)
-               cache->func.debug("dirty-out", im_dirty);
-
-             if (error != 0) goto on_error;
- */
 #ifdef EVAS_FRAME_QUEUING
              LKL(im_dirty->lock_references);
 #endif
@@ -1129,7 +1133,7 @@ evas_cache_image_alone(Image_Entry *im)
    LKU(im->lock_references);
 #endif
 
-   if (references == 1)
+   if (references <= 1)
      {
         if (!(im->flags.dirty))
           {
@@ -1152,18 +1156,6 @@ evas_cache_image_alone(Image_Entry *im)
         error = cache->func.dirty(im_dirty, im);
         if (cache->func.debug)
           cache->func.debug("dirty-out", im_dirty);
-/*        
-        im_dirty = _evas_cache_image_entry_new(cache, NULL, im->timestamp, im->file, im->key, &im->load_opts, &error);
-        if (!im_dirty) goto on_error;
-
-        if (cache->func.debug)
-          cache->func.debug("dirty-src", im);
-        error = cache->func.dirty(im_dirty, im);
-        if (cache->func.debug)
-          cache->func.debug("dirty-out", im_dirty);
-
-        if (error != 0) goto on_error;
- */
 #ifdef EVAS_FRAME_QUEUING
    LKL(im_dirty->lock_references);
 #endif
@@ -1194,7 +1186,7 @@ evas_cache_image_copied_data(Evas_Cache_Image *cache, unsigned int w, unsigned i
        (cspace == EVAS_COLORSPACE_YCBCR422P709_PL))
      w &= ~0x1;
 
-   im = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL);
+   im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
    if (!im) return NULL;
 
    im->space = cspace;
@@ -1231,7 +1223,7 @@ evas_cache_image_data(Evas_Cache_Image *cache, unsigned int w, unsigned int h, D
        (cspace == EVAS_COLORSPACE_YCBCR422P709_PL))
      w &= ~0x1;
 
-   im = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL);
+   im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
    im->w = w;
    im->h = h;
    im->flags.alpha = alpha;
@@ -1300,7 +1292,7 @@ evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h)
 
    cache = im->cache;
 
-   new = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, &error);
+   new = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, &error);
    if (!new) goto on_error;
 
    new->flags.alpha = im->flags.alpha;
@@ -1551,7 +1543,7 @@ evas_cache_image_empty(Evas_Cache_Image *cache)
 {
    Image_Entry *im;
 
-   im = _evas_cache_image_entry_new(cache, NULL, 0, NULL, NULL, NULL, NULL);
+   im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
    if (!im) return NULL;
 
 #ifdef EVAS_FRAME_QUEUING
index 55f7dad..fc663fa 100644 (file)
@@ -7,6 +7,8 @@ evas_object_clip_dirty(Evas_Object *obj)
    Eina_List *l;
    Evas_Object *data;
 
+   if (obj->cur.cache.clip.dirty) return ;
+
    obj->cur.cache.clip.dirty = 1;
    EINA_LIST_FOREACH(obj->clip.clipees, l, data)
      evas_object_clip_dirty(data);
index 8f71561..2940f9d 100644 (file)
@@ -1,3 +1,8 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+
 #include "evas_common.h"
 #include "evas_private.h"
 #include "../engines/common/evas_convert_color.h"
@@ -57,6 +62,9 @@ struct _Evas_Object_Image
       Evas_Object_Image_Pixels_Get_Cb  get_pixels;
       void                            *get_pixels_data;
    } func;
+   
+   const char             *tmpf;
+   int                     tmpf_fd;
 
    Evas_Image_Scale_Hint   scale_hint;
    Evas_Image_Content_Hint content_hint;
@@ -100,6 +108,7 @@ static void _proxy_unset(Evas_Object *proxy);
 static void _proxy_set(Evas_Object *proxy, Evas_Object *src);
 static void _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y);
 
+static void _cleanup_tmpf(Evas_Object *obj);
 
 static const Evas_Object_Func object_func =
 {
@@ -179,6 +188,120 @@ evas_object_image_filled_add(Evas *e)
    return obj;
 }
 
+static void
+_cleanup_tmpf(Evas_Object *obj)
+{
+   Evas_Object_Image *o;
+   
+   o = (Evas_Object_Image *)(obj->object_data);
+   if (!o->tmpf) return;
+#ifdef __linux__
+#else
+   unlink(o->tmpf);
+#endif
+   if (o->tmpf_fd >= 0) close(o->tmpf_fd);
+   eina_stringshare_del(o->tmpf);
+   o->tmpf_fd = -1;
+   o->tmpf = NULL;
+}
+
+static void
+_create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__)
+{
+   Evas_Object_Image *o;
+   char buf[4096];
+   void *dst;
+   int fd = -1;
+   
+   o = (Evas_Object_Image *)(obj->object_data);
+#ifdef __linux__
+   snprintf(buf, sizeof(buf), "/dev/shm/.evas-tmpf-%i-%p-%i-XXXXXX", 
+            (int)getpid(), data, (int)size);
+   fd = mkstemp(buf);
+#endif   
+   if (fd < 0)
+     {
+        snprintf(buf, sizeof(buf), "/tmp/.evas-tmpf-%i-%p-%i-XXXXXX", 
+                 (int)getpid(), data, (int)size);
+        fd = mkstemp(buf);
+     }
+   if (fd < 0) return;
+   if (ftruncate(fd, size) < 0)
+     {
+        unlink(buf);
+        close(fd);
+        return;
+     }
+   unlink(buf);
+   dst = mmap(NULL, size, 
+              PROT_READ | PROT_WRITE, 
+              MAP_SHARED, 
+              fd, 0);
+   if (dst == MAP_FAILED)
+     {
+        close(fd);
+        return;
+     }
+   o->tmpf_fd = fd;
+#ifdef __linux__
+   snprintf(buf, sizeof(buf), "/proc/%li/fd/%i", (long)getpid(), fd);
+#endif   
+   o->tmpf = eina_stringshare_add(buf);
+   memcpy(dst, data, size);
+   munmap(dst, size);
+}
+
+/**
+ * Sets the data for an image from memory to be loaded
+ *
+ * This is the same as evas_object_image_file_set() but the file to be loaded
+ * may exist at an address in memory (the data for the file, not the filename
+ * itself). The @p data at the address is copied and stored for future use, so
+ * no @p data needs to be kept after this call is made. It will be managed and
+ * freed for you when no longer needed. The @p size is limited to 2 gigabytes
+ * in size, and must be greater than 0. A NULL @p data pointer is also invalid.
+ * Set the filename to NULL to reset to empty state and have the image file
+ * data freed from memory using evas_object_image_file_set().
+ * 
+ * The @p format is optional (pass NULL if you don't need/use it). It is used
+ * to help Evas guess better which loader to use for the data. It may simply
+ * be the "extension" of the file as it would normally be on disk such as
+ * "jpg" or "png" or "gif" etc.
+ *
+ * @param obj The given image object.
+ * @param data The image file data address
+ * @param size The size of the image file data in bytes
+ * @param format The format of the file (optional), or NULL if not needed
+ * @param key The image key in file, or NULL.
+ */
+EAPI void
+evas_object_image_memfile_set(Evas_Object *obj, void *data, int size, char *format, char *key)
+{
+   Evas_Object_Image *o;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return;
+   MAGIC_CHECK_END();
+   _cleanup_tmpf(obj);
+   evas_object_image_file_set(obj, NULL, NULL);
+   if ((size < 1) || (!data)) return;
+       
+   _create_tmpf(obj, data, size, format);
+   evas_object_image_file_set(obj, o->tmpf, key);
+   if (!o->engine_data)
+     {
+        _cleanup_tmpf(obj);
+        return;
+     }
+   // invalidate the cache effectively
+   evas_object_image_alpha_set(obj, !o->cur.has_alpha);
+   evas_object_image_alpha_set(obj, !o->cur.has_alpha);
+}
+
 /**
  * Sets the filename and key of the given image object.
  *
@@ -202,6 +325,7 @@ evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key)
    MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
    return;
    MAGIC_CHECK_END();
+   if ((o->tmpf) && (file != o->tmpf)) _cleanup_tmpf(obj);
    if ((o->cur.file) && (file) && (!strcmp(o->cur.file, file)))
      {
        if ((!o->cur.key) && (!key))
@@ -1303,7 +1427,7 @@ evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool has_alpha)
    if (o->engine_data)
      {
         int stride = 0;
-        
+
 #ifdef EVAS_FRAME_QUEUING
         evas_common_pipe_op_image_flush(o->engine_data);
 #endif
@@ -2389,19 +2513,30 @@ _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface,
    return;
 }
 
+
 static void
-_proxy_subrender_recurse(Evas_Object *obj, void *output, void *surface, void *ctx, int x, int y){
+_proxy_subrender_recurse(Evas_Object *obj, Evas_Object *clip, void *output, void *surface, void *ctx, int x, int y){
      Evas_Object *obj2;
      Evas *e;
      e = obj->layer->evas;
      if (obj->clip.clipees) return;
-     if (!evas_object_is_visible(obj)) return;
-     obj->pre_render_done = 1;
+     /* evas_object_is_visible, inline and tweaked to handle it's clip hidden*/
+     if (!obj->cur.visible) return;
+     if (!clip || clip != obj->cur.clipper)
+       {
+          if (!obj->cur.cache.clip.visible) return;
+          if (obj->cur.cache.clip.a == 0 &&
+              obj->cur.render_op == EVAS_RENDER_BLEND) return;
+       }
+     if (obj->func->is_visible && !obj->func->is_visible(obj)) return;
+
+     if (!obj->pre_render_done)
+        obj->func->render_pre(obj);
      ctx = e->engine.func->context_new(output);
      if (obj->smart.smart)
        {
           EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2){
-               _proxy_subrender_recurse(obj2, output, surface, ctx, x,y);
+               _proxy_subrender_recurse(obj2, clip, output, surface, ctx, x,y);
           }
        }
      else
@@ -2422,7 +2557,7 @@ static void
 _proxy_subrender(Evas *e, Evas_Object *source)
 {
    void *ctx;
-   Evas_Object *obj2;
+   Evas_Object *obj2, *clip;
    int w,h;
 
    if (!source) return;
@@ -2460,8 +2595,9 @@ _proxy_subrender(Evas *e, Evas_Object *source)
    ctx = e->engine.func->context_new(e->engine.data.output);
    if (source->smart.smart)
      {
+        clip = evas_object_smart_clipped_clipper_get(source);
         EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(source), obj2){
-             _proxy_subrender_recurse(obj2, e->engine.data.output,
+             _proxy_subrender_recurse(obj2, clip, e->engine.data.output,
                                       source->proxy.surface,
                                       ctx,
                                       -source->cur.geometry.x,
@@ -2470,6 +2606,8 @@ _proxy_subrender(Evas *e, Evas_Object *source)
      }
    else
      {
+        if (!source->pre_render_done)
+           source->func->render_pre(source);
         source->func->render(source, e->engine.data.output, ctx,
                                     source->proxy.surface,
                                     -source->cur.geometry.x,
@@ -2659,6 +2797,7 @@ evas_object_image_new(void)
    o->cur.opaque_valid = 0;
    o->cur.source = NULL;
    o->prev = o->cur;
+   o->tmpf_fd = -1;
    return o;
 }
 
@@ -2674,6 +2813,7 @@ evas_object_image_free(Evas_Object *obj)
    return;
    MAGIC_CHECK_END();
    /* free obj */
+   _cleanup_tmpf(obj);
    if (o->cur.file) eina_stringshare_del(o->cur.file);
    if (o->cur.key) eina_stringshare_del(o->cur.key);
    if (o->cur.source) _proxy_unset(obj);
index f50df7e..f835aee 100644 (file)
@@ -280,7 +280,7 @@ evas_object_line_free(Evas_Object *obj)
    MAGIC_CHECK_END();
    /* free obj */
    o->magic = 0;
-   EVAS_MEMPOOL_FREE(_mp_obj,o);
+   EVAS_MEMPOOL_FREE(_mp_obj, o);
 }
 
 static void
index 5f44d72..531790e 100644 (file)
@@ -354,6 +354,53 @@ evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
 /* routines apps will call */
 
 /**
+ * Increments object reference count to defer deletion
+ * 
+ * This increments the reference count of an object, which if greater than
+ * 0 will defer deletion by evas_object_del() until all references are
+ * released back to 0. References cannot go below 0 and unreferencing more
+ * times that referencing will result in the reference count being limited
+ * to 0. References are limited to 2^32 - 1 for an object. Referencing it more
+ * than this will result in it being limited to this value.
+ * 
+ * @param obj The given evas object to reference
+ * @ingroup Evas_Object_Group_Basic
+ * @since 1.1.0
+ */
+EAPI void
+evas_object_ref(Evas_Object *obj)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   obj->ref++;
+   if (obj->ref == 0) obj->ref--;
+}
+
+/**
+ * Decrements object reference count to defer deletion
+ * 
+ * This decrements the reference count of an object. If the object has had
+ * evas_object_del() called on it while references were more than 0, it will
+ * be deleted at the time this function is called as it normally would have
+ * been. See evas_object_ref() for more information.
+ * 
+ * @param obj The given evas object to unreference
+ * @ingroup Evas_Object_Group_Basic
+ * @since 1.1.0
+ */
+EAPI void
+evas_object_unref(Evas_Object *obj)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->ref == 0) return;
+   obj->ref--;
+   if ((obj->del_ref) && (obj->ref == 0)) evas_object_del(obj);
+}
+
+/**
  * Deletes the given evas object and frees its memory.
  *
  * The object's 'free' callback is called when this function is called.
@@ -372,12 +419,25 @@ evas_object_del(Evas_Object *obj)
 
    if (obj->delete_me) return;
 
+   if (obj->ref > 0)
+     {
+        obj->del_ref = 1;
+        return;
+     }
 #ifdef EVAS_FRAME_QUEUING
    evas_common_frameq_flush();
 #endif
 
+   evas_object_hide(obj);
+   if (obj->focused)
+     {
+       obj->focused = 0;
+       obj->layer->evas->focused = NULL;
+       _evas_object_event_new();
+       evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
+        _evas_post_event_callback_call(obj->layer->evas);
+     }
    _evas_object_event_new();
-
    evas_object_event_callback_call(obj, EVAS_CALLBACK_DEL, NULL);
    _evas_post_event_callback_call(obj->layer->evas);
    if (obj->name) evas_object_name_set(obj, NULL);
@@ -386,18 +446,9 @@ evas_object_del(Evas_Object *obj)
        evas_object_free(obj, 1);
        return;
      }
-   if (obj->focused)
-     {
-       obj->focused = 0;
-       obj->layer->evas->focused = NULL;
-       _evas_object_event_new();
-       evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
-        _evas_post_event_callback_call(obj->layer->evas);
-     }
    obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
    obj->mouse_grabbed = 0;
    obj->mouse_in = 0;
-   evas_object_hide(obj);
    evas_object_grabs_cleanup(obj);
    while (obj->clip.clipees) 
      evas_object_clip_unset(obj->clip.clipees->data);
index 73d03b6..5f39f78 100644 (file)
@@ -537,8 +537,8 @@ _evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
               o->engine_data,
               it->text, &it->text_props,
               &it->w, &it->h);
-        it->adv = ENFN->font_h_advance_get(ENDT, o->engine_data, it->text,
-              &it->text_props);
+        it->adv = it->w + ENFN->font_right_inset_get(ENDT, o->engine_data,
+                                                    &it->text_props);
      }
    o->items = (Evas_Object_Text_Item *)
       eina_inlist_append(EINA_INLIST_GET(o->items), EINA_INLIST_GET(it));
@@ -1890,6 +1890,12 @@ evas_object_text_render(Evas_Object *obj, void *output, void *context, void *sur
    evas_text_style_pad_get(o->cur.style, &sl, NULL, &st, NULL);
    ENFN->context_multiplier_unset(output, context);
    ENFN->context_render_op_set(output, context, obj->cur.render_op);
+   /* FIXME: This clipping is just until we fix inset handling correctly. */
+   ENFN->context_clip_clip(output, context,
+                              obj->cur.geometry.x + x,
+                              obj->cur.geometry.y + y,
+                              obj->cur.geometry.w,
+                              obj->cur.geometry.h);
 /*
    ENFN->context_color_set(output,
                            context,
index 3f81b65..22ad339 100644 (file)
@@ -339,6 +339,8 @@ struct _Evas_Object_Textblock_Text_Item
    Eina_Unicode                    *text;
    Evas_Text_Props                  text_props;
    int                              inset, baseline;
+   Evas_Coord                       x_adjustment; /* Used to indicate by how
+                                                     much we adjusted sizes */
 };
 
 struct _Evas_Object_Textblock_Format_Item
@@ -419,10 +421,11 @@ struct _Evas_Object_Textblock
    Evas_Object_Textblock_Node_Text    *text_nodes;
    Evas_Object_Textblock_Node_Format  *format_nodes;
    Evas_Object_Textblock_Paragraph    *paragraphs;
-   int                                 last_w;
+   int                                 last_w, last_h;
    struct {
       int                              l, r, t, b;
    } style_pad;
+   double                              valign;
    char                               *markup_text;
    void                               *engine_data;
    const char                         *repch;
@@ -433,6 +436,7 @@ struct _Evas_Object_Textblock
    unsigned char                       redraw : 1;
    unsigned char                       changed : 1;
    unsigned char                       content_changed : 1;
+   unsigned char                       have_ellipsis : 1;
    Eina_Bool                           newline_is_ps : 1;
 };
 
@@ -1580,6 +1584,13 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char
         fmt->ellipsis = strtod(tmp_param, &endptr);
         if ((fmt->ellipsis < 0.0) || (fmt->ellipsis > 1.0))
           fmt->ellipsis = -1.0;
+        else
+          {
+             Evas_Object_Textblock *o;
+             
+             o = (Evas_Object_Textblock *)(obj->object_data);
+             o->have_ellipsis = 1;
+          }
      }
    else if (cmd == passwordstr)
      {
@@ -1802,7 +1813,7 @@ struct _Ctxt
    int line_no;
    int underline_extend;
    int have_underline, have_underline2;
-   double align;
+   double align, valign;
    Eina_Bool align_auto;
 };
 
@@ -2023,7 +2034,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt)
  * @param c the context to work on - Not NULL.
  * @param fmt the format to free.
  * @return the next format in the stack, or format if there's none.
- * @see _layout_format_pop()
+ * @see _layout_format_push()
  */
 static Evas_Object_Textblock_Format *
 _layout_format_pop(Ctxt *c, Evas_Object_Textblock_Format *fmt)
@@ -2183,6 +2194,8 @@ _layout_line_order(Ctxt *c __UNUSED__, Evas_Object_Textblock_Line *line)
      }
 
    if (v_to_l) free(v_to_l);
+#else
+   line = NULL;
 #endif
 }
 
@@ -2332,7 +2345,7 @@ loop_advance:
         it->x = x;
         x += it->adv;
 
-        if (x > c->ln->w) c->ln->w = x;
+        if ((it->x + it->w) > c->ln->w) c->ln->w = it->x + it->w;
      }
 
    c->ln->y = (c->y - c->par->y) + c->o->style_pad.t;
@@ -2429,7 +2442,7 @@ _layout_text_cutoff_get(Ctxt *c, Evas_Object_Textblock_Format *fmt,
      {
         Evas_Coord x;
         x = c->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl -
-           c->marginr - c->x;
+           c->marginr - c->x - ti->x_adjustment;
         if (x < 0)
           x = 0;
         return c->ENFN->font_last_up_to_pos(c->ENDT, fmt->font.font, ti->text,
@@ -2493,23 +2506,7 @@ _layout_item_text_split_strip_white(Ctxt *c,
 
    if (new_ti || white_ti)
      {
-#if 0
-        /* FIXME: This is more correct, but wayy slower, so until I make this
-         * fast I'll just take the less correct approach. At least until
-         * someone notices a glitch */
         _text_item_update_sizes(c, ti);
-#else
-        if (new_ti)
-          {
-             ti->parent.w -= new_ti->parent.w;
-             ti->parent.adv -= new_ti->parent.adv;
-          }
-        if (white_ti)
-          {
-             ti->parent.w -= white_ti->parent.w;
-             ti->parent.adv -= white_ti->parent.adv;
-          }
-#endif
 
         ti->text = eina_unicode_strndup(ts, cut);
         free(ts);
@@ -2537,15 +2534,8 @@ _layout_item_merge_and_free(Ctxt *c,
    evas_common_text_props_merge(&item1->text_props,
          &item2->text_props);
 
-#if 0
-   /* FIXME: This is more correct, but wayy slower, so until I make this fast
-    * I'll just take the less correct approach. At least until someone
-    * notices a glitch */
-   _text_item_update_sizes(c, item1);
-#else
-   item1->parent.w += item2->parent.w;
+   item1->parent.w = item1->parent.adv + item2->parent.w;
    item1->parent.adv += item2->parent.adv;
-#endif
 
    tmp = realloc(item1->text, (len1 + len2 + 1) * sizeof(Eina_Unicode));
    eina_unicode_strncpy(tmp + len1, item2->text, len2);
@@ -2665,25 +2655,57 @@ _layout_word_next(Eina_Unicode *str, int p)
 static void
 _text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
 {
-   int tw, th, adv, inset;
+   int tw, th, inset, right_inset;
    const Evas_Object_Textblock_Format *fmt = ti->parent.format;
 
    tw = th = 0;
    if (fmt->font.font)
      c->ENFN->font_string_size_get(c->ENDT, fmt->font.font, ti->text,
            &ti->text_props, &tw, &th);
-   ti->parent.w = tw;
-   ti->parent.h = th;
    inset = 0;
    if (fmt->font.font)
      inset = c->ENFN->font_inset_get(c->ENDT, fmt->font.font,
            &ti->text_props);
-   ti->inset = inset;
-   adv = 0;
+   right_inset = 0;
    if (fmt->font.font)
-     adv = c->ENFN->font_h_advance_get(c->ENDT, fmt->font.font,
-           ti->text, &ti->text_props);
-   ti->parent.adv = adv;
+      right_inset = c->ENFN->font_right_inset_get(c->ENDT, fmt->font.font,
+            &ti->text_props);
+
+   /* These adjustments are calculated and thus heavily linked to those in
+    * textblock_render!!! Don't change one without the other. */
+   switch (ti->parent.format->style)
+     {
+        case EVAS_TEXT_STYLE_SHADOW:
+           ti->x_adjustment = 1;
+           break;
+        case EVAS_TEXT_STYLE_OUTLINE_SHADOW:
+        case EVAS_TEXT_STYLE_FAR_SHADOW:
+           ti->x_adjustment = 2;
+           break;
+        case EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW:
+        case EVAS_TEXT_STYLE_FAR_SOFT_SHADOW:
+           ti->x_adjustment = 4;
+           break;
+        case EVAS_TEXT_STYLE_SOFT_SHADOW:
+           inset += 1;
+           ti->x_adjustment = 4;
+           break;
+        case EVAS_TEXT_STYLE_GLOW:
+        case EVAS_TEXT_STYLE_SOFT_OUTLINE:
+           inset += 2;
+           ti->x_adjustment = 4;
+           break;
+        case EVAS_TEXT_STYLE_OUTLINE:
+           inset += 1;
+           ti->x_adjustment = 1;
+           break;
+        default:
+           break;
+     }
+   ti->inset = inset;
+   ti->parent.w = tw + ti->x_adjustment;
+   ti->parent.h = th;
+   ti->parent.adv = tw + right_inset;
    ti->parent.x = 0;
 }
 
@@ -2818,11 +2840,14 @@ skip:
                    ti->parent.text_node->bidi_props, ti->parent.text_pos);
              evas_common_text_props_script_set (&ti->text_props,
                    ti->text);
-             c->ENFN->font_text_props_info_create(c->ENDT,
-                   ti->parent.format->font.font,
-                   ti->text, &ti->text_props,
-                   ti->parent.text_node->bidi_props,
-                   ti->parent.text_pos, tmp_len);
+             if (ti->parent.format->font.font)
+               {
+                  c->ENFN->font_text_props_info_create(c->ENDT,
+                        ti->parent.format->font.font,
+                        ti->text, &ti->text_props,
+                        ti->parent.text_node->bidi_props,
+                        ti->parent.text_pos, tmp_len);
+               }
           }
         str += tmp_len;
         cur_len -= tmp_len;
@@ -3065,6 +3090,10 @@ _layout_update_par(Ctxt *c)
      {
         c->par->y = last_par->y + last_par->h;
      }
+   else
+     {
+        c->par->y = 0;
+     }
 }
 
 /* -1 means no wrap */
@@ -3287,7 +3316,7 @@ _layout_visualize_par(Ctxt *c)
 
         /* Check if we need to wrap, i.e the text is bigger than the width */
         if ((c->w >= 0) &&
-              ((c->x + it->adv) >
+              ((c->x + it->w) >
                (c->w - c->o->style_pad.l - c->o->style_pad.r -
                 c->marginl - c->marginr)))
           {
@@ -3685,6 +3714,18 @@ _layout(const Evas_Object *obj, int calc_only, int w, int h, int *w_ret, int *h_
    if (w_ret) *w_ret = c->wmax;
    if (h_ret) *h_ret = c->hmax;
 
+   /* Is this really the place? */
+   /* Vertically align the textblock */
+   if ((o->valign > 0.0) && (c->h > c->hmax))
+     {
+        Evas_Coord adjustment = (c->h - c->hmax) * o->valign;
+        Evas_Object_Textblock_Paragraph *par;
+        EINA_INLIST_FOREACH(c->paragraphs, par)
+          {
+             par->y += adjustment;
+          }
+     }
+
    if ((o->style_pad.l != style_pad_l) || (o->style_pad.r != style_pad_r) ||
        (o->style_pad.t != style_pad_t) || (o->style_pad.b != style_pad_b))
      {
@@ -3736,12 +3777,14 @@ _relayout(const Evas_Object *obj)
    Evas_Object_Textblock *o;
 
    o = (Evas_Object_Textblock *)(obj->object_data);
+   o->have_ellipsis = 0;
    _layout(obj,
          0,
          obj->cur.geometry.w, obj->cur.geometry.h,
          &o->formatted.w, &o->formatted.h);
    o->formatted.valid = 1;
    o->last_w = obj->cur.geometry.w;
+   o->last_h = obj->cur.geometry.h;
    o->changed = 0;
    o->content_changed = 0;
    o->redraw = 1;
@@ -4108,7 +4151,8 @@ evas_object_textblock_newline_mode_set(Evas_Object *obj, Eina_Bool mode)
       return;
 
    o->newline_is_ps = mode;
-    _evas_textblock_text_node_changed(o, obj, NULL);
+   /* FIXME: Should recreate all the textnodes... For now, it's just
+    * for new text inserted. */
 }
 
 /**
@@ -4127,6 +4171,43 @@ evas_object_textblock_newline_mode_get(const Evas_Object *obj)
 }
 
 /**
+ * @brief Sets the vertical alignment of text within the textblock object
+ * as a whole.
+ *
+ * Normally alignment is 0.0 (top of object). Values given should be
+ * between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
+ * etc.).
+ *
+ * @param obj The given textblock object.
+ * @param align A value between 0.0 and 1.0
+ * @since 1.1.0
+ */
+EAPI void
+evas_object_textblock_valign_set(Evas_Object *obj, double align)
+{
+   TB_HEAD();
+   if (align < 0.0) align = 0.0;
+   else if (align > 1.0) align = 1.0;
+   if (o->valign == align) return;
+   o->valign = align;
+    _evas_textblock_text_node_changed(o, obj, NULL);
+}
+
+/**
+ * @brief Gets the vertical alignment of a textblock
+ *
+ * @param obj The given textblock object.
+ * @return The elignment set for the object
+ * @since 1.1.0
+ */
+EAPI double
+evas_object_textblock_valign_get(const Evas_Object *obj)
+{
+   TB_HEAD_RETURN(0.0);
+   return o->valign;
+}
+
+/**
  * @brief Get the "replacement character" for given textblock object. Returns
  * NULL if no replacement character is in use.
  *
@@ -6533,6 +6614,9 @@ _evas_textblock_cursor_is_at_the_end(const Evas_Textblock_Cursor *cur)
  * This behavior is because visible formats are like characters and invisible
  * should be stacked in a way that the last one is added last.
  *
+ * This function works with native formats, that means that style defined
+ * tags like <br> won't work here. For those kind of things use markup prepend.
+ *
  * @param cur the cursor to where to add format at.
  * @param format the format to add.
  * @return Returns true if a visible format was added, false otherwise.
@@ -6663,6 +6747,9 @@ evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *form
  * should be stacked in a way that the last one is added last.
  * If the format is visible the cursor is advanced after it.
  *
+ * This function works with native formats, that means that style defined
+ * tags like <br> won't work here. For those kind of things use markup prepend.
+ *
  * @param cur the cursor to where to add format at.
  * @param format the format to add.
  * @return Returns true if a visible format was added, false otherwise.
@@ -8286,6 +8373,12 @@ evas_object_textblock_render(Evas_Object *obj, void *output, void *context, void
    o = (Evas_Object_Textblock *)(obj->object_data);
    obj->layer->evas->engine.func->context_multiplier_unset(output,
                                                           context);
+   /* FIXME: This clipping is just until we fix inset handling correctly. */
+   ENFN->context_clip_clip(output, context,
+                              obj->cur.geometry.x + x,
+                              obj->cur.geometry.y + y,
+                              obj->cur.geometry.w,
+                              obj->cur.geometry.h);
    clip = ENFN->context_clip_get(output, context, &cx, &cy, &cw, &ch);
    /* If there are no paragraphs and thus there are no lines,
     * there's nothing left to do. */
@@ -8413,6 +8506,9 @@ evas_object_textblock_render(Evas_Object *obj, void *output, void *context, void
      }
    ITEM_WALK_END();
 
+   /* There are size adjustments that depend on the styles drawn here back
+    * in "_text_item_update_sizes" should not modify one without the other. */
+
    /* prepare everything for text draw */
 
    /* shadows */
@@ -8572,7 +8668,9 @@ evas_object_textblock_render_pre(Evas_Object *obj)
    /* if so what and where and add the appropriate redraw textblocks */
    o = (Evas_Object_Textblock *)(obj->object_data);
    if ((o->changed) || (o->content_changed) ||
-       (o->last_w != obj->cur.geometry.w))
+       ((obj->cur.geometry.w != o->last_w) ||
+           (((o->valign != 0.0) || (o->have_ellipsis)) &&
+               (obj->cur.geometry.h != o->last_h))))
      {
        o->formatted.valid = 0;
        _layout(obj,
@@ -8581,6 +8679,7 @@ evas_object_textblock_render_pre(Evas_Object *obj)
                &o->formatted.w, &o->formatted.h);
        o->formatted.valid = 1;
        o->last_w = obj->cur.geometry.w;
+       o->last_h = obj->cur.geometry.h;
        o->redraw = 0;
        evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, obj);
        o->changed = 0;
@@ -8727,7 +8826,9 @@ evas_object_textblock_coords_recalc(Evas_Object *obj)
    Evas_Object_Textblock *o;
 
    o = (Evas_Object_Textblock *)(obj->object_data);
-   if (obj->cur.geometry.w != o->last_w)
+   if ((obj->cur.geometry.w != o->last_w) ||
+       (((o->valign != 0.0) || (o->have_ellipsis)) &&
+           (obj->cur.geometry.h != o->last_h)))
      {
        o->formatted.valid = 0;
        o->changed = 1;
@@ -8737,7 +8838,12 @@ evas_object_textblock_coords_recalc(Evas_Object *obj)
 static void
 evas_object_textblock_scale_update(Evas_Object *obj)
 {
-   _relayout(obj);
+   Evas_Object_Textblock *o;
+   
+   o = (Evas_Object_Textblock *)(obj->object_data);
+   o->content_changed = 1;
+   o->formatted.valid = 0;
+   o->changed = 1;
 }
 
 void
index f3f07ee..be11b0e 100644 (file)
@@ -2,8 +2,8 @@
 #include "evas_private.h"
 
 // debug rendering
-//#define REND_DGB 1
-//#define STDOUT_DBG 1
+/* #define REND_DGB 1 */
+/* #define STDOUT_DBG 1 */
 
 #ifdef REND_DGB
 static FILE *dbf = NULL;
@@ -670,7 +670,8 @@ chlist(Evas_Object *obj, int i)
 
 static Eina_Bool
 evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
-                   int off_x, int off_y, int mapped
+                   int off_x, int off_y, int mapped,
+                   int ecx, int ecy, int ecw, int ech
 #ifdef REND_DGB
                    , int level
 #endif
@@ -863,7 +864,8 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                     {
                        clean_them |= evas_render_mapped(e, obj2, ctx,
                                                        obj->cur.map->surface,
-                                                       off_x2, off_y2, 1
+                                                       off_x2, off_y2, 1,
+                                                        ecx, ecy, ecw, ech
 #ifdef REND_DGB
                                                        , level + 1
 #endif
@@ -881,6 +883,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                                      obj->cur.geometry.y + off_y2,
                                      obj->cur.geometry.w,
                                      obj->cur.geometry.h);
+
                   e->engine.func->context_clip_set(e->engine.data.output,
                                                    ctx, x, y, w, h);
                   obj->func->render(obj, e->engine.data.output, ctx,
@@ -919,6 +922,11 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                        y = obj->cur.cache.clip.y;
                        w = obj->cur.cache.clip.w;
                        h = obj->cur.cache.clip.h;
+                       RECTS_CLIP_TO_RECT(x, y, w, h,
+                              obj->cur.clipper->cur.cache.clip.x,
+                              obj->cur.clipper->cur.cache.clip.y,
+                              obj->cur.clipper->cur.cache.clip.w,
+                              obj->cur.clipper->cur.cache.clip.h);
                        e->engine.func->context_clip_set(e->engine.data.output,
                                                         e->engine.data.context,
                                                         x + off_x, y + off_y, w, h);
@@ -946,6 +954,10 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                     }
                }
           }
+        if (surface == e->engine.data.output)
+           e->engine.func->context_clip_clip(e->engine.data.output,
+                                             e->engine.data.context,
+                                             ecx, ecy, ecw, ech);
         if (obj->cur.cache.clip.visible)
            obj->layer->evas->engine.func->image_map_draw
            (e->engine.data.output, e->engine.data.context, surface,
@@ -971,7 +983,8 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                     {
                        clean_them |= evas_render_mapped(e, obj2, ctx,
                                                        surface,
-                                                       off_x, off_y, 1
+                                                       off_x, off_y, 1,
+                                                        ecx, ecy, ecw, ech
 #ifdef REND_DGB
                                                        , level + 1
 #endif
@@ -982,7 +995,33 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                {
                   if (!obj->cur.map)
                     {
+                       int x, y, w, h;
+
                        RDI(level);
+
+                       x = obj->cur.cache.clip.x + off_x;
+                       y = obj->cur.cache.clip.y + off_y;
+                       w = obj->cur.cache.clip.w;
+                       h = obj->cur.cache.clip.h;
+
+                       if (obj->cur.clipper)
+                         {
+                            if (_evas_render_has_map(obj))
+                              evas_object_clip_recalc(obj);
+
+                            RD("        clipper: %i %i %ix%i\n",
+                               obj->cur.clipper->cur.cache.clip.x + off_x,
+                               obj->cur.clipper->cur.cache.clip.y + off_y,
+                               obj->cur.clipper->cur.cache.clip.w,
+                               obj->cur.clipper->cur.cache.clip.h);
+
+                            RECTS_CLIP_TO_RECT(x, y, w, h,
+                                               obj->cur.clipper->cur.cache.clip.x + off_x,
+                                               obj->cur.clipper->cur.cache.clip.y + off_y,
+                                               obj->cur.clipper->cur.cache.clip.w,
+                                               obj->cur.clipper->cur.cache.clip.h);
+                         }
+
                        RD("        clip: %i %i %ix%i [%i %i %ix%i]\n",
                           obj->cur.cache.clip.x + off_x,
                           obj->cur.cache.clip.y + off_y, 
@@ -993,11 +1032,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
                           obj->cur.geometry.w,
                           obj->cur.geometry.h);
                        e->engine.func->context_clip_set(e->engine.data.output,
-                                                        ctx,
-                                                        obj->cur.cache.clip.x + off_x,
-                                                        obj->cur.cache.clip.y + off_y, 
-                                                        obj->cur.cache.clip.w,
-                                                        obj->cur.cache.clip.h);
+                                                        ctx, x, y, w, h);
                     }
                   else
                     {
@@ -1020,6 +1055,29 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
           }
         else
           {
+             if (obj->cur.clipper)
+               {
+                  int x, y, w, h;
+
+                  if (_evas_render_has_map(obj))
+                    evas_object_clip_recalc(obj);
+                  x = obj->cur.cache.clip.x;
+                  y = obj->cur.cache.clip.y;
+                  w = obj->cur.cache.clip.w;
+                  h = obj->cur.cache.clip.h;
+                  RECTS_CLIP_TO_RECT(x, y, w, h,
+                                     obj->cur.clipper->cur.cache.clip.x,
+                                     obj->cur.clipper->cur.cache.clip.y,
+                                     obj->cur.clipper->cur.cache.clip.w,
+                                     obj->cur.clipper->cur.cache.clip.h);
+                  e->engine.func->context_clip_set(e->engine.data.output,
+                                                   e->engine.data.context,
+                                                   x + off_x, y + off_y, w, h);
+                  e->engine.func->context_clip_clip(e->engine.data.output,
+                                                    e->engine.data.context,
+                                                    ecx, ecy, ecw, ech);
+               }
+
              RDI(level);
              RD("        draw normal obj\n");
              obj->func->render(obj, e->engine.data.output, context, surface,
@@ -1064,10 +1122,10 @@ evas_render_updates_internal(Evas *e,
 
    /* phase 1. add extra updates for changed objects */
    if (e->invalidate || e->render_objects.count <= 0)
-     clean_them = _evas_render_phase1_process(e, 
-                                              &e->active_objects, 
-                                              &e->restack_objects, 
-                                              &e->delete_objects, 
+     clean_them = _evas_render_phase1_process(e,
+                                              &e->active_objects,
+                                              &e->restack_objects,
+                                              &e->delete_objects,
                                               &e->render_objects,
                                               &redraw_all);
 
@@ -1269,26 +1327,6 @@ evas_render_updates_internal(Evas *e,
                           (eina_array_data_get(&e->temporary_objects, offset) == obj))
                         offset++;
                       x = cx; y = cy; w = cw; h = ch;
-                       if (obj->cur.clipper)
-                         {
-                            if (_evas_render_has_map(obj))
-                              {
-                                 evas_object_clip_recalc(obj);
-                              }
-/* hmmmm clip seems to kill eweather in elm-test
-                            printf("clip: %4i %4i %4ix%4i to %4i %4i %4ix%4i\n",
-                                   x, y, w, h,
-                                   obj->cur.cache.clip.x + off_x,
-                                   obj->cur.cache.clip.y + off_y,
-                                   obj->cur.cache.clip.w,
-                                   obj->cur.cache.clip.h);
- */
-                            RECTS_CLIP_TO_RECT(x, y, w, h,
-                                               obj->cur.cache.clip.x + off_x,
-                                               obj->cur.cache.clip.y + off_y,
-                                               obj->cur.cache.clip.w,
-                                               obj->cur.cache.clip.h);
-                         }
                       if (((w > 0) && (h > 0)) || (obj->smart.smart))
                         {
                             if (!obj->smart.smart)
@@ -1358,11 +1396,9 @@ evas_render_updates_internal(Evas *e,
                                    }
                              }
 #endif
-                            e->engine.func->context_clip_set(e->engine.data.output,
-                                                             e->engine.data.context,
-                                                             x, y, w, h);
                             clean_them |= evas_render_mapped(e, obj, e->engine.data.context,
-                                                            surface, off_x, off_y, 0
+                                                            surface, off_x, off_y, 0,
+                                                             cx, cy, cw, ch
 #ifdef REND_DGB
                                                             , 1
 #endif
index c3290b9..62b96aa 100644 (file)
@@ -82,6 +82,7 @@ evas_convert_rgb_8.h \
 evas_convert_yuv.h \
 evas_draw.h \
 evas_font.h \
+evas_font_default_walk.x \
 evas_font_private.h \
 evas_image.h \
 evas_image_private.h \
index 3db4366..13e5dc5 100644 (file)
@@ -58,6 +58,7 @@ EAPI void              evas_common_font_all_clear            (void);
 EAPI int               evas_common_font_query_kerning        (RGBA_Font_Int* fi, FT_UInt left, FT_UInt right, int* kerning);
 EAPI void              evas_common_font_query_size           (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int *w, int *h);
 EAPI int               evas_common_font_query_inset          (RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props);
+EAPI int               evas_common_font_query_right_inset    (RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props);
 EAPI void              evas_common_font_query_advance        (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int *h_adv, int *v_adv);
 EAPI int               evas_common_font_query_char_coords    (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
 EAPI int               evas_common_font_query_pen_coords     (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
index 3be396a..5845b35 100644 (file)
@@ -49,7 +49,7 @@ struct cinfo
 #if defined(METRIC_CACHE) || defined(WORD_CACHE)
 LK(lock_words); // for word cache call
 static Eina_Inlist *words = NULL;
-static struct prword *evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *text, const Evas_Text_Props *text_props, int len, RGBA_Font *fn, RGBA_Font_Int *fi,int use_kerning);
+static struct prword *evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *text, const Evas_Text_Props *text_props, int len, RGBA_Font *fn, RGBA_Font_Int *fi);
 #endif
 
 EAPI void
@@ -263,6 +263,9 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
 
    if (!fi->fash) fi->fash = _fash_gl_new();
    if (fi->fash) _fash_gl_add(fi->fash, index, fg);
+   /* This '+ 200' is just an estimation of how much memory freetype will use
+    * on it's size. This value is not really used anywhere in code - it's
+    * only for statistics. */
    size = sizeof(RGBA_Font_Glyph) + sizeof(Eina_List) +
     (fg->glyph_out->bitmap.width * fg->glyph_out->bitmap.rows) + 200;
    fi->usage += size;
@@ -397,8 +400,7 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, int gl)
 static void
 evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Eina_Unicode *in_text,
                                const Evas_Text_Props *text_props, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, 
-                               int ext_h, RGBA_Font_Int *fi, int im_w, int im_h __UNUSED__, int use_kerning
-                               )
+                               int ext_h, RGBA_Font_Int *fi, int im_w, int im_h __UNUSED__)
 {
    const Eina_Unicode *text = in_text;
    DATA32 *im;
@@ -417,7 +419,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
 
         word =
           evas_font_word_prerender(dc, text, text_props,
-                                   len, fn, fi, use_kerning);
+                                   len, fn, fi);
         if (word)
           {
              int j, rowstart, rowend, xstart, xrun;
@@ -493,18 +495,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
 # endif
           }
      }
-#else
-   (void) use_kerning;
 #endif
-/*
-   if (fi->src->current_size != fi->size)
-     {
-        FTLOCK();
-        FT_Activate_Size(fi->ft.size);
-        FTUNLOCK();
-        fi->src->current_size = fi->size;
-     }
-*/
 
    im = dst->image.data;
    /* Load the glyph according to the first letter of the script, preety
@@ -521,6 +512,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
         if (!*tmp && (tmp > text)) tmp--;
         evas_common_font_glyph_search(fn, &fi, *tmp);
      }
+
    if (fi->src->current_size != fi->size)
      {
         FTLOCK();
@@ -711,7 +703,6 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
 {
    int ext_x, ext_y, ext_w, ext_h;
    int im_w, im_h;
-   int use_kerning;
    RGBA_Gfx_Func func;
    RGBA_Font_Int *fi;
    Cutout_Rects *rects;
@@ -754,14 +745,13 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
 #endif
    evas_common_font_int_reload(fi);
 //   evas_common_font_size_use(fn);
-   use_kerning = FT_HAS_KERNING(fi->src->ft.face);
    func = evas_common_gfx_func_composite_mask_color_span_get(dc->col.col, dst, 1, dc->render_op);
 
    if (!dc->cutout.rects)
      {
         evas_common_font_draw_internal(dst, dc, fn, x, y, text, text_props,
                                        func, ext_x, ext_y, ext_w, ext_h, fi,
-                                       im_w, im_h, use_kerning);
+                                       im_w, im_h);
      }
    else
      {
@@ -777,7 +767,7 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
                   evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
                   evas_common_font_draw_internal(dst, dc, fn, x, y, text, text_props,
                                                  func, r->x, r->y, r->w, r->h, fi,
-                                                 im_w, im_h, use_kerning);
+                                                 im_w, im_h);
                }
              evas_common_draw_context_apply_clear_cutouts(rects);
           }
@@ -792,7 +782,7 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
 /* Only used if cache is on */
 #if defined(METRIC_CACHE) || defined(WORD_CACHE)
 struct prword *
-evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *in_text, const Evas_Text_Props *text_props, int len, RGBA_Font *fn, RGBA_Font_Int *fi,int use_kerning __UNUSED__)
+evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *in_text, const Evas_Text_Props *text_props, int len, RGBA_Font *fn, RGBA_Font_Int *fi)
 {
    struct cinfo *metrics;
    const Eina_Unicode *text = in_text;
index 62ed99a..6a6a4e4 100644 (file)
@@ -194,6 +194,8 @@ evas_common_font_ot_populate_text_props(void *_fn, const Eina_Unicode *text,
    hb_glyph_info_t *infos;
    int slen;
    unsigned int i;
+   Evas_Font_Glyph_Info *gl_itr;
+   Evas_Font_OT_Info *ot_itr;
 
    fi = fn->fonts->data;
    /* Load the font needed for this script */
@@ -246,13 +248,20 @@ evas_common_font_ot_populate_text_props(void *_fn, const Eina_Unicode *text,
               sizeof(Evas_Font_Glyph_Info));
    positions = hb_buffer_get_glyph_positions(buffer);
    infos = hb_buffer_get_glyph_infos(buffer);
+   gl_itr = props->info->glyph;
+   ot_itr = props->info->ot;
    for (i = 0 ; i < props->len ; i++)
      {
-        props->info->ot[i].source_cluster = infos[i].cluster;
-        props->info->ot[i].x_offset = positions[i].x_offset;
-        props->info->ot[i].y_offset = positions[i].y_offset;
-        props->info->glyph[i].index = infos[i].codepoint;
-        props->info->glyph[i].advance = positions[i].x_advance;
+        ot_itr->source_cluster = infos->cluster;
+        ot_itr->x_offset = positions->x_offset;
+        ot_itr->y_offset = positions->y_offset;
+        gl_itr->index = infos->codepoint;
+        gl_itr->advance = positions->x_advance;
+
+        ot_itr++;
+        gl_itr++;
+        infos++;
+        positions++;
      }
 
    hb_buffer_destroy(buffer);
index cc68578..eed3faf 100644 (file)
@@ -24,6 +24,11 @@ extern LK(lock_ot); // for harfbuzz calls
 #  define BIDILOCK()
 #  define BIDIUNLOCK()
 
+/* Macros for text walking */
+#  define OTLOCK()
+#  define OTUNLOCK()
+# endif
+
 void evas_common_font_source_unload(RGBA_Font_Source *fs);
 void evas_common_font_source_reload(RGBA_Font_Source *fs);
 
@@ -32,10 +37,6 @@ void evas_common_font_int_use_increase(int size);
 void evas_common_font_int_use_trim(void);
 void evas_common_font_int_unload(RGBA_Font_Int *fi);
 void evas_common_font_int_reload(RGBA_Font_Int *fi);
-/* Macros for text walking */
-#  define OTLOCK()
-#  define OTUNLOCK()
-# endif
 
 /* 6th bit is on is the same as frac part >= 0.5 */
 # define EVAS_FONT_ROUND_26_6_TO_INT(x) \
index ae73e60..f666e96 100644 (file)
@@ -66,6 +66,27 @@ evas_common_font_query_inset(RGBA_Font *fn __UNUSED__, const Evas_Text_Props *te
    return text_props->info->glyph[text_props->start].x_bear;
 }
 
+/* text right x inset */
+EAPI int
+evas_common_font_query_right_inset(RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props)
+{
+   const Evas_Font_Glyph_Info *gli;
+   if (!text_props->len) return 0;
+   gli = text_props->info->glyph + text_props->start + text_props->len - 1;
+
+   /* If the last char is a whitespace, we use the advance as the size,
+    * so the right_inset is 0. */
+   if (gli->width == 0)
+      return 0;
+
+   return EVAS_FONT_ROUND_26_6_TO_INT(gli->advance) -
+      (gli->width + gli->x_bear
+#ifdef OT_SUPPORT
+       + text_props->info->ot[text_props->start + text_props->len - 1].x_offset
+#endif
+      );
+}
+
 /* size of the string (width and height) in pixels
  * BiDi handling: We receive the shaped string + other props from text_props,
  * We only care about the size, and the size does not depend on the visual order.
@@ -93,7 +114,15 @@ evas_common_font_query_size(RGBA_Font *fn, const Eina_Unicode *text __UNUSED__,
      }
    EVAS_FONT_WALK_TEXT_END();
 
-   if (w) *w = prev_pen_x + keep_width;
+   /* If the last char is a whitespace, we use the advance as the size */
+   if (keep_width > 0)
+     {
+        if (w) *w = prev_pen_x + keep_width;
+     }
+   else
+     {
+        if (w) *w = EVAS_FONT_WALK_PEN_X;
+     }
    if (h) *h = evas_common_font_max_ascent_get(fn) + evas_common_font_max_descent_get(fn);
 }
 
index b113040..ba6b38d 100644 (file)
@@ -30,12 +30,14 @@ static const struct ext_loader_s loaders[] =
    { "pnm", "pmaps" },
    { "bmp", "bmp" },
    { "tga", "tga" },
-   { "wbmp", "wbmp" }
+   { "wbmp", "wbmp" },
+   { "ico", "ico" },
+   { "cur", "ico" }
 };
 
 static const char *loaders_name[] =
 {
-  "png", "jpeg", "eet", "xpm", "tiff", "gif", "svg", "pmaps", "edb", "bmp", "tga", "wbmp"
+  "png", "jpeg", "eet", "xpm", "tiff", "gif", "svg", "pmaps", "edb", "bmp", "tga", "wbmp", "ico"
 };
 
 struct evas_image_foreach_loader_data
index bda94ee..1f1b030 100644 (file)
@@ -1,6 +1,7 @@
 // THIS IS DEPRECATED. WILL GO EVENTUALLTY. NO NEED TO SUPPORT ANYMORE
 
 #include "evas_common.h"
+#include <unistd.h>
 
 #ifdef BUILD_PIPE_RENDER
 
index fe54ca4..616cd7e 100644 (file)
@@ -175,7 +175,6 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
 {
    RGBA_Font *fn = (RGBA_Font *) _fn;
    RGBA_Font_Int *fi;
-   size_t char_index;
 
    if (text_props->info)
      {
@@ -200,6 +199,8 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
      }
 
 #ifdef OT_SUPPORT
+   size_t char_index;
+   Evas_Font_Glyph_Info *gl_itr;
    const Eina_Unicode *base_char;
    evas_common_font_ot_populate_text_props(fn, text, text_props, len);
 
@@ -217,19 +218,20 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
         evas_common_font_glyph_search(fn, &fi, *base_char);
      }
 
+   gl_itr = text_props->info->glyph;
    for (char_index = 0 ; char_index < text_props->len ; char_index++)
      {
         FT_UInt index;
         RGBA_Font_Glyph *fg;
         Eina_Bool is_replacement = EINA_FALSE;
         /* If we got a malformed index, show the replacement char instead */
-        if (text_props->info->glyph[char_index].index == 0)
+        if (gl_itr->index == 0)
           {
-             text_props->info->glyph[char_index].index =
+             gl_itr->index =
                 evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR);
              is_replacement = EINA_TRUE;
           }
-        index = text_props->info->glyph[char_index].index;
+        index = gl_itr->index;
         LKL(fi->ft_mutex);
         fg = evas_common_font_int_cache_glyph_get(fi, index);
         if (!fg)
@@ -241,25 +243,25 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
         if (is_replacement)
           {
              /* Update the advance accordingly */
-             text_props->info->glyph[char_index].advance =
+             gl_itr->advance =
                 fg->glyph->advance.x >> 10;
              /* FIXME: reload fi, a bit slow, but I have no choice. */
              evas_common_font_glyph_search(fn, &fi, *base_char);
           }
-        text_props->info->glyph[char_index].x_bear =
-           fg->glyph_out->left;
-        text_props->info->glyph[char_index].width =
-           fg->glyph_out->bitmap.width;
+        gl_itr->x_bear = fg->glyph_out->left;
+        gl_itr->width = fg->glyph_out->bitmap.width;
         /* text_props->info->glyph[char_index].advance =
          * text_props->info->glyph[char_index].index =
          * already done by the ot function */
         if (EVAS_FONT_CHARACTER_IS_INVISIBLE(
               text[text_props->info->ot[char_index].source_cluster]))
-           text_props->info->glyph[char_index].index = 0;
+           gl_itr->index = 0;
 
+        gl_itr++;
      }
 #else
    /* We are walking the string in visual ordering */
+   Evas_Font_Glyph_Info *gl_itr;
    Eina_Bool use_kerning;
    FT_UInt prev_index;
    FT_Face pface = NULL;
@@ -282,8 +284,9 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
      {
         adv_d = 1;
      }
-   char_index = 0;
-   for ( ; i > 0 ; char_index++, text += adv_d, i--)
+
+   gl_itr = text_props->info->glyph;
+   for ( ; i > 0 ; gl_itr++, text += adv_d, i--)
      {
         FT_UInt index;
         RGBA_Font_Glyph *fg;
@@ -331,8 +334,7 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
                {
                   if (evas_common_font_query_kerning(fi, index, prev_index, &kern))
                     {
-                       text_props->info->glyph[char_index - 1].advance +=
-                          kern;
+                       (gl_itr - 1)->advance += kern;
                     }
                }
              else
@@ -340,8 +342,7 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
                {
                   if (evas_common_font_query_kerning(fi, prev_index, index, &kern))
                     {
-                       text_props->info->glyph[char_index - 1].advance +=
-                          kern;
+                       (gl_itr - 1)->advance += kern;
                     }
                }
           }
@@ -350,15 +351,12 @@ evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
         LKU(fi->ft_mutex);
 
         if (EVAS_FONT_CHARACTER_IS_INVISIBLE(_gl))
-           text_props->info->glyph[char_index].index = 0;
-
-        text_props->info->glyph[char_index].index = index;
-        text_props->info->glyph[char_index].x_bear =
-           fg->glyph_out->left;
-        text_props->info->glyph[char_index].advance =
-           fg->glyph->advance.x >> 10;
-        text_props->info->glyph[char_index].width =
-           fg->glyph_out->bitmap.width;
+           gl_itr->index = 0;
+
+        gl_itr->index = index;
+        gl_itr->x_bear = fg->glyph_out->left;
+        gl_itr->advance = fg->glyph->advance.x >> 10;
+        gl_itr->width = fg->glyph_out->bitmap.width;
 
         prev_index = index;
      }
index 1884baf..b22a85d 100644 (file)
@@ -376,6 +376,7 @@ evas_common_soft16_line_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, i
    int dx, dy;
    int  x, y, w, h;
 
+   c_tmp.mask = NULL;
    c_tmp.use = 1;
    c_tmp.x = 0;
    c_tmp.y = 0;
index 4e37f1a..6466abd 100644 (file)
@@ -125,6 +125,7 @@ EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, eet);
 EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, edb);
 EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, tga);
 EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, wbmp);
+EVAS_EINA_STATIC_MODULE_DEFINE(image_loader, ico);
 EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, edb);
 EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, eet);
 EVAS_EINA_STATIC_MODULE_DEFINE(image_saver, jpeg);
@@ -240,6 +241,9 @@ static const struct {
 #ifdef EVAS_STATIC_BUILD_WBMP
   EVAS_EINA_STATIC_MODULE_USE(image_loader, wbmp),
 #endif
+#ifdef EVAS_STATIC_BUILD_ICO
+  EVAS_EINA_STATIC_MODULE_USE(image_loader, ico),
+#endif
 #ifdef EVAS_STATIC_BUILD_EDB
   EVAS_EINA_STATIC_MODULE_USE(image_saver, edb),
 #endif
index cdc5e96..57fc791 100644 (file)
@@ -116,44 +116,44 @@ struct _Evas_Cairo_Polygon_Point
 #endif
 
 /*
-Evas_GL_Context  *evas_gl_common_context_new(void);
-void              evas_gl_common_context_free(Evas_GL_Context *gc);
-void              evas_gl_common_context_use(Evas_GL_Context *gc);
-void              evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h);
-void              evas_gl_common_context_color_set(Evas_GL_Context *gc, int r, int g, int b, int a);
-void              evas_gl_common_context_blend_set(Evas_GL_Context *gc, int blend);
-void              evas_gl_common_context_dither_set(Evas_GL_Context *gc, int dither);
-void              evas_gl_common_context_texture_set(Evas_GL_Context *gc, Evas_GL_Texture *tex, int smooth, int w, int h);
-void              evas_gl_common_context_font_texture_set(Evas_GL_Context *gc, Evas_GL_Font_Texture *ft);
-void              evas_gl_common_context_clip_set(Evas_GL_Context *gc, int on, int x, int y, int w, int h);
-void              evas_gl_common_context_read_buf_set(Evas_GL_Context *gc, GLenum buf);
-void              evas_gl_common_context_write_buf_set(Evas_GL_Context *gc, GLenum buf);
-
-Evas_GL_Texture  *evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im, int smooth);
+Evas_Engine_GL_Context  *evas_gl_common_context_new(void);
+void              evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
+void              evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
+void              evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h);
+void              evas_gl_common_context_color_set(Evas_Engine_GL_Context *gc, int r, int g, int b, int a);
+void              evas_gl_common_context_blend_set(Evas_Engine_GL_Context *gc, int blend);
+void              evas_gl_common_context_dither_set(Evas_Engine_GL_Context *gc, int dither);
+void              evas_gl_common_context_texture_set(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, int smooth, int w, int h);
+void              evas_gl_common_context_font_texture_set(Evas_Engine_GL_Context *gc, Evas_GL_Font_Texture *ft);
+void              evas_gl_common_context_clip_set(Evas_Engine_GL_Context *gc, int on, int x, int y, int w, int h);
+void              evas_gl_common_context_read_buf_set(Evas_Engine_GL_Context *gc, GLenum buf);
+void              evas_gl_common_context_write_buf_set(Evas_Engine_GL_Context *gc, GLenum buf);
+
+Evas_GL_Texture  *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im, int smooth);
 void              evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im, int smooth);
 void              evas_gl_common_texture_free(Evas_GL_Texture *tex);
 void              evas_gl_common_texture_mipmaps_build(Evas_GL_Texture *tex, RGBA_Image *im, int smooth);
 
-Evas_GL_Image    *evas_gl_common_image_load(Evas_GL_Context *gc, char *file, char *key);
-Evas_GL_Image    *evas_gl_common_image_new_from_data(Evas_GL_Context *gc, int w, int h, int *data);
-Evas_GL_Image    *evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, int w, int h, int *data);
-Evas_GL_Image    *evas_gl_common_image_new(Evas_GL_Context *gc, int w, int h);
+Evas_GL_Image    *evas_gl_common_image_load(Evas_Engine_GL_Context *gc, char *file, char *key);
+Evas_GL_Image    *evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, int w, int h, int *data);
+Evas_GL_Image    *evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, int w, int h, int *data);
+Evas_GL_Image    *evas_gl_common_image_new(Evas_Engine_GL_Context *gc, int w, int h);
 void              evas_gl_common_image_free(Evas_GL_Image *im);
 void              evas_gl_common_image_dirty(Evas_GL_Image *im);
 
 Evas_GL_Polygon  *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
 Evas_GL_Polygon  *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
 
-void              evas_gl_common_swap_rect(Evas_GL_Context *gc, int x, int y, int w, int h);
+void              evas_gl_common_swap_rect(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
 
-void              evas_gl_common_rect_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x, int y, int w, int h);
-void              evas_gl_common_image_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
-void              evas_gl_common_line_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
-void              evas_gl_common_poly_draw(Evas_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Polygon *poly);
+void              evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, RGBA_Draw_Context *dc, int x, int y, int w, int h);
+void              evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
+void              evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
+void              evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, RGBA_Draw_Context *dc, Evas_GL_Polygon *poly);
 
-Evas_GL_Font_Texture *evas_gl_font_texture_new(Evas_GL_Context *gc, RGBA_Font_Glyph *fg);
+Evas_GL_Font_Texture *evas_gl_font_texture_new(Evas_Engine_GL_Context *gc, RGBA_Font_Glyph *fg);
 void                  evas_gl_font_texture_free(Evas_GL_Font_Texture *ft);
-void                  evas_gl_font_texture_draw(Evas_GL_Context *gc, void *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
+void                  evas_gl_font_texture_draw(Evas_Engine_GL_Context *gc, void *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
 */
 
 #endif
index 6e9cb6d..eb5e9c7 100644 (file)
 #include <Eina.h>
 #include "Evas.h"
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
 /* macros needed to log message through eina_log */
 extern EAPI int _evas_log_dom_global;
 #ifdef  _EVAS_DEFAULT_LOG_DOM
@@ -119,8 +123,8 @@ extern EAPI int _evas_log_dom_global;
 
 #ifdef BUILD_PTHREAD
 
-#ifndef __USE_GNU
-#define __USE_GNU
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
 #endif
 
 # include <pthread.h>
@@ -395,6 +399,7 @@ typedef unsigned char                   DATA8;
 
 typedef struct _Image_Entry             Image_Entry;
 typedef struct _Image_Entry_Flags      Image_Entry_Flags;
+typedef struct _Image_Timestamp         Image_Timestamp;
 typedef struct _Engine_Image_Entry      Engine_Image_Entry;
 typedef struct _Evas_Cache_Target       Evas_Cache_Target;
 typedef struct _Evas_Preload_Pthread    Evas_Preload_Pthread;
@@ -541,6 +546,16 @@ struct _Evas_Cache_Target
   void *data;
 };
 
+struct _Image_Timestamp
+{
+   time_t mtime;
+   off_t  size;
+   ino_t  ino;
+#ifdef _STAT_VER_LINUX
+   unsigned long int mtime_nsec;
+#endif   
+};
+
 struct _Image_Entry
 {
    EINA_INLIST;
@@ -553,10 +568,9 @@ struct _Image_Entry
    const char            *key;
 
    Evas_Cache_Target     *targets;
-   Evas_Preload_Pthread   *preload;
+   Evas_Preload_Pthread  *preload;
 
-   time_t                 timestamp;
-   time_t                 laststat;
+   Image_Timestamp        tstamp;
 
    int                    references;
 #ifdef EVAS_FRAME_QUEUING
index 73f3f42..3137579 100644 (file)
@@ -206,28 +206,33 @@ evas_object_clip_recalc(Evas_Object *obj)
    else cvis = obj->cur.visible;
    cr = obj->cur.color.r; cg = obj->cur.color.g;
    cb = obj->cur.color.b; ca = obj->cur.color.a;
-   if ((obj->cur.clipper) &&
-       (obj->cur.clipper->cur.map_parent == obj->cur.map_parent))
+   if (obj->cur.clipper)
      {
 // this causes problems... hmmm
-       if (obj->cur.clipper->cur.cache.clip.dirty)
-         evas_object_clip_recalc(obj->cur.clipper);
-       nx = obj->cur.clipper->cur.cache.clip.x;
-       ny = obj->cur.clipper->cur.cache.clip.y;
-       nw = obj->cur.clipper->cur.cache.clip.w;
-       nh = obj->cur.clipper->cur.cache.clip.h;
-       RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh);
-
-       nvis = obj->cur.clipper->cur.cache.clip.visible;
-       nr = obj->cur.clipper->cur.cache.clip.r;
-       ng = obj->cur.clipper->cur.cache.clip.g;
-       nb = obj->cur.clipper->cur.cache.clip.b;
-       na = obj->cur.clipper->cur.cache.clip.a;
-       cvis = cvis * nvis;
-       cr = (cr * (nr + 1)) >> 8;
-       cg = (cg * (ng + 1)) >> 8;
-       cb = (cb * (nb + 1)) >> 8;
-       ca = (ca * (na + 1)) >> 8;
+        if (obj->cur.clipper->cur.cache.clip.dirty)
+          evas_object_clip_recalc(obj->cur.clipper);
+
+        // I don't know why this test was here in the first place. As I have
+        // no issue showing up due to this, I keep it and move color out of it.
+        if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent)
+          {
+             nx = obj->cur.clipper->cur.cache.clip.x;
+             ny = obj->cur.clipper->cur.cache.clip.y;
+             nw = obj->cur.clipper->cur.cache.clip.w;
+             nh = obj->cur.clipper->cur.cache.clip.h;
+             RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh);
+          }
+
+        nvis = obj->cur.clipper->cur.cache.clip.visible;
+        nr = obj->cur.clipper->cur.cache.clip.r;
+        ng = obj->cur.clipper->cur.cache.clip.g;
+        nb = obj->cur.clipper->cur.cache.clip.b;
+        na = obj->cur.clipper->cur.cache.clip.a;
+        cvis = cvis * nvis;
+        cr = (cr * (nr + 1)) >> 8;
+        cg = (cg * (ng + 1)) >> 8;
+        cb = (cb * (nb + 1)) >> 8;
+        ca = (ca * (na + 1)) >> 8;
      }
    if ((ca == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) || (cw <= 0) || (ch <= 0)) cvis = 0;
    obj->cur.cache.clip.x = cx;
index 6103bfd..e5b9eb4 100644 (file)
@@ -460,6 +460,8 @@ struct _Evas_Object
    struct {
       int                      in_move, in_resize;
    } doing;
+   
+   unsigned int                ref;
 
    unsigned char               delete_me;
 
@@ -488,6 +490,7 @@ struct _Evas_Object
    Eina_Bool                   changed_move : 1;
    Eina_Bool                   changed_move_only : 1;
    Eina_Bool                   changed_nomove : 1;
+   Eina_Bool                   del_ref : 1;
 };
 
 struct _Evas_Func_Node
@@ -684,6 +687,7 @@ struct _Evas_Func
    int  (*image_content_hint_get)          (void *data, void *surface);
    int  (*font_pen_coords_get)            (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
    Eina_Bool (*font_text_props_info_create)                (void *data __UNUSED__, void *font, Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
+   int  (*font_right_inset_get)                  (void *data, void *font, const Evas_Text_Props *text_props);
 };
 
 struct _Evas_Image_Load_Func
index bdc9ba1..40337a8 100644 (file)
@@ -17,15 +17,20 @@ endif
 if !EVAS_STATIC_BUILD_FB
 SUBDIRS += fb
 endif
+
+if !EVAS_STATIC_BUILD_GL_COMMON
+SUBDIRS += gl_common
+endif
 if !EVAS_STATIC_BUILD_GL_GLEW
-SUBDIRS += gl_common gl_glew
+SUBDIRS += gl_glew
 endif
 if !EVAS_STATIC_BUILD_GL_X11
-SUBDIRS += gl_common gl_x11
+SUBDIRS += gl_x11
 endif
 if !EVAS_STATIC_BUILD_GL_SDL
-SUBDIRS += gl_common gl_sdl
+SUBDIRS += gl_sdl
 endif
+
 if !EVAS_STATIC_BUILD_QUARTZ
 SUBDIRS += quartz
 endif
index 45d92cd..aa02fc6 100644 (file)
@@ -17,13 +17,13 @@ BUFFER_SOURCES = \
 evas_engine.c \
 evas_outbuf.c
 
-pkgdir = $(libdir)/evas/modules/engines/buffer/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Buffer.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_BUFFER
 
+pkgdir = $(libdir)/evas/modules/engines/buffer/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES = $(BUFFER_SOURCES)
index 33153ff..d2fa180 100644 (file)
@@ -18,13 +18,13 @@ evas_x_main.c
 
 CAIRO_X11_LIBADD = @evas_engine_cairo_x11_libs@ $(top_builddir)/src/modules/engines/cairo_common/libevas_engine_cairo_common.la
 
-pkgdir = $(libdir)/evas/modules/engines/cairo_x11/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Cairo_X11.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_CAIRO_X11
 
+pkgdir = $(libdir)/evas/modules/engines/cairo_x11/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES = $(CAIRO_X11_SOURCES)
index 0f9ea14..5a9881e 100644 (file)
@@ -90,6 +90,7 @@ static int eng_font_max_ascent_get(void *data, void *font);
 static int eng_font_max_descent_get(void *data, void *font);
 static void eng_font_string_size_get(void *data, void *font, char *text, int *w, int *h);
 static int eng_font_inset_get(void *data, void *font, const Evas_Text_Props *intl_props);
+static int eng_font_right_inset_get(void *data, void *font, const Evas_Text_Props *intl_props);
 static int eng_font_h_advance_get(void *data, void *font, char *text);
 static int eng_font_v_advance_get(void *data, void *font, char *text);
 static int eng_font_char_coords_get(void *data, void *font, char *text, int pos, int *cx, int *cy, int *cw, int *ch);
@@ -219,7 +220,8 @@ static Evas_Func eng_func =
      NULL, // eng_image_content_hint_set - software doesn't use it
      NULL, // eng_image_content_hint_get - software doesn't use it
      eng_font_pen_coords_get,
-     eng_font_text_props_info_create
+     eng_font_text_props_info_create,
+     eng_font_right_inset_get
      /* FUTURE software generic calls go here */
 };
 
index 5847494..6b64ef5 100644 (file)
@@ -29,13 +29,13 @@ evas_direct3d_vertex_buffer_cache.cpp
 
 DIRECT3D_LIBADD = @evas_engine_direct3d_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/direct3d/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Direct3D.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_DIRECT3D
 
+pkgdir = $(libdir)/evas/modules/engines/direct3d/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(DIRECT3D_SOURCES)
 module_la_CXXFLAGS = -fno-exceptions
index ff571b5..fae87da 100644 (file)
@@ -17,13 +17,13 @@ if BUILD_ENGINE_DIRECTFB
 DIRECTFB_SOURCES = evas_engine.c polygon.c
 DIRECTFB_LIBADD = @evas_engine_directfb_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/directfb/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_DirectFB.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_DIRECTFB
 
+pkgdir = $(libdir)/evas/modules/engines/directfb/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES  = $(DIRECTFB_SOURCES)
index 58c70ca..47527f7 100644 (file)
@@ -19,13 +19,13 @@ evas_outbuf.c
 
 FB_LIBADD = @evas_engine_fb_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/fb/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_FB.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_FB
 
+pkgdir = $(libdir)/evas/modules/engines/fb/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(FB_SOURCES)
 module_la_LIBADD = @EINA_LIBS@ $(FB_LIBADD) $(top_builddir)/src/lib/libevas.la
index d83bdd1..6dcedd8 100644 (file)
 typedef struct _Evas_GL_Program                      Evas_GL_Program;
 typedef struct _Evas_GL_Program_Source               Evas_GL_Program_Source;
 typedef struct _Evas_GL_Shared                       Evas_GL_Shared;
-typedef struct _Evas_GL_Context                      Evas_GL_Context;
+typedef struct _Evas_Engine_GL_Context               Evas_Engine_GL_Context;
 typedef struct _Evas_GL_Texture_Pool                 Evas_GL_Texture_Pool;
 typedef struct _Evas_GL_Texture                      Evas_GL_Texture;
 typedef struct _Evas_GL_Image                        Evas_GL_Image;
@@ -218,7 +218,7 @@ struct _Evas_GL_Shared
 
 
 
-struct _Evas_GL_Context
+struct _Evas_Engine_GL_Context
 {
    int                references;
    int                w, h;
@@ -297,7 +297,7 @@ struct _Evas_GL_Context
 
 struct _Evas_GL_Texture_Pool
 {
-   Evas_GL_Context *gc;
+   Evas_Engine_GL_Context *gc;
    GLuint           texture, fb;
    GLuint           intformat, format, dataformat;
    int              w, h;
@@ -318,7 +318,7 @@ struct _Evas_GL_Texture_Pool
 
 struct _Evas_GL_Texture
 {
-   Evas_GL_Context *gc;
+   Evas_Engine_GL_Context *gc;
    Evas_GL_Image   *im;
    Evas_GL_Texture_Pool *pt, *ptu, *ptv;
    int              x, y, w, h;
@@ -330,7 +330,7 @@ struct _Evas_GL_Texture
 
 struct _Evas_GL_Image
 {
-   Evas_GL_Context *gc;
+   Evas_Engine_GL_Context *gc;
    RGBA_Image      *im;
    Evas_GL_Texture *tex;
    RGBA_Image_Loadopts load_opts;
@@ -410,27 +410,27 @@ extern Evas_GL_Program_Source shader_tex_nomul_vert_src;
 
 void glerr(int err, const char *file, const char *func, int line, const char *op);
  
-Evas_GL_Context  *evas_gl_common_context_new(void);
-void              evas_gl_common_context_free(Evas_GL_Context *gc);
-void              evas_gl_common_context_use(Evas_GL_Context *gc);
-void              evas_gl_common_context_newframe(Evas_GL_Context *gc);
-void              evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h, int rot);
-void              evas_gl_common_context_target_surface_set(Evas_GL_Context *gc, Evas_GL_Image *surface);
-
-void              evas_gl_common_context_line_push(Evas_GL_Context *gc,
+Evas_Engine_GL_Context  *evas_gl_common_context_new(void);
+void              evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
+void              evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
+void              evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc);
+void              evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot);
+void              evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, Evas_GL_Image *surface);
+
+void              evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
                                                    int x1, int y1, int x2, int y2,
                                                    int clip, int cx, int cy, int cw, int ch,
                                                    int r, int g, int b, int a);
-void              evas_gl_common_context_rectangle_push(Evas_GL_Context *gc,
+void              evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
                                                         int x, int y, int w, int h,
                                                         int r, int g, int b, int a);
-void              evas_gl_common_context_image_push(Evas_GL_Context *gc,
+void              evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
                                                     Evas_GL_Texture *tex,
                                                     double sx, double sy, double sw, double sh,
                                                     int x, int y, int w, int h,
                                                     int r, int g, int b, int a,
                                                     Eina_Bool smooth, Eina_Bool tex_only);
-void              evas_gl_common_context_image_mask_push(Evas_GL_Context *gc,
+void              evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
                                                     Evas_GL_Texture *tex,
                                                     Evas_GL_Texture *texm,
                                                     double sx, double sy, double sw, double sh,
@@ -438,20 +438,18 @@ void              evas_gl_common_context_image_mask_push(Evas_GL_Context *gc,
                                                     int x, int y, int w, int h,
                                                     int r, int g, int b, int a,
                                                     Eina_Bool smooth);
-
-
-void              evas_gl_common_context_font_push(Evas_GL_Context *gc,
+void              evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
                                                    Evas_GL_Texture *tex,
                                                    double sx, double sy, double sw, double sh,
                                                    int x, int y, int w, int h,
                                                    int r, int g, int b, int a);
-void             evas_gl_common_context_yuv_push(Evas_GL_Context *gc,
+void             evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
                                                  Evas_GL_Texture *tex,
                                                  double sx, double sy, double sw, double sh,
                                                  int x, int y, int w, int h,
                                                  int r, int g, int b, int a,
                                                  Eina_Bool smooth);
-void             evas_gl_common_context_image_map_push(Evas_GL_Context *gc,
+void             evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
                                                        Evas_GL_Texture *tex,
                                                        int npoints,
                                                        RGBA_Map_Point *p,
@@ -460,47 +458,48 @@ void             evas_gl_common_context_image_map_push(Evas_GL_Context *gc,
                                                        Eina_Bool smooth, 
                                                        Eina_Bool tex_only,
                                                        Eina_Bool yuv);
-void              evas_gl_common_context_flush(Evas_GL_Context *gc);
+void              evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
 
 int               evas_gl_common_shader_program_init(Evas_GL_Program *p,
                                                      Evas_GL_Program_Source *vert,
                                                      Evas_GL_Program_Source *frag,
                                                      const char *name);
+void              evas_gl_common_shader_program_init_done(void);
 void              evas_gl_common_shader_program_shutdown(Evas_GL_Program *p);
     
-void              evas_gl_common_rect_draw(Evas_GL_Context *gc, int x, int y, int w, int h);
+void              evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
 
 void              evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt);
-Evas_GL_Texture  *evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im);
-Evas_GL_Texture  *evas_gl_common_texture_native_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im);
-Evas_GL_Texture  *evas_gl_common_texture_render_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
-Evas_GL_Texture  *evas_gl_common_texture_dynamic_new(Evas_GL_Context *gc, Evas_GL_Image *im);
+Evas_GL_Texture  *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im);
+Evas_GL_Texture  *evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im);
+Evas_GL_Texture  *evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
+Evas_GL_Texture  *evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
 void              evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im);
 void              evas_gl_common_texture_free(Evas_GL_Texture *tex);
-Evas_GL_Texture  *evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
+Evas_GL_Texture  *evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
 void              evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
-Evas_GL_Texture  *evas_gl_common_texture_yuv_new(Evas_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
+Evas_GL_Texture  *evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
 void              evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
 
-void              evas_gl_common_image_all_unload(Evas_GL_Context *gc);
+void              evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc);
 
 void              evas_gl_common_image_ref(Evas_GL_Image *im);
 void              evas_gl_common_image_unref(Evas_GL_Image *im);
-Evas_GL_Image    *evas_gl_common_image_load(Evas_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
-Evas_GL_Image    *evas_gl_common_image_new_from_data(Evas_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
-Evas_GL_Image    *evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
-Evas_GL_Image    *evas_gl_common_image_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace);
+Evas_GL_Image    *evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
+Evas_GL_Image    *evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
+Evas_GL_Image    *evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
+Evas_GL_Image    *evas_gl_common_image_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace);
 Evas_GL_Image    *evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha);
 void              evas_gl_common_image_native_enable(Evas_GL_Image *im);
 void              evas_gl_common_image_native_disable(Evas_GL_Image *im);
 void              evas_gl_common_image_scale_hint_set(Evas_GL_Image *im, int hint);
 void              evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint);
-void              evas_gl_common_image_cache_flush(Evas_GL_Context *gc);
+void              evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc);
 void              evas_gl_common_image_free(Evas_GL_Image *im);
-Evas_GL_Image    *evas_gl_common_image_surface_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
+Evas_GL_Image    *evas_gl_common_image_surface_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
 void              evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
-void              evas_gl_common_image_map_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int npoints, RGBA_Map_Point *p, int smooth, int level);
-void              evas_gl_common_image_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
+void              evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int npoints, RGBA_Map_Point *p, int smooth, int level);
+void              evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
 
 void             *evas_gl_font_texture_new(void *gc, RGBA_Font_Glyph *fg);
 void              evas_gl_font_texture_free(void *);
@@ -508,9 +507,9 @@ void              evas_gl_font_texture_draw(void *gc, void *surface, void *dc, R
 
 Evas_GL_Polygon  *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
 Evas_GL_Polygon  *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
-void              evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
+void              evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
 
-void              evas_gl_common_line_draw(Evas_GL_Context *gc, int x1, int y1, int x2, int y2);
+void              evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
 
 extern void (*glsym_glGenFramebuffers)      (GLsizei a, GLuint *b);
 extern void (*glsym_glBindFramebuffer)      (GLenum a, GLuint b);
index 5eceb64..5be4d4f 100644 (file)
@@ -107,9 +107,9 @@ gl_symbols(void)
 #endif   
 }
 
-static void shader_array_flush(Evas_GL_Context *gc);
+static void shader_array_flush(Evas_Engine_GL_Context *gc);
 
-static Evas_GL_Context *_evas_gl_common_context = NULL;
+static Evas_Engine_GL_Context *_evas_gl_common_context = NULL;
 static Evas_GL_Shared *shared = NULL;
 
 void
@@ -287,11 +287,12 @@ _evas_gl_common_version_check()
 }
 
 static void
-_evas_gl_common_viewport_set(Evas_GL_Context *gc)
+_evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
 {
    GLfloat proj[16];
    int w = 1, h = 1, m = 1, rot = 1, foc = 0;
 
+   EINA_SAFETY_ON_NULL_RETURN(gc);
    foc = gc->foc;
    // surface in pipe 0 will be the same as all pipes
    if ((gc->pipe[0].shader.surface == gc->def_surface) ||
@@ -476,23 +477,23 @@ _evas_gl_common_viewport_set(Evas_GL_Context *gc)
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
 }
 
-Evas_GL_Context *
+Evas_Engine_GL_Context *
 evas_gl_common_context_new(void)
 {
-   Evas_GL_Context *gc;
+   Evas_Engine_GL_Context *gc;
    const char *s;
    int i;
 
 #if 1
    if (_evas_gl_common_context)
      {
-       _evas_gl_common_context->references++;
-       return _evas_gl_common_context;
+        _evas_gl_common_context->references++;
+        return _evas_gl_common_context;
      }
 #endif
    if (!_evas_gl_common_version_check())
      return NULL;
-   gc = calloc(1, sizeof(Evas_GL_Context));
+   gc = calloc(1, sizeof(Evas_Engine_GL_Context));
    if (!gc) return NULL;
 
    gl_symbols();
@@ -753,6 +754,8 @@ evas_gl_common_context_new(void)
         
         glUseProgram(gc->pipe[0].shader.cur_prog);
         GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+        
+        evas_gl_common_shader_program_init_done();
         // in shader:
         // uniform sampler2D tex[8];
         // 
@@ -776,7 +779,7 @@ evas_gl_common_context_new(void)
 }
 
 void
-evas_gl_common_context_free(Evas_GL_Context *gc)
+evas_gl_common_context_free(Evas_Engine_GL_Context *gc)
 {
    int i, j;
    Eina_List *l;
@@ -840,7 +843,7 @@ evas_gl_common_context_free(Evas_GL_Context *gc)
 }
 
 void
-evas_gl_common_context_use(Evas_GL_Context *gc)
+evas_gl_common_context_use(Evas_Engine_GL_Context *gc)
 {
    if (_evas_gl_common_context == gc) return;
    _evas_gl_common_context = gc;
@@ -848,7 +851,7 @@ evas_gl_common_context_use(Evas_GL_Context *gc)
 }
 
 void
-evas_gl_common_context_newframe(Evas_GL_Context *gc)
+evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
 {
    int i;
 
@@ -959,7 +962,7 @@ evas_gl_common_context_newframe(Evas_GL_Context *gc)
 }
 
 void
-evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h, int rot)
+evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot)
 {
    if ((gc->w == w) && (gc->h == h) && (gc->rot == rot)) return;
    evas_gl_common_context_flush(gc);
@@ -971,7 +974,7 @@ evas_gl_common_context_resize(Evas_GL_Context *gc, int w, int h, int rot)
 }
 
 void
-evas_gl_common_context_target_surface_set(Evas_GL_Context *gc,
+evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
                                           Evas_GL_Image *surface)
 {
    if (surface == gc->pipe[0].shader.surface) return;
@@ -1039,7 +1042,7 @@ evas_gl_common_context_target_surface_set(Evas_GL_Context *gc,
 
 
 static inline void
-array_alloc(Evas_GL_Context *gc, int n)
+array_alloc(Evas_Engine_GL_Context *gc, int n)
 {
    gc->havestuff = EINA_TRUE;
    if (gc->pipe[n].array.num <= gc->pipe[n].array.alloc) return;
@@ -1065,7 +1068,7 @@ array_alloc(Evas_GL_Context *gc, int n)
 }
 
 static int
-pipe_region_intersects(Evas_GL_Context *gc, int n,
+pipe_region_intersects(Evas_Engine_GL_Context *gc, int n,
                        int x, int y, int w, int h)
 {
    int i, rx, ry, rw, rh, ii;
@@ -1104,7 +1107,7 @@ pipe_region_intersects(Evas_GL_Context *gc, int n,
 }
 
 static void
-pipe_region_expand(Evas_GL_Context *gc, int n,
+pipe_region_expand(Evas_Engine_GL_Context *gc, int n,
                    int x, int y, int w, int h)
 {
    int x1, y1, x2, y2;
@@ -1132,7 +1135,7 @@ pipe_region_expand(Evas_GL_Context *gc, int n,
 }
 
 static Eina_Bool
-vertex_array_size_check(Evas_GL_Context *gc, int pn, int n)
+vertex_array_size_check(Evas_Engine_GL_Context *gc, int pn, int n)
 {
    return 1;
 // this fixup breaks for expedite test 32. why?
@@ -1145,7 +1148,7 @@ vertex_array_size_check(Evas_GL_Context *gc, int pn, int n)
 }
 
 void
-evas_gl_common_context_line_push(Evas_GL_Context *gc, 
+evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc, 
                                  int x1, int y1, int x2, int y2,
                                  int clip, int cx, int cy, int cw, int ch,
                                  int r, int g, int b, int a)
@@ -1201,7 +1204,7 @@ evas_gl_common_context_line_push(Evas_GL_Context *gc,
 }
 
 void
-evas_gl_common_context_rectangle_push(Evas_GL_Context *gc,
+evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc, 
                                       int x, int y, int w, int h,
                                       int r, int g, int b, int a)
 {
@@ -1348,7 +1351,7 @@ again:
 }
 
 void
-evas_gl_common_context_image_push(Evas_GL_Context *gc,
+evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
                                   Evas_GL_Texture *tex,
                                   double sx, double sy, double sw, double sh,
                                   int x, int y, int w, int h,
@@ -1554,9 +1557,9 @@ again:
    if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
      {
         tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
-        ty1 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
+        ty1 = 1.0 - ((double)(tex->y) + sy) / (double)tex->pt->h;
         tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
-        ty2 = ((double)(tex->y) + sy) / (double)tex->pt->h;
+        ty2 = 1.0 - ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
      }
    else
      {
@@ -1591,7 +1594,7 @@ again:
 
 
 void
-evas_gl_common_context_image_mask_push(Evas_GL_Context *gc,
+evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
                                   Evas_GL_Texture *tex,
                                   Evas_GL_Texture *texm,
                                   double sx, double sy, double sw, double sh,
@@ -1839,7 +1842,7 @@ again:
 
 
 void
-evas_gl_common_context_font_push(Evas_GL_Context *gc,
+evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
                                  Evas_GL_Texture *tex,
                                  double sx, double sy, double sw, double sh,
                                  int x, int y, int w, int h,
@@ -1998,7 +2001,7 @@ again:
 }
 
 void
-evas_gl_common_context_yuv_push(Evas_GL_Context *gc,
+evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
                                 Evas_GL_Texture *tex, 
                                 double sx, double sy, double sw, double sh,
                                 int x, int y, int w, int h,
@@ -2185,7 +2188,7 @@ again:
 }
 
 void
-evas_gl_common_context_image_map_push(Evas_GL_Context *gc,
+evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
                                       Evas_GL_Texture *tex,
                                       int npoints,
                                       RGBA_Map_Point *p,
@@ -2580,13 +2583,13 @@ again:
 }
 
 void
-evas_gl_common_context_flush(Evas_GL_Context *gc)
+evas_gl_common_context_flush(Evas_Engine_GL_Context *gc)
 {
    shader_array_flush(gc);
 }
 
 static void
-shader_array_flush(Evas_GL_Context *gc)
+shader_array_flush(Evas_Engine_GL_Context *gc)
 {
    int i, gw, gh, setclip, cy, fbo = 0, done = 0;
 
index ac0edf8..d867a09 100644 (file)
@@ -3,7 +3,7 @@
 void *
 evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
 {
-   Evas_GL_Context *gc = context;
+   Evas_Engine_GL_Context *gc = context;
    Evas_GL_Texture *tex;
    DATA8 *data;
    int w, h, j, nw;
@@ -99,7 +99,7 @@ evas_gl_font_texture_free(void *tex)
 void
 evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_context, RGBA_Font_Glyph *fg, int x, int y)
 {
-   Evas_GL_Context *gc = context;
+   Evas_Engine_GL_Context *gc = context;
    RGBA_Draw_Context *dc = draw_context;
    Evas_GL_Texture *tex;
    Cutout_Rects *rects;
index e119df9..75e9ce6 100644 (file)
@@ -1,7 +1,7 @@
 #include "evas_gl_private.h"
 
 void
-evas_gl_common_image_all_unload(Evas_GL_Context *gc)
+evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc)
 {
    Eina_List *l;
    Evas_GL_Image *im;
@@ -21,7 +21,7 @@ evas_gl_common_image_all_unload(Evas_GL_Context *gc)
 }
 
 static void
-_evas_gl_image_cache_trim(Evas_GL_Context *gc)
+_evas_gl_image_cache_trim(Evas_Engine_GL_Context *gc)
 {
    int size = evas_common_image_get_cache();
 
@@ -97,7 +97,7 @@ evas_gl_common_image_unref(Evas_GL_Image *im)
 }
 
 Evas_GL_Image *
-evas_gl_common_image_load(Evas_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error)
+evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error)
 {
    Evas_GL_Image        *im;
    RGBA_Image           *im_im;
@@ -142,7 +142,7 @@ evas_gl_common_image_load(Evas_GL_Context *gc, const char *file, const char *key
 }
 
 Evas_GL_Image *
-evas_gl_common_image_new_from_data(Evas_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace)
+evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace)
 {
    Evas_GL_Image *im;
    Eina_List *l;
@@ -196,7 +196,7 @@ evas_gl_common_image_new_from_data(Evas_GL_Context *gc, unsigned int w, unsigned
 }
 
 Evas_GL_Image *
-evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace)
+evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace)
 {
    Evas_GL_Image *im;
 
@@ -237,7 +237,7 @@ evas_gl_common_image_new_from_copied_data(Evas_GL_Context *gc, unsigned int w, u
 }
 
 Evas_GL_Image *
-evas_gl_common_image_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace)
+evas_gl_common_image_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace)
 {
    Evas_GL_Image *im;
 
@@ -425,7 +425,7 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
 }
 
 void
-evas_gl_common_image_cache_flush(Evas_GL_Context *gc)
+evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc)
 {
    _evas_gl_image_cache_trim(gc);
 }
@@ -453,7 +453,7 @@ evas_gl_common_image_free(Evas_GL_Image *im)
 }
 
 Evas_GL_Image *
-evas_gl_common_image_surface_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha)
+evas_gl_common_image_surface_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha)
 {
    Evas_GL_Image *im;
 
@@ -486,7 +486,7 @@ evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, un
 }
 
 static void
-_evas_gl_common_image_update(Evas_GL_Context *gc, Evas_GL_Image *im)
+_evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
 {
    if (!im->im) return;
 /*   
@@ -553,7 +553,7 @@ _evas_gl_common_image_update(Evas_GL_Context *gc, Evas_GL_Image *im)
 }
 
 void
-evas_gl_common_image_map_draw(Evas_GL_Context *gc, Evas_GL_Image *im, 
+evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, 
                               int npoints, RGBA_Map_Point *p, int smooth, int level __UNUSED__)
 {
    RGBA_Draw_Context *dc;
@@ -590,7 +590,7 @@ evas_gl_common_image_map_draw(Evas_GL_Context *gc, Evas_GL_Image *im,
 }
 
 void
-evas_gl_common_image_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth)
+evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth)
 {
    RGBA_Draw_Context *dc;
    Evas_GL_Image *imm;
index 33a3187..a76fa6a 100644 (file)
@@ -1,7 +1,7 @@
 #include "evas_gl_private.h"
 
 void
-evas_gl_common_line_draw(Evas_GL_Context *gc, int x1, int y1, int x2, int y2)
+evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2)
 {
    RGBA_Draw_Context *dc;
    int r, g, b, a;
index fda1400..fa6b312 100644 (file)
@@ -120,7 +120,7 @@ polygon_edge_sorter(const void *a, const void *b)
 }
 
 void
-evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly, int dx, int dy)
+evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int dx, int dy)
 {
    Cutout_Rects *rects;
    Cutout_Rect  *r;
index a5cbece..2714cfd 100644 (file)
@@ -1,7 +1,7 @@
 #include "evas_gl_private.h"
 
 void
-evas_gl_common_rect_draw(Evas_GL_Context *gc, int x, int y, int w, int h)
+evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
 {
    Cutout_Rects *rects;
    Cutout_Rect  *r;
index ac6c22d..1b89aa3 100644 (file)
@@ -556,6 +556,14 @@ evas_gl_common_shader_program_init(Evas_GL_Program *p,
 }
 
 void
+evas_gl_common_shader_program_init_done(void)
+{
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+   glReleaseShaderCompiler();
+#endif   
+}
+
+void
 evas_gl_common_shader_program_shutdown(Evas_GL_Program *p)
 {
    glDeleteShader(p->vert);
index 0810472..6e8246b 100644 (file)
@@ -63,7 +63,7 @@ _nearest_pow2(int num)
 }
 
 static void
-_tex_adjust(Evas_GL_Context *gc, int *w, int *h)
+_tex_adjust(Evas_Engine_GL_Context *gc, int *w, int *h)
 {
    if (gc->shared->info.tex_npo2) return;
    /*if (gc->shared->info.tex_rect) return;*/
@@ -72,7 +72,7 @@ _tex_adjust(Evas_GL_Context *gc, int *w, int *h)
 }
 
 static int
-_tex_round_slot(Evas_GL_Context *gc, int h)
+_tex_round_slot(Evas_Engine_GL_Context *gc, int h)
 {
    if (!gc->shared->info.tex_npo2)
      h = _nearest_pow2(h);
@@ -117,7 +117,7 @@ _tex_sub_2d(int x, int y, int w, int h, int fmt, int type, const void *pix)
 }
 
 static Evas_GL_Texture_Pool *
-_pool_tex_new(Evas_GL_Context *gc, int w, int h, int intformat, GLenum format)
+_pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum format)
 {
    Evas_GL_Texture_Pool *pt;
    
@@ -215,7 +215,7 @@ _pool_tex_alloc(Evas_GL_Texture_Pool *pt, int w, int h __UNUSED__, int *u, int *
 }
 
 static Evas_GL_Texture_Pool *
-_pool_tex_find(Evas_GL_Context *gc, int w, int h, 
+_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h, 
                int intformat, int format, int *u, int *v, 
                Eina_List **l_after, int atlas_w)
 {
@@ -264,7 +264,7 @@ _pool_tex_find(Evas_GL_Context *gc, int w, int h,
 }
 
 Evas_GL_Texture *
-evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im)
+evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
 {
    Evas_GL_Texture *tex;
    Eina_List *l_after = NULL;
@@ -331,7 +331,7 @@ evas_gl_common_texture_new(Evas_GL_Context *gc, RGBA_Image *im)
 }
 
 static Evas_GL_Texture_Pool *
-_pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int format)
+_pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format)
 {
    Evas_GL_Texture_Pool *pt;
    
@@ -396,7 +396,7 @@ _pool_tex_render_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
 }
 
 static Evas_GL_Texture_Pool *
-_pool_tex_native_new(Evas_GL_Context *gc, int w, int h, int intformat, int format, Evas_GL_Image *im)
+_pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format, Evas_GL_Image *im)
 {
    Evas_GL_Texture_Pool *pt;
    
@@ -457,7 +457,7 @@ _pool_tex_native_new(Evas_GL_Context *gc, int w, int h, int intformat, int forma
 }
 
 static Evas_GL_Texture_Pool *
-_pool_tex_dynamic_new(Evas_GL_Context *gc, int w, int h, int intformat, int format)
+_pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format)
 {
    Evas_GL_Texture_Pool *pt = NULL;
    
@@ -696,7 +696,7 @@ pt_unref(Evas_GL_Texture_Pool *pt)
 }
 
 Evas_GL_Texture *
-evas_gl_common_texture_native_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im)
+evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im)
 {
    Evas_GL_Texture *tex;
 
@@ -734,7 +734,7 @@ evas_gl_common_texture_native_new(Evas_GL_Context *gc, unsigned int w, unsigned
 }
 
 Evas_GL_Texture *
-evas_gl_common_texture_render_new(Evas_GL_Context *gc, unsigned int w, unsigned int h, int alpha)
+evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha)
 {
    Evas_GL_Texture *tex;
 
@@ -772,7 +772,7 @@ evas_gl_common_texture_render_new(Evas_GL_Context *gc, unsigned int w, unsigned
 }
 
 Evas_GL_Texture *
-evas_gl_common_texture_dynamic_new(Evas_GL_Context *gc, Evas_GL_Image *im)
+evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
 {
    Evas_GL_Texture *tex;
 
@@ -916,7 +916,7 @@ evas_gl_common_texture_free(Evas_GL_Texture *tex)
 }
 
 Evas_GL_Texture *
-evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels,
+evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels,
                                  unsigned int w, unsigned int h, int fh)
 {
    Evas_GL_Texture *tex;
@@ -973,7 +973,7 @@ evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
 }
 
 Evas_GL_Texture *
-evas_gl_common_texture_yuv_new(Evas_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
+evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
 {
    Evas_GL_Texture *tex;
 
index 2042b4a..13307f7 100644 (file)
@@ -18,13 +18,13 @@ evas_glew_win32_main.c
 
 GL_GLEW_LIBADD = @evas_engine_gl_glew_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la
 
-pkgdir = $(libdir)/evas/modules/engines/gl_glew/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_GL_Glew.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_GL_GLEW
 
+pkgdir = $(libdir)/evas/modules/engines/gl_glew/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES  = $(GL_GLEW_SOURCES)
index d38c4fa..46393fb 100644 (file)
@@ -48,7 +48,7 @@ struct _Evas_GL_Glew_Window
    int              width;
    int              height;
    int              depth;
-   Evas_GL_Context *gl_context;
+   Evas_Engine_GL_Context *gl_context;
    struct {
       int           x1;
       int           y1;
index 4af0ed5..57da21b 100644 (file)
@@ -17,13 +17,13 @@ evas_engine.c
 
 GL_SDL_LIBADD = @evas_engine_gl_sdl_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la 
 
-pkgdir = $(libdir)/evas/modules/engines/gl_sdl/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_GL_SDL.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_GL_SDL
 
+pkgdir = $(libdir)/evas/modules/engines/gl_sdl/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES = $(GL_SDL_SOURCES)
index 36d91b4..7d46720 100644 (file)
@@ -55,7 +55,7 @@ struct _Render_Engine
    Evas_Engine_Info_GL_SDL     *info;
    int                 w, h;
 
-   Evas_GL_Context *gl_context;
+   Evas_Engine_GL_Context *gl_context;
    struct {
       int              redraw : 1;
       int              drew : 1;
index de391da..91cd0d4 100644 (file)
@@ -18,13 +18,13 @@ evas_x_main.c
 
 GL_X11_LIBADD = @evas_engine_gl_x11_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la 
 
-pkgdir = $(libdir)/evas/modules/engines/gl_x11/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_GL_X11.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_GL_X11
 
+pkgdir = $(libdir)/evas/modules/engines/gl_x11/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES = $(GL_X11_SOURCES)
index 8523df4..f943209 100644 (file)
@@ -66,7 +66,8 @@ int      (*glsym_glXWaitVideoSync)   (int a, int b, unsigned int *c) = NULL;
 XID      (*glsym_glXCreatePixmap)    (Display *a, void *b, Pixmap c, const int *d) = NULL;
 void     (*glsym_glXDestroyPixmap)   (Display *a, XID b) = NULL;
 void     (*glsym_glXQueryDrawable)   (Display *a, XID b, int c, unsigned int *d) = NULL;
-void     (*glsym_glxSwapInterval)    (int a) = NULL;
+int      (*glsym_glxSwapIntervalSGI) (int a) = NULL;
+void     (*glsym_glxSwapIntervalEXT) (Display *s, GLXDrawable b, int c) = NULL;
 #endif
 
 static void
@@ -140,10 +141,10 @@ _sym_init(void)
    FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableEXT", glsym_func_void);
    FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableARB", glsym_func_void);
 
-   FINDSYM(glsym_glxSwapInterval, "glxSwapInterval", glsym_func_void);
-   FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalEXT", glsym_func_void);
-   FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalARB", glsym_func_void);
-   FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalSGI", glsym_func_void);
+   FINDSYM(glsym_glxSwapIntervalSGI, "glXSwapIntervalMESA", glsym_func_int);
+   FINDSYM(glsym_glxSwapIntervalSGI, "glXSwapIntervalSGI", glsym_func_int);
+   
+   FINDSYM(glsym_glxSwapIntervalEXT, "glXSwapIntervalEXT", glsym_func_void);
 #endif
 }
 
@@ -668,12 +669,21 @@ eng_output_flush(void *data)
 #ifdef VSYNC_TO_SCREEN   
    if ((re->info->vsync)/* || (1)*/)
      {
-        if (glsym_glxSwapInterval)
+        if (glsym_glxSwapIntervalEXT)
+          {
+             if (!re->vsync)
+               {
+                  if (re->info->vsync) glsym_glxSwapIntervalEXT(re->win->disp, re->win->win, 1);
+                  else glsym_glxSwapIntervalEXT(re->win->disp, re->win->win, 0);
+                  re->vsync = 1;
+               }
+          }
+        if (glsym_glxSwapIntervalSGI)
           {
              if (!re->vsync)
                {
-                  if (re->info->vsync) glsym_glxSwapInterval(1);
-                  else glsym_glxSwapInterval(0);
+                  if (re->info->vsync) glsym_glxSwapIntervalSGI(1);
+                  else glsym_glxSwapIntervalSGI(0);
                   re->vsync = 1;
                }
           }
index 30a0c04..0d63f9d 100644 (file)
@@ -82,7 +82,7 @@ struct _Evas_GL_X11_Window
    int              depth;
    int              alpha;
    int              rot;
-   Evas_GL_Context *gl_context;
+   Evas_Engine_GL_Context *gl_context;
    struct {
       int              redraw : 1;
       int              drew : 1;
index 95437dd..e370e75 100644 (file)
@@ -285,6 +285,7 @@ eng_window_new(Display *disp,
      {
         int i, j,  num;
         GLXFBConfig *fbc;
+        int blacklist = 0;
 
         if (gw->glxwin)
           {
@@ -317,20 +318,99 @@ eng_window_new(Display *disp,
              fprintf(stderr, "renderer: %s\n", renderer);
              fprintf(stderr, "version: %s\n", version);
           }
-        if (strstr((const char*)vendor, "NVIDIA"))
-           // FIXME: also same as tegra2 - maybe check renderer too
-           // 
-           // vendor: NVIDIA Corporation
-           // renderer: NVIDIA Tegra
-           // version: OpenGL ES 2.0
-           // 
-           // vs (for example)
-           // 
-           // vendor: NVIDIA Corporation
-           // renderer: GeForce GT 220/PCI/SSE2
-           // version: 3.2.0 NVIDIA 195.36.24
+        //   examples:
+        // vendor: NVIDIA Corporation
+        // renderer: NVIDIA Tegra
+        // version: OpenGL ES 2.0
+        //   or
+        // vendor: Imagination Technologies
+        // renderer: PowerVR SGX 540
+        // version: OpenGL ES 2.0
+        //   or
+        // vendor: NVIDIA Corporation
+        // renderer: GeForce GT 330M/PCI/SSE2
+        // version: 3.3.0 NVIDIA 256.53
+        //   or
+        // vendor: NVIDIA Corporation
+        // renderer: GeForce GT 220/PCI/SSE2
+        // version: 3.2.0 NVIDIA 195.36.24
+        //   or
+        // vendor: NVIDIA Corporation
+        // renderer: GeForce 8600 GTS/PCI/SSE2
+        // version: 3.3.0 NVIDIA 260.19.36
+        //   or
+        // vendor: ATI Technologies Inc.
+        // renderer: ATI Mobility Radeon HD 4650
+        // version: 3.2.9756 Compatibility Profile Context
+        //   or
+        // vendor: Tungsten Graphics, Inc
+        // renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20100330 DEVELOPMENT x86/MMX/SSE2
+        // version: 2.1 Mesa 7.9-devel
+        //   or
+        // vendor: Advanced Micro Devices, Inc.
+        // renderer: Mesa DRI R600 (RS780 9610) 20090101  TCL DRI2
+        // version: 2.1 Mesa 7.9-devel
+        //   or
+        // vendor: NVIDIA Corporation
+        // renderer: GeForce 9600 GT/PCI/SSE2
+        // version: 3.3.0 NVIDIA 260.19.29
+        //   or
+        // vendor: ATI Technologies Inc.
+        // renderer: ATI Radeon HD 4800 Series
+        // version: 3.3.10237 Compatibility Profile Context
+        //   or
+        // vendor: Advanced Micro Devices, Inc.
+        // renderer: Mesa DRI R600 (RV770 9442) 20090101  TCL DRI2
+        // version: 2.0 Mesa 7.8.2
+        //   or
+        // vendor: Tungsten Graphics, Inc
+        // renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GEM 20100330 DEVELOPMENT 
+        // version: 2.1 Mesa 7.9-devel
+        //   or (bad - software renderer)
+        // vendor: Mesa Project
+        // renderer: Software Rasterizer
+        // version: 2.1 Mesa 7.9-devel
+        //   or (bad - software renderer)
+        // vendor: VMware, Inc.
+        // renderer: Gallium 0.4 on softpipe
+        // version: 2.1 Mesa 7.9-devel
+        
+        if (strstr((const char *)vendor, "Mesa Project"))
+          {
+             if (strstr((const char *)renderer, "Software Rasterizer"))
+                blacklist = 1;
+          }
+        if (strstr((const char *)renderer, "softpipe"))
+           blacklist = 1;
+        if (blacklist)
+          {
+             ERR("OpenGL Driver blacklisted:");
+             ERR("Vendor: %s", (const char *)vendor);
+             ERR("Renderer: %s", (const char *)renderer);
+             ERR("Version: %s", (const char *)version);
+             eng_window_free(gw);
+             return NULL;
+          }
+        if (strstr((const char *)vendor, "NVIDIA"))
           {
-             gw->detected.loose_binding = 1;
+             if (!strstr((const char *)renderer, "NVIDIA Tegra"))
+               {
+                  int v1 = 0, v2 = 0, v3 = 0;
+
+                  if (sscanf((const char *)version, 
+                             "%*s %*s %i.%i.%i",
+                             &v1, &v2, &v3) != 3)
+                    {
+                       v1 = v2 = v3 = 0;
+                       if (sscanf((const char *)version, 
+                                  "%*s %*s %i.%i",
+                                  &v1, &v2) != 2)
+                          v1 = 0;
+                    }
+                  // ALSO as of some nvidia driver version loose binding is
+                  // probably not needed
+                  if (v1 < 195) gw->detected.loose_binding = 1;
+               }
           }
         else
           {
index df92e17..17be2de 100644 (file)
@@ -14,13 +14,13 @@ if BUILD_ENGINE_QUARTZ
 QUARTZ_SOURCES = evas_engine.c
 QUARTZ_LIBADD = @evas_engine_quartz_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/quartz/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Quartz.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_QUARTZ
 
+pkgdir = $(libdir)/evas/modules/engines/quartz/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES = $(QUARTZ_SOURCES)
index c1a1123..024d274 100644 (file)
@@ -77,6 +77,7 @@ static int eng_font_max_ascent_get(void *data, void *font);
 static int eng_font_max_descent_get(void *data, void *font);
 static void eng_font_string_size_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props, int *w, int *h);
 static int eng_font_inset_get(void *data, void *font, const Evas_Text_Props *intl_props);
+static int eng_font_right_inset_get(void *data, void *font, const Evas_Text_Props *intl_props);
 static int eng_font_h_advance_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props);
 static int eng_font_v_advance_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props);
 static int eng_font_char_coords_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
index 47eaf10..1735d7b 100644 (file)
@@ -15,10 +15,10 @@ if BUILD_ENGINE_SOFTWARE_16
 
 SOFTWARE_16_SOURCES = evas_engine.c
 
-pkgdir = $(libdir)/evas/modules/engines/software_16/$(MODULE_ARCH)
 
 if !EVAS_STATIC_BUILD_SOFTWARE_16
 
+pkgdir = $(libdir)/evas/modules/engines/software_16/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(SOFTWARE_16_SOURCES)
 module_la_LIBADD = @EINA_LIBS@ $(top_builddir)/src/lib/libevas.la
index fd657d9..eaec10e 100644 (file)
@@ -517,6 +517,12 @@ eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *tex
 }
 
 static int
+eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
+{
+   return evas_common_font_query_right_inset(font, text_props);
+}
+
+static int
 eng_font_h_advance_get(void *data __UNUSED__, void *font, const Eina_Unicode *text, const Evas_Text_Props *text_props)
 {
    int h, v;
@@ -746,7 +752,8 @@ static Evas_Func func =
      NULL, // eng_image_content_hint_set - software doesn't use it
      NULL, // eng_image_content_hint_get - software doesn't use it
      eng_font_pen_coords_get,
-     eng_font_text_props_info_create
+     eng_font_text_props_info_create,
+     eng_font_right_inset_get
      /* FUTURE software generic calls go here */
 };
 
index c075691..d32019e 100644 (file)
@@ -20,13 +20,13 @@ evas_ddraw_main.cpp
 
 SOFTWARE_16_DDRAW_LIBADD = @evas_engine_software_16_ddraw_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_16_ddraw/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_16_DDraw.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_16_DDRAW
 
+pkgdir = $(libdir)/evas/modules/engines/software_16_ddraw/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
 module_la_SOURCES = $(SOFTWARE_16_DDRAW_SOURCES)
index bcaa15b..5a8dc2f 100644 (file)
@@ -10,13 +10,13 @@ SOFTWARE_SDL_SOURCES = \
 evas_engine.c \
 evas_engine.h
 
-pkgdir = $(libdir)/evas/modules/engines/software_16_sdl/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_SDL_16.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_SDL
 
+pkgdir = $(libdir)/evas/modules/engines/software_16_sdl/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES = $(SOFTWARE_SDL_SOURCES)
index 984b418..d7e39b4 100644 (file)
@@ -22,13 +22,13 @@ evas_wince_gdi_buffer.c
 
 SOFTWARE_16_WINCE_LIBADD = @evas_engine_software_16_wince_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_16_wince/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_16_WinCE.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_16_WINCE
 
+pkgdir = $(libdir)/evas/modules/engines/software_16_wince/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
 module_la_SOURCES = $(SOFTWARE_16_WINCE_SOURCE)
index 979f315..dc24584 100644 (file)
@@ -19,13 +19,13 @@ evas_x_buffer.c
 
 SOFTWARE_16_X11_LIBADD = @evas_engine_software_16_x11_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_16_x11/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_16_X11.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_16_X11
 
+pkgdir = $(libdir)/evas/modules/engines/software_16_x11/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
 module_la_SOURCES = $(SOFTWARE_16_X11_SOURCES)
index 9f100f6..4c48018 100644 (file)
@@ -15,10 +15,10 @@ if BUILD_ENGINE_SOFTWARE_8
 
 SOFTWARE_8_SOURCES = evas_engine.c
 
-pkgdir = $(libdir)/evas/modules/engines/software_8/$(MODULE_ARCH)
 
 if !EVAS_STATIC_BUILD_SOFTWARE_8_X11
 
+pkgdir = $(libdir)/evas/modules/engines/software_8/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(SOFTWARE_8_SOURCES)
 module_la_LIBADD = @EINA_LIBS@ $(top_builddir)/src/lib/libevas.la
index bc8b933..e060cdb 100644 (file)
@@ -574,6 +574,12 @@ eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *tex
 }
 
 static int
+eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
+{
+   return evas_common_font_query_right_inset(font, text_props);
+}
+
+static int
 eng_font_h_advance_get(void *data __UNUSED__, void *font, const Eina_Unicode *text, const Evas_Text_Props *text_props)
 {
    int h, v;
@@ -792,7 +798,8 @@ static Evas_Func func = {
    NULL, // eng_image_content_hint_set - software doesn't use it
    NULL, // eng_image_content_hint_get - software doesn't use it
    eng_font_pen_coords_get,
-   eng_font_text_props_info_create
+   eng_font_text_props_info_create,
+   eng_font_right_inset_get
    /* FUTURE software generic calls go here */
 };
 
index 497fe84..bfb2b9b 100644 (file)
@@ -20,13 +20,13 @@ evas_x_buffer.c
 
 SOFTWARE_8_X11_LIBADD = @evas_engine_software_8_x11_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_8_x11/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_8_X11.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_8_X11
 
+pkgdir = $(libdir)/evas/modules/engines/software_8_x11/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
 module_la_SOURCES = $(SOFTWARE_8_X11_SOURCES)
index 440e291..7a5856e 100644 (file)
@@ -20,13 +20,13 @@ evas_ddraw_main.cpp
 
 SOFTWARE_DDRAW_LIBADD = @evas_engine_software_ddraw_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_ddraw/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_DDraw.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_DDRAW
 
+pkgdir = $(libdir)/evas/modules/engines/software_ddraw/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(SOFTWARE_DDRAW_SOURCES)
 module_la_CXXFLAGS = -fno-rtti -fno-exceptions
index dfebabe..02a60c0 100644 (file)
@@ -20,13 +20,13 @@ evas_gdi_main.c
 
 SOFTWARE_GDI_LIBADD = @evas_engine_software_gdi_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_gdi/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_Gdi.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_GDI
 
+pkgdir = $(libdir)/evas/modules/engines/software_gdi/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(SOFTWARE_GDI_SOURCES)
 module_la_LIBADD = $(top_builddir)/src/lib/libevas.la @EINA_LIBS@ $(SOFTWARE_GDI_LIBADD)
index de7f982..8278969 100644 (file)
@@ -13,10 +13,10 @@ AM_CFLAGS = @WIN32_CFLAGS@
 
 SOFTWARE_GENERIC_SOURCES = evas_engine.c
 
-pkgdir = $(libdir)/evas/modules/engines/software_generic/$(MODULE_ARCH)
 
 if !EVAS_STATIC_BUILD_SOFTWARE_GENERIC
 
+pkgdir = $(libdir)/evas/modules/engines/software_generic/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES  = $(SOFTWARE_GENERIC_SOURCES)
index 2ff188e..f99599f 100644 (file)
@@ -737,6 +737,12 @@ eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *tex
 }
 
 static int
+eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
+{
+   return evas_common_font_query_right_inset(font, text_props);
+}
+
+static int
 eng_font_h_advance_get(void *data __UNUSED__, void *font, const Eina_Unicode *text, const Evas_Text_Props *text_props)
 {
    int h, v;
@@ -971,7 +977,8 @@ static Evas_Func func =
      NULL, // eng_image_content_hint_set - software doesn't use it
      NULL, // eng_image_content_hint_get - software doesn't use it
      eng_font_pen_coords_get,
-     eng_font_text_props_info_create
+     eng_font_text_props_info_create,
+     eng_font_right_inset_get
      /* FUTURE software generic calls go here */
 };
 
index a4202a9..fdbd47c 100644 (file)
@@ -21,13 +21,13 @@ evas_qt_main.cpp
 
 SOFTWARE_QTOPIA_LIBADD = @evas_engine_software_qtopia_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_qtopia/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_Software_Qtopia.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_QTOPIA
 
+pkgdir = $(libdir)/evas/modules/engines/software_qtopia/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 module_la_SOURCES = $(SOFTWARE_QTOPIA_SOURCES)
 module_la_LIBADD = @EINA_LIBS@ $(SOFTWARE_QTOPIA_LIBADD) $(top_builddir)/src/lib/libevas.la
index 4e3e386..57892f6 100644 (file)
@@ -17,13 +17,13 @@ if BUILD_ENGINE_SOFTWARE_SDL
 SOFTWARE_SDL_SOURCES = evas_engine.c
 SOFTWARE_SDL_LIBADD = @evas_engine_software_sdl_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/software_sdl/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_SDL.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_SDL
 
+pkgdir = $(libdir)/evas/modules/engines/software_sdl/$(MODULE_ARCH)
 pkg_LTLIBRARIES = module.la
 
 module_la_SOURCES  = $(SOFTWARE_SDL_SOURCES)
index 7e20f2d..86960b7 100644 (file)
@@ -37,13 +37,12 @@ evas_xcb_main.c
 
 endif
 
-pkgdir = $(libdir)/evas/modules/engines/software_x11/$(MODULE_ARCH)
-
 includes_HEADERS = Evas_Engine_Software_X11.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_SOFTWARE_X11
 
+pkgdir = $(libdir)/evas/modules/engines/software_x11/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
 module_la_SOURCES = $(SOFTWARE_X11_SOURCES)
index 74df4bd..4ad72a7 100644 (file)
@@ -32,13 +32,13 @@ endif
 
 XRENDER_X11_LIBADD = @evas_engine_xrender_xcb_libs@ @evas_engine_xrender_x11_libs@
 
-pkgdir = $(libdir)/evas/modules/engines/xrender_x11/$(MODULE_ARCH)
 
 includes_HEADERS = Evas_Engine_XRender_X11.h
 includesdir = $(includedir)/evas-@VMAJ@
 
 if !EVAS_STATIC_BUILD_XRENDER_X11
 
+pkgdir = $(libdir)/evas/modules/engines/xrender_x11/$(MODULE_ARCH)
 pkg_LTLIBRARIES        = module.la
 
 module_la_SOURCES = $(XRENDER_X11_SOURCES)
index e1ed01d..222bef1 100644 (file)
@@ -2,6 +2,12 @@ MAINTAINERCLEANFILES = Makefile.in
 
 SUBDIRS =
 
+if BUILD_LOADER_BMP
+if !EVAS_STATIC_BUILD_BMP
+SUBDIRS += bmp
+endif
+endif
+
 if BUILD_LOADER_EDB
 if !EVAS_STATIC_BUILD_EDB
 SUBDIRS += edb
@@ -20,6 +26,12 @@ SUBDIRS += gif
 endif
 endif
 
+if BUILD_LOADER_ICO
+if !EVAS_STATIC_BUILD_ICO
+SUBDIRS += ico
+endif
+endif
+
 if BUILD_LOADER_JPEG
 if !EVAS_STATIC_BUILD_JPEG
 SUBDIRS += jpeg
@@ -44,33 +56,27 @@ SUBDIRS += svg
 endif
 endif
 
-if BUILD_LOADER_TIFF
-if !EVAS_STATIC_BUILD_TIFF
-SUBDIRS += tiff
-endif
-endif
-
-if BUILD_LOADER_XPM
-if !EVAS_STATIC_BUILD_XPM
-SUBDIRS += xpm
-endif
-endif
-
-if BUILD_LOADER_BMP
-if !EVAS_STATIC_BUILD_BMP
-SUBDIRS += bmp
-endif
-endif
-
 if BUILD_LOADER_TGA
 if !EVAS_STATIC_BUILD_TGA
 SUBDIRS += tga
 endif
 endif
 
+if BUILD_LOADER_TIFF
+if !EVAS_STATIC_BUILD_TIFF
+SUBDIRS += tiff
+endif
+endif
+
 if BUILD_LOADER_WBMP
 if !EVAS_STATIC_BUILD_WBMP
 SUBDIRS += wbmp
 endif
 endif
 
+if BUILD_LOADER_XPM
+if !EVAS_STATIC_BUILD_XPM
+SUBDIRS += xpm
+endif
+endif
+
index a06d807..465df6f 100644 (file)
@@ -161,6 +161,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key
         if (!read_int(f, &tmp2)) goto close_file;
         important_colors = tmp2; // number of important colors - 0 if all
         if (image_size == 0) image_size = fsize - offset;
+        if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way
      }
    else if (head_size == 108) // Windows 95/NT4 + (v4)
      {
@@ -435,6 +436,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
         if (!read_int(f, &tmp2)) goto close_file;
         important_colors = tmp2; // number of important colors - 0 if all
         if (image_size == 0) image_size = fsize - offset;
+        if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way
      }
    else if (head_size == 108) // Windows 95/NT4 + (v4)
      {
@@ -949,6 +951,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
                }
              else if (bit_count == 32)
                {
+                  int none_zero_alpha = 0;
                   pix = surface;
                   for (y = 0; y < h; y++)
                     {
@@ -959,6 +962,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
                             g = p[1];
                             r = p[2];
                             a = p[3];
+                            if (a) none_zero_alpha = 1;
                             if (!hasa) a = 0xff;
                             *pix = ARGB_JOIN(a, r, g, b);
                             p += 4;
@@ -969,6 +973,17 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
                        if (fix > 0) p += 4 - fix; // align row read
                        if (p >= buffer_end) break;
                     }
+                  if (!none_zero_alpha)
+                    {
+                       ie->flags.alpha = 0;
+                       if (hasa)
+                         {
+                            unsigned int *pixend = pix + (w * h);
+                            
+                            for (pix = surface; pix < pixend; pix++)
+                               A_VAL(pix) = 0xff;
+                         }
+                    }
                }
              else
                goto close_file;