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>
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
-Evas @VERSION@ BETA
+Evas @VERSION@
******************************************************************************
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
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>
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)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
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)
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"
# 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
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,
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])
EVAS_CHECK_IMAGE_LOADER([WBMP], [${want_evas_image_loader_wbmp}])
+EVAS_CHECK_IMAGE_LOADER([ICO], [${want_evas_image_loader_ico}])
#####################################################################
## Cpu based optimizations
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
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"
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
@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
--- /dev/null
+[evas] Rebase is completed.
%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.
%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
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
%{_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)
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"]
)
])
+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],
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);
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);
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;
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
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,
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;
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)
{
size_t file_length;
size_t key_length;
struct stat st;
+ Image_Timestamp tstamp;
assert(cache != NULL);
#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;
#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)
{
{
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)
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);
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
LKU(im->lock_references);
#endif
- if (references == 1)
+ if (references <= 1)
{
if (!(im->flags.dirty))
{
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
(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;
(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;
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;
{
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
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);
+#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"
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;
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 =
{
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.
*
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))
if (o->engine_data)
{
int stride = 0;
-
+
#ifdef EVAS_FRAME_QUEUING
evas_common_pipe_op_image_flush(o->engine_data);
#endif
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
_proxy_subrender(Evas *e, Evas_Object *source)
{
void *ctx;
- Evas_Object *obj2;
+ Evas_Object *obj2, *clip;
int w,h;
if (!source) return;
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,
}
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,
o->cur.opaque_valid = 0;
o->cur.source = NULL;
o->prev = o->cur;
+ o->tmpf_fd = -1;
return o;
}
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);
MAGIC_CHECK_END();
/* free obj */
o->magic = 0;
- EVAS_MEMPOOL_FREE(_mp_obj,o);
+ EVAS_MEMPOOL_FREE(_mp_obj, o);
}
static void
/* 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.
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);
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);
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));
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,
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
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;
unsigned char redraw : 1;
unsigned char changed : 1;
unsigned char content_changed : 1;
+ unsigned char have_ellipsis : 1;
Eina_Bool newline_is_ps : 1;
};
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)
{
int line_no;
int underline_extend;
int have_underline, have_underline2;
- double align;
+ double align, valign;
Eina_Bool align_auto;
};
* @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)
}
if (v_to_l) free(v_to_l);
+#else
+ line = NULL;
#endif
}
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;
{
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,
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);
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);
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;
}
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;
{
c->par->y = last_par->y + last_par->h;
}
+ else
+ {
+ c->par->y = 0;
+ }
}
/* -1 means no wrap */
/* 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)))
{
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))
{
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;
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. */
}
/**
}
/**
+ * @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.
*
* 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.
* 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.
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. */
}
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 */
/* 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,
&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;
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;
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
#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;
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
{
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
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,
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);
}
}
}
+ 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,
{
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
{
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,
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
{
}
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,
/* 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);
(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)
}
}
#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
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 \
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);
#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
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;
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;
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;
# 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
if (!*tmp && (tmp > text)) tmp--;
evas_common_font_glyph_search(fn, &fi, *tmp);
}
+
if (fi->src->current_size != fi->size)
{
FTLOCK();
{
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;
#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
{
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);
}
/* 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;
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 */
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);
# 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);
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) \
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.
}
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);
}
{ "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
// THIS IS DEPRECATED. WILL GO EVENTUALLTY. NO NEED TO SUPPORT ANYMORE
#include "evas_common.h"
+#include <unistd.h>
#ifdef BUILD_PIPE_RENDER
{
RGBA_Font *fn = (RGBA_Font *) _fn;
RGBA_Font_Int *fi;
- size_t char_index;
if (text_props->info)
{
}
#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);
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)
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;
{
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;
{
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
{
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;
}
}
}
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;
}
int dx, dy;
int x, y, w, h;
+ c_tmp.mask = NULL;
c_tmp.use = 1;
c_tmp.x = 0;
c_tmp.y = 0;
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);
#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
#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
#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
#ifdef BUILD_PTHREAD
-#ifndef __USE_GNU
-#define __USE_GNU
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
#endif
# include <pthread.h>
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;
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;
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
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;
struct {
int in_move, in_resize;
} doing;
+
+ unsigned int ref;
unsigned char delete_me;
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
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
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
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)
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)
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);
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 */
};
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
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)
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
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;
-struct _Evas_GL_Context
+struct _Evas_Engine_GL_Context
{
int references;
int w, h;
struct _Evas_GL_Texture_Pool
{
- Evas_GL_Context *gc;
+ Evas_Engine_GL_Context *gc;
GLuint texture, fb;
GLuint intformat, format, dataformat;
int w, h;
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;
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;
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,
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,
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 *);
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);
#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
}
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) ||
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();
glUseProgram(gc->pipe[0].shader.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+
+ evas_gl_common_shader_program_init_done();
// in shader:
// uniform sampler2D tex[8];
//
}
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;
}
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;
}
void
-evas_gl_common_context_newframe(Evas_GL_Context *gc)
+evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
{
int i;
}
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);
}
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;
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;
}
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;
}
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;
}
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?
}
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)
}
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)
{
}
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,
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
{
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,
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,
}
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,
}
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,
}
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;
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;
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;
#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;
}
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();
}
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;
}
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;
}
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;
}
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;
}
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);
}
}
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;
}
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;
/*
}
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;
}
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;
#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;
}
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;
#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;
}
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);
}
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;*/
}
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);
}
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;
}
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)
{
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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)
int width;
int height;
int depth;
- Evas_GL_Context *gl_context;
+ Evas_Engine_GL_Context *gl_context;
struct {
int x1;
int y1;
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)
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;
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)
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
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
}
#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;
}
}
int depth;
int alpha;
int rot;
- Evas_GL_Context *gl_context;
+ Evas_Engine_GL_Context *gl_context;
struct {
int redraw : 1;
int drew : 1;
{
int i, j, num;
GLXFBConfig *fbc;
+ int blacklist = 0;
if (gw->glxwin)
{
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
{
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)
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);
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
}
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;
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 */
};
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)
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)
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)
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)
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
}
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;
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 */
};
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)
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
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)
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)
}
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;
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 */
};
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
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)
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)
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)
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
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
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
+
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)
{
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)
{
}
else if (bit_count == 32)
{
+ int none_zero_alpha = 0;
pix = surface;
for (y = 0; y < h; y++)
{
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;
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;