*.gcov
src/tests/evas_suite
coverage
+/config.guess.cdbs-orig
+/config.sub.cdbs-orig
+/debian/files
+/debian/*.debhelper.log
+/debian/*.substvars
+/debian/libevas-dbg/
+/debian/libevas-dev/
+/debian/libevas-doc/
+/debian/*.debhelper
+/debian/libevas-engines-extras/
+/debian/libevas-engines/
+/debian/libevas/
+/debian/stamp-*
+/debian/tmp/
+/doc/html/
+/doc/latex/
+/doc/man/
+/*-doc.tar.bz2
+/*-doc.tar.bz2.cdbs-config_list
Shilpa Singh <shilpa.singh@samsung.com> <shilpasingh.o@gmail.com>
ChunEon Park <hermet@hermet.pe.kr>
Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
+Seungsoo Woo <om101.woo@samsung.com>
+Youness Alaoui <kakaroto@kakaroto.homelinux.net>
+Jim Kukunas <james.t.kukunas@linux.intel.com>
+EunMi Lee <eunmi15.lee@samsung.com>
Copyright notice for Evas:
-Copyright (C) 2000-2010 Carsten Haitzler and various contributors (see AUTHORS)
+Copyright (C) 2000-2011 Carsten Haitzler and various contributors (see AUTHORS)
All rights reserved.
2011-08-17 Tom Hacohen (TAsn)
* Callbacks: Added priority support to callbacks.
+
+2011-08-23 Cedric Bail
+
+ * Fix evas_object_image_data_convert.
+ * Add YUV 601 input format to evas_object_image_data_convert.
+
+2011-08-29 Cedric Bail
+
+ * Add colorspaces NV12 and MT12 (64 * 32 macro block tiled
+ format, see Linux videodev documentation for more information).
evas-software-sdl.pc.in \
evas.spec.in \
evas.spec \
-m4/ac_attribute.m4 \
+m4/efl_attribute.m4 \
m4/efl_coverage.m4 \
m4/efl_doxygen.m4 \
m4/efl_fnmatch.m4 \
fallback routines as i haven't managed to come up with any arm assembly that
actually can beat the c code (when compiled with all optimizations) in speed.
+--enable-cpu-sse3
+
+this enables sse3 optimizations available in the Intel Pentium4, Core, Xeon,
+and Atom processors, as well as the AMD Athlon64, Phenom, Opteron, and Turion
+processors.
+
--enable-cpu-neon
AC_CANONICAL_HOST
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
MODULE_ARCH="$host_os-$host_cpu"
;;
*)
want_evas_engine_software_16_x11="no"
want_evas_engine_software_16_ddraw="no"
want_evas_engine_software_16_wince="no"
+want_evas_engine_software_16_sdl="no"
want_evas_engine_gl_xlib="no"
want_evas_engine_gl_xcb="no"
want_evas_engine_gl_sdl="no"
want_evas_font_loader_eet="yes"
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
want_fontconfig="no"
want_evas_engine_software_16_wince="yes"
want_evas_image_loader_edb="no"
# Evil library for compilation on Windows CE
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
PKG_CHECK_MODULES([EVIL], [evil])
AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
requirement_evas="evil ${requirement_evas}"
if test "x${want_fontconfig}" = "xyes" -o "x${want_fontconfig}" = "xauto" ; then
PKG_CHECK_MODULES([FONTCONFIG],
- [fontconfig],
+ [fontconfig >= 2.5.0],
[
have_fontconfig="yes"
AC_DEFINE(HAVE_FONTCONFIG, 1, [have fontconfig searching capabilities])
### Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS([unistd.h stdint.h sys/param.h netinet/in.h])
-
EFL_CHECK_PATH_MAX
### Checks for types
+AC_CHECK_TYPES([struct sigaction], [], [],
+ [[#include <signal.h>]])
### Checks for structures
### Checks for compiler characteristics
AC_C_CONST
AC_C_BIGENDIAN
-AC_C___ATTRIBUTE__
AM_PROG_CC_STDC
+EFL_ATTRIBUTE_UNUSED
+EFL_ATTRIBUTE_VECTOR
+EFL_ATTRIBUTE_ALWAYS_INLINE
WIN32_CPPFLAGS=""
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
;;
mingw*)
AC_SUBST(WIN32_CPPFLAGS)
WIN32_CFLAGS=""
-case "${host_os}" in
- cegcc*)
- WIN32_CFLAGS="-mwin32"
- ;;
-esac
AC_SUBST(WIN32_CFLAGS)
### Checks for linker characteristics
lt_enable_auto_import=""
case "${host_os}" in
- mingw* | cegcc*)
+ mingw*)
AC_DEFINE(EFL_EVAS_BUILD, 1, [Define to mention that evas is built])
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
### Checks for library functions
AC_ISC_POSIX
+AC_CHECK_FUNCS([siglongjmp])
# alloca
AC_FUNC_ALLOCA
# dlopen
dlopen_libs=""
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
# managed by evil
AC_DEFINE(HAVE_DLADDR)
;;
EVAS_CHECK_ENGINE([software-16-wince], [${want_evas_engine_software_16_wince}], [no], [Software Windows CE 16 bits])
+EVAS_CHECK_ENGINE([software-16-sdl], [${want_evas_engine_software_16_sdl}], [no], [Software SDL 16 bits])
+
# SDL primitive
sdl_primitive="no"
if test "x$have_evas_engine_software_16_x11" = "xyes" -o "x$have_evas_engine_software_16_x11" = "xstatic"; then
have_evas_engine_software_16="yes"
fi
-if test "x$have_evas_engine_software_sdl" = "xyes" -o "x$have_evas_engine_software_sdl" = "xstatic"; then
+if test "x$have_evas_engine_software_16_sdl" = "xyes" -o "x$have_evas_engine_software_16_sdl" = "xstatic"; then
have_evas_engine_software_16="yes"
fi
if test "x$have_evas_engine_software_16_ddraw" = "xyes" -o "x$have_evas_engine_software_16_ddraw" = "xstatic"; then
dnl So we disable the jpeg saver.
dnl TODO: must find a workaround
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
;;
*)
if test "x${have_evas_image_loader_jpeg}" = "xyes" ; then
)
#######################################
+## SSE3
+build_cpu_sse3="no"
+case $host_cpu in
+ i*86)
+ build_cpu_sse3="yes"
+ ;;
+ x86_64)
+ build_cpu_sse3="yes"
+ ;;
+ amd64)
+ build_cpu_sse3="yes"
+ ;;
+esac
+AC_MSG_CHECKING(whether to build sse3 code)
+AC_ARG_ENABLE(cpu-sse3,
+ AS_HELP_STRING([--enable-cpu-sse3], [enable sse3 code]),
+ [
+ if test "x$enableval" = "xyes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
+ build_cpu_sse3="yes"
+ else
+ AC_MSG_RESULT(no)
+ build_cpu_sse3="no"
+ fi
+ ],
+ [
+ AC_MSG_RESULT($build_cpu_sse3)
+ if test "x$build_cpu_sse3" = "xyes" ; then
+ AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
+ fi
+ ]
+)
+
+
+# as a big warning flag to anyone doing stuff like this...
+# NEVER EVER EVER EVER put **OPTIMIZATION** flags in
+# build flags in makefiles (from configure or anywhere else)
+# EVER as this screws your ability to build 1 binary and
+# cover ALL x86 arch's. This is the HEIGHT of WRONG. If the
+# person building choses to add optimization flags themselves
+# and decide the minimum baseline cpu arch is X then that's
+# their business, but NEVER should it be done here. NEVER.
+# I now have to do this due to the way this sse3 code was done - using
+# intrinsics and "functions" (opcodes) and types that only compile *IF*
+# you compile with -msse3. this ALSO tries to optimize REGULAR c code
+# with sse3 asm.. and this breaks things so badly. so... sse3 will be
+# off until further notice for 32bit x86.
+EVAS_SSE3_CFLAGS=" "
+if test "x$build_cpu_sse3" = "xyes" ; then
+ EVAS_SSE3_CFLAGS="-msse3 "
+# CFLAGS="${CFLAGS} ${EVAS_SSE3_CFLAGS}"
+fi
+
+AC_SUBST(CFLAGS)
+AC_SUBST(EVAS_SSE3_CFLAGS)
+
+#######################################
## ALTIVEC
build_cpu_altivec="no"
case $host_cpu in
echo " Software 16bit X11.........: $have_evas_engine_software_16_x11"
echo " Software 16bit Directdraw..: $have_evas_engine_software_16_ddraw"
echo " Software 16bit WinCE.......: $have_evas_engine_software_16_wince"
-echo " Software 16bit SDL.........: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
+echo " Software 16bit SDL.........: $have_evas_engine_software_16_sdl (primitive: $sdl_primitive)"
echo
echo "Image Loaders:"
echo " BMP.....................: $have_evas_image_loader_bmp"
echo " Fallback C Code.........: $build_cpu_c"
echo " MMX.....................: $build_cpu_mmx"
echo " SSE.....................: $build_cpu_sse"
+echo " SSE3....................: $build_cpu_sse3"
echo " ALTIVEC.................: $build_cpu_altivec"
echo " NEON....................: $build_cpu_neon"
echo " Thread Support..........: $build_pthreads"
+++ /dev/null
-Revision 51480
-Last Changed Rev 51458
+++ /dev/null
-evas (0.9.9.060+svnYYYYMMDD-1) unstable; urgency=low
-
- * Clean up changelog
-
- -- quaker <quaker66@gmail.com> Thu, 22 Apr 2009 18:27:21 +0100
-
-evas (0.9.9.050+svnYYYYMMDD-1) unstable; urgency=low
-
- * Clean up changelog
-
- -- quaker <quaker66@gmail.com> Tue, 21 Apr 2009 19:13:59 +0100
+++ /dev/null
-Source: evas
-Section: libs
-Priority: optional
-Maintainer: Debian Pkg-e Team <pkg-e-devel@lists.alioth.debian.org>
-Uploaders: Albin Tonnerre <albin.tonnerre@gmail.com>,
- Niv Sardi <xaiki@debian.org>, Xavier Oswald <x.oswald@free.fr>,
- Jan Lübbe <jluebbe@debian.org>,
- Nikita V. Youshchenko <yoush@debian.org>
-Build-Depends: debhelper (>= 6), cdbs, libeet-dev (>= 1.1.0), libeina-dev (>= 0.0.2.060+svnYYYYMMDD),
- libfreetype6-dev, libpng12-dev | libpng-dev, libx11-dev, libxrender-dev,
- x11proto-xext-dev, zlib1g, libjpeg62-dev, libtiff4-dev, libgif-dev,
- libfontconfig1-dev, libglu1-mesa-dev, mesa-common-dev, libxpm-dev,
- librsvg2-dev, doxygen, pkg-config, libtool
-Standards-Version: 3.8.1
-Homepage: http://www.enlightenment.org
-
-Package: libevas-svn-01
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libevas-engines (>= 0.9.9.060+svnYYYYMMDD)
-Provides: libevas0
-Conflicts: libevas0
-Description: Enlightenment DR17 advanced canvas library
- Evas is an advanced canvas library, providing six engines for rendering: X11,
- OpenGL (hardware accelerated), DirectFB, the framebuffer, Microsoft Windows
- and Qtopia.
- .
- Due to its simple API, evas can be developed with rapidly, and cleanly.
- .
- This package contains the core library and a set of image loaders and/or savers
- for various formats: eet, gif, jpeg, png, svg, tiff and xpm
-
-Package: libevas-doc
-Architecture: all
-Section: doc
-Depends: ${misc:Depends}
-Enhances: libevas-dev
-Description: Evas API Documentation
- Evas is an advanced canvas library, providing six engines for rendering: X11,
- OpenGL (hardware accelerated), DirectFB, the framebuffer, Microsoft Windows
- and Qtopia.
- Due to its simple API, evas can be developed with rapidly, and cleanly.
- .
- This package provides development documentation (html and manpages) for the
- Evas library.
-
-Package: libevas-dev
-Section: libdevel
-Architecture: any
-Depends: ${misc:Depends}, libevas-svn-01 (= ${binary:Version}), libjpeg62-dev, libx11-dev,
- libfreetype6-dev, libfontconfig1-dev, libeet-dev, pkg-config, libeina-dev (>= 0.0.2.060+svnYYYYMMDD)
-Suggests: libevas-doc
-Description: Enlightenment DR17 advanced canvas library development files
- Evas is an advanced canvas library, providing six engines for rendering: X11,
- OpenGL (hardware accelerated), DirectFB, the framebuffer, Microsoft Windows
- and Qtopia.
- .
- Due to its simple API, evas can be developed with rapidly, and cleanly.
- .
- This package provides headers and static libraries required to develop against
- evas.
-
-Package: libevas-dbg
-Architecture: any
-Section: debug
-Depends: ${misc:Depends}, libevas-svn-01 (= ${binary:Version})
-Priority: extra
-Description: enlightenment advanced canvas library
- Evas is an advanced canvas library, providing six engines for rendering: X11,
- OpenGL (hardware accelerated), DirectFB, the framebuffer, Microsoft Windows
- and Qtopia.
- .
- This package contains unstripped shared libraries. It is provided primarily
- to provide a backtrace with names in a debugger, this makes it somewhat
- easier to interpret core dumps. The libraries are installed in
- /usr/lib/debug and are automatically used by gdb.
-
-Package: libevas-engines
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Conflicts: libevas-0.9.9.050a-engines
-Description: Evas module providingg the framebuffer render engine
- Evas is an advanced canvas library, providing six engines for rendering: X11,
- OpenGL (hardware accelerated), DirectFB, the framebuffer, Microsoft Windows
- and Qtopia.
- Due to its simple API, evas can be developed with rapidly, and cleanly.
- .
- This package contains the following Evas engine modules:
- - buffer
- - software/genenric
- - software/X11
- - xrender/X11
-
-Package: libevas-engines-extras
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libevas-engines
-Conflicts: libevas-0.9.9.050a-engines-extras
-Description: Evas module providing the Xrender engine
- Evas is an advanced canvas library, providing six engines for rendering: X11,
- OpenGL (hardware accelerated), DirectFB, the framebuffer, Microsoft Windows
- and Qtopia.
- Due to its simple API, evas can be developed with rapidly, and cleanly.
- .
- This package contains some extra Evas engine modules:
- - GL/X11
- - Framebuffer
+++ /dev/null
-This package was debianized by Debian Pkg-e Team <pkg-e-devel@lists.alioth.debian.org>
-Sat, 07 Jul 2007 09:29:10 +0000.
-
-It was downloaded from http://download.enlightenment.org/
-
-Upstream Authors:
-
- Enlightenment team <enlightenment-devel@lists.sourceforge.net>
-
-Copyright:
-
- Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS)
- src/modules/engines/fb/evas_fb.h: Copyright (c) 1999 - Carsten Haitzler
- src/modules/engines/fb/evas_fb_main.c: Copyright (c) 1999 - Carsten Haitzler
-
-License:
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies of the Software, its documentation and marketing & publicity
- materials, and acknowledgment shall be given in the documentation,
- materials and software packages that this Software was used.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-On Debian systems, the complete text of the BSD License can be found
-in `/usr/share/common-licenses/BSD'.
+++ /dev/null
-debian/tmp/usr/include/*
-debian/tmp/usr/lib/lib*.a
-debian/tmp/usr/lib/pkgconfig/*
-debian/tmp/usr/lib/libevas.so
+++ /dev/null
-usr/share/doc/libevas-doc
+++ /dev/null
-Document: evas
-Title: Evas Guide
-Author: Carsten Haitzler
-Abstract: This document describes Evas API
- and provides sample C code.
-Section: Programming/C
-
-Format: HTML
-Index: /usr/share/doc/libevas-doc/html/index.html
-Files: /usr/share/doc/libevas-doc/html/*.html
+++ /dev/null
-debian/tmp/usr/lib/evas/modules/engines/fb/*/module.so
-debian/tmp/usr/lib/evas/modules/engines/gl_x11/*/module.so
+++ /dev/null
-debian/tmp/usr/lib/evas/modules/engines/buffer/*/module.so
-debian/tmp/usr/lib/evas/modules/engines/software_generic/*/module.so
-debian/tmp/usr/lib/evas/modules/engines/software_x11/*/module.so
-debian/tmp/usr/lib/evas/modules/engines/xrender_x11/*/module.so
+++ /dev/null
-debian/tmp/usr/lib/libevas-*.so.*
-debian/tmp/usr/lib/evas/modules/loaders/*/*/*.so
-debian/tmp/usr/lib/evas/modules/savers/*/*/*.so
+++ /dev/null
-libevas-ver-pre-svn-01 0 libevas-svn-01 (>= 0.9.9.060+svnYYYYMMDD)
+++ /dev/null
-#!/usr/bin/make -f
-
-include /usr/share/cdbs/1/class/autotools.mk
-include /usr/share/cdbs/1/rules/debhelper.mk
-
-DEB_CONFIGURE_SCRIPT := ./autogen.sh
-DEB_MAKE_CLEAN_TARGET := distclean
-CFLAGS += -fvisibility=hidden -ffast-math
-LDFLAGS += -fvisibility=hidden
-
-DEB_DH_STRIP_ARGS := --dbg-package=libevas-dbg
-
-ifeq (hppa,$(DEB_HOST_ARCH))
- arch_flags += --disable-pthreads
-else
- arch_flags += --enable-pthreads
-endif
-
-ifeq (amd64,$(DEB_HOST_ARCH))
- arch_flags += --enable-cpu-sse
-endif
-
-DEB_CONFIGURE_EXTRA_FLAGS := --enable-strict \
- --enable-fontconfig \
- --enable-software-x11 \
- --enable-fb \
- --enable-buffer \
- --enable-gl-x11 \
- --enable-xrender-x11 \
- --enable-image-loader-gif \
- --enable-image-loader-png \
- --enable-image-loader-jpeg \
- --enable-image-loader-eet \
- --enable-font-loader-eet \
- --enable-image-loader-tiff \
- --enable-image-loader-xpm \
- --enable-image-loader-svg \
- --enable-scale-sample \
- --enable-scale-smooth \
- --enable-convert-yuv \
- --enable-small-dither-mask \
- --enable-convert-8-rgb-332 \
- --enable-convert-8-rgb-666 \
- --enable-convert-8-rgb-232 \
- --enable-convert-8-rgb-222 \
- --enable-convert-8-rgb-221 \
- --enable-convert-8-rgb-121 \
- --enable-convert-8-rgb-111 \
- --enable-convert-16-rgb-565 \
- --enable-convert-16-bgr-565 \
- --enable-convert-16-rgb-555 \
- --enable-convert-16-rgb-444 \
- --enable-convert-16-rgb-ipq \
- --enable-convert-16-rgb-rot-0 \
- --enable-convert-16-rgb-rot-180 \
- --enable-convert-16-rgb-rot-270 \
- --enable-convert-16-rgb-rot-90 \
- --enable-convert-24-rgb-888 \
- --enable-convert-24-bgr-888 \
- --enable-convert-32-rgb-8888 \
- --enable-convert-32-rgbx-8888 \
- --enable-convert-32-bgr-8888 \
- --enable-convert-32-bgrx-8888 \
- --enable-convert-32-rgb-rot-0 \
- --enable-convert-32-rgb-rot-180 \
- --enable-convert-32-rgb-rot-270 \
- --enable-convert-32-rgb-rot-90 \
- --disable-image-loader-edb \
- --enable-doc \
- --disable-rpath $(arch_flags)
-
-build/libevas-doc::
- cd $(DEB_SRCDIR)/doc && make doc
-
-install/libevas-doc::
- mkdir -p debian/libevas-doc/usr/share/doc/libevas-doc
- cp -R $(DEB_SRCDIR)/doc/html debian/libevas-doc/usr/share/doc/libevas-doc/
-
-clean::
- [ ! -f Makefile ] || make distclean
- rm -f evas-*.tar.bz2 evas-*.cdbs-config_list
+evas (1.0.0.001+svn.63811slp2+build01) unstable; urgency=low
+
+ * Merge with upstream
+ * Git: 165.213.180.234:/slp/pkgs/e/evas
+ * Tag: evas_1.0.0.001+svn.63811slp2+build01
+
+ -- Mike McCormack <mj.mccormack@samsung.com> Wed, 05 Oct 2011 14:39:09 +0900
+
evas (1.0.0.001+svn.62695slp2+build32) unstable; urgency=low
* Package Upload.
Source: evas
Section: libs
Priority: optional
-Maintainer: Jaehwan Kim <jae.hwan.kim@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Doyoun Kang <doyoun.kang@samsung.com>, YoungHoon Jung <yhoon.jung@samsung.com>, Myungjae Lee <mjae.lee@samsung.com>, Juyung Seo <juyung.seo@samsung.com>, Gwanglim Lee <gl77.lee@samsung.com>, Jeonghyun Yun <jh0506.yun@samsung.com>, Seokjae Jeong <seok.j.jeong@samsung.com>, MyoungWoon Kim <myoungwoon.kim@samsung.com>, ChunEon Park <chuneon.park@samsung.com>, Hyoyoung Chang <hyoyoung.chang@samsung.com>, WooHyun Jung <wh0705.jung@samsung.com>, Gwangyeong Mun <kk.moon@samsung.com>, Jiyoun Park <jy0703.park@samsung.com>, Shinwoo Kim <cinoo.kim@samsung.com>
-Original-Maintainer: Debian Pkg-e Team <pkg-e-devel@lists.alioth.debian.org>
-Uploaders: Albin Tonnerre <albin.tonnerre@gmail.com>,
- Niv Sardi <xaiki@debian.org>, Xavier Oswald <x.oswald@free.fr>,
- Jan Lübbe <jluebbe@debian.org>,
- Nikita V. Youshchenko <yoush@debian.org>
-Build-Depends: debhelper (>= 6), cdbs, libeet-dev (>= 1.1.0), libeina-dev (>= 0.0.2.060+svn20100304),
- libfreetype6-dev, libpng12-dev | libpng-dev, libx11-dev, libxrender-dev,
- x11proto-xext-dev, zlib1g, libjpeg7-dev,
- libfontconfig1-dev, libxpm-dev,
- doxygen, pkg-config, libtool, libxext-dev, opengl-es-dev, libfribidi-dev, libharfbuzz-dev,
- libgif-dev, libsm-dev
+Maintainer: Jaehwan Kim <jae.hwan.kim@samsung.com>,
+ Sangjin Lee <lsj119@samsung.com>,
+ Doyoun Kang <doyoun.kang@samsung.com>,
+ YoungHoon Jung <yhoon.jung@samsung.com>,
+ Myungjae Lee <mjae.lee@samsung.com>,
+ Juyung Seo <juyung.seo@samsung.com>,
+ Gwanglim Lee <gl77.lee@samsung.com>,
+ Jeonghyun Yun <jh0506.yun@samsung.com>,
+ Seokjae Jeong <seok.j.jeong@samsung.com>,
+ MyoungWoon Kim <myoungwoon.kim@samsung.com>,
+ ChunEon Park <chuneon.park@samsung.com>,
+ Hyoyoung Chang <hyoyoung.chang@samsung.com>,
+ WooHyun Jung <wh0705.jung@samsung.com>,
+ Gwangyeong Mun <kk.moon@samsung.com>,
+ Jiyoun Park <jy0703.park@samsung.com>,
+ Shinwoo Kim <cinoo.kim@samsung.com>,
+ Mike McCormack <mj.mccormack@samsung.com>
+Build-Depends: debhelper (>= 6),
+ cdbs,
+ libeet-dev (>= 1.1.0),
+ libeina-dev (>= 0.0.2.060+svn20100304),
+ libfreetype6-dev,
+ libpng12-dev | libpng-dev,
+ libx11-dev,
+ libxrender-dev,
+ x11proto-xext-dev,
+ zlib1g,
+ libjpeg7-dev,
+ libfontconfig1-dev,
+ libxpm-dev,
+ doxygen,
+ pkg-config,
+ libtool,
+ libxext-dev,
+ opengl-es-dev,
+ libfribidi-dev,
+ libharfbuzz-dev,
+ libgif-dev,
+ libsm-dev
Standards-Version: 3.8.1
Homepage: http://www.enlightenment.org
--enable-gl-flavor-gles \
--enable-gles-variety-sgx
-build/libevas-doc::
- cd $(DEB_SRCDIR)/doc && make doc
+#build/libevas-doc::
+# cd $(DEB_SRCDIR)/doc && make doc
install::
ifeq (i386,$(DEB_HOST_ARCH))
cp -f $(DEB_SRCDIR)/debian/libevas-engines-extras.install.default $(DEB_SRCDIR)/debian/libevas-engines-extras.install
endif
-install/libevas-doc::
- mkdir -p debian/libevas-doc/usr/share/doc/libevas-doc
- cp -R $(DEB_SRCDIR)/doc/html debian/libevas-doc/usr/share/doc/libevas-doc/
+#install/libevas-doc::
+# mkdir -p debian/libevas-doc/usr/share/doc/libevas-doc
+# cp -R $(DEB_SRCDIR)/doc/html debian/libevas-doc/usr/share/doc/libevas-doc/
clean::
[ ! -f Makefile ] || make distclean
%package module_engine_software_xcb
Summary: Software XCB X11 rendering engine module for Evas
Group: System Environment/Libraries
-BuildRequires: xcb-devel
+BuildRequires: libxcb-devel
Requires: evas-module_engine_software_generic
Requires: evas
%description module_engine_software_xcb
+++ /dev/null
-dnl Copyright (C) 2004-2008 Kim Woelders
-dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
-dnl That code is public domain and can be freely used or copied.
-dnl Originally snatched from somewhere...
-
-dnl Macro for checking if the compiler supports __attribute__
-
-dnl Usage: AC_C___ATTRIBUTE__
-dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
-dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
-dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
-dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
-dnl defined to nothing.
-
-AC_DEFUN([AC_C___ATTRIBUTE__],
-[
-
-AC_MSG_CHECKING([for __attribute__])
-
-AC_CACHE_VAL([ac_cv___attribute__],
- [AC_TRY_COMPILE(
- [
-#include <stdlib.h>
-
-int func(int x);
-int foo(int x __attribute__ ((unused)))
-{
- exit(1);
-}
- ],
- [],
- [ac_cv___attribute__="yes"],
- [ac_cv___attribute__="no"]
- )])
-
-AC_MSG_RESULT($ac_cv___attribute__)
-
-if test "x${ac_cv___attribute__}" = "xyes" ; then
- AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
- AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
- else
- AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
-fi
-
-])
-
-dnl End of ac_attribute.m4
])
+
+dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+
+AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_SDL],
+[
+
+requirement=""
+have_dep="no"
+evas_engine_[]$1[]_cflags=""
+evas_engine_[]$1[]_libs=""
+
+PKG_CHECK_MODULES([SDL],
+ [sdl >= 1.2.0],
+ [
+ have_dep="yes"
+ requirement="sdl"
+ evas_engine_[]$1[]_cflags="${SDL_CFLAGS}"
+ evas_engine_[]$1[]_libs="${SDL_LIBS}"
+ ]
+)
+
+AC_SUBST([evas_engine_$1_cflags])
+AC_SUBST([evas_engine_$1_libs])
+
+if test "x$3" = "xstatic" ; then
+ requirement_evas="${requirement} ${requirement_evas}"
+fi
+
+if test "x${have_dep}" = "xyes" ; then
+ m4_default([$4], [:])
+else
+ m4_default([$5], [:])
+fi
+
+])
+
dnl use: EVAS_CHECK_ENGINE_DEP_GL_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_SDL],
+++ /dev/null
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 4 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
@author Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@@samsung.com> <myoungwoon@@gmail.com>
@author Thierry el Borgi <thierry@@substantiel.fr>
@author ChunEon Park <hermet@@hermet.pe.kr>
+@author Christopher 'devilhorns' Michael <cpmichael1@comcast.net>
+@author Seungsoo Woo <om101.woo@samsung.com>
Please contact <enlightenment-devel@lists.sourceforge.net> to get in
contact with the developers and maintainers.
* More Evas object event types - see evas_object_event_callback_add():
*/
EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanims in Evas that throw out original image data) */
+ EVAS_CALLBACK_TOUCH, /**< Touch Event */
EVAS_CALLBACK_LAST /**< kept as last element/sentinel -- not really an event */
} Evas_Callback_Type; /**< The types of events triggering a callback */
} Evas_Event_Flags; /**< Flags for Events */
/**
+ * State of Evas_Coord_Touch_Point
+ */
+typedef enum _Evas_Touch_Point_State
+{
+ EVAS_TOUCH_POINT_DOWN, /**< Touch point is pressed down */
+ EVAS_TOUCH_POINT_UP, /**< Touch point is released */
+ EVAS_TOUCH_POINT_MOVE, /**< Touch point is moved */
+ EVAS_TOUCH_POINT_STILL, /**< Touch point is not moved after pressed */
+ EVAS_TOUCH_POINT_CANCEL /**< Touch point is calcelled */
+} Evas_Touch_Point_State;
+
+/**
+ * Types for Evas_Touch_Event
+ */
+typedef enum _Evas_Event_Touch_Type
+{
+ EVAS_EVENT_TOUCH_BEGIN, /**< Begin touch event with pressed new touch point */
+ EVAS_EVENT_TOUCH_END, /**< End touch event with released touch point */
+ EVAS_EVENT_TOUCH_MOVE, /**< Any touch point in the touch_points list is moved */
+ EVAS_EVENT_TOUCH_CANCEL /**< Touch event is cancelled */
+} Evas_Event_Touch_Type;
+
+/**
* Flags for Font Hinting
* @ingroup Evas_Font_Group
*/
EVAS_COLORSPACE_YCBCR422P709_PL,/**< YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */
EVAS_COLORSPACE_RGB565_A5P, /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
EVAS_COLORSPACE_GRY8, /**< 8bit grayscale */
- EVAS_COLORSPACE_YCBCR422601_PL /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
+ EVAS_COLORSPACE_YCBCR422601_PL, /**< YCbCr 4:2:2, ITU.BT-601 specifications. The data poitned to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */
+ EVAS_COLORSPACE_YCBCR420NV12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */
+ EVAS_COLORSPACE_YCBCR420TM12601_PL, /**< YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */
} Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
/**
typedef struct _Evas_Coord_Point Evas_Coord_Point; /**< Evas_Coord point */
typedef struct _Evas_Coord_Precision_Point Evas_Coord_Precision_Point; /**< Evas_Coord point with sub-pixel precision */
+typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point; /**< Evas_Coord point with touch type and id */
typedef struct _Evas_Position Evas_Position; /**< associates given point in Canvas and Output */
typedef struct _Evas_Precision_Position Evas_Precision_Position; /**< associates given point in Canvas and Output, with sub-pixel precision */
typedef struct _Evas_Lock Evas_Lock; /**< An opaque type containing information on which lock keys are registered in an Evas canvas */
typedef struct _Evas_Smart Evas_Smart; /**< An Evas Smart Object handle */
typedef struct _Evas_Native_Surface Evas_Native_Surface; /**< A generic datatype for engine specific native surface information */
+
+ /**
+ * @typedef Evas_Video_Surface
+ *
+ * A generic datatype for video specific surface information
+ * @see evas_object_image_video_surface_set
+ * @see evas_object_image_video_surface_get
+ * @since 1.1.0
+ */
+typedef struct _Evas_Video_Surface Evas_Video_Surface;
+
typedef unsigned long long Evas_Modifier_Mask; /**< An Evas modifier mask type */
typedef int Evas_Coord;
double xsub, ysub;
};
+struct _Evas_Coord_Touch_Point
+{
+ Evas_Coord x, y;
+ int id; /**< id in order to distinguish each point */
+ Evas_Touch_Point_State state;
+};
+
struct _Evas_Position
{
Evas_Point output;
typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down; /**< Event structure for #EVAS_CALLBACK_KEY_DOWN event callbacks */
typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up; /**< Event structure for #EVAS_CALLBACK_KEY_UP event callbacks */
typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure for #EVAS_CALLBACK_HOLD event callbacks */
+typedef struct _Evas_Event_Touch Evas_Event_Touch; /**< Event structure for #EVAS_CALLBACK_TOUCH event callbacks */
typedef enum _Evas_Load_Error
{
} data;
};
+/**
+ * @def EVAS_VIDEO_SURFACE_VERSION
+ * Magic version number to know what the video surf struct looks like
+ * @since 1.1.0
+ */
+#define EVAS_VIDEO_SURFACE_VERSION 1
+
+typedef void (*Evas_Video_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface);
+typedef void (*Evas_Video_Coord_Cb)(void *data, Evas_Object *obj, const Evas_Video_Surface *surface, Evas_Coord a, Evas_Coord b);
+
+struct _Evas_Video_Surface
+{
+ int version;
+
+ Evas_Video_Coord_Cb move; /**< Move the video surface to this position */
+ Evas_Video_Coord_Cb resize; /**< Resize the video surface to that size */
+ Evas_Video_Cb show; /**< Show the video overlay surface */
+ Evas_Video_Cb hide; /**< Hide the video overlay surface */
+ Evas_Video_Cb update_pixels; /**< Please update the Evas_Object_Image pixels when called */
+
+ Evas_Object *parent;
+ void *data;
+};
+
#define EVAS_LAYER_MIN -32768 /**< bottom-most layer number */
#define EVAS_LAYER_MAX 32767 /**< top-most layer number */
Evas_Device *dev;
};
+struct _Evas_Event_Touch /** Touch event */
+{
+ Eina_List *points; /**< Evas_Coord_Touch_Point list */
+ Evas_Modifier *modifiers;
+ unsigned int timestamp;
+ Evas_Event_Touch_Type type; /**< Type for Evas_Event_Touch */
+};
+
/**
* How the mouse pointer should be handled by Evas.
*
* @return The init counter value.
*
* This function initializes Evas and increments a counter of the
- * number of calls to it. It returs the new counter's value.
+ * number of calls to it. It returns the new counter's value.
*
* @see evas_shutdown().
*
* @param a The alpha component of the given color.
*
* @see evas_object_color_get() (for an example)
+ * @note These color values are expected to be premultiplied by @p a.
*
* @ingroup Evas_Object_Group_Basic
*/
*
* Retrieves the “main” color's RGB component (and alpha channel)
* values, <b>which range from 0 to 255</b>. For the alpha channel,
- * which defines the object's transparency level, the former value
- * means totally trasparent, while the latter means opaque.
+ * which defines the object's transparency level, 0 means totally
+ * trasparent, while 255 means opaque. These color values are
+ * premultiplied by the alpha value.
*
* Usually you’ll use this attribute for text and rectangle objects,
* where the “main” color is their unique one. If set for objects
EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
/**
+ * Set the video surface linked to a given image of the canvas
+ *
+ * @param obj The given canvas pointer.
+ * @param surf The new video surface.
+ * @since 1.1.0
+ *
+ * This function link a video surface to a given canvas image.
+ *
+ */
+EAPI void evas_object_image_video_surface_set (Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1, 2);
+
+/**
+ * Get the video surface linekd to a given image of the canvas
+ *
+ * @param obj The given canvas pointer.
+ * @return The video surface of the given canvas image.
+ * @since 1.1.0
+ *
+ * This function returns the video surface linked to a given canvas image.
+ *
+ */
+EAPI const Evas_Video_Surface *evas_object_image_video_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
+
+/**
* Set the scale hint of a given image of the canvas.
*
* @param obj The given image object pointer.
* @endcode
*
* @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get()
+ * @see evas_object_image_animated_frame_count_get()
* @see evas_object_image_animated_loop_type_get()
* @see evas_object_image_animated_loop_count_get()
* @see evas_object_image_animated_frame_duration_get()
* This returns total number of frames the image object supports (if animated)
*
* @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get()
+ * @see evas_object_image_animated_frame_count_get()
* @see evas_object_image_animated_loop_type_get()
* @see evas_object_image_animated_loop_count_get()
* @see evas_object_image_animated_frame_duration_get()
* @since 1.1.0
*/
EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
-EINA_DEPRECATED EAPI int evas_object_image_animated_frame_num_get(const Evas_Object *obj);
/**
* Get the kind of looping the image object does.
* The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
*
* @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get()
+ * @see evas_object_image_animated_frame_count_get()
* @see evas_object_image_animated_loop_type_get()
* @see evas_object_image_animated_loop_count_get()
* @see evas_object_image_animated_frame_duration_get()
* the number of times it loops).
*
* @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get()
+ * @see evas_object_image_animated_frame_count_get()
* @see evas_object_image_animated_loop_type_get()
* @see evas_object_image_animated_loop_count_get()
* @see evas_object_image_animated_frame_duration_get()
* frame2's duration
*
* @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get()
+ * @see evas_object_image_animated_frame_count_get()
* @see evas_object_image_animated_loop_type_get()
* @see evas_object_image_animated_loop_count_get()
* @see evas_object_image_animated_frame_duration_get()
* frame.
*
* @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get()
+ * @see evas_object_image_animated_frame_count_get()
* @see evas_object_image_animated_loop_type_get()
* @see evas_object_image_animated_loop_count_get()
* @see evas_object_image_animated_frame_duration_get()
EAPI void evas_smart_objects_calculate (Evas *e);
/**
+ * This gets the internal counter that counts the number of smart calculations
+ *
+ * @param e The canvas to get the calculate counter from
+ *
+ * Whenever evas performs smart object calculations on the whole canvas
+ * it increments a counter by 1. This is the smart object calculate counter
+ * that this function returns the value of. It starts at the value of 0 and
+ * will increase (and eventually wrap around to negative values and so on) by
+ * 1 every time objects are calculated. You can use this counter to ensure
+ * you dont re-do calculations withint the same calculation generation/run
+ * if the calculations maybe cause self-feeding effects.
+ *
+ * @ingroup Evas_Smart_Object_Group
+ * @since 1.1
+ */
+EAPI int evas_smart_objects_calculate_count_get (const Evas *e);
+
+/**
* Moves all children objects of a given smart object relative to a
* given offset.
*
ie = cache->func.alloc();
if (!ie)
{
- *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
- return NULL;
+ *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+ return NULL;
}
ie->cache = cache;
if (hkey) ie->cache_key = eina_stringshare_add(hkey);
static void
_evas_cache_image_entry_surface_alloc__locked(Evas_Cache_Image *cache,
- Image_Entry *ie,
- unsigned int wmin,
+ Image_Entry *ie,
+ unsigned int wmin,
unsigned int hmin)
{
if ((ie->allocated.w == wmin) && (ie->allocated.h == hmin)) return;
Evas_Cache_Target *tg;
if (ie->flags.preload_done) return 0;
+
tg = malloc(sizeof (Evas_Cache_Target));
if (!tg) return 0;
eina_hash_foreach(cache->activ, _evas_cache_image_free_cb, &delete_list);
while (delete_list)
{
- _evas_cache_image_entry_delete(cache, eina_list_data_get(delete_list));
- delete_list = eina_list_remove_list(delete_list, delete_list);
+ _evas_cache_image_entry_delete(cache, eina_list_data_get(delete_list));
+ delete_list = eina_list_remove_list(delete_list, delete_list);
}
#ifdef BUILD_ASYNC_PRELOAD
const char *ckey = "(null)";
char *hkey;
Image_Entry *im;
- Evas_Image_Load_Opts prevent = { 0, 0, 0, 0, { 0, 0, 0, 0 }, 0 };
+ Evas_Image_Load_Opts prevent = { 0, 0.0, 0, 0, 0, { 0, 0, 0, 0 }, EINA_FALSE };
size_t size;
int stat_done = 0, stat_failed = 0;
size_t file_length;
if ((!file) || ((!file) && (!key)))
{
- *error = EVAS_LOAD_ERROR_GENERIC;
- return NULL;
+ *error = EVAS_LOAD_ERROR_GENERIC;
+ return NULL;
}
/* generate hkey from file+key+load opts */
if (lo->orientation)
{
hkey[size] = '/';
+ size += 1;
hkey[size] = 'o';
- size += 2;
+ size += 1;
}
}
hkey[size] = '\0';
#ifdef EVAS_FRAME_QUEUING
LKU(im->lock_references);
#endif
-
+
cache = im->cache;
if (references == 0)
LKU(im->ref_fq_del);
return;
}
- LKU(im->ref_fq_add);
- LKU(im->ref_fq_del);
+ LKU(im->ref_fq_add);
+ LKU(im->ref_fq_del);
#endif
#ifdef BUILD_ASYNC_PRELOAD
#ifdef BUILD_ASYNC_PRELOAD
LKU(im->lock);
#endif
- return;
+ return;
}
im->cache->func.destructor(im);
#ifdef BUILD_ASYNC_PRELOAD
if ((im->flags.loaded) && (img->image.data))
{
- evas_object_inform_call_image_preloaded((Evas_Object *)target);
- return;
+ evas_object_inform_call_image_preloaded((Evas_Object *)target);
+ return;
}
im->flags.loaded = 0;
if (!_evas_cache_image_entry_preload_add(im, target))
{
#ifdef CACHEDUMP
_dump_cache(cache);
-#endif
+#endif
if (cache->limit == (unsigned int)-1) return -1;
while ((cache->lru) && (cache->limit < (unsigned int)cache->usage))
evas_stack.c \
evas_async_events.c \
evas_stats.c \
+evas_touch_events.c \
evas_map.c \
evas_gl.c
if (!obj->no_propagate)
{
if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
- (type <= EVAS_CALLBACK_KEY_UP))
+ ((type <= EVAS_CALLBACK_KEY_UP) || (type == EVAS_CALLBACK_TOUCH)))
evas_object_event_callback_call(obj->smart.parent, type, event_info);
}
}
_evas_event_havemap_adjust(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed)
{
if (obj->smart.parent)
- _evas_event_havemap_adjust(obj->smart.parent, x, y, mouse_grabbed);
+ _evas_event_havemap_adjust(obj->smart.parent, x, y, mouse_grabbed);
if ((!obj->cur.map) || (!obj->cur.map->count == 4) || (!obj->cur.usemap))
- return;
+ return;
if (obj->cur.map)
{
const void *data;
EINA_LIST_FOREACH(list, l, data)
- new_l = eina_list_append(new_l, data);
+ new_l = eina_list_append(new_l, data);
return new_l;
}
/* public functions */
e->last_mouse_down_counter++;
_evas_post_event_callback_call(e);
_evas_unwalk(e);
+
+ /* process mouse down for touch */
+ _evas_event_touch_down(e, e->pointer.x, e->pointer.y, 0, timestamp);
}
static int
{
obj->mouse_in = 0;
if (e->events_frozen <= 0)
- evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
}
}
if (e->delete_me) break;
{
obj_itr->mouse_in = 1;
if (e->events_frozen <= 0)
- evas_object_event_callback_call(obj_itr, EVAS_CALLBACK_MOUSE_IN, &ev_in);
+ evas_object_event_callback_call(obj_itr, EVAS_CALLBACK_MOUSE_IN, &ev_in);
}
}
if (e->delete_me) break;
eina_list_free(ins);
}
if (e->pointer.inside)
- evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
+ evas_event_feed_mouse_move(e, e->pointer.x, e->pointer.y, timestamp, data);
return post_called;
}
ERR("BUG? e->pointer.mouse_grabbed (=%d) < 0!",
e->pointer.mouse_grabbed);
}
- /* don't need this anymore - havent actually triggered this for a long
- * time and this also doesn't account for multitouch, so leave here if we
- * ever find bugs again so we can turn it on, but otherwise.. dont use this
- if ((e->pointer.button == 0) && (e->pointer.mouse_grabbed != 0))
- {
- INF("restore to 0 grabs (from %i)", e->pointer.mouse_grabbed);
- e->pointer.mouse_grabbed = 0;
- }
- */
+/* don't need this anymore - havent actually triggered this for a long
+ * time and this also doesn't account for multitouch, so leave here if we
+ * ever find bugs again so we can turn it on, but otherwise.. dont use this
+ if ((e->pointer.button == 0) && (e->pointer.mouse_grabbed != 0))
+ {
+ INF("restore to 0 grabs (from %i)", e->pointer.mouse_grabbed);
+ e->pointer.mouse_grabbed = 0;
+ }
+ */
_evas_unwalk(e);
+
+ /* process mouse up for touch */
+ _evas_event_touch_up(e, e->pointer.x, e->pointer.y, 0, timestamp);
}
EAPI void
evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data)
{
int px, py;
- //// Evas_Coord pcx, pcy;
+//// Evas_Coord pcx, pcy;
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
return;
px = e->pointer.x;
py = e->pointer.y;
- //// pcx = e->pointer.canvas_x;
- //// pcy = e->pointer.canvas_y;
+//// pcx = e->pointer.canvas_x;
+//// pcy = e->pointer.canvas_y;
if (e->events_frozen > 0) return;
e->last_timestamp = timestamp;
e->pointer.x = x;
e->pointer.y = y;
- //// e->pointer.canvas_x = x;
- //// e->pointer.canvas_y = y;
- //// e->pointer.canvas_x = evas_coord_screen_x_to_world(e, x);
- //// e->pointer.canvas_y = evas_coord_screen_y_to_world(e, y);
+//// e->pointer.canvas_x = x;
+//// e->pointer.canvas_y = y;
+//// e->pointer.canvas_x = evas_coord_screen_x_to_world(e, x);
+//// e->pointer.canvas_y = evas_coord_screen_y_to_world(e, y);
if ((!e->pointer.inside) && (e->pointer.mouse_grabbed == 0)) return;
_evas_walk(e);
/* if our mouse button is grabbed to any objects */
if (!obj->delete_me)
{
if (e->events_frozen <= 0)
- evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
}
}
}
// evas_object_clip_recalc(obj);
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
((evas_object_clippers_is_visible(obj)) ||
- (obj->mouse_grabbed)) &&
+ (obj->mouse_grabbed)) &&
(eina_list_data_find(ins, obj)) &&
(!evas_event_passes_through(obj)) &&
(!obj->clip.clipees) &&
ev2.canvas.y = e->pointer.y;
_evas_event_havemap_adjust(obj, &ev2.canvas.x, &ev2.canvas.y, obj->mouse_grabbed);
if (e->events_frozen <= 0)
- evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2);
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev2);
}
}
if (e->delete_me) break;
_evas_post_event_callback_call(e);
}
_evas_unwalk(e);
+
+ /* process mouse move for touch */
+ _evas_event_touch_move(e, e->pointer.x, e->pointer.y, 0, timestamp);
}
EAPI void
{
obj->mouse_in = 1;
if (e->events_frozen <= 0)
- evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_IN, &ev);
}
}
if (e->delete_me) break;
if (!obj->delete_me)
{
if (e->events_frozen <= 0)
- evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
}
}
if (e->delete_me) break;
if (copy) eina_list_free(copy);
_evas_post_event_callback_call(e);
_evas_unwalk(e);
+
+ /* process multi down for touch */
+ _evas_event_touch_down(e, x, y, d, timestamp);
}
EAPI void
}
if (copy) copy = eina_list_free(copy);
if ((e->pointer.mouse_grabbed == 0) && !_post_up_handle(e, timestamp, data))
- _evas_post_event_callback_call(e);
+ _evas_post_event_callback_call(e);
_evas_unwalk(e);
+
+ /* process multi up for touch */
+ _evas_event_touch_up(e, x, y, d, timestamp);
}
EAPI void
// evas_object_clip_recalc(obj);
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
((evas_object_clippers_is_visible(obj)) ||
- (obj->mouse_grabbed)) &&
+ (obj->mouse_grabbed)) &&
(eina_list_data_find(ins, obj)) &&
(!evas_event_passes_through(obj)) &&
(!obj->clip.clipees) &&
_evas_post_event_callback_call(e);
}
_evas_unwalk(e);
+
+ /* process multi move for touch */
+ _evas_event_touch_move(e, x, y, d, timestamp);
}
EAPI void
{
Evas_Event_Multi_Down *ev = event_copy;
evas_event_feed_multi_down(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
- break;
+ break;
}
case EVAS_CALLBACK_MULTI_UP:
{
Evas_Font_Description *fdesc;
fdesc = calloc(1, sizeof(*fdesc));
fdesc->ref = 1;
- fdesc->new = EINA_TRUE;
+ fdesc->is_new = EINA_TRUE;
return fdesc;
}
new = evas_font_desc_new();
memcpy(new, fdesc, sizeof(*new));
new->ref = 1;
- new->new = EINA_TRUE;
+ new->is_new = EINA_TRUE;
new->name = eina_stringshare_ref(new->name);
return new;
Font_Rend_Flags wanted_rend = 0;
if (!fdesc) return NULL;
- fdesc->new = EINA_FALSE;
+ fdesc->is_new = EINA_FALSE;
if (fdesc->slant != EVAS_FONT_SLANT_NORMAL)
wanted_rend |= FONT_REND_SLANT;
e->name_hash = eina_hash_string_superfast_new(NULL);
#define EVAS_ARRAY_SET(E, Array) \
- eina_array_step_set(&E->Array, sizeof (E->Array), 256);
+ eina_array_step_set(&E->Array, sizeof (E->Array), 4096);
EVAS_ARRAY_SET(e, delete_objects);
EVAS_ARRAY_SET(e, active_objects);
evas_free(Evas *e)
{
Eina_Rectangle *r;
+ Evas_Coord_Touch_Point *touch_point;
Evas_Layer *lay;
int i;
int del;
eina_array_flush(&e->calculate_objects);
eina_array_flush(&e->clip_changes);
+ EINA_LIST_FREE(e->touch_points, touch_point)
+ free(touch_point);
+
+ eina_list_free(e->calc_list);
+
e->magic = 0;
free(e);
}
EAPI Eina_List *
evas_render_method_list(void)
{
- Eina_List *methods = NULL;
-
- /* FIXME: get from modules - this is currently coded-in */
-#ifdef BUILD_ENGINE_SOFTWARE_GDI
- methods = eina_list_append(methods, "software_gdi");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_DDRAW
- methods = eina_list_append(methods, "software_ddraw");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_16_DDRAW
- methods = eina_list_append(methods, "software_16_ddraw");
-#endif
-#ifdef BUILD_ENGINE_DIRECT3D
- methods = eina_list_append(methods, "direct3d");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_16_WINCE
- methods = eina_list_append(methods, "software_16_wince");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_X11
- methods = eina_list_append(methods, "software_x11");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_16_X11
- methods = eina_list_append(methods, "software_16_x11");
-#endif
-#ifdef BUILD_ENGINE_GL_X11
- methods = eina_list_append(methods, "gl_x11");
-#endif
-#ifdef BUILD_ENGINE_DIRECTFB
- methods = eina_list_append(methods, "directfb");
-#endif
-#ifdef BUILD_ENGINE_FB
- methods = eina_list_append(methods, "fb");
-#endif
-#ifdef BUILD_ENGINE_BUFFER
- methods = eina_list_append(methods, "buffer");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_WIN32_GDI
- methods = eina_list_append(methods, "software_win32_gdi");
-#endif
-#ifdef BUILD_ENGINE_SOFTWARE_SDL
- methods = eina_list_append(methods, "software_sdl");
-#endif
-
- return methods;
+ return evas_module_engine_list();
}
EAPI void
Eina_Bool ch = EINA_FALSE;
if (!obj->cur.map) return;
- /* WARN: Do not merge below code to SLP until it is fixed.
- It has an infinite loop bug.
+
+ // WARN: Do not merge below code to SLP until it is fixed.
+ // It has an infinite loop bug.
+#if 0
if (obj->prev.map)
{
// FIXME: this causes an infinite loop somewhere... hard to debug
}
else
ch = 1;
- WARN: DO NOT REMOVE THIS COMMENT. LEAVE IT AS IS UNTIL FIXED. */
+#endif
p = obj->cur.map->points;
p_end = p + obj->cur.map->count;
MAGIC_CHECK_END();
if (obj->name)
{
- eina_hash_del(obj->layer->evas->name_hash, obj->name, obj);
- free(obj->name);
+ eina_hash_del(obj->layer->evas->name_hash, obj->name, obj);
+ free(obj->name);
}
if (!name) obj->name = NULL;
else
{
- obj->name = strdup(name);
- eina_hash_add(obj->layer->evas->name_hash, obj->name, obj);
+ obj->name = strdup(name);
+ eina_hash_add(obj->layer->evas->name_hash, obj->name, obj);
}
}
EAPI void
evas_object_grid_size_get(const Evas_Object *o, int *w, int *h)
{
+ if (w) *w = 0;
+ if (h) *h = 0;
EVAS_OBJECT_GRID_DATA_GET_OR_RETURN(o, priv);
- if (priv)
- {
- if (w) *w = priv->size.w;
- if (h) *h = priv->size.h;
- }
- else
- {
- if (w) *w = 0;
- if (h) *h = 0;
- }
+ if (w) *w = priv->size.w;
+ if (h) *h = priv->size.h;
}
EAPI Eina_Bool
{
Evas_Object_Grid_Option *opt;
+ if (x) *x = 0;
+ if (y) *y = 0;
+ if (w) *w = 0;
+ if (h) *h = 0;
EVAS_OBJECT_GRID_DATA_GET_OR_RETURN_VAL(o, priv, 0);
opt = _evas_object_grid_option_get(child);
if (!opt) return 0;
const char *file;
const char *key;
int frame;
- int cspace;
+ Evas_Colorspace cspace;
unsigned char smooth_scale : 1;
unsigned char has_alpha :1;
Evas_Object_Image_Pixels_Get_Cb get_pixels;
void *get_pixels_data;
} func;
-
+
+ Evas_Video_Surface video;
+
const char *tmpf;
int tmpf_fd;
unsigned char filled : 1;
unsigned char proxyrendering : 1;
unsigned char preloading : 1;
+ unsigned char video_rendering : 1;
+ unsigned char video_surface : 1;
+ unsigned char video_visible : 1;
+ unsigned char created : 1;
};
/* private methods for image objects */
EVAS_MEMPOOL(_mp_obj);
+static void
+_evas_object_image_cleanup(Evas_Object *obj, Evas_Object_Image *o)
+{
+ if ((o->preloading) && (o->engine_data))
+ {
+ o->preloading = 0;
+ obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
+ o->engine_data,
+ obj);
+ }
+ if (o->tmpf) _cleanup_tmpf(obj);
+ if (o->cur.source) _proxy_unset(obj);
+}
+
EAPI Evas_Object *
evas_object_image_add(Evas *e)
{
if (src == obj) return EINA_FALSE;
if (o->cur.source == src) return EINA_TRUE;
- if (o->tmpf) _cleanup_tmpf(obj);
+ _evas_object_image_cleanup(obj, o);
/* Kill the image if any */
if (o->cur.file || o->cur.key)
evas_object_image_file_set(obj, NULL, NULL);
- if (o->cur.source)
- {
- _proxy_unset(obj);
- }
-
if (src)
{
_proxy_set(obj, src);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return;
MAGIC_CHECK_END();
- if ((o->preloading) && (o->engine_data))
- {
- o->preloading = 0;
- obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
- o->engine_data,
- obj);
- }
+ _evas_object_image_cleanup(obj, o);
if (w < 1) w = 1;
if (h < 1) h = 1;
if (w > 32768) return;
if (h > 32768) return;
if ((w == o->cur.image.w) &&
(h == o->cur.image.h)) return;
- if (o->tmpf) _cleanup_tmpf(obj);
o->cur.image.w = w;
o->cur.image.h = h;
if (o->engine_data)
o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_data
(obj->layer->evas->engine.data.output, w, h, NULL, o->cur.has_alpha,
o->cur.cspace);
-
+
if (o->engine_data)
{
if (obj->layer->evas->engine.func->image_scale_hint_set)
obj);
}
if (!o->engine_data) return NULL;
- if (!o->cur.cspace == to_cspace) return NULL;
+ if (o->cur.cspace == to_cspace) return NULL;
data = NULL;
o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output,
o->engine_data,
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return;
MAGIC_CHECK_END();
- if ((o->preloading) && (o->engine_data))
- {
- o->preloading = 0;
- obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
- o->engine_data,
- obj);
- }
+ _evas_object_image_cleanup(obj, o);
#ifdef EVAS_FRAME_QUEUING
if (o->engine_data)
evas_common_pipe_op_image_flush(o->engine_data);
#endif
p_data = o->engine_data;
- if (o->tmpf) _cleanup_tmpf(obj);
if (data)
{
if (o->engine_data)
for_writing,
&data,
&o->load_error);
+
+ /* if we fail to get engine_data, we have to return NULL */
+ if (!o->engine_data) return NULL;
+
if (o->engine_data)
{
int stride = 0;
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return;
MAGIC_CHECK_END();
- if ((o->preloading) && (o->engine_data))
- {
- o->preloading = 0;
- obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
- o->engine_data,
- obj);
- }
+ _evas_object_image_cleanup(obj, o);
if ((o->cur.image.w <= 0) ||
(o->cur.image.h <= 0)) return;
- if (o->tmpf) _cleanup_tmpf(obj);
if (o->engine_data)
obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
o->engine_data);
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return 0;
MAGIC_CHECK_END();
-
- if ((o->preloading) && (o->engine_data))
- {
- o->preloading = 0;
- obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
- o->engine_data,
- obj);
- }
+ _evas_object_image_cleanup(obj, o);
if ((pixels->w != o->cur.image.w) || (pixels->h != o->cur.image.h)) return 0;
- if (o->tmpf) _cleanup_tmpf(obj);
switch (pixels->format)
{
#if 0
return;
MAGIC_CHECK_END();
- if ((o->preloading) && (o->engine_data))
- {
- o->preloading = 0;
- obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
- o->engine_data,
- obj);
- }
- if (o->tmpf) _cleanup_tmpf(obj);
+ _evas_object_image_cleanup(obj, o);
#ifdef EVAS_FRAME_QUEUING
if ((Evas_Colorspace)o->cur.cspace != cspace)
{
}
EAPI void
-evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf)
+evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf)
{
Evas_Object_Image *o;
MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
return;
MAGIC_CHECK_END();
- if ((o->preloading) && (o->engine_data))
+ _evas_object_image_cleanup(obj, o);
+ if (o->video_surface)
{
- o->preloading = 0;
- obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output,
- o->engine_data,
- obj);
+ o->video_surface = 0;
+ obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj);
}
- if (o->tmpf) _cleanup_tmpf(obj);
- if (o->cur.source) _proxy_unset(obj);
+
+ if (surf)
+ {
+ fprintf(stderr, "video surface ?\n");
+ if (surf->version != EVAS_VIDEO_SURFACE_VERSION) return ;
+
+ if (!surf->update_pixels ||
+ !surf->move ||
+ !surf->resize ||
+ !surf->hide ||
+ !surf->show)
+ return ;
+
+ o->created = EINA_TRUE;
+ o->video_surface = 1;
+ o->video = *surf;
+
+ fprintf(stderr, "yes\n");
+ obj->layer->evas->video_objects = eina_list_append(obj->layer->evas->video_objects, obj);
+ }
+ else
+ {
+ o->video_surface = 0;
+ o->video.update_pixels = NULL;
+ o->video.move = NULL;
+ o->video.resize = NULL;
+ o->video.hide = NULL;
+ o->video.show = NULL;
+ o->video.data = NULL;
+ }
+}
+
+EAPI const Evas_Video_Surface *
+evas_object_image_video_surface_get(const Evas_Object *obj)
+{
+ Evas_Object_Image *o;
+
+ MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+ return NULL;
+ MAGIC_CHECK_END();
+ o = (Evas_Object_Image *)(obj->object_data);
+ MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+ return NULL;
+ MAGIC_CHECK_END();
+ if (!o->video_surface) return NULL;
+ return &o->video;
+}
+
+EAPI void
+evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf)
+{
+ 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();
+ _evas_object_image_cleanup(obj, o);
if (!obj->layer->evas->engine.func->image_native_set) return;
if ((surf) &&
((surf->version < 2) ||
obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output,
o->engine_data);
}
+ if (o->video_surface)
+ {
+ o->video_surface = 0;
+ obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj);
+ }
o->engine_data = NULL;
o->magic = 0;
EINA_LIST_FREE(o->pixel_updates, r)
return;
}
+ /* We are displaying the overlay */
+ if (o->video_visible)
+ {
+ fprintf(stderr, "overlay visible, make a hole\n");
+
+ /* Create a transparent rectangle */
+ obj->layer->evas->engine.func->context_color_set(output,
+ context,
+ 0, 0, 0, 0);
+ obj->layer->evas->engine.func->context_multiplier_unset(output,
+ context);
+ obj->layer->evas->engine.func->context_render_op_set(output, context,
+ EVAS_RENDER_COPY);
+ obj->layer->evas->engine.func->rectangle_draw(output,
+ context,
+ surface,
+ obj->cur.geometry.x + x,
+ obj->cur.geometry.y + y,
+ obj->cur.geometry.w,
+ obj->cur.geometry.h);
+
+ return ;
+ }
obj->layer->evas->engine.func->context_color_set(output,
context,
if (o->func.get_pixels)
{
o->func.get_pixels(o->func.get_pixels_data, obj);
+ if (o->engine_data != pixels)
+ pixels = o->engine_data;
o->engine_data = obj->layer->evas->engine.func->image_dirty_region
(obj->layer->evas->engine.data.output, o->engine_data,
0, 0, o->cur.image.w, o->cur.image.h);
o->cur.has_alpha,
to_cspace);
break;
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ fprintf(stderr, "EVAS_COLORSPACE_YCBCR422601_PL:\n");
+ out = evas_common_convert_yuv_422_601_to(data,
+ o->cur.image.w,
+ o->cur.image.h,
+ to_cspace);
+ break;
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ out = evas_common_convert_yuv_422P_601_to(data,
+ o->cur.image.w,
+ o->cur.image.h,
+ to_cspace);
+ break;
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ out = evas_common_convert_yuv_420_601_to(data,
+ o->cur.image.w,
+ o->cur.image.h,
+ to_cspace);
+ break;
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ out = evas_common_convert_yuv_420T_601_to(data,
+ o->cur.image.w,
+ o->cur.image.h,
+ to_cspace);
+ break;
default:
+ fprintf(stderr, "unknow colorspace: %i\n", o->cur.cspace);
break;
}
(obj->layer->evas->engine.data.output, o->engine_data);
}
+Evas_Object *
+_evas_object_image_video_parent_get(Evas_Object *obj)
+{
+ Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
+
+ return o->video_surface ? o->video.parent : NULL;
+}
+
+void
+_evas_object_image_video_overlay_show(Evas_Object *obj)
+{
+ Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
+
+ if (obj->cur.cache.clip.x != obj->prev.cache.clip.x ||
+ obj->cur.cache.clip.y != obj->prev.cache.clip.y ||
+ o->created || !o->video_visible)
+ o->video.move(o->video.data, obj, &o->video, obj->cur.cache.clip.x, obj->cur.cache.clip.y);
+ if (obj->cur.cache.clip.w != obj->prev.cache.clip.w ||
+ obj->cur.cache.clip.h != obj->prev.cache.clip.h ||
+ o->created || !o->video_visible)
+ o->video.resize(o->video.data, obj, &o->video, obj->cur.cache.clip.w, obj->cur.cache.clip.h);
+ if (!o->video_visible || o->created)
+ o->video.show(o->video.data, obj, &o->video);
+ o->video_visible = EINA_TRUE;
+ o->created = EINA_FALSE;
+}
+
+void
+_evas_object_image_video_overlay_hide(Evas_Object *obj)
+{
+ Evas_Object_Image *o = (Evas_Object_Image *)(obj->object_data);
+
+ if (o->video_visible || o->created)
+ o->video.hide(o->video.data, obj, &o->video);
+ if (evas_object_is_visible(obj))
+ o->video.update_pixels(o->video.data, obj, &o->video);
+ o->video_visible = EINA_FALSE;
+ o->created = EINA_FALSE;
+}
+
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
#if 0 // filtering disabled
evas_filter_free(obj);
#endif
+ if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(obj, NULL);
evas_object_map_set(obj, NULL);
evas_object_grabs_cleanup(obj);
evas_object_intercept_cleanup(obj);
if (evas_object_is_in_output_rect(obj,
obj->layer->evas->pointer.x,
obj->layer->evas->pointer.y, 1, 1))
- evas_event_feed_mouse_move(obj->layer->evas,
- obj->layer->evas->pointer.x,
- obj->layer->evas->pointer.y,
- obj->layer->evas->last_timestamp,
- NULL);
+ evas_event_feed_mouse_move(obj->layer->evas,
+ obj->layer->evas->pointer.x,
+ obj->layer->evas->pointer.y,
+ obj->layer->evas->last_timestamp,
+ NULL);
+ }
+/* this is at odds to handling events when an obj is moved out of the mouse
+ * ore resized out or clipped out. if mouse is grabbed - regardless of
+ * visibility, mouse move events should keep happening and mouse up.
+ * for better or worse it's at least consistent.
+ if (obj->delete_me) return;
+ if (obj->mouse_grabbed > 0)
+ obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
+ if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
+ obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
+ obj->mouse_grabbed = 0;
+ if (obj->layer->evas->events_frozen > 0)
+ {
+ obj->mouse_in = 0;
+ return;
}
- /* this is at odds to handling events when an obj is moved out of the mouse
- * ore resized out or clipped out. if mouse is grabbed - regardless of
- * visibility, mouse move events should keep happening and mouse up.
- * for better or worse it's at least consistent.
- if (obj->delete_me) return;
- if (obj->mouse_grabbed > 0)
- obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
- if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
- obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
- obj->mouse_grabbed = 0;
- if (obj->layer->evas->events_frozen > 0)
- {
- obj->mouse_in = 0;
- return;
- }
- if (obj->mouse_in)
- {
- Evas_Event_Mouse_Out ev;
-
- _evas_object_event_new();
-
- obj->mouse_in = 0;
- ev.buttons = obj->layer->evas->pointer.button;
- ev.output.x = obj->layer->evas->pointer.x;
- ev.output.y = obj->layer->evas->pointer.y;
- ev.canvas.x = obj->layer->evas->pointer.x;
- ev.canvas.y = obj->layer->evas->pointer.y;
- ev.data = NULL;
- ev.modifiers = &(obj->layer->evas->modifiers);
- ev.locks = &(obj->layer->evas->locks);
- ev.timestamp = obj->layer->evas->last_timestamp;
- ev.event_flags = EVAS_EVENT_FLAG_NONE;
- evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
- _evas_post_event_callback_call(obj->layer->evas);
- }
- */
+ if (obj->mouse_in)
+ {
+ Evas_Event_Mouse_Out ev;
+
+ _evas_object_event_new();
+
+ obj->mouse_in = 0;
+ ev.buttons = obj->layer->evas->pointer.button;
+ ev.output.x = obj->layer->evas->pointer.x;
+ ev.output.y = obj->layer->evas->pointer.y;
+ ev.canvas.x = obj->layer->evas->pointer.x;
+ ev.canvas.y = obj->layer->evas->pointer.y;
+ ev.data = NULL;
+ ev.modifiers = &(obj->layer->evas->modifiers);
+ ev.locks = &(obj->layer->evas->locks);
+ ev.timestamp = obj->layer->evas->last_timestamp;
+ ev.event_flags = EVAS_EVENT_FLAG_NONE;
+ evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_OUT, &ev);
+ _evas_post_event_callback_call(obj->layer->evas);
+ }
+ */
}
}
}
else
{
- /*
- if (obj->mouse_grabbed > 0)
- obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
- if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
- obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
- obj->mouse_grabbed = 0;
- obj->mouse_in = 0;
- */
+/*
+ if (obj->mouse_grabbed > 0)
+ obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
+ if ((obj->mouse_in) || (obj->mouse_grabbed > 0))
+ obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, obj);
+ obj->mouse_grabbed = 0;
+ obj->mouse_in = 0;
+ */
}
evas_object_inform_call_hide(obj);
}
void *engine_data;
void *data;
Eina_List *callbacks;
- Eina_Inlist *contained;
+ Eina_Inlist *contained;
+ Eina_List *calc_node;
Evas_Smart_Cb_Description_Array callbacks_descriptions;
int walking_list;
Eina_Bool deletions_waiting : 1;
return;
MAGIC_CHECK_END();
+ // XXX: do i need this?
+ if (obj->delete_me) return;
+
value = !!value;
- if (o->need_recalculate == value)
- return;
+ if (value)
+ {
+ Evas *e = obj->layer->evas;
+
+ if (o->need_recalculate)
+ {
+ if ((o->calc_node) && (e->calc_list_current != o->calc_node))
+ e->calc_list = eina_list_demote_list(e->calc_list,
+ o->calc_node);
+ else
+ e->calc_list = eina_list_append(e->calc_list, obj);
+ }
+ else
+ e->calc_list = eina_list_append(e->calc_list, obj);
+ o->calc_node = eina_list_last(e->calc_list);
+ }
+ else
+ {
+ Evas *e = obj->layer->evas;
+
+ if (o->need_recalculate)
+ {
+ if ((o->calc_node) && (e->calc_list_current != o->calc_node))
+ e->calc_list = eina_list_remove_list(e->calc_list,
+ o->calc_node);
+ o->calc_node = NULL;
+
+ }
+ }
+
+ if (o->need_recalculate == value) return;
- if (obj->recalculate_cycle > 64)
+ if (obj->recalculate_cycle > 256)
{
ERR("Object %p is not stable during recalc loop", obj);
- return ;
+ return;
}
- if (obj->layer->evas->in_smart_calc)
- obj->recalculate_cycle++;
+ if (obj->layer->evas->in_smart_calc) obj->recalculate_cycle++;
o->need_recalculate = value;
-
- if (!obj->smart.smart->smart_class->calculate) return;
-
- /* XXX: objects can be present multiple times in calculate_objects()
- * XXX: after a set-unset-set cycle, but it's not a problem since
- * XXX: on _evas_render_call_smart_calculate() will check for the flag
- * XXX: and it will be unset after the first.
- */
- if (o->need_recalculate)
- {
- Evas *e = obj->layer->evas;
- eina_array_push(&e->calculate_objects, obj);
- }
- /* TODO: else, remove from array */
}
EAPI Eina_Bool
evas_call_smarts_calculate(e);
}
+EAPI int
+evas_smart_objects_calculate_count_get(const Evas *e)
+{
+ MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+ return 0;
+ MAGIC_CHECK_END();
+ return e->smart_calc_count;
+}
+
/**
* Call calculate() on all smart objects that need_recalculate.
*
void
evas_call_smarts_calculate(Evas *e)
{
- Eina_Array *calculate;
Evas_Object *obj;
- Eina_Array_Iterator it;
- unsigned int i;
+ Eina_List *l;
+// printf("+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------v\n");
+ evas_event_freeze(e);
e->in_smart_calc++;
- calculate = &e->calculate_objects;
- for (i = 0; i < eina_array_count_get(calculate); ++i)
+
+ EINA_LIST_FOREACH(e->calc_list, l, obj)
{
- Evas_Object_Smart *o;
-
- obj = eina_array_data_get(calculate, i);
- if (obj->delete_me)
- continue;
-
- o = obj->object_data;
+ Evas_Object_Smart *o = obj->object_data;
+
+ if (obj->delete_me) continue;
+ e->calc_list_current = l;
if (o->need_recalculate)
{
o->need_recalculate = 0;
obj->smart.smart->smart_class->calculate(obj);
}
+ if (o->calc_node == l) o->calc_node = NULL;
+ e->calc_list_current = NULL;
}
- EINA_ARRAY_ITER_NEXT(calculate, i, obj, it)
+ EINA_LIST_FREE(e->calc_list, obj)
{
obj->recalculate_cycle = 0;
}
+ e->calc_list_current = NULL;
e->in_smart_calc--;
- if (e->in_smart_calc == 0) eina_array_clean(calculate);
+ if (e->in_smart_calc == 0) e->smart_calc_count++;
+ evas_event_thaw(e);
+ evas_event_thaw_eval(e);
+// printf("-CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------^\n");
}
EAPI void
o = (Evas_Object_Smart *)(obj->object_data);
if (o->magic == MAGIC_OBJ_SMART)
{
+ Evas *e = obj->layer->evas;
+
+ if ((o->calc_node) && (e->calc_list_current != o->calc_node))
+ e->calc_list = eina_list_remove_list(e->calc_list,
+ o->calc_node);
+ o->calc_node = NULL;
while (o->contained)
- evas_object_smart_member_del((Evas_Object *)o->contained);
+ evas_object_smart_member_del((Evas_Object *)o->contained);
while (o->callbacks)
{
Evas_Smart_Callback *cb;
-
+
cb = o->callbacks->data;
o->callbacks = eina_list_remove(o->callbacks, cb);
if (cb->event) eina_stringshare_del(cb->event);
obj->parent_cache_valid = 0;
o = (Evas_Object_Smart *)(obj->object_data);
- if (o->magic != MAGIC_OBJ_SMART)
- return;
+ if (o->magic != MAGIC_OBJ_SMART) return;
for (l = o->contained; l; l = l->next)
- {
- Evas_Object *obj2;
-
- obj2 = (Evas_Object *)l;
- evas_object_smart_member_cache_invalidate(obj2);
- }
+ evas_object_smart_member_cache_invalidate((Evas_Object *) l);
}
void
Evas_Object_Textblock_Node_Format *format_node;
Evas_Object_Textblock_Paragraph *par;
Eina_Bool dirty : 1;
- Eina_Bool new : 1;
+ Eina_Bool is_new : 1;
};
struct _Evas_Object_Textblock_Node_Format
unsigned char anchor : 2;
Eina_Bool visible : 1;
Eina_Bool format_change : 1;
- Eina_Bool new : 1;
+ Eina_Bool is_new : 1;
};
#define ANCHOR_NONE 0
{
fmt->font.fdesc = evas_font_desc_new();
}
- else if (!fmt->font.fdesc->new)
+ else if (!fmt->font.fdesc->is_new)
{
Evas_Font_Description *old = fmt->font.fdesc;
fmt->font.fdesc = evas_font_desc_dup(fmt->font.fdesc);
/* Check if we need to skip this paragraph because it's already layouted
* correctly, and mark handled nodes as dirty. */
c->par->line_no = c->line_no;
+
if (c->par->text_node)
{
/* Skip this paragraph if width is the same, there is no ellipsis
* and we aren't just calculating. */
- if (!c->par->text_node->new && !c->par->text_node->dirty &&
+ if (!c->par->text_node->is_new && !c->par->text_node->dirty &&
!c->width_changed && c->par->lines &&
!c->o->have_ellipsis)
{
return 0;
}
c->par->text_node->dirty = EINA_FALSE;
- c->par->text_node->new = EINA_FALSE;
+ c->par->text_node->is_new = EINA_FALSE;
c->par->rendered = EINA_FALSE;
/* Merge back and clear the paragraph */
int balance = 0;
while (fnode)
{
- if (fnode->new)
+ if (fnode->is_new)
{
const char *fstr = fnode->orig_format;
/* balance < 0 means we gave up and everything should be
/* If it's not a new paragraph, either update it or skip it.
* Remove all the paragraphs that were deleted */
- if (!n->new)
+ if (!n->is_new)
{
/* Remove all the deleted paragraphs at this point */
while (c->par->text_node != n)
{
off = 0;
}
- fnode->new = EINA_FALSE;
+ fnode->is_new = EINA_FALSE;
fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next);
}
_layout_text_append(c, c->fmt, n, start, -1, o->repch);
to->par->text_node = NULL;
to->par = NULL;
- to->new = EINA_TRUE;
+ to->is_new = EINA_TRUE;
_evas_textblock_cursors_set_node(o, from, to);
_evas_textblock_node_text_remove(o, from);
n->unicode = eina_ustrbuf_new();
/* We want to layout each paragraph at least once. */
n->dirty = EINA_TRUE;
- n->new = EINA_TRUE;
+ n->is_new = EINA_TRUE;
return n;
}
{
o->anchors_item = eina_list_append(o->anchors_item, n);
}
- n->new = EINA_TRUE;
+ n->is_new = EINA_TRUE;
return n;
}
{
/* Handle visible format nodes here */
cur->node->dirty = EINA_TRUE;
- n->new = EINA_FALSE;
+ n->is_new = EINA_FALSE;
}
}
else
EAPI Eina_Bool
evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end)
{
+ Evas *e;
Evas_Coord cy, ch;
Evas_Object *obj = start->obj;
TB_HEAD_RETURN(EINA_FALSE);
- /* Clip is relative to the object */
- cy = obj->cur.cache.clip.y - obj->cur.geometry.y;
- ch = obj->cur.cache.clip.h;
+ e = evas_object_evas_get(obj);
+ cy = 0 - obj->cur.geometry.y;
+ ch = e->viewport.h;
evas_textblock_cursor_line_coord_set(start, cy);
evas_textblock_cursor_line_coord_set(end, cy + ch);
evas_textblock_cursor_line_char_last(end);
Evas_Coord x1, w1, x2, w2;
Evas_Coord x, w, y, h;
Evas_Object_Textblock_Text_Item *ti;
- int ret;
+ int ret = 0;
ti = _ITEM_TEXT(it1);
- ret = cur->ENFN->font_pen_coords_get(cur->ENDT,
- ti->parent.format->font.font,
- &ti->text_props,
- start,
- &x1, &y, &w1, &h);
+ if (ti->parent.format->font.font)
+ {
+ ret = cur->ENFN->font_pen_coords_get(cur->ENDT,
+ ti->parent.format->font.font,
+ &ti->text_props,
+ start,
+ &x1, &y, &w1, &h);
+ }
if (!ret)
{
return NULL;
if (b) *b = o->style_pad.b;
}
+/** @internal
+ * FIXME: DELETE ME! DELETE ME!
+ * This is an ugly workaround to get around the fact that
+ * evas_object_textblock_coords_recalc isn't really called when it's supposed
+ * to. When that bug is fixed please remove this. */
+static void
+_workaround_object_coords_recalc(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+{
+ evas_object_textblock_coords_recalc(obj);
+}
+
/* all nice and private */
static void
evas_object_textblock_init(Evas_Object *obj)
o = (Evas_Object_Textblock *)(obj->object_data);
o->cursor->obj = obj;
o->legacy_newline = EINA_TRUE;
+ evas_object_event_callback_priority_add(obj, EVAS_CALLBACK_RESIZE, -1000,
+ _workaround_object_coords_recalc, NULL);
}
static void *
}
}
*/
+static Eina_Bool
+_evas_render_can_use_overlay(Evas *e, Evas_Object *obj)
+{
+ Eina_Rectangle *r;
+ Evas_Object *tmp;
+ Eina_List *alphas = NULL;
+ Eina_List *opaques = NULL;
+ Evas_Object *video_parent = NULL;
+ Eina_Rectangle zone;
+ Evas_Coord xc1, yc1, xc2, yc2;
+ unsigned int i;
+ Eina_Bool nooverlay;
+
+ video_parent = _evas_object_image_video_parent_get(obj);
+
+ /* Check if any one is the stack make this object mapped */
+ tmp = obj;
+ while (tmp && !_evas_render_has_map(tmp))
+ tmp = tmp->smart.parent;
+
+ if (tmp && _evas_render_has_map(tmp)) return EINA_FALSE; /* we are mapped, we can't be an overlay */
+
+ if (!evas_object_is_visible(obj)) return EINA_FALSE; /* no need to update the overlay if it's not visible */
+
+ /* If any recoloring of the surface is needed, n overlay to */
+ if ((obj->cur.cache.clip.r != 255) ||
+ (obj->cur.cache.clip.g != 255) ||
+ (obj->cur.cache.clip.b != 255) ||
+ (obj->cur.cache.clip.a != 255))
+ return EINA_FALSE;
+
+ /* Check presence of transparent object on top of the video object */
+ EINA_RECTANGLE_SET(&zone,
+ obj->cur.cache.clip.x,
+ obj->cur.cache.clip.y,
+ obj->cur.cache.clip.w,
+ obj->cur.cache.clip.h);
+
+ for (i = e->active_objects.count - 1; i > 0; i--)
+ {
+ Eina_Rectangle self;
+ Eina_Rectangle *match;
+ Evas_Object *current;
+ Eina_List *l;
+ int xm1, ym1, xm2, ym2;
+
+ current = eina_array_data_get(&e->active_objects, i);
+
+ /* Did we find the video object in the stack ? */
+ if (current == video_parent || current == obj)
+ break;
+
+ EINA_RECTANGLE_SET(&self,
+ current->cur.cache.clip.x,
+ current->cur.cache.clip.y,
+ current->cur.cache.clip.w,
+ current->cur.cache.clip.h);
+
+ /* This doesn't cover the area of the video object, so don't bother with that object */
+ if (!eina_rectangles_intersect(&zone, &self))
+ continue ;
+
+ xc1 = current->cur.cache.clip.x;
+ yc1 = current->cur.cache.clip.y;
+ xc2 = current->cur.cache.clip.x + current->cur.cache.clip.w;
+ yc2 = current->cur.cache.clip.y + current->cur.cache.clip.h;
+
+ if (evas_object_is_visible(current) &&
+ (!current->clip.clipees) &&
+ (current->cur.visible) &&
+ (!current->delete_me) &&
+ (current->cur.cache.clip.visible) &&
+ (!current->smart.smart))
+ {
+ Eina_Bool included = EINA_FALSE;
+
+ if (evas_object_is_opaque(current) ||
+ ((current->func->has_opaque_rect) &&
+ (current->func->has_opaque_rect(current))))
+ {
+ /* The object is opaque */
+
+ /* Check if the opaque object is inside another opaque object */
+ EINA_LIST_FOREACH(opaques, l, match)
+ {
+ xm1 = match->x;
+ ym1 = match->y;
+ xm2 = match->x + match->w;
+ ym2 = match->y + match->h;
+
+ /* Both object are included */
+ if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
+ {
+ included = EINA_TRUE;
+ break;
+ }
+ }
+
+ /* Not included yet */
+ if (!included)
+ {
+ Eina_List *ln;
+ Evas_Coord xn2, yn2;
+
+ r = eina_rectangle_new(current->cur.cache.clip.x, current->cur.cache.clip.y,
+ current->cur.cache.clip.w, current->cur.cache.clip.h);
+
+ opaques = eina_list_append(opaques, r);
+
+ xn2 = r->x + r->w;
+ yn2 = r->y + r->h;
+
+ /* Remove all the transparent object that are covered by the new opaque object */
+ EINA_LIST_FOREACH_SAFE(alphas, l, ln, match)
+ {
+ xm1 = match->x;
+ ym1 = match->y;
+ xm2 = match->x + match->w;
+ ym2 = match->y + match->h;
+
+ if (xm1 >= r->x && ym1 >= r->y && xm2 <= xn2 && ym2 <= yn2)
+ {
+ /* The new rectangle is over some transparent object,
+ so remove the transparent object */
+ alphas = eina_list_remove_list(alphas, l);
+ }
+ }
+ }
+ }
+ else
+ {
+ /* The object has some transparency */
+
+ /* Check if the transparent object is inside any other transparent object */
+ EINA_LIST_FOREACH(alphas, l, match)
+ {
+ xm1 = match->x;
+ ym1 = match->y;
+ xm2 = match->x + match->w;
+ ym2 = match->y + match->h;
+
+ /* Both object are included */
+ if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
+ {
+ included = EINA_TRUE;
+ break;
+ }
+ }
+
+ /* If not check if it is inside any opaque one */
+ if (!included)
+ {
+ EINA_LIST_FOREACH(opaques, l, match)
+ {
+ xm1 = match->x;
+ ym1 = match->y;
+ xm2 = match->x + match->w;
+ ym2 = match->y + match->h;
+
+ /* Both object are included */
+ if (xc1 >= xm1 && yc1 >= ym1 && xc2 <= xm2 && yc2 <= ym2)
+ {
+ included = EINA_TRUE;
+ break;
+ }
+ }
+ }
+
+ /* No inclusion at all, so add it */
+ if (!included)
+ {
+ r = eina_rectangle_new(current->cur.cache.clip.x, current->cur.cache.clip.y,
+ current->cur.cache.clip.w, current->cur.cache.clip.h);
+
+ alphas = eina_list_append(alphas, r);
+ }
+ }
+ }
+ }
+
+ /* If there is any pending transparent object, then no overlay */
+ nooverlay = !!eina_list_count(alphas);
+
+ EINA_LIST_FREE(alphas, r)
+ eina_rectangle_free(r);
+ EINA_LIST_FREE(opaques, r)
+ eina_rectangle_free(r);
+
+ if (nooverlay)
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
Eina_Bool
evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
unsigned char make_updates,
unsigned char do_draw)
{
+ Evas_Object *obj;
Eina_List *updates = NULL;
Eina_List *ll;
void *surface;
_evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,
&e->delete_objects, &e->render_objects);
+ /* phase 1.5. check if the video should be inlined or stay in their overlay */
+ alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
+ e->engine.data.context);
+
+ EINA_LIST_FOREACH(e->video_objects, ll, obj)
+ {
+ /* we need the surface to be transparent to display the underlying overlay */
+ if (alpha && _evas_render_can_use_overlay(e, obj))
+ _evas_object_image_video_overlay_show(obj);
+ else
+ _evas_object_image_video_overlay_hide(obj);
+ }
+
/* phase 2. force updates for restacks */
for (i = 0; i < e->restack_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = eina_array_data_get(&e->restack_objects, i);
obj->func->render_pre(obj);
_evas_render_prev_cur_clip_cache_add(e, obj);
/* build obscure objects list of active objects that obscure */
for (i = 0; i < e->active_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = eina_array_data_get(&e->active_objects, i);
if (UNLIKELY((evas_object_is_opaque(obj) ||
((obj->func->has_opaque_rect) &&
/* obscuring_objects = eina_list_append(obscuring_objects, obj); */
eina_array_push(&e->obscuring_objects, obj);
}
+
/* save this list */
/* obscuring_objects_orig = obscuring_objects; */
/* obscuring_objects = NULL; */
{
unsigned int offset = 0;
- alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
- e->engine.data.context);
while ((surface =
e->engine.func->output_redraws_next_update_get
(e->engine.data.output,
/* build obscuring objects list (in order from bottom to top) */
for (i = 0; i < e->obscuring_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = (Evas_Object *)eina_array_data_get
(&e->obscuring_objects, i);
if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh))
/* render all object that intersect with rect */
for (i = 0; i < e->active_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = eina_array_data_get(&e->active_objects, i);
/* if it's in our outpout rect and it doesn't clip anything */
/* and do a post render pass */
for (i = 0; i < e->active_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = eina_array_data_get(&e->active_objects, i);
obj->pre_render_done = 0;
RD(" OBJ [%p] post... %i %i\n", obj, obj->changed, do_draw);
for (i = 0; i < e->render_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = eina_array_data_get(&e->render_objects, i);
obj->pre_render_done = 0;
}
/* delete all objects flagged for deletion now */
for (i = 0; i < e->delete_objects.count; ++i)
{
- Evas_Object *obj;
-
obj = eina_array_data_get(&e->delete_objects, i);
evas_object_free(obj, 1);
}
libevas_engine_common_la_DEPENDENCIES = \
$(top_builddir)/config.h
+
+libevas_engine_common_la_LIBADD = \
+evas_op_blend/libevas_engine_common_op_blend_master_sse3.la
return NULL;
}
+EAPI void *
+evas_common_convert_yuv_422_601_to(void *data, int w, int h, Evas_Colorspace cspace)
+{
+ switch (cspace)
+ {
+ case EVAS_COLORSPACE_ARGB8888:
+ {
+ void *dst;
+
+ fprintf(stderr, "to argb888\n");
+
+ dst = malloc(sizeof (unsigned int) * w * h);
+ if (!dst) return NULL;
+
+ evas_common_convert_yuv_422_601_rgba(data, dst, w, h);
+ return dst;
+ }
+ default:
+ break;
+ }
+ return NULL;
+}
+
+EAPI void *
+evas_common_convert_yuv_422P_601_to(void *data, int w, int h, Evas_Colorspace cspace)
+{
+ switch (cspace)
+ {
+ case EVAS_COLORSPACE_ARGB8888:
+ {
+ void *dst;
+
+ dst = malloc(sizeof (unsigned int) * w * h);
+ if (!dst) return NULL;
+
+ evas_common_convert_yuv_420p_601_rgba(data, dst, w, h);
+ break;
+ }
+ default:
+ break;
+ }
+ return NULL;
+}
+
+EAPI void *
+evas_common_convert_yuv_420_601_to(void *data, int w, int h, Evas_Colorspace cspace)
+{
+ switch (cspace)
+ {
+ case EVAS_COLORSPACE_ARGB8888:
+ {
+ void *dst;
+
+ dst = malloc(sizeof (unsigned int) * w * h);
+ if (!dst) return NULL;
+
+ evas_common_convert_yuv_420_601_rgba(data, dst, w, h);
+ break;
+ }
+ default:
+ break;
+ }
+ return NULL;
+}
+
+EAPI void *
+evas_common_convert_yuv_420T_601_to(void *data, int w, int h, Evas_Colorspace cspace)
+{
+ switch (cspace)
+ {
+ case EVAS_COLORSPACE_ARGB8888:
+ {
+ void *dst;
+
+ dst = malloc(sizeof (unsigned int) * w * h);
+ if (!dst) return NULL;
+
+ evas_common_convert_yuv_420_601_rgba(data, dst, w, h);
+ break;
+ }
+ default:
+ break;
+ }
+ return NULL;
+}
+
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
#define _EVAS_CONVERT_COLORSPACE_H
-EAPI void *evas_common_convert_argb8888_to (void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
-EAPI void *evas_common_convert_rgb565_a5p_to (void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
-
+EAPI void *evas_common_convert_argb8888_to (void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
+EAPI void *evas_common_convert_rgb565_a5p_to (void *data, int w, int h, int stride, Eina_Bool has_alpha, Evas_Colorspace cspace);
+EAPI void *evas_common_convert_yuv_422P_601_to(void *data, int w, int h, Evas_Colorspace cspace);
+EAPI void *evas_common_convert_yuv_422_601_to (void *data, int w, int h, Evas_Colorspace cspace);
+EAPI void *evas_common_convert_yuv_420_601_to (void *data, int w, int h, Evas_Colorspace cspace);
+EAPI void *evas_common_convert_yuv_420T_601_to(void *data, int w, int h, Evas_Colorspace cspace);
#endif /* _EVAS_CONVERT_COLORSPACE_H */
#endif
static void _evas_yv12torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
static void _evas_yuy2torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
+static void _evas_nv12torgb_raster (unsigned char **yuv, unsigned char *rgb, int w, int h);
+static void _evas_nv12tiledtorgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h);
#define CRV 104595
#define CBU 132251
#endif
}
+void
+evas_common_convert_yuv_420_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
+{
+#ifdef BUILD_C
+ if (!initted) _evas_yuv_init();
+ initted = 1;
+ _evas_nv12torgb_raster(src, dst, w, h);
+#endif
+}
+
+void
+evas_common_convert_yuv_420T_601_rgba(DATA8 **src, DATA8 *dst, int w, int h)
+{
+#ifdef BUILD_C
+ if (initted) _evas_yuv_init();
+ initted = 1;
+ _evas_nv12tiledtorgb_raster(src, dst, w, h);
+#endif
+}
+
static void
_evas_yuy2torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
{
#endif
}
+#ifdef BUILD_C
+static inline void
+_evas_yuv2rgb_420_raster(unsigned char *yp1, unsigned char *yp2, unsigned char *up, unsigned char *vp,
+ unsigned char *dp1, unsigned char *dp2)
+{
+ int y, u, v;
+ int vmu;
+ int rgb;
+
+ /* collect u & v for 4 pixels block */
+ u = *up;
+ v = *vp;
+
+ /* save lookups */
+#ifdef MEM_BP
+ vmu = _v813[v] + _v391[u];
+ u = _v2018[u];
+ v = _v1596[v];
+#else
+ u -= 128;
+ v -= 128;
+ vmu = v * CGV + u * CGU;
+ u = u * CBU;
+ v = v * CRV;
+#endif
+
+ /* do the top 2 pixels of the 2x2 block which shared u & v */
+ /* yuv to rgb */
+#ifdef MEM_BP
+ y = _v1164[*yp1];
+ rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
+#else
+ y = (*yp1 - 16 ) * YMUL;
+ rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
+ LUT_CLIP(((y - vmu + OFF) >> 16)),
+ LUT_CLIP(((y + u + OFF) >> 16)));
+#endif
+ *((DATA32 *) dp1) = 0xff000000 + rgb;
+
+ dp1 += 4; yp1++;
+
+ /* yuv to rgb */
+#ifdef MEM_BP
+ y = _v1164[*yp1];
+ rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
+#else
+ y = (*yp1 - 16 ) * YMUL;
+ rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
+ LUT_CLIP(((y - vmu + OFF) >> 16)),
+ LUT_CLIP(((y + u + OFF) >> 16)));
+#endif
+ *((DATA32 *) dp1) = 0xff000000 + rgb;
+
+ /* do the bottom 2 pixels of the 2x2 block which shared u & v */
+ /* yuv to rgb */
+#ifdef MEM_BP
+ y = _v1164[*yp2];
+ rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
+#else
+ y = (*yp2 - 16 ) * YMUL;
+ rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
+ LUT_CLIP(((y - vmu + OFF) >> 16)),
+ LUT_CLIP(((y + u + OFF) >> 16)));
+#endif
+ *((DATA32 *) dp2) = 0xff000000 + rgb;
+
+ dp2 += 4; yp2++;
+
+ /* yuv to rgb */
+#ifdef MEM_BP
+ y = _v1164[*yp2];
+ rgb = RGB_JOIN(LUT_CLIP(y + v), LUT_CLIP(y - vmu), LUT_CLIP(y + u));
+#else
+ y = (*yp2 - 16 ) * YMUL;
+ rgb = RGB_JOIN(LUT_CLIP(((y + v) >> 16)),
+ LUT_CLIP(((y - vmu + OFF) >> 16)),
+ LUT_CLIP(((y + u + OFF) >> 16)));
+#endif
+ *((DATA32 *) dp2) = 0xff000000 + rgb;
+}
+#endif
+
+static void
+_evas_nv12tiledtorgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
+{
+#ifdef BUILD_C
+
+#define HANDLE_MACROBLOCK(YP1, YP2, UP, VP, DP1, DP2) \
+ { \
+ int i; \
+ int j; \
+ \
+ for (i = 0; i < 32; i += 2) \
+ { \
+ for (j = 0; j < 64; j += 2) \
+ { \
+ _evas_yuv2rgb_420_raster(YP1, YP2, UP, VP, DP1, DP2); \
+ \
+ /* the previous call just rendered 2 pixels per lines */ \
+ DP1 += 8; DP2 += 8; \
+ \
+ /* and took for that 2 lines with 2 Y, 1 U and 1 V. Don't forget U & V are in the same plane */ \
+ YP1 += 2; YP2 += 2; UP += 2; VP += 2; \
+ } \
+ \
+ DP1 += sizeof (int) * ((w << 1) - 64); \
+ DP2 += sizeof (int) * ((w << 1) - 64); \
+ YP1 += 64; \
+ YP2 += 64; \
+ } \
+ }
+
+ /* One macro block is 32 lines of Y and 16 lines of UV */
+ const int offset_value[2] = { 0, 64 * 16 };
+ int mb_x, mb_y, mb_w, mb_h;
+ int base_h;
+ int uv_x, uv_y, uv_step;
+ int stride;
+
+ /* Idea iterate over each macroblock and convert each of them using _evas_nv12torgb_raster */
+
+ /* The layout of the Y macroblock order in RGB non tiled space : */
+ /* --------------------------------------------------- */
+ /* | 0 | 1 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | */
+ /* --------------------------------------------------- */
+ /* | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 18 | 19 | */
+ /* --------------------------------------------------- */
+ /* | 20 | 21 | 26 | 27 | 28 | 29 | 34 | 35 | 36 | 37 | */
+ /* --------------------------------------------------- */
+ /* | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 38 | 39 | */
+ /* --------------------------------------------------- */
+ /* | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | */
+ /* --------------------------------------------------- */
+ /* The layout of the UV macroblock order in the same RGB non tiled space : */
+ /* --------------------------------------------------- */
+ /* | | | | | | | | | | | */
+ /* - 0 - 1 - 6 - 7 - 8 - 9 - 14 - 15 - 16 - 17 - */
+ /* | | | | | | | | | | | */
+ /* --------------------------------------------------- */
+ /* | | | | | | | | | | | */
+ /* - 2 - 3 - 4 - 5 - 10 - 11 - 12 - 13 - 18 - 19 - */
+ /* | | | | | | | | | | | */
+ /* --------------------------------------------------- */
+ /* | | | | | | | | | | | */
+ /* - 20 - 21 - 22 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - */
+
+ /* the number of macroblock should be a multiple of 64x32 */
+ mb_w = w / 64;
+ mb_h = h / 32;
+
+ base_h = (mb_h >> 1) + (mb_h & 0x1);
+ stride = w * sizeof (int);
+
+ uv_x = 0; uv_y = 0;
+
+ /* In this format we linearize macroblock on two line to form a Z and it's invert */
+ for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
+ {
+ int step = 2;
+ int offset = 0;
+ int x = 0;
+ int rmb_x = 0;
+ int ry[2];
+
+ ry[0] = mb_y * 2 * 32 * stride;
+ ry[1] = ry[0] + 32 * stride;
+
+ uv_step = (mb_y & 0x1) == 0 ? 4 : 0;
+ uv_x = (mb_y & 0x1) == 0 ? 0 : 2 * 64 * 32;
+
+ for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
+ {
+ unsigned char *yp1, *yp2, *up, *vp;
+ unsigned char *dp1, *dp2;
+
+ dp1 = rgb + x + ry[offset];
+ dp2 = dp1 + stride;
+
+ yp1 = yuv[mb_y] + rmb_x;
+ yp2 = yp1 + 64;
+
+ /* UV plane is two time less bigger in pixel count, but it old two bytes each times */
+ up = yuv[(mb_y >> 1) + base_h] + uv_x + offset_value[offset];
+ vp = up + 1;
+
+ HANDLE_MACROBLOCK(yp1, yp2, up, vp, dp1, dp2);
+
+ step++;
+ if ((step & 0x3) == 0)
+ {
+ offset = 1 - offset;
+ x -= 64 * sizeof (int);
+ uv_x -= 64 * 32;
+ }
+ else
+ {
+ x += 64 * sizeof (int);
+ uv_x += 64 * 32;
+ }
+
+ uv_step++;
+ if (uv_step == 8)
+ {
+ uv_step = 0;
+ uv_x += 4 * 64 * 32;
+ }
+ }
+ }
+
+ if (mb_h & 0x1)
+ {
+ int x = 0;
+ int ry;
+
+ ry = mb_y << 1;
+
+ uv_step = 0;
+ uv_x = 0;
+
+ for (mb_x = 0; mb_x < mb_w; mb_x++, x++, uv_x++)
+ {
+ unsigned char *yp1, *yp2, *up, *vp;
+ unsigned char *dp1, *dp2;
+
+ dp1 = rgb + (x * 64 + (ry * 32 * w)) * sizeof (int);
+ dp2 = dp1 + sizeof (int) * w;
+
+ yp1 = yuv[mb_y] + mb_x * 64 * 32;
+ yp2 = yp1 + 64;
+
+ up = yuv[mb_y / 2 + base_h] + uv_x * 64 * 32;
+ vp = up + 1;
+
+ HANDLE_MACROBLOCK(yp1, yp2, up, vp, dp1, dp2);
+ }
+ }
+#endif
+}
+
+static void
+_evas_nv12torgb_raster(unsigned char **yuv, unsigned char *rgb, int w, int h)
+{
+#ifdef BUILD_C
+ int xx, yy;
+ unsigned char *yp1, *yp2, *up, *vp;
+ unsigned char *dp1;
+ unsigned char *dp2;
+
+ dp1 = rgb;
+ dp2 = dp1 + sizeof (int) * w;
+
+ for (yy = 0; yy < h; yy++)
+ {
+ yp1 = yuv[yy++];
+ yp2 = yuv[yy];
+
+ up = yuv[h + (yy >> 1)];
+ vp = up + 1;
+
+ for (xx = 0; xx < w; xx += 2)
+ {
+ _evas_yuv2rgb_420_raster(yp1, yp2, up, vp, dp1, dp2);
+
+ /* the previous call just rendered 2 pixels per lines */
+ dp1 += 8; dp2 += 8;
+
+ /* and took for that 2 lines with 2 Y, 1 U and 1 V. Don't forget U & V are in the same plane */
+ yp1 += 2; yp2 += 2; up += 2; vp += 2;
+ }
+
+ /* jump one line */
+ dp1 += sizeof (int) * w;
+ dp2 += sizeof (int) * w;
+ yp1 += w;
+ yp2 += w;
+ }
+#endif
+}
+
#endif
#ifndef _EVAS_CONVERT_YUV_H
#define _EVAS_CONVERT_YUV_H
-
-EAPI void evas_common_convert_yuv_420p_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
-EAPI void evas_common_convert_yuv_422_601_rgba(DATA8 **src, DATA8 *dst, int w, int h);
-
+EAPI void evas_common_convert_yuv_420p_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
+EAPI void evas_common_convert_yuv_422_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
+EAPI void evas_common_convert_yuv_420_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
+EAPI void evas_common_convert_yuv_420T_601_rgba (DATA8 **src, DATA8 *dst, int w, int h);
#endif /* _EVAS_CONVERT_YUV_H */
#include "evas_mmx.h"
#endif
-#ifndef _WIN32
+#if defined BUILD_SSE3
+#include <immintrin.h>
+#endif
+
+#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
#include <signal.h>
#include <setjmp.h>
#include <errno.h>
static int cpu_feature_mask = 0;
-#ifndef _WIN32
+#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
static void evas_common_cpu_catch_ill(int sig);
static void evas_common_cpu_catch_segv(int sig);
#endif
}
+void evas_common_op_sse3_test(void);
+
+void
+evas_common_cpu_sse3_test(void)
+{
+#ifdef BUILD_SSE3
+ evas_common_op_sse3_test();
+#endif
+}
+
void
evas_common_cpu_altivec_test(void)
{
int
evas_common_cpu_feature_test(void (*feature)(void))
{
-#ifndef _WIN32
+#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
int enabled = 1;
struct sigaction act, oact, oact2;
evas_common_cpu_end_opt();
if (getenv("EVAS_CPU_NO_SSE"))
cpu_feature_mask &= ~CPU_FEATURE_SSE;
+#ifdef BUILD_SSE3
+ cpu_feature_mask |= CPU_FEATURE_SSE3 *
+ evas_common_cpu_feature_test(evas_common_cpu_sse3_test);
+ evas_common_cpu_end_opt();
+ if (getenv("EVAS_CPU_NO_SSE3"))
+ cpu_feature_mask &= ~CPU_FEATURE_SSE3;
+#endif /* BUILD_SSE3 */
#endif /* BUILD_SSE */
#endif /* BUILD_MMX */
#ifdef __POWERPC__
slen = len;
}
- buffer = hb_buffer_create(slen);
+ buffer = hb_buffer_create();
hb_buffer_set_unicode_funcs(buffer, _evas_common_font_ot_unicode_funcs_get());
hb_buffer_set_language(buffer, hb_language_from_string(
- evas_common_language_from_locale_get()));
+ evas_common_language_from_locale_get(), -1));
hb_buffer_set_script(buffer, _evas_script_to_harfbuzz[props->script]);
hb_buffer_set_direction(buffer,
(props->bidi.dir == EVAS_BIDI_DIRECTION_RTL) ?
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
w &= ~0x1;
dst->cache_entry.w = w;
dst->cache_entry.h = h;
/* FIXME: Is dst->image.data valid. */
switch (cspace)
{
- case EVAS_COLORSPACE_ARGB8888:
- dst->cache_entry.flags.alpha = alpha ? 1 : 0;
- if (image_data)
- memcpy(dst->image.data, image_data, w * h * sizeof(DATA32));
- break;
- case EVAS_COLORSPACE_YCBCR422P601_PL:
- case EVAS_COLORSPACE_YCBCR422P709_PL:
- case EVAS_COLORSPACE_YCBCR422601_PL:
- dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char*) * 2);
- if (image_data && (dst->cs.data))
- memcpy(dst->cs.data, image_data, dst->cache_entry.h * sizeof(unsigned char*) * 2);
- break;
- default:
- abort();
- break;
+ case EVAS_COLORSPACE_ARGB8888:
+ dst->cache_entry.flags.alpha = alpha ? 1 : 0;
+ if (image_data)
+ memcpy(dst->image.data, image_data, w * h * sizeof(DATA32));
+ break;
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char*) * 2);
+ if (image_data && (dst->cs.data))
+ memcpy(dst->cs.data, image_data, dst->cache_entry.h * sizeof(unsigned char*) * 2);
+ break;
+ default:
+ abort();
+ break;
}
dst->cache_entry.space = cspace;
if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
- (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL))
- w &= ~0x1;
+ (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL) ||
+ (im->cache_entry.space == EVAS_COLORSPACE_YCBCR420TM12601_PL) ||
+ (im->cache_entry.space == EVAS_COLORSPACE_YCBCR420NV12601_PL))
+ {
+ w &= ~0x1;
+ dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
+ }
dst->flags = im->flags;
dst->cs.no_free = 0;
- if ((im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
- (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422P709_PL) ||
- (im->cache_entry.space == EVAS_COLORSPACE_YCBCR422601_PL))
- dst->cs.data = calloc(1, dst->cache_entry.h * sizeof(unsigned char *) * 2);
evas_common_image_colorspace_dirty(dst);
_evas_common_rgba_image_post_surface(ie_dst);
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
if (dst->image.no_free)
{
ie_dst->allocated.w = 0;
im->cache_entry.w, im->cache_entry.h);
#endif
break;
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+#ifdef BUILD_CONVERT_YUV
+ if ((im->image.data) && (*((unsigned char **)im->cs.data)))
+ evas_common_convert_yuv_420_601_rgba(im->cs.data, (DATA8*) im->image.data,
+ im->cache_entry.w, im->cache_entry.h);
+#endif
+ break;
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+#ifdef BUILD_CONVERT_YUV
+ if ((im->image.data) && (*((unsigned char **)im->cs.data)))
+ evas_common_convert_yuv_420T_601_rgba(im->cs.data, (DATA8*) im->image.data,
+ im->cache_entry.w, im->cache_entry.h);
+#endif
+ break;
default:
break;
}
op_blend_color_.c \
op_blend_color_i386.c \
op_blend_color_neon.c \
+op_blend_color_sse3.c \
op_blend_mask_color_.c \
op_blend_mask_color_i386.c \
op_blend_mask_color_neon.c \
+op_blend_mask_color_sse3.c \
op_blend_pixel_.c \
op_blend_pixel_color_.c \
op_blend_pixel_color_i386.c \
op_blend_pixel_color_neon.c \
+op_blend_pixel_color_sse3.c \
op_blend_pixel_i386.c \
op_blend_pixel_mask_.c \
op_blend_pixel_mask_i386.c \
op_blend_pixel_mask_neon.c \
-op_blend_pixel_neon.c
+op_blend_pixel_mask_sse3.c \
+op_blend_pixel_neon.c \
+op_blend_pixel_sse3.c
+
+noinst_LTLIBRARIES = libevas_engine_common_op_blend_master_sse3.la
+
+libevas_engine_common_op_blend_master_sse3_la_SOURCES = \
+op_blend_master_sse3.c
+
+libevas_engine_common_op_blend_master_sse3_la_CFLAGS = \
+-I. \
+-I$(top_srcdir)/src/lib \
+-I$(top_srcdir)/src/lib/engines/common \
+-I$(top_srcdir)/src/lib/engines/common/evas_op_blend \
+-I$(top_srcdir)/src/lib/cserve \
+-I$(top_srcdir)/src/lib/include \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
+@FREETYPE_CFLAGS@ @VALGRIND_CFLAGS@ \
+@PIXMAN_CFLAGS@ \
+@EET_CFLAGS@ @pthread_cflags@ \
+@WIN32_CFLAGS@ @EINA_CFLAGS@ \
+@FRIBIDI_CFLAGS@ @HARFBUZZ_CFLAGS@ \
+@PIXMAN_CFLAGS@ \
+@EVAS_SSE3_CFLAGS@
+
+libevas_engine_common_op_blend_master_sse3_la_DEPENENCIES = \
+$(top_builddir)/config.h
+
#include "evas_common.h"
-static RGBA_Gfx_Func op_blend_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
-static RGBA_Gfx_Pt_Func op_blend_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
+RGBA_Gfx_Func op_blend_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
+RGBA_Gfx_Pt_Func op_blend_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
static void op_blend_init(void);
static void op_blend_shutdown(void);
}
-static RGBA_Gfx_Func op_blend_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
-static RGBA_Gfx_Pt_Func op_blend_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
+RGBA_Gfx_Func op_blend_rel_span_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
+RGBA_Gfx_Pt_Func op_blend_rel_pt_funcs[SP_LAST][SM_LAST][SC_LAST][DP_LAST][CPU_LAST];
static void op_blend_rel_init(void);
static void op_blend_rel_shutdown(void);
# include "./evas_op_blend/op_blend_mask_color_neon.c"
//# include "./evas_op_blend/op_blend_pixel_mask_color_neon.c"
+#ifdef BUILD_SSE3
+void evas_common_op_blend_init_sse3(void);
+#endif
+
static void
op_blend_init(void)
{
memset(op_blend_span_funcs, 0, sizeof(op_blend_span_funcs));
memset(op_blend_pt_funcs, 0, sizeof(op_blend_pt_funcs));
+#ifdef BUILD_SSE3
+ evas_common_op_blend_init_sse3();
+#endif
#ifdef BUILD_MMX
init_blend_pixel_span_funcs_mmx();
init_blend_pixel_color_span_funcs_mmx();
init_blend_pixel_mask_pt_funcs_neon();
init_blend_color_pt_funcs_neon();
init_blend_mask_color_pt_funcs_neon();
-#endif
+#endif
#ifdef BUILD_C
init_blend_pixel_span_funcs_c();
init_blend_pixel_color_span_funcs_c();
{
RGBA_Gfx_Func func = NULL;
int cpu = CPU_N;
+#ifdef BUILD_SSE3
+ if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
+ {
+ cpu = CPU_SSE3;
+ func = op_blend_span_funcs[s][m][c][d][cpu];
+ if(func) return func;
+ }
+#endif
#ifdef BUILD_MMX
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
{
RGBA_Gfx_Pt_Func func = NULL;
int cpu = CPU_N;
+#ifdef BUILD_SSE3
+ if(evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
+ {
+ cpu = CPU_SSE3;
+ func = op_blend_pt_funcs[s][m][c][d][cpu];
+ if(func) return func;
+ }
+#endif
#ifdef BUILD_MMX
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
return blend_gfx_pt_func_cpu(s, m, c, d);
}
+void evas_common_op_blend_rel_init_sse3(void);
static void
op_blend_rel_init(void)
{
memset(op_blend_rel_span_funcs, 0, sizeof(op_blend_rel_span_funcs));
memset(op_blend_rel_pt_funcs, 0, sizeof(op_blend_rel_pt_funcs));
+#ifdef BUILD_SSE3
+ evas_common_op_blend_rel_init_sse3();
+#endif
#ifdef BUILD_MMX
init_blend_rel_pixel_span_funcs_mmx();
init_blend_rel_pixel_color_span_funcs_mmx();
{
RGBA_Gfx_Func func = NULL;
int cpu = CPU_N;
+#ifdef BUILD_SSE3
+ if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
+ {
+ cpu = CPU_SSE3;
+ func = op_blend_rel_span_funcs[s][m][c][d][cpu];
+ if(func) return func;
+ }
+#endif
#ifdef BUILD_MMX
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
{
RGBA_Gfx_Pt_Func func = NULL;
int cpu = CPU_N;
+#ifdef BUILD_SSE3
+ if (evas_common_cpu_has_feature(CPU_FEATURE_SSE3))
+ {
+ cpu = CPU_SSE3;
+ func = op_blend_rel_pt_funcs[s][m][c][d][cpu];
+ if(func) return func;
+ }
+#endif
#ifdef BUILD_MMX
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
return EINA_TRUE;
}
+Eina_List *
+evas_module_engine_list(void)
+{
+ Evas_Module *em;
+ Eina_List *r = NULL;
+ Eina_Array_Iterator iterator;
+ unsigned int i;
+
+ EINA_ARRAY_ITER_NEXT(evas_engines, i, em, iterator)
+ r = eina_list_append(r, em->definition->name);
+
+ return r;
+}
+
Eina_Bool
evas_module_unregister(const Evas_Module_Api *module, Evas_Module_Type type)
{
}
return 0;
}
+
+static Eina_Prefix *pfx = NULL;
+
+EAPI const char *
+_evas_module_libdir_get(void)
+{
+ if (!pfx) pfx = eina_prefix_new
+ (NULL, _evas_module_libdir_get, "EVAS", "evas", NULL,
+ PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
+ if (!pfx) return NULL;
+ return eina_prefix_lib_get(pfx);
+}
#include "evas_mmx.h"
#endif
+#include "config.h"
+
+#ifdef NEED_SSE3
+# if defined BUILD_SSE3
+# include <immintrin.h>
+# endif
+#endif
+
/* src pixel flags: */
/* pixels none */
#define CPU_SSE2 4
/* cpu flags count */
#define CPU_NEON 5
+/* CPU SSE3 */
+#define CPU_SSE3 6
/* cpu flags count */
-#define CPU_LAST 6
+#define CPU_LAST 7
/* some useful constants */
#endif
+
+/* some useful SSE3 inline functions */
+
+#ifdef NEED_SSE3
+#ifdef BUILD_SSE3
+
+static __m128i GA_MASK_SSE3;
+static __m128i RB_MASK_SSE3;
+static __m128i SYM4_MASK_SSE3;
+static __m128i RGB_MASK_SSE3;
+//static __m128i A_MASK_SSE3;
+
+static __m128i ALPHA_SSE3;
+
+static always_inline __m128i
+mul_256_sse3(__m128i a, __m128i c) {
+
+ /* prepare alpha for word multiplication */
+ __m128i a_l = a;
+ __m128i a_h = a;
+ a_l = _mm_unpacklo_epi16(a_l, a_l);
+ a_h = _mm_unpackhi_epi16(a_h, a_h);
+ __m128i a0 = (__m128i) _mm_shuffle_ps( (__m128)a_l, (__m128)a_h, 0x88);
+
+ /* first half of calc */
+ __m128i c0 = c;
+ c0 = _mm_srli_epi32(c0, 8);
+ c0 = _mm_and_si128(GA_MASK_SSE3, c0);
+ c0 = _mm_mullo_epi16(a0, c0);
+ c0 = _mm_and_si128(RB_MASK_SSE3, c0);
+
+ /* second half of calc */
+ __m128i c1 = c;
+ c1 = _mm_and_si128(GA_MASK_SSE3, c1);
+ c1 = _mm_mullo_epi16(a0, c1);
+ c1 = _mm_srli_epi32(c1, 8);
+ c1 = _mm_and_si128(GA_MASK_SSE3, c1);
+
+ /* combine */
+ return _mm_add_epi32(c0, c1);
+}
+
+static always_inline __m128i
+sub4_alpha_sse3(__m128i c) {
+
+ __m128i c0 = c;
+
+ c0 = _mm_srli_epi32(c0, 24);
+ return _mm_sub_epi32(ALPHA_SSE3, c0);
+}
+
+static always_inline __m128i
+interp4_256_sse3(__m128i a, __m128i c0, __m128i c1)
+{
+ const __m128i zero = _mm_setzero_si128();
+
+ __m128i a_l = a;
+ __m128i a_h = a;
+ a_l = _mm_unpacklo_epi16(a_l, a_l);
+ a_h = _mm_unpackhi_epi16(a_h, a_h);
+
+ __m128i a_t = _mm_slli_epi64(a_l, 32);
+ __m128i a_t0 = _mm_slli_epi64(a_h, 32);
+
+ a_l = _mm_add_epi32(a_l, a_t);
+ a_h = _mm_add_epi32(a_h, a_t0);
+
+ __m128i c0_l = c0;
+ __m128i c0_h = c0;
+
+ c0_l = _mm_unpacklo_epi8(c0_l, zero);
+ c0_h = _mm_unpackhi_epi8(c0_h, zero);
+
+ __m128i c1_l = c1;
+ __m128i c1_h = c1;
+
+ c1_l = _mm_unpacklo_epi8(c1_l, zero);
+ c1_h = _mm_unpackhi_epi8(c1_h, zero);
+
+ __m128i cl_sub = _mm_sub_epi16(c0_l, c1_l);
+ __m128i ch_sub = _mm_sub_epi16(c0_h, c1_h);
+
+ cl_sub = _mm_mullo_epi16(cl_sub, a_l);
+ ch_sub = _mm_mullo_epi16(ch_sub, a_h);
+
+ __m128i c1ls = _mm_slli_epi16(c1_l, 8);
+ __m128i c1hs = _mm_slli_epi16(c1_h, 8);
+
+ cl_sub = _mm_add_epi16(cl_sub, c1ls);
+ ch_sub = _mm_add_epi16(ch_sub, c1hs);
+
+ cl_sub = _mm_and_si128(cl_sub, RB_MASK_SSE3);
+ ch_sub = _mm_and_si128(ch_sub, RB_MASK_SSE3);
+
+ cl_sub = _mm_srli_epi64(cl_sub, 8);
+ ch_sub = _mm_srli_epi64(ch_sub, 8);
+
+ cl_sub = _mm_packus_epi16(cl_sub, cl_sub);
+ ch_sub = _mm_packus_epi16(ch_sub, ch_sub);
+
+ return (__m128i) _mm_shuffle_ps( (__m128)cl_sub, (__m128)ch_sub, 0x44);
+}
+
+static always_inline __m128i
+mul_sym_sse3(__m128i a, __m128i c) {
+
+ /* Prepare alpha for word mult */
+ __m128i a_l = a;
+ __m128i a_h = a;
+ a_l = _mm_unpacklo_epi16(a_l, a_l);
+ a_h = _mm_unpackhi_epi16(a_h, a_h);
+ __m128i a0 = (__m128i) _mm_shuffle_ps( (__m128)a_l, (__m128)a_h, 0x88);
+
+ /* first part */
+ __m128i c0 = c;
+ c0 = _mm_srli_epi32(c0, 8);
+ c0 = _mm_and_si128(GA_MASK_SSE3, c0);
+ c0 = _mm_mullo_epi16(a0, c0);
+ c0 = _mm_add_epi32(c0, GA_MASK_SSE3);
+ c0 = _mm_and_si128(RB_MASK_SSE3, c0);
+
+ /* second part */
+ __m128i c1 = c;
+ c1 = _mm_and_si128(GA_MASK_SSE3, c1);
+ c1 = _mm_mullo_epi16(a0, c1);
+ c1 = _mm_add_epi32(c1, GA_MASK_SSE3);
+ c1 = _mm_srli_epi32(c1, 8);
+ c1 = _mm_and_si128(GA_MASK_SSE3, c1);
+
+ return _mm_add_epi32(c0, c1);
+}
+
+static always_inline __m128i
+mul4_sym_sse3(__m128i x, __m128i y) {
+
+ const __m128i zero = _mm_setzero_si128();
+
+ __m128i x_l = _mm_unpacklo_epi8(x, zero);
+ __m128i x_h = _mm_unpackhi_epi8(x, zero);
+
+ __m128i y_l = _mm_unpacklo_epi8(y, zero);
+ __m128i y_h = _mm_unpackhi_epi8(y, zero);
+
+ __m128i r_l = _mm_mullo_epi16(x_l, y_l);
+ __m128i r_h = _mm_mullo_epi16(x_h, y_h);
+
+ r_l = _mm_add_epi16(r_l, SYM4_MASK_SSE3);
+ r_h = _mm_add_epi16(r_h, SYM4_MASK_SSE3);
+
+ r_l = _mm_srli_epi16(r_l, 8);
+ r_h = _mm_srli_epi16(r_h, 8);
+
+ return _mm_packus_epi16(r_l, r_h);
+}
+
+static always_inline __m128i
+mul3_sym_sse3(__m128i x, __m128i y) {
+
+ __m128i res = mul4_sym_sse3(x, y);
+ return _mm_and_si128(res, RGB_MASK_SSE3);
+}
+
+#define LOOP_ALIGNED_U1_A48_SSE3(D, LENGTH, UOP,A4OP, A8OP) \
+ { \
+ while((uintptr_t)d & 0xF && l) UOP \
+ \
+ while(l) { \
+ switch(l) { \
+ case 3: UOP \
+ case 2: UOP \
+ case 1: UOP \
+ break; \
+ case 7: \
+ case 6: \
+ case 5: \
+ case 4: \
+ A4OP \
+ break; \
+ default: \
+ A8OP \
+ break; \
+ } \
+ } \
+ }
+
+
+#endif
+#endif
+
#endif
# define LKI(x)
# define LKD(x)
# define LKL(x)
-# define LKT(x) 0
+# define LKT(x) 1
# define LKU(x)
# define TH(x)
# define THI(x)
/*****************************************************************************/
-typedef unsigned long long DATA64;
-typedef unsigned int DATA32;
-typedef unsigned short DATA16;
+typedef unsigned long long DATA64;
+typedef unsigned int DATA32;
+typedef unsigned short DATA16;
typedef unsigned char DATA8;
typedef struct _Image_Entry Image_Entry;
CPU_FEATURE_ALTIVEC = (1 << 3),
CPU_FEATURE_VIS = (1 << 4),
CPU_FEATURE_VIS2 = (1 << 5),
- CPU_FEATURE_NEON = (1 << 6)
+ CPU_FEATURE_NEON = (1 << 6),
+ CPU_FEATURE_SSE3 = (1 << 7)
} CPU_Features;
typedef enum _Font_Hint_Flags
/*#define BUILD_MMX*/
/*#define BUILD_SSE*/
+/*#define BUILD_SSE3*/
/*#define BUILD_C*/
/*#define BUILD_LOADER_PNG*/
/* check in that the user configured it right */
#ifndef BUILD_MMX
-# ifndef BUILD_SSE
-# ifndef BUILD_C
+# ifndef BUILD_SSE3
+# ifndef BUILD_SSE
+# ifndef BUILD_C
# error "Please Read the README"
+ #endif
# endif
# endif
#endif
typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
typedef struct _Evas_Post_Callback Evas_Post_Callback;
+enum _Evas_Font_Style
+{
+ EVAS_FONT_STYLE_SLANT,
+ EVAS_FONT_STYLE_WEIGHT,
+ EVAS_FONT_STYLE_WIDTH
+};
+
+enum _Evas_Font_Slant
+{
+ EVAS_FONT_SLANT_NORMAL,
+ EVAS_FONT_SLANT_OBLIQUE,
+ EVAS_FONT_SLANT_ITALIC
+};
+
+enum _Evas_Font_Weight
+{
+ EVAS_FONT_WEIGHT_NORMAL,
+ EVAS_FONT_WEIGHT_THIN,
+ EVAS_FONT_WEIGHT_ULTRALIGHT,
+ EVAS_FONT_WEIGHT_LIGHT,
+ EVAS_FONT_WEIGHT_BOOK,
+ EVAS_FONT_WEIGHT_MEDIUM,
+ EVAS_FONT_WEIGHT_SEMIBOLD,
+ EVAS_FONT_WEIGHT_BOLD,
+ EVAS_FONT_WEIGHT_ULTRABOLD,
+ EVAS_FONT_WEIGHT_BLACK,
+ EVAS_FONT_WEIGHT_EXTRABLACK
+};
+
+enum _Evas_Font_Width
+{
+ EVAS_FONT_WIDTH_NORMAL,
+ EVAS_FONT_WIDTH_ULTRACONDENSED,
+ EVAS_FONT_WIDTH_EXTRACONDENSED,
+ EVAS_FONT_WIDTH_CONDENSED,
+ EVAS_FONT_WIDTH_SEMICONDENSED,
+ EVAS_FONT_WIDTH_SEMIEXPANDED,
+ EVAS_FONT_WIDTH_EXPANDED,
+ EVAS_FONT_WIDTH_EXTRAEXPANDED,
+ EVAS_FONT_WIDTH_ULTRAEXPANDED
+};
+
typedef enum _Evas_Font_Style Evas_Font_Style;
typedef enum _Evas_Font_Slant Evas_Font_Slant;
typedef enum _Evas_Font_Weight Evas_Font_Weight;
Eina_Array calculate_objects;
Eina_Array clip_changes;
+ Eina_List *calc_list;
+ Eina_List *calc_list_current;
+ Eina_List *video_objects;
+
Eina_List *post_events; // free me on evas_free
Evas_Callbacks *callbacks;
Eina_List *font_path;
int in_smart_calc;
+ int smart_calc_count;
Evas_Object *focused;
void *attach_data;
unsigned char invalidate : 1;
unsigned char cleanup : 1;
unsigned char focus : 1;
+
+ Eina_List *touch_points;
};
struct _Evas_Layer
Evas_Font *fn;
};
-enum _Evas_Font_Style
-{
- EVAS_FONT_STYLE_SLANT,
- EVAS_FONT_STYLE_WEIGHT,
- EVAS_FONT_STYLE_WIDTH
-};
-
-enum _Evas_Font_Slant
-{
- EVAS_FONT_SLANT_NORMAL,
- EVAS_FONT_SLANT_OBLIQUE,
- EVAS_FONT_SLANT_ITALIC
-};
-
-enum _Evas_Font_Weight
-{
- EVAS_FONT_WEIGHT_NORMAL,
- EVAS_FONT_WEIGHT_THIN,
- EVAS_FONT_WEIGHT_ULTRALIGHT,
- EVAS_FONT_WEIGHT_LIGHT,
- EVAS_FONT_WEIGHT_BOOK,
- EVAS_FONT_WEIGHT_MEDIUM,
- EVAS_FONT_WEIGHT_SEMIBOLD,
- EVAS_FONT_WEIGHT_BOLD,
- EVAS_FONT_WEIGHT_ULTRABOLD,
- EVAS_FONT_WEIGHT_BLACK,
- EVAS_FONT_WEIGHT_EXTRABLACK
-};
-
-enum _Evas_Font_Width
-{
- EVAS_FONT_WIDTH_NORMAL,
- EVAS_FONT_WIDTH_ULTRACONDENSED,
- EVAS_FONT_WIDTH_EXTRACONDENSED,
- EVAS_FONT_WIDTH_CONDENSED,
- EVAS_FONT_WIDTH_SEMICONDENSED,
- EVAS_FONT_WIDTH_SEMIEXPANDED,
- EVAS_FONT_WIDTH_EXPANDED,
- EVAS_FONT_WIDTH_EXTRAEXPANDED,
- EVAS_FONT_WIDTH_ULTRAEXPANDED
-};
-
struct _Evas_Font_Description
{
int ref;
Evas_Font_Weight weight;
Evas_Font_Width width;
- Eina_Bool new : 1;
+ Eina_Bool is_new : 1;
};
struct _Evas_Object_Func
Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading);
void _evas_object_image_preloading_check(Evas_Object *obj);
+Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
+void _evas_object_image_video_overlay_show(Evas_Object *obj);
+void _evas_object_image_video_overlay_hide(Evas_Object *obj);
void evas_object_smart_del(Evas_Object *obj);
void evas_object_smart_cleanup(Evas_Object *obj);
void evas_object_smart_member_raise(Evas_Object *member);
// expose for use in engines
EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name);
-
+EAPI const char *_evas_module_libdir_get(void);
+
Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj,
void *context, void *surface,
int off_x, int off_y, int mapped,
Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab);
+Eina_List *evas_module_engine_list(void);
+
+/* for touch event */
+void _evas_event_touch_down(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp);
+void _evas_event_touch_up(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp);
+void _evas_event_touch_move(Evas *e, Evas_Coord x, Evas_Coord y, int id, unsigned int timestamp);
+
/****************************************************************************/
/*****************************************/
/********************/
SUBDIRS += software_16_x11
endif
if !EVAS_STATIC_BUILD_SOFTWARE_SDL
-SUBDIRS += software_16_sdl software_sdl
+SUBDIRS += software_sdl
+endif
+if !EVAS_STATIC_BUILD_SOFTWARE_16_SDL
+SUBDIRS += software_16_sdl
endif
if !EVAS_STATIC_BUILD_SOFTWARE_DDRAW
SUBDIRS += software_ddraw
shader/img_bgra_nomul_vert_bin_s3c6410.h \
shader/img_mask_frag.h \
shader/img_mask_vert.h \
+shader/nv12_nomul_vert.h \
+shader/nv12_vert.h \
+shader/nv12_nomul_frag.h \
+shader/nv12_frag.h \
shader/yuv_frag.h \
shader/yuv_frag_bin_s3c6410.h \
shader/yuv_vert.h \
shader/filter_blur.h \
shader/filter_blur_nomul.h \
shader/filter_blur_bgra.h \
-shader/filter_blur_bgra_nomul.h
+shader/filter_blur_bgra_nomul.h \
+shader/yuy2_frag.h \
+shader/yuy2_vert.h \
+shader/yuy2_nomul_frag.h \
+shader/yuy2_nomul_vert.h
libevas_engine_gl_common_la_LIBADD = @EINA_LIBS@ @GL_EET_LIBS@ @evas_engine_gl_common_libs@ @dlopen_libs@
endif
#ifndef EGL_MAP_GL_TEXTURE_RGBA_SEC
# define EGL_MAP_GL_TEXTURE_RGBA_SEC 0x3206
#endif
+#ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_SEC
+# define EGL_MAP_GL_TEXTURE_LUMINANCE_SEC 0x3207
+#endif
+#ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC
+# define EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC 0x3208
+#endif
#ifndef EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC
-# define EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC 0x3206
+# define EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC 0x3209
#endif
#ifndef EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC
-# define EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC 0x3207
+# define EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC 0x3210
#endif
#ifndef EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC
-# define EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC 0x3208
+# define EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC 0x3211
#endif
#ifndef GL_PROGRAM_BINARY_LENGTH
# define GL_PROGRAM_BINARY_LENGTH 0x8741
typedef struct _Evas_GL_Polygon Evas_GL_Polygon;
typedef struct _Evas_GL_Polygon_Point Evas_GL_Polygon_Point;
+typedef enum {
+ SHADER_RECT,
+ SHADER_FONT,
+ SHADER_IMG,
+ SHADER_IMG_NOMUL,
+ SHADER_IMG_BGRA,
+ SHADER_IMG_BGRA_NOMUL,
+ SHADER_IMG_MASK,
+ SHADER_YUV,
+ SHADER_YUV_NOMUL,
+ SHADER_YUY2,
+ SHADER_YUY2_NOMUL,
+ SHADER_NV12,
+ SHADER_NV12_NOMUL,
+ SHADER_TEX,
+ SHADER_TEX_NOMUL,
+ SHADER_FILTER_INVERT,
+ SHADER_FILTER_INVERT_NOMUL,
+ SHADER_FILTER_INVERT_BGRA,
+ SHADER_FILTER_INVERT_BGRA_NOMUL,
+ SHADER_FILTER_GREYSCALE,
+ SHADER_FILTER_GREYSCALE_NOMUL,
+ SHADER_FILTER_GREYSCALE_BGRA,
+ SHADER_FILTER_GREYSCALE_BGRA_NOMUL,
+ SHADER_FILTER_SEPIA,
+ SHADER_FILTER_SEPIA_NOMUL,
+ SHADER_FILTER_SEPIA_BGRA,
+ SHADER_FILTER_SEPIA_BGRA_NOMUL,
+ /* SHADER_FILTER_BLUR, */
+ /* SHADER_FILTER_BLUR_NOMUL, */
+ /* SHADER_FILTER_BLUR_BGRA, */
+ /* SHADER_FILTER_BLUR_BGRA_NOMUL, */
+ SHADER_LAST
+} Evas_GL_Shader;
+
struct _Evas_GL_Program
{
GLuint vert, frag, prog;
+
+ int tex_count;
};
struct _Evas_GL_Program_Source
Eina_Hash *native_pm_hash;
Eina_Hash *native_tex_hash;
- struct {
- Evas_GL_Program rect;
- Evas_GL_Program font;
-
- Evas_GL_Program img, img_nomul;
- Evas_GL_Program img_bgra, img_bgra_nomul;
- Evas_GL_Program img_mask;
- Evas_GL_Program yuv, yuv_nomul;
- Evas_GL_Program tex, tex_nomul;
-
- Evas_GL_Program filter_invert, filter_invert_nomul;
- Evas_GL_Program filter_invert_bgra, filter_invert_bgra_nomul;
- Evas_GL_Program filter_greyscale, filter_greyscale_nomul;
- Evas_GL_Program filter_greyscale_bgra, filter_greyscale_bgra_nomul;
- Evas_GL_Program filter_sepia, filter_sepia_nomul;
- Evas_GL_Program filter_sepia_bgra, filter_sepia_bgra_nomul;
-#if 0
- Evas_GL_Program filter_blur_vert;
- Evas_GL_Program filter_blur, filter_blur_nomul;
- Evas_GL_Program filter_blur_bgra, filter_blur_bgra_nomul;
-#endif
- } shader;
+ Evas_GL_Program shader[SHADER_LAST];
+
int references;
int w, h;
int rot;
#define RTYPE_YUV 4
#define RTYPE_MAP 5 /* need to merge with image */
#define RTYPE_IMASK 6
-
-
+#define RTYPE_YUY2 7
+#define RTYPE_NV12 8
struct _Evas_Engine_GL_Context
{
int top_pipe;
struct {
GLuint cur_prog;
- GLuint cur_tex, cur_texu, cur_texv;
+ GLuint cur_tex, cur_texu, cur_texv;
GLuint cur_texm, cur_texmu, cur_texmv;
int render_op;
int cx, cy, cw, ch;
Evas_GL_Image *surface;
GLuint cur_prog;
GLuint cur_tex, cur_texu, cur_texv, cur_texm;
- int render_op;
+ void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn;
+ int render_op;
int cx, cy, cw, ch;
int smooth;
int blend;
{
Evas_Engine_GL_Context *gc;
Evas_GL_Image *im;
- Evas_GL_Texture_Pool *pt, *ptu, *ptv;
+ Evas_GL_Texture_Pool *pt, *ptu, *ptv, *ptuv;
int x, y, w, h;
double sx1, sy1, sx2, sy2;
int references;
+ struct
+ {
+ Evas_GL_Texture_Pool *pt[2], *ptuv[2];
+ int source;
+ } double_buffer;
+
Eina_Bool alpha : 1;
+ Eina_Bool dyn : 1;
};
struct _Evas_GL_Image
int x, y;
};
+#if 0
extern Evas_GL_Program_Source shader_rect_frag_src;
extern Evas_GL_Program_Source shader_rect_vert_src;
extern Evas_GL_Program_Source shader_font_frag_src;
extern Evas_GL_Program_Source shader_yuv_nomul_frag_src;
extern Evas_GL_Program_Source shader_yuv_nomul_vert_src;
+extern Evas_GL_Program_Source shader_yuy2_frag_src;
+extern Evas_GL_Program_Source shader_yuy2_vert_src;
+extern Evas_GL_Program_Source shader_yuy2_nomul_frag_src;
+extern Evas_GL_Program_Source shader_yuy2_nomul_vert_src;
+
extern Evas_GL_Program_Source shader_tex_frag_src;
extern Evas_GL_Program_Source shader_tex_vert_src;
extern Evas_GL_Program_Source shader_tex_nomul_frag_src;
extern Evas_GL_Program_Source shader_filter_greyscale_nomul_frag_src;
extern Evas_GL_Program_Source shader_filter_greyscale_bgra_frag_src;
extern Evas_GL_Program_Source shader_filter_greyscale_bgra_nomul_frag_src;
-#if 0
/* blur (annoyingly) needs (aka is faster with) a vertex shader */
extern Evas_GL_Program_Source shader_filter_blur_vert_src;
extern Evas_GL_Program_Source shader_filter_blur_frag_src;
int x, int y, int w, int h,
int r, int g, int b, int a,
Eina_Bool smooth);
+void evas_gl_common_context_yuy2_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_nv12_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_Engine_GL_Context *gc,
Evas_GL_Texture *tex,
int npoints,
int r, int g, int b, int a,
Eina_Bool smooth,
Eina_Bool tex_only,
- Eina_Bool yuv);
+ Evas_Colorspace cspace);
void evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
int evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
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_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);
+Evas_GL_Texture *evas_gl_common_texture_yuy2_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
+void evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
+Evas_GL_Texture *evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
+void evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
+Evas_GL_Texture *evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
+void evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc);
extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d);
#endif
-//#define GL_ERRORS 1
+#define GL_ERRORS 1
#ifdef GL_ERRORS
# define GLERR(fn, fl, ln, op) \
_evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
{
GLfloat proj[16];
+ unsigned int i;
int w = 1, h = 1, m = 1, rot = 1, foc = 0;
EINA_SAFETY_ON_NULL_RETURN(gc);
gc->shared->ay = ay;
}
- glUseProgram(gc->shared->shader.rect.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.rect.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.font.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.font.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
- glUseProgram(gc->shared->shader.yuv.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.yuv.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.yuv_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.yuv_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
- glUseProgram(gc->shared->shader.tex.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.tex.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.tex_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.tex_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
- glUseProgram(gc->shared->shader.img.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.img.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.img_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.img_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
- glUseProgram(gc->shared->shader.img_bgra.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.img_bgra.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.img_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.img_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.img_mask.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.img_mask.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_invert.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_invert.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_invert_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_invert_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_invert_bgra.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_invert_bgra.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_invert_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_invert_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
- glUseProgram(gc->shared->shader.filter_greyscale.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_greyscale.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_greyscale_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_greyscale_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_greyscale_bgra.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_greyscale_bgra.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_greyscale_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_greyscale_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
- glUseProgram(gc->shared->shader.filter_sepia.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_sepia.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_sepia_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_sepia_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_sepia_bgra.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_sepia_bgra.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_sepia_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_sepia_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
-#if 0
- glUseProgram(gc->shared->shader.filter_blur_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_blur_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_blur_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_blur_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_blur_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_blur_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(gc->shared->shader.filter_blur_bgra_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader.filter_blur_bgra_nomul.prog, "mvp"), 1,
- GL_FALSE, proj);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-#endif
-
+ for (i = 0; i < SHADER_LAST; ++i)
+ {
+ glUseProgram(gc->shared->shader[i].prog);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ }
glUseProgram(gc->pipe[0].shader.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!evas_gl_common_shader_program_init(shared)) goto error;
- glUseProgram(shared->shader.yuv.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "tex"), 0);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texu"), 1);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.yuv.prog, "texv"), 2);
+#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \
+ glUseProgram(Shared->shader[SHADER_##Shader].prog); \
+ GLERR(__FUNCTION__, __FILE__, __LINE__, ""); \
+ glUniform1i(glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUseProgram(shared->shader.yuv_nomul.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.yuv_nomul.prog, "tex"), 0);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.yuv_nomul.prog, "texu"), 1);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.yuv_nomul.prog, "texv"), 2);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ SHADER_TEXTURE_ADD(shared, YUV, tex);
+ SHADER_TEXTURE_ADD(shared, YUV, texu);
+ SHADER_TEXTURE_ADD(shared, YUV, texv);
- glUseProgram(shared->shader.img_mask.prog);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.img_mask.prog, "tex"), 0);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- glUniform1i(glGetUniformLocation(shared->shader.img_mask.prog, "texm"), 1);
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ SHADER_TEXTURE_ADD(shared, YUY2, tex);
+ SHADER_TEXTURE_ADD(shared, YUY2, texuv);
+
+ SHADER_TEXTURE_ADD(shared, NV12, tex);
+ SHADER_TEXTURE_ADD(shared, NV12, texuv);
+
+ SHADER_TEXTURE_ADD(shared, YUV_NOMUL, tex);
+ SHADER_TEXTURE_ADD(shared, YUV_NOMUL, texu);
+ SHADER_TEXTURE_ADD(shared, YUV_NOMUL, texv);
+ SHADER_TEXTURE_ADD(shared, YUY2_NOMUL, tex);
+ SHADER_TEXTURE_ADD(shared, YUY2_NOMUL, texuv);
+ SHADER_TEXTURE_ADD(shared, NV12_NOMUL, tex);
+ SHADER_TEXTURE_ADD(shared, NV12_NOMUL, texuv);
+
+ SHADER_TEXTURE_ADD(shared, IMG_MASK, tex);
+ SHADER_TEXTURE_ADD(shared, IMG_MASK, texm);
glUseProgram(gc->pipe[0].shader.cur_prog);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
{
Evas_GL_Texture_Pool *pt;
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.rect));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.font));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.img));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.img_nomul));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.img_bgra));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.img_bgra_nomul));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.img_mask));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.yuv));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.yuv_nomul));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.tex));
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.tex_nomul));
-
- evas_gl_common_shader_program_shutdown(&(gc->shared->shader.filter_invert));
+ for (i = 0; i < SHADER_LAST; ++i)
+ evas_gl_common_shader_program_shutdown(&(gc->shared->shader[i]));
while (gc->shared->images)
{
gc->pipe[n].array.alloc * sizeof(GLfloat) * 2);
}
+#ifdef GLPIPES
static int
pipe_region_intersects(Evas_Engine_GL_Context *gc, int n,
int x, int y, int w, int h)
}
return 0;
}
+#endif
static void
pipe_region_expand(Evas_Engine_GL_Context *gc, int n,
return 1;
}
+static inline Evas_GL_Shader
+evas_gl_common_shader_choice(int npoints __UNUSED__,
+ RGBA_Map_Point *p,
+ int r, int g, int b, int a,
+ Evas_GL_Shader nomul,
+ Evas_GL_Shader mul)
+{
+ if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
+ {
+ if (!p) return nomul;
+
+ if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
+ (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
+ return nomul;
+ }
+ return mul;
+}
+
+static int
+_evas_gl_common_context_push(int rtype,
+ Evas_Engine_GL_Context *gc,
+ Evas_GL_Texture *tex,
+ Evas_GL_Texture *texm,
+ GLuint prog,
+ int x, int y, int w, int h,
+ Eina_Bool blend,
+ Eina_Bool smooth,
+ Eina_Bool clip,
+ int cx, int cy, int cw, int ch)
+{
+ int pn = 0;
+
+#ifdef GLPIPES
+ again:
+#endif
+ vertex_array_size_check(gc, gc->state.top_pipe, 6);
+ pn = gc->state.top_pipe;
+#ifdef GLPIPES
+ if (!((pn == 0) && (gc->pipe[pn].array.num == 0)))
+ {
+ int found = 0;
+ int i;
+
+ for (i = pn; i >= 0; i--)
+ {
+ if ((gc->pipe[i].region.type == rtype)
+ && (!tex || gc->pipe[i].shader.cur_tex == tex->pt->texture)
+ && (!texm || gc->pipe[i].shader.cur_texm == texm->pt->texture)
+ && (gc->pipe[i].shader.cur_prog == prog)
+ && (gc->pipe[i].shader.smooth == smooth)
+ && (gc->pipe[i].shader.blend == blend)
+ && (gc->pipe[i].shader.render_op == gc->dc->render_op)
+ && (gc->pipe[i].shader.clip == clip)
+ && (!clip || ((gc->pipe[i].shader.cx == cx)
+ && (gc->pipe[i].shader.cy == cy)
+ && (gc->pipe[i].shader.cw == cw)
+ && (gc->pipe[i].shader.ch == ch))))
+ {
+ found = 1;
+ pn = i;
+ break;
+ }
+ if (pipe_region_intersects(gc, i, x, y, w, h)) break;
+ }
+ if (!found)
+ {
+ pn = gc->state.top_pipe + 1;
+ if (pn >= gc->shared->info.tune.pipes.max)
+ {
+ shader_array_flush(gc);
+ goto again;
+ }
+ gc->state.top_pipe = pn;
+ }
+ }
+ if ((tex) && (((tex->im) && (tex->im->native.data)) || tex->pt->dyn.img))
+ {
+ if (gc->pipe[pn].array.im != tex->im)
+ {
+ shader_array_flush(gc);
+ pn = gc->state.top_pipe;
+ gc->pipe[pn].array.im = tex->im;
+ goto again;
+ }
+ }
+#else
+ if (!((gc->pipe[pn].region.type == rtype)
+ && (!tex || gc->pipe[pn].shader.cur_tex == tex->pt->texture)
+ && (!texm || gc->pipe[pn].shader.cur_texm == texm->pt->texture)
+ && (gc->pipe[pn].shader.cur_prog == prog)
+ && (gc->pipe[pn].shader.smooth == smooth)
+ && (gc->pipe[pn].shader.blend == blend)
+ && (gc->pipe[pn].shader.render_op == gc->dc->render_op)
+ && (gc->pipe[pn].shader.clip == clip)
+ && (!clip || ((gc->pipe[pn].shader.cx == cx)
+ && (gc->pipe[pn].shader.cy == cy)
+ && (gc->pipe[pn].shader.cw == cw)
+ && (gc->pipe[pn].shader.ch == ch)))))
+ {
+ shader_array_flush(gc);
+ }
+ if ((tex) && (((tex->im) && (tex->im->native.data)) || tex->pt->dyn.img))
+ {
+ if (gc->pipe[pn].array.im != tex->im)
+ {
+ shader_array_flush(gc);
+ gc->pipe[pn].array.im = tex->im;
+ }
+ }
+#endif
+
+ return pn;
+}
+
void
evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
int x1, int y1, int x2, int y2,
{
int pnum, nv, nc, nu, nt, i;
Eina_Bool blend = 0;
- GLuint prog = gc->shared->shader.rect.prog;
+ GLuint prog = gc->shared->shader[SHADER_RECT].prog;
int pn = 0;
if (a < 255) blend = 1;
{
int pnum, nv, nc, nu, nt, i;
Eina_Bool blend = 0;
- GLuint prog = gc->shared->shader.rect.prog;
+ GLuint prog = gc->shared->shader[SHADER_RECT].prog;
int pn = 0;
if (gc->dc->mask.mask)
int pnum, nv, nc, nu, nu2, nt, i;
GLfloat tx1, tx2, ty1, ty2;
Eina_Bool blend = 1;
- GLuint prog = gc->shared->shader.img.prog;
+ GLuint prog = gc->shared->shader[SHADER_IMG].prog;
int pn = 0;
if (!tex->alpha) blend = 0;
{
if (tex->pt->dyn.img)
{
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- prog = gc->shared->shader.img_nomul.prog;
- else
- prog = gc->shared->shader.img.prog;
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_IMG_NOMUL, SHADER_IMG)].prog;
}
else
{
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- prog = gc->shared->shader.tex_nomul.prog;
- else
- prog = gc->shared->shader.tex.prog;
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_TEX_NOMUL, SHADER_TEX)].prog;
}
}
else
{
if (tex->gc->shared->info.bgra)
{
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- prog = gc->shared->shader.img_bgra_nomul.prog;
- else
- prog = gc->shared->shader.img_bgra.prog;
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA)].prog;
}
else
{
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- prog = gc->shared->shader.img_nomul.prog;
- else
- prog = gc->shared->shader.img.prog;
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_IMG_NOMUL, SHADER_IMG)].prog;
}
}
-again:
- vertex_array_size_check(gc, gc->state.top_pipe, 6);
- pn = gc->state.top_pipe;
-#ifdef GLPIPES
- if ((pn == 0) && (gc->pipe[pn].array.num == 0))
+ pn = _evas_gl_common_context_push(RTYPE_IMAGE,
+ gc, tex, NULL,
+ prog,
+ x, y, w, h,
+ blend,
+ smooth,
+ 0, 0, 0, 0, 0);
+
+ gc->pipe[pn].region.type = RTYPE_IMAGE;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = smooth;
+ gc->pipe[pn].shader.blend = blend;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = 0;
+ gc->pipe[pn].shader.cx = 0;
+ gc->pipe[pn].shader.cy = 0;
+ gc->pipe[pn].shader.cw = 0;
+ gc->pipe[pn].shader.ch = 0;
+ gc->pipe[pn].array.line = 0;
+ gc->pipe[pn].array.use_vertex = 1;
+ // if nomul... dont need this
+ gc->pipe[pn].array.use_color = 1;
+ gc->pipe[pn].array.use_texuv = 1;
+ gc->pipe[pn].array.use_texuv2 = 0;
+ gc->pipe[pn].array.use_texuv3 = 0;
+
+ pipe_region_expand(gc, pn, x, y, w, h);
+
+ pnum = gc->pipe[pn].array.num;
+ nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nu2 = pnum * 2;
+ nt = pnum * 4;
+ gc->pipe[pn].array.num += 6;
+ array_alloc(gc, pn);
+
+ if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
{
- gc->pipe[pn].region.type = RTYPE_IMAGE;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- // if nomul... dont need this
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
+ tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
+ ty1 = 1.0 - ((double)(tex->y) + sy) / (double)tex->pt->h;
+ tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
+ ty2 = 1.0 - ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
}
else
{
- int found = 0;
+ tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
+ ty1 = ((double)(tex->y) + sy) / (double)tex->pt->h;
+ tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
+ ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
+ }
- for (i = pn; i >= 0; i--)
- {
- if ((gc->pipe[i].region.type == RTYPE_IMAGE)
- && (gc->pipe[i].shader.cur_tex == tex->pt->texture)
- && (gc->pipe[i].shader.cur_prog == prog)
- && (gc->pipe[i].shader.smooth == smooth)
- && (gc->pipe[i].shader.blend == blend)
- && (gc->pipe[i].shader.render_op == gc->dc->render_op)
- && (gc->pipe[i].shader.clip == 0)
- )
- {
- found = 1;
- pn = i;
- break;
- }
- if (pipe_region_intersects(gc, i, x, y, w, h)) break;
- }
- if (!found)
- {
- pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.tune.pipes.max)
- {
- shader_array_flush(gc);
- goto again;
- }
- gc->state.top_pipe = pn;
- gc->pipe[pn].region.type = RTYPE_IMAGE;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- // if nomul... dont need this
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
+ PUSH_VERTEX(pn, x , y , 0);
+ PUSH_VERTEX(pn, x + w, y , 0);
+ PUSH_VERTEX(pn, x , y + h, 0);
- }
- }
- if ((tex->im) && (tex->im->native.data))
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- pn = gc->state.top_pipe;
- gc->pipe[pn].array.im = tex->im;
- goto again;
- }
- }
- if (tex->pt->dyn.img)
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- pn = gc->state.top_pipe;
- gc->pipe[pn].array.im = tex->im;
- goto again;
- }
- }
-#else
- if ((gc->pipe[pn].shader.cur_tex != tex->pt->texture)
- || (gc->pipe[pn].shader.cur_prog != prog)
- || (gc->pipe[pn].shader.smooth != smooth)
- || (gc->pipe[pn].shader.blend != blend)
- || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
- || (gc->pipe[pn].shader.clip != 0)
- )
- {
- shader_array_flush(gc);
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- }
- if ((tex->im) && (tex->im->native.data))
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- gc->pipe[pn].array.im = tex->im;
- }
- }
- if (tex->pt->dyn.img)
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- gc->pipe[pn].array.im = tex->im;
- }
- }
-
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- // if nomul... dont need this
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuvm = 0;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
-#endif
-
- pipe_region_expand(gc, pn, x, y, w, h);
-
- pnum = gc->pipe[pn].array.num;
- nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nu2 = pnum * 2;
- nt = pnum * 4;
- gc->pipe[pn].array.num += 6;
- array_alloc(gc, pn);
-
- if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
- {
- tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
- ty1 = 1.0 - ((double)(tex->y) + sy) / (double)tex->pt->h;
- tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
- ty2 = 1.0 - ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
- }
- else
- {
- tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
- ty1 = ((double)(tex->y) + sy) / (double)tex->pt->h;
- tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
- ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
- }
-
- PUSH_VERTEX(pn, x , y , 0);
- PUSH_VERTEX(pn, x + w, y , 0);
- PUSH_VERTEX(pn, x , y + h, 0);
-
- PUSH_TEXUV(pn, tx1, ty1);
- PUSH_TEXUV(pn, tx2, ty1);
- PUSH_TEXUV(pn, tx1, ty2);
-
- PUSH_VERTEX(pn, x + w, y , 0);
- PUSH_VERTEX(pn, x + w, y + h, 0);
- PUSH_VERTEX(pn, x , y + h, 0);
-
- PUSH_TEXUV(pn, tx2, ty1);
- PUSH_TEXUV(pn, tx2, ty2);
- PUSH_TEXUV(pn, tx1, ty2);
-
- // if nomul... dont need this
- for (i = 0; i < 6; i++)
+ PUSH_TEXUV(pn, tx1, ty1);
+ PUSH_TEXUV(pn, tx2, ty1);
+ PUSH_TEXUV(pn, tx1, ty2);
+
+ PUSH_VERTEX(pn, x + w, y , 0);
+ PUSH_VERTEX(pn, x + w, y + h, 0);
+ PUSH_VERTEX(pn, x , y + h, 0);
+
+ PUSH_TEXUV(pn, tx2, ty1);
+ PUSH_TEXUV(pn, tx2, ty2);
+ PUSH_TEXUV(pn, tx1, ty2);
+
+ // if nomul... dont need this
+ for (i = 0; i < 6; i++)
{
PUSH_COLOR(pn, r, g, b, a);
}
GLfloat tx1, tx2, ty1, ty2;
GLfloat txm1, txm2, tym1, tym2;
Eina_Bool blend = 1;
- GLuint prog = gc->shared->shader.img_mask.prog;
+ GLuint prog = gc->shared->shader[SHADER_IMG_MASK].prog;
int pn = 0;
#if 0
if (tex->gc->shared->info.bgra)
{
- prog = gc->shared->shader.img_mask.prog;
+ prog = gc->shared->shader[SHADER_IMG_MASK].prog;
}
else
{
#warning Nash: FIXME: Need two shaders?
printf("Not good: Need other texture\n");
- prog = gc->shared->shader.img.prog;
+ prog = gc->shared->shader[SHADER_IMG].prog;
}
#endif
-again:
- vertex_array_size_check(gc, gc->state.top_pipe, 6);
- pn = gc->state.top_pipe;
-#ifdef GLPIPES
- if ((pn == 0) && (gc->pipe[pn].array.num == 0))
- {
- gc->pipe[pn].region.type = RTYPE_IMASK;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_texm = texm->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- // if nomul... dont need this
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- gc->pipe[pn].array.use_texm = 1;
- }
- else
- {
- int found = 0;
-
- for (i = pn; i >= 0; i--)
- {
- if ((gc->pipe[i].region.type == RTYPE_IMASK)
- && (gc->pipe[i].shader.cur_tex == tex->pt->texture)
- && (gc->pipe[i].shader.cur_texm == texm->pt->texture)
- && (gc->pipe[i].shader.cur_prog == prog)
- && (gc->pipe[i].shader.smooth == smooth)
- && (gc->pipe[i].shader.blend == blend)
- && (gc->pipe[i].shader.render_op == gc->dc->render_op)
- && (gc->pipe[i].shader.clip == 0)
- )
- {
- found = 1;
- pn = i;
- break;
- }
- if (pipe_region_intersects(gc, i, x, y, w, h)) break;
- }
- if (!found)
- {
- pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.tune.pipes.max)
- {
- shader_array_flush(gc);
- goto again;
- }
- gc->state.top_pipe = pn;
- gc->pipe[pn].region.type = RTYPE_IMASK;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_texm = texm->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- gc->pipe[pn].array.use_texm = 1;
-
- }
- }
- if ((tex->im) && (tex->im->native.data))
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- pn = gc->state.top_pipe;
- gc->pipe[pn].array.im = tex->im;
- goto again;
- }
- }
- if (tex->pt->dyn.img)
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- pn = gc->state.top_pipe;
- gc->pipe[pn].array.im = tex->im;
- goto again;
- }
- }
-#else
- if ((gc->pipe[pn].shader.cur_tex != tex->pt->texture)
- || (gc->pipe[pn].shader.cur_prog != prog)
- || (gc->pipe[pn].shader.smooth != smooth)
- || (gc->pipe[pn].shader.blend != blend)
- || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
- || (gc->pipe[pn].shader.clip != 0)
- )
- {
- shader_array_flush(gc);
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_texm = texm->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- }
- if ((tex->im) && (tex->im->native.data))
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- gc->pipe[pn].array.im = tex->im;
- }
- }
- if (tex->pt->dyn.img)
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- gc->pipe[pn].array.im = tex->im;
- }
- }
-
+ pn = _evas_gl_common_context_push(RTYPE_IMASK,
+ gc, tex, texm,
+ prog,
+ x, y, w, h,
+ blend,
+ smooth,
+ 0, 0, 0, 0, 0);
+
+ gc->pipe[pn].region.type = RTYPE_IMASK;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ gc->pipe[pn].shader.cur_texm = texm->pt->texture;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = smooth;
+ gc->pipe[pn].shader.blend = blend;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = 0;
+ gc->pipe[pn].shader.cx = 0;
+ gc->pipe[pn].shader.cy = 0;
+ gc->pipe[pn].shader.cw = 0;
+ gc->pipe[pn].shader.ch = 0;
gc->pipe[pn].array.line = 0;
gc->pipe[pn].array.use_vertex = 1;
+ // if nomul... dont need this
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
gc->pipe[pn].array.use_texuv2 = 0;
gc->pipe[pn].array.use_texuv3 = 0;
gc->pipe[pn].array.use_texm = 1;
-#endif
pipe_region_expand(gc, pn, x, y, w, h);
{
int pnum, nv, nc, nu, nt, i;
GLfloat tx1, tx2, ty1, ty2;
+ GLuint prog = gc->shared->shader[SHADER_FONT].prog;
int pn = 0;
-again:
- vertex_array_size_check(gc, gc->state.top_pipe, 6);
- pn = gc->state.top_pipe;
-#ifdef GLPIPES
- if ((pn == 0) && (gc->pipe[pn].array.num == 0))
- {
- gc->pipe[pn].region.type = RTYPE_FONT;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = gc->shared->shader.font.prog;
- gc->pipe[pn].shader.smooth = 0;
- gc->pipe[pn].shader.blend = 1;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- }
- else
- {
- int found = 0;
-
- for (i = pn; i >= 0; i--)
- {
- if ((gc->pipe[i].region.type == RTYPE_FONT)
- && (gc->pipe[i].shader.cur_tex == tex->pt->texture)
- && (gc->pipe[i].shader.cur_prog == gc->shared->shader.font.prog)
- && (gc->pipe[i].shader.smooth == 0)
- && (gc->pipe[i].shader.blend == 1)
- && (gc->pipe[i].shader.render_op == gc->dc->render_op)
- && (gc->pipe[i].shader.clip == 0)
- )
- {
- found = 1;
- pn = i;
- break;
- }
- if (pipe_region_intersects(gc, i, x, y, w, h)) break;
- }
- if (!found)
- {
- pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.tune.pipes.max)
- {
- shader_array_flush(gc);
- goto again;
- }
- gc->state.top_pipe = pn;
- gc->pipe[pn].region.type = RTYPE_FONT;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = gc->shared->shader.font.prog;
- gc->pipe[pn].shader.smooth = 0;
- gc->pipe[pn].shader.blend = 1;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- }
- }
-#else
- if ((gc->pipe[pn].shader.cur_tex != tex->pt->texture)
- || (gc->pipe[pn].shader.cur_prog != gc->shared->shader.font.prog)
- || (gc->pipe[pn].shader.smooth != 0)
- || (gc->pipe[pn].shader.blend != 1)
- || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
- || (gc->pipe[pn].shader.clip != 0)
- )
- {
- shader_array_flush(gc);
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = gc->shared->shader.font.prog;
- gc->pipe[pn].shader.smooth = 0;
- gc->pipe[pn].shader.blend = 1;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- }
+ pn = _evas_gl_common_context_push(RTYPE_FONT,
+ gc, tex, NULL,
+ prog,
+ x, y, w, h,
+ 1,
+ 0,
+ 0, 0, 0, 0, 0);
gc->pipe[pn].region.type = RTYPE_FONT;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = 0;
+ gc->pipe[pn].shader.blend = 1;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = 0;
+ gc->pipe[pn].shader.cx = 0;
+ gc->pipe[pn].shader.cy = 0;
+ gc->pipe[pn].shader.cw = 0;
+ gc->pipe[pn].shader.ch = 0;
gc->pipe[pn].array.line = 0;
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
gc->pipe[pn].array.use_texuv2 = 0;
gc->pipe[pn].array.use_texuv3 = 0;
-#endif
pipe_region_expand(gc, pn, x, y, w, h);
int pnum, nv, nc, nu, nu2, nu3, nt, i;
GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
Eina_Bool blend = 0;
- GLuint prog = gc->shared->shader.yuv.prog;
+ GLuint prog;
int pn = 0;
if (a < 255) blend = 1;
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- prog = gc->shared->shader.yuv_nomul.prog;
- else
- prog = gc->shared->shader.yuv.prog;
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_YUV_NOMUL, SHADER_YUV)].prog;
-again:
- vertex_array_size_check(gc, gc->state.top_pipe, 6);
- pn = gc->state.top_pipe;
-#ifdef GLPIPES
- if ((pn == 0) && (gc->pipe[pn].array.num == 0))
+ pn = _evas_gl_common_context_push(RTYPE_YUV,
+ gc, tex, NULL,
+ prog,
+ x, y, w, h,
+ blend,
+ smooth,
+ 0, 0, 0, 0, 0);
+
+ gc->pipe[pn].region.type = RTYPE_YUV;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
+ gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = smooth;
+ gc->pipe[pn].shader.blend = blend;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = 0;
+ gc->pipe[pn].shader.cx = 0;
+ gc->pipe[pn].shader.cy = 0;
+ gc->pipe[pn].shader.cw = 0;
+ gc->pipe[pn].shader.ch = 0;
+ gc->pipe[pn].array.line = 0;
+ gc->pipe[pn].array.use_vertex = 1;
+ gc->pipe[pn].array.use_color = 1;
+ gc->pipe[pn].array.use_texuv = 1;
+ gc->pipe[pn].array.use_texuv2 = 1;
+ gc->pipe[pn].array.use_texuv3 = 1;
+
+ pipe_region_expand(gc, pn, x, y, w, h);
+
+ pnum = gc->pipe[pn].array.num;
+ nv = pnum * 3; nc = pnum * 4; nu = pnum * 2;
+ nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
+ gc->pipe[pn].array.num += 6;
+ array_alloc(gc, pn);
+
+ tx1 = (sx) / (double)tex->pt->w;
+ ty1 = (sy) / (double)tex->pt->h;
+ tx2 = (sx + sw) / (double)tex->pt->w;
+ ty2 = (sy + sh) / (double)tex->pt->h;
+
+ t2x1 = ((sx) / 2) / (double)tex->ptu->w;
+ t2y1 = ((sy) / 2) / (double)tex->ptu->h;
+ t2x2 = ((sx + sw) / 2) / (double)tex->ptu->w;
+ t2y2 = ((sy + sh) / 2) / (double)tex->ptu->h;
+
+ PUSH_VERTEX(pn, x , y , 0);
+ PUSH_VERTEX(pn, x + w, y , 0);
+ PUSH_VERTEX(pn, x , y + h, 0);
+
+ PUSH_TEXUV(pn, tx1, ty1);
+ PUSH_TEXUV(pn, tx2, ty1);
+ PUSH_TEXUV(pn, tx1, ty2);
+
+ PUSH_TEXUV2(pn, t2x1, t2y1);
+ PUSH_TEXUV2(pn, t2x2, t2y1);
+ PUSH_TEXUV2(pn, t2x1, t2y2);
+
+ PUSH_TEXUV3(pn, t2x1, t2y1);
+ PUSH_TEXUV3(pn, t2x2, t2y1);
+ PUSH_TEXUV3(pn, t2x1, t2y2);
+
+ PUSH_VERTEX(pn, x + w, y , 0);
+ PUSH_VERTEX(pn, x + w, y + h, 0);
+ PUSH_VERTEX(pn, x , y + h, 0);
+
+ PUSH_TEXUV(pn, tx2, ty1);
+ PUSH_TEXUV(pn, tx2, ty2);
+ PUSH_TEXUV(pn, tx1, ty2);
+
+ PUSH_TEXUV2(pn, t2x2, t2y1);
+ PUSH_TEXUV2(pn, t2x2, t2y2);
+ PUSH_TEXUV2(pn, t2x1, t2y2);
+
+ PUSH_TEXUV3(pn, t2x2, t2y1);
+ PUSH_TEXUV3(pn, t2x2, t2y2);
+ PUSH_TEXUV3(pn, t2x1, t2y2);
+
+ for (i = 0; i < 6; i++)
{
- gc->pipe[pn].region.type = RTYPE_YUV;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
- gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 1;
- gc->pipe[pn].array.use_texuv3 = 1;
+ PUSH_COLOR(pn, r, g, b, a);
}
- else
- {
- int found = 0;
+}
+
+void
+evas_gl_common_context_yuy2_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)
+{
+ int pnum, nv, nc, nu, nu2, nu3, nt, i;
+ GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
+ Eina_Bool blend = 0;
+ GLuint prog;
+ int pn = 0;
+
+ if (a < 255) blend = 1;
+
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_YUY2_NOMUL, SHADER_YUY2)].prog;
+
+ pn = _evas_gl_common_context_push(RTYPE_YUY2,
+ gc, tex, NULL,
+ prog,
+ x, y, w, h,
+ blend,
+ smooth,
+ 0, 0, 0, 0, 0);
+
+ gc->pipe[pn].region.type = RTYPE_YUY2;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = smooth;
+ gc->pipe[pn].shader.blend = blend;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = 0;
+ gc->pipe[pn].shader.cx = 0;
+ gc->pipe[pn].shader.cy = 0;
+ gc->pipe[pn].shader.cw = 0;
+ gc->pipe[pn].shader.ch = 0;
+ gc->pipe[pn].array.line = 0;
+ gc->pipe[pn].array.use_vertex = 1;
+ gc->pipe[pn].array.use_color = 1;
+ gc->pipe[pn].array.use_texuv = 1;
+ gc->pipe[pn].array.use_texuv2 = 1;
+ gc->pipe[pn].array.use_texuv3 = 0;
+
+ pipe_region_expand(gc, pn, x, y, w, h);
+
+ pnum = gc->pipe[pn].array.num;
+ nv = pnum * 3; nc = pnum * 4; nu = pnum * 2;
+ nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
+ gc->pipe[pn].array.num += 6;
+ array_alloc(gc, pn);
+
+ tx1 = (sx) / (double)tex->pt->w;
+ ty1 = (sy) / (double)tex->pt->h;
+ tx2 = (sx + sw) / (double)tex->pt->w;
+ ty2 = (sy + sh) / (double)tex->pt->h;
+
+ t2x1 = sx / (double)tex->ptuv->w;
+ t2y1 = sy / (double)tex->ptuv->h;
+ t2x2 = (sx + sw) / (double)tex->ptuv->w;
+ t2y2 = (sy + sh) / (double)tex->ptuv->h;
+
+ PUSH_VERTEX(pn, x , y , 0);
+ PUSH_VERTEX(pn, x + w, y , 0);
+ PUSH_VERTEX(pn, x , y + h, 0);
+
+ PUSH_TEXUV(pn, tx1, ty1);
+ PUSH_TEXUV(pn, tx2, ty1);
+ PUSH_TEXUV(pn, tx1, ty2);
+
+ PUSH_TEXUV2(pn, t2x1, t2y1);
+ PUSH_TEXUV2(pn, t2x2, t2y1);
+ PUSH_TEXUV2(pn, t2x1, t2y2);
+
+ PUSH_VERTEX(pn, x + w, y , 0);
+ PUSH_VERTEX(pn, x + w, y + h, 0);
+ PUSH_VERTEX(pn, x , y + h, 0);
+
+ PUSH_TEXUV(pn, tx2, ty1);
+ PUSH_TEXUV(pn, tx2, ty2);
+ PUSH_TEXUV(pn, tx1, ty2);
+
+ PUSH_TEXUV2(pn, t2x2, t2y1);
+ PUSH_TEXUV2(pn, t2x2, t2y2);
+ PUSH_TEXUV2(pn, t2x1, t2y2);
- for (i = pn; i >= 0; i--)
- {
- if ((gc->pipe[i].region.type == RTYPE_YUV)
- && (gc->pipe[i].shader.cur_tex == tex->pt->texture)
- && (gc->pipe[i].shader.cur_prog == gc->shared->shader.font.prog)
- && (gc->pipe[i].shader.smooth == smooth)
- && (gc->pipe[i].shader.blend == blend)
- && (gc->pipe[i].shader.render_op == gc->dc->render_op)
- && (gc->pipe[i].shader.clip == 0)
- )
- {
- found = 1;
- pn = i;
- break;
- }
- if (pipe_region_intersects(gc, i, x, y, w, h)) break;
- }
- if (!found)
- {
- pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.tune.pipes.max)
- {
- shader_array_flush(gc);
- goto again;
- }
- gc->state.top_pipe = pn;
- gc->pipe[pn].region.type = RTYPE_YUV;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
- gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- gc->pipe[pn].array.use_texuv2 = 1;
- gc->pipe[pn].array.use_texuv3 = 1;
- }
- }
-#else
- if ((gc->pipe[pn].shader.cur_tex != tex->pt->texture)
- || (gc->pipe[pn].shader.cur_prog != prog)
- || (gc->pipe[pn].shader.smooth != smooth)
- || (gc->pipe[pn].shader.blend != blend)
- || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
- || (gc->pipe[pn].shader.clip != 0)
- )
+ for (i = 0; i < 6; i++)
{
- shader_array_flush(gc);
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
- gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = 0;
- gc->pipe[pn].shader.cx = 0;
- gc->pipe[pn].shader.cy = 0;
- gc->pipe[pn].shader.cw = 0;
- gc->pipe[pn].shader.ch = 0;
+ PUSH_COLOR(pn, r, g, b, a);
}
+}
- gc->pipe[pn].region.type = RTYPE_YUV;
+void
+evas_gl_common_context_nv12_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)
+{
+ int pnum, nv, nc, nu, nu2, nu3, nt, i;
+ GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
+ Eina_Bool blend = 0;
+ GLuint prog;
+ int pn = 0;
+
+ if (a < 255) blend = 1;
+
+ prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
+ SHADER_NV12_NOMUL, SHADER_NV12)].prog;
+
+ pn = _evas_gl_common_context_push(RTYPE_NV12,
+ gc, tex, NULL,
+ prog,
+ x, y, w, h,
+ blend,
+ smooth,
+ 0, 0, 0, 0, 0);
+
+ gc->pipe[pn].region.type = RTYPE_NV12;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ gc->pipe[pn].shader.cur_tex_dyn = tex->pt->dyn.img;
+ gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
+ gc->pipe[pn].shader.cur_texu_dyn = tex->ptuv->dyn.img;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = smooth;
+ gc->pipe[pn].shader.blend = blend;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = 0;
+ gc->pipe[pn].shader.cx = 0;
+ gc->pipe[pn].shader.cy = 0;
+ gc->pipe[pn].shader.cw = 0;
+ gc->pipe[pn].shader.ch = 0;
gc->pipe[pn].array.line = 0;
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
gc->pipe[pn].array.use_texuv2 = 1;
- gc->pipe[pn].array.use_texuv3 = 1;
-#endif
+ gc->pipe[pn].array.use_texuv3 = 0;
pipe_region_expand(gc, pn, x, y, w, h);
tx2 = (sx + sw) / (double)tex->pt->w;
ty2 = (sy + sh) / (double)tex->pt->h;
- t2x1 = ((sx) / 2) / (double)tex->ptu->w;
- t2y1 = ((sy) / 2) / (double)tex->ptu->h;
- t2x2 = ((sx + sw) / 2) / (double)tex->ptu->w;
- t2y2 = ((sy + sh) / 2) / (double)tex->ptu->h;
+ t2x1 = sx / (double)tex->ptuv->w;
+ t2y1 = sy / (double)tex->ptuv->h;
+ t2x2 = (sx + sw) / (double)tex->ptuv->w;
+ t2y2 = (sy + sh) / (double)tex->ptuv->h;
PUSH_VERTEX(pn, x , y , 0);
PUSH_VERTEX(pn, x + w, y , 0);
PUSH_TEXUV2(pn, t2x2, t2y1);
PUSH_TEXUV2(pn, t2x1, t2y2);
- PUSH_TEXUV3(pn, t2x1, t2y1);
- PUSH_TEXUV3(pn, t2x2, t2y1);
- PUSH_TEXUV3(pn, t2x1, t2y2);
-
PUSH_VERTEX(pn, x + w, y , 0);
PUSH_VERTEX(pn, x + w, y + h, 0);
PUSH_VERTEX(pn, x , y + h, 0);
PUSH_TEXUV2(pn, t2x2, t2y2);
PUSH_TEXUV2(pn, t2x1, t2y2);
- PUSH_TEXUV3(pn, t2x2, t2y1);
- PUSH_TEXUV3(pn, t2x2, t2y2);
- PUSH_TEXUV3(pn, t2x1, t2y2);
-
for (i = 0; i < 6; i++)
{
PUSH_COLOR(pn, r, g, b, a);
RGBA_Map_Point *p,
int clip, int cx, int cy, int cw, int ch,
int r, int g, int b, int a,
- Eina_Bool smooth, Eina_Bool tex_only,
- Eina_Bool yuv)
+ Eina_Bool smooth, Eina_Bool tex_only,
+ Evas_Colorspace cspace)
{
int pnum, nv, nc, nu, nu2, nu3, nt, i;
const int points[6] = { 0, 1, 2, 0, 2, 3 };
GLfloat tx[4], ty[4], t2x[4], t2y[4];
Eina_Bool blend = 1;
DATA32 cmul;
- GLuint prog = gc->shared->shader.img.prog;
+ GLuint prog = gc->shared->shader[SHADER_IMG].prog;
+ Eina_Bool utexture = EINA_FALSE;
+ Eina_Bool uvtexture = EINA_FALSE;
int pn = 0;
int flat = 0;
{
if (p[0].foc <= 0) flat = 1;
}
- if (yuv)
- {
- prog = gc->shared->shader.yuv.prog;
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- {
- if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
- (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
- prog = gc->shared->shader.yuv_nomul.prog;
- else
- prog = gc->shared->shader.yuv.prog;
- }
- else
- prog = gc->shared->shader.yuv.prog;
- }
- else
- {
- if (tex_only)
- {
- if (tex->pt->dyn.img)
- {
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- {
- if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
- (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
- prog = gc->shared->shader.img_nomul.prog;
- else
- prog = gc->shared->shader.img.prog;
- }
- else
- prog = gc->shared->shader.img.prog;
- }
- else
- {
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- {
- if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
- (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
- prog = gc->shared->shader.tex_nomul.prog;
- else
- prog = gc->shared->shader.tex.prog;
- }
- else
- prog = gc->shared->shader.tex.prog;
- }
- }
- else
- {
- if (tex->gc->shared->info.bgra)
- {
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- {
- if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
- (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
- prog = gc->shared->shader.img_bgra_nomul.prog;
- else
- prog = gc->shared->shader.img_bgra.prog;
- }
- else
- prog = gc->shared->shader.img_bgra.prog;
- }
+
+ switch (cspace)
+ {
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ case EVAS_COLORSPACE_YCBCR422P709_PL:
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_YUV_NOMUL, SHADER_YUV)].prog;
+ utexture = EINA_TRUE;
+ break;
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_YUY2_NOMUL, SHADER_YUY2)].prog;
+ uvtexture = EINA_TRUE;
+ break;
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_NV12_NOMUL, SHADER_NV12)].prog;
+ uvtexture = EINA_TRUE;
+ break;
+
+ default:
+ if (tex_only)
+ {
+ if (tex->pt->dyn.img)
+ {
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_IMG_NOMUL, SHADER_IMG)].prog;
+ }
+ else
+ {
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_TEX_NOMUL, SHADER_TEX)].prog;
+ }
+ }
+ else
+ {
+ if (tex->gc->shared->info.bgra)
+ {
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_IMG_BGRA_NOMUL,
+ SHADER_IMG_BGRA)].prog;
+ }
else
{
- if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
- {
- if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
- (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
- prog = gc->shared->shader.img_nomul.prog;
- else
- prog = gc->shared->shader.img.prog;
- }
- else
- prog = gc->shared->shader.img.prog;
+ prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
+ SHADER_IMG_NOMUL,
+ SHADER_IMG)].prog;
}
- }
+ }
}
x = w = (p[points[0]].x >> FP);
py = (p[points[i]].y >> FP);
if (py < y) y = py;
else if (py > h) h = py;
- if (yuv)
+ if (utexture)
{
t2x[i] = ((((double)p[i].u / 2) / FP1)) / (double)tex->ptu->w;
t2y[i] = ((((double)p[i].v / 2) / FP1)) / (double)tex->ptu->h;
}
+ else if (uvtexture)
+ {
+ t2x[i] = ((((double)p[i].u / 2) / FP1)) / (double)tex->ptuv->w;
+ t2y[i] = ((((double)p[i].v / 2) / FP1)) / (double)tex->ptuv->h;
+ }
}
w = w - x;
h = h - y;
gc->change.size = 1;
_evas_gl_common_viewport_set(gc);
}
-again:
- vertex_array_size_check(gc, gc->state.top_pipe, 6);
- pn = gc->state.top_pipe;
-#ifdef GLPIPES
- if ((pn == 0) && (gc->pipe[pn].array.num == 0))
- {
- gc->pipe[pn].region.type = RTYPE_MAP;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- if (yuv)
- {
- gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
- gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
- }
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = clip;
- gc->pipe[pn].shader.cx = cx;
- gc->pipe[pn].shader.cy = cy;
- gc->pipe[pn].shader.cw = cw;
- gc->pipe[pn].shader.ch = ch;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- if (yuv)
- {
- gc->pipe[pn].array.use_texuv2 = 1;
- gc->pipe[pn].array.use_texuv3 = 1;
- }
- else
- {
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- }
- }
- else
- {
- int found = 0;
- for (i = pn; i >= 0; i--)
- {
- if ((gc->pipe[i].region.type == RTYPE_MAP)
- && (gc->pipe[i].shader.cur_tex == tex->pt->texture)
- && (gc->pipe[i].shader.cur_prog == prog)
- && (gc->pipe[i].shader.smooth == smooth)
- && (gc->pipe[i].shader.blend == blend)
- && (gc->pipe[i].shader.render_op == gc->dc->render_op)
- && (gc->pipe[i].shader.clip == clip)
- && (gc->pipe[i].shader.cx == cx)
- && (gc->pipe[i].shader.cy == cy)
- && (gc->pipe[i].shader.cw == cw)
- && (gc->pipe[i].shader.ch == ch)
- )
- {
- found = 1;
- pn = i;
- break;
- }
- if (pipe_region_intersects(gc, i, x, y, w, h)) break;
- }
- if (!found)
- {
- pn = gc->state.top_pipe + 1;
- if (pn >= gc->shared->info.tune.pipes.max)
- {
- shader_array_flush(gc);
- goto again;
- }
- gc->state.top_pipe = pn;
- gc->pipe[pn].region.type = RTYPE_MAP;
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- if (yuv)
- {
- gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
- gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
- }
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = clip;
- gc->pipe[pn].shader.cx = cx;
- gc->pipe[pn].shader.cy = cy;
- gc->pipe[pn].shader.cw = cw;
- gc->pipe[pn].shader.ch = ch;
- gc->pipe[pn].array.line = 0;
- gc->pipe[pn].array.use_vertex = 1;
- gc->pipe[pn].array.use_color = 1;
- gc->pipe[pn].array.use_texuv = 1;
- if (yuv)
- {
- gc->pipe[pn].array.use_texuv2 = 1;
- gc->pipe[pn].array.use_texuv3 = 1;
- }
- else
- {
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- }
- }
- }
- if ((tex->im) && (tex->im->native.data))
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- pn = gc->state.top_pipe;
- gc->pipe[pn].array.im = tex->im;
- goto again;
- }
- }
- if (tex->pt->dyn.img)
- {
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- pn = gc->state.top_pipe;
- gc->pipe[pn].array.im = tex->im;
- goto again;
- }
- }
-#else
- if ((gc->pipe[pn].shader.cur_tex != tex->pt->texture)
- || (gc->pipe[pn].shader.cur_prog != prog)
- || (gc->pipe[pn].shader.smooth != smooth)
- || (gc->pipe[pn].shader.blend != blend)
- || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
- || (gc->pipe[pn].shader.clip != clip)
- || (gc->pipe[pn].shader.cx != cx)
- || (gc->pipe[pn].shader.cy != cy)
- || (gc->pipe[pn].shader.cw != cw)
- || (gc->pipe[pn].shader.ch != ch)
- )
- {
- shader_array_flush(gc);
- gc->pipe[pn].shader.cur_tex = tex->pt->texture;
- gc->pipe[pn].shader.cur_prog = prog;
- gc->pipe[pn].shader.smooth = smooth;
- gc->pipe[pn].shader.blend = blend;
- gc->pipe[pn].shader.render_op = gc->dc->render_op;
- gc->pipe[pn].shader.clip = clip;
- gc->pipe[pn].shader.cx = cx;
- gc->pipe[pn].shader.cy = cy;
- gc->pipe[pn].shader.cw = cw;
- gc->pipe[pn].shader.ch = ch;
- }
- if ((tex->im) && (tex->im->native.data))
+ pn = _evas_gl_common_context_push(RTYPE_MAP,
+ gc, tex, NULL,
+ prog,
+ x, y, w, h,
+ blend,
+ smooth,
+ clip, cx, cy, cw, ch);
+
+ gc->pipe[pn].region.type = RTYPE_MAP;
+ gc->pipe[pn].shader.cur_tex = tex->pt->texture;
+ if (utexture)
{
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- gc->pipe[pn].array.im = tex->im;
- }
+ gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
+ gc->pipe[pn].shader.cur_texu_dyn = tex->ptu->dyn.img;
+ gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
+ gc->pipe[pn].shader.cur_texv_dyn = tex->ptv->dyn.img;
}
- if (tex->pt->dyn.img)
+ else if (uvtexture)
{
- if (gc->pipe[pn].array.im != tex->im)
- {
- shader_array_flush(gc);
- gc->pipe[pn].array.im = tex->im;
- }
+ gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
+ gc->pipe[pn].shader.cur_texu_dyn = tex->ptuv->dyn.img;
}
-
- gc->pipe[pn].region.type = RTYPE_MAP;
+ gc->pipe[pn].shader.cur_prog = prog;
+ gc->pipe[pn].shader.smooth = smooth;
+ gc->pipe[pn].shader.blend = blend;
+ gc->pipe[pn].shader.render_op = gc->dc->render_op;
+ gc->pipe[pn].shader.clip = clip;
+ gc->pipe[pn].shader.cx = cx;
+ gc->pipe[pn].shader.cy = cy;
+ gc->pipe[pn].shader.cw = cw;
+ gc->pipe[pn].shader.ch = ch;
gc->pipe[pn].array.line = 0;
gc->pipe[pn].array.use_vertex = 1;
gc->pipe[pn].array.use_color = 1;
gc->pipe[pn].array.use_texuv = 1;
- if (yuv)
- {
- gc->pipe[pn].array.use_texuv2 = 1;
- gc->pipe[pn].array.use_texuv3 = 1;
- }
- else
- {
- gc->pipe[pn].array.use_texuv2 = 0;
- gc->pipe[pn].array.use_texuv3 = 0;
- }
-#endif
+ gc->pipe[pn].array.use_texuv2 = (utexture || uvtexture) ? 1 : 0;
+ gc->pipe[pn].array.use_texuv3 = (utexture) ? 1 : 0;
pipe_region_expand(gc, pn, x, y, w, h);
for (i = 0; i < 4; i++)
{
ty[i] = 1.0 - ty[i];
- if (yuv)
+ if (utexture || uvtexture)
t2y[i] = 1.0 - t2y[i];
}
}
PUSH_TEXUV(pn,
tx[points[i]],
ty[points[i]]);
- if (yuv)
+ if (utexture)
{
PUSH_TEXUV2(pn,
t2x[points[i]],
t2x[points[i]],
t2y[points[i]]);
}
+ else if (uvtexture)
+ {
+ PUSH_TEXUV2(pn,
+ t2x[points[i]],
+ t2y[points[i]]);
+ }
PUSH_COLOR(pn,
R_VAL(&cl),
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv3);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+
glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ if (gc->pipe[i].shader.cur_texu_dyn)
+ secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
+#endif
+
glActiveTexture(GL_TEXTURE2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ if (gc->pipe[i].shader.cur_texv_dyn)
+ secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
+#endif
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+
glActiveTexture(GL_TEXTURE1);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ if (gc->pipe[i].shader.cur_texu_dyn)
+ secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
+#endif
glActiveTexture(GL_TEXTURE0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
g = (dc->col.col >> 8 ) & 0xff;
b = (dc->col.col ) & 0xff;
sx = 0; sy = 0; sw = tex->w, sh = tex->h;
- if ((!gc->dc->cutout.rects)
-// || (gc->dc->cutout.active > 32)
- )
+ if ((!gc->dc->cutout.rects) ||
+ ((gc->shared->info.tune.cutout.max > 0) &&
+ (gc->dc->cutout.active > gc->shared->info.tune.cutout.max)))
{
if (gc->dc->clip.use)
{
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
// if (im->tex) evas_gl_common_texture_free(im->tex);
im->tex = NULL;
im->cs.no_free = 0;
}
if (!im->tex) return;
break;
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ if ((im->tex) && (im->dirty))
+ {
+ evas_gl_common_texture_yuy2_update(im->tex, im->cs.data,
+ im->im->cache_entry.w,
+ im->im->cache_entry.h);
+ im->dirty = 0;
+ }
+ if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
+ {
+ im->tex = evas_gl_common_texture_yuy2_new(gc, im->cs.data,
+ im->im->cache_entry.w,
+ im->im->cache_entry.h);
+ im->dirty = 0;
+ }
+ if (!im->tex) return;
+ break;
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ if ((im->tex) && (im->dirty))
+ {
+ evas_gl_common_texture_nv12_update(im->tex, im->cs.data,
+ im->im->cache_entry.w,
+ im->im->cache_entry.h);
+ im->dirty = 0;
+ }
+ if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
+ {
+ im->tex = evas_gl_common_texture_nv12_new(gc, im->cs.data,
+ im->im->cache_entry.w,
+ im->im->cache_entry.h);
+ im->dirty = 0;
+ }
+ if (!im->tex) return;
+ break;
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ if ((im->tex) && (im->dirty))
+ {
+ evas_gl_common_texture_nv12tiled_update(im->tex, im->cs.data,
+ im->im->cache_entry.w,
+ im->im->cache_entry.h);
+ im->dirty = 0;
+ }
+ if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
+ {
+ im->tex = evas_gl_common_texture_nv12tiled_new(gc, im->cs.data,
+ im->im->cache_entry.w,
+ im->im->cache_entry.h);
+ im->dirty = 0;
+ }
+ if (!im->tex) return;
+ break;
default:
- ERR("unhandled img format colorspace=%d", im->cs.space);
- break;
+ ERR("unhandled img format colorspace=%d", im->cs.space);
+ break;
}
}
RGBA_Draw_Context *dc;
int r, g, b, a;
int c, cx, cy, cw, ch;
- Eina_Bool yuv = 0;
dc = gc->dc;
if (dc->mul.use)
cx = gc->dc->clip.x; cy = gc->dc->clip.y;
cw = gc->dc->clip.w; ch = gc->dc->clip.h;
im->tex->im = im;
- if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
- (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
- yuv = 1;
+
evas_gl_common_context_image_map_push(gc, im->tex, npoints, p,
c, cx, cy, cw, ch,
r, g, b, a, smooth, im->tex_only,
- yuv);
+ im->cs.space);
}
void
int c, cx, cy, cw, ch;
int i;
int yuv = 0;
+ int yuy2 = 0;
+ int nv12 = 0;
if (sw < 1) sw = 1;
if (sh < 1) sh = 1;
if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
(im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
yuv = 1;
+ if (im->cs.space == EVAS_COLORSPACE_YCBCR422601_PL)
+ yuy2 = 1;
+ if ((im->cs.space == EVAS_COLORSPACE_YCBCR420NV12601_PL) ||
+ (im->cs.space == EVAS_COLORSPACE_YCBCR420TM12601_PL))
+ nv12 = 1;
im->tex->im = im;
if (imm) imm->tex->im = imm;
dx, dy, dw, dh,
r, g, b, a,
smooth);
+ else if (yuy2)
+ evas_gl_common_context_yuy2_push(gc,
+ im->tex,
+ sx, sy, sw, sh,
+ dx, dy, dw, dh,
+ r, g, b, a,
+ smooth);
+ else if (nv12)
+ evas_gl_common_context_nv12_push(gc,
+ im->tex,
+ sx, sy, sw, sh,
+ dx, dy, dw, dh,
+ r, g, b, a,
+ smooth);
else
+
evas_gl_common_context_image_push(gc,
im->tex,
sx, sy, sw, sh,
nx, ny, nw, nh,
r, g, b, a,
smooth);
+ else if (yuy2)
+ evas_gl_common_context_yuy2_push(gc,
+ im->tex,
+ ssx, ssy, ssw, ssh,
+ nx, ny, nw, nh,
+ r, g, b, a,
+ smooth);
+ else if (nv12)
+ evas_gl_common_context_nv12_push(gc,
+ im->tex,
+ ssx, ssy, ssw, ssh,
+ nx, ny, nw, nh,
+ r, g, b, a,
+ smooth);
else
evas_gl_common_context_image_push(gc,
im->tex,
dx, dy, dw, dh,
r, g, b, a,
smooth);
+ else if (yuy2)
+ evas_gl_common_context_yuy2_push(gc,
+ im->tex,
+ sx, sy, sw, sh,
+ dx, dy, dw, dh,
+ r, g, b, a,
+ smooth);
+ else if (nv12)
+ evas_gl_common_context_nv12_push(gc,
+ im->tex,
+ sx, sy, sw, sh,
+ dx, dy, dw, dh,
+ r, g, b, a,
+ smooth);
else
evas_gl_common_context_image_push(gc,
im->tex,
dx, dy, dw, dh,
r, g, b, a,
smooth);
+ else if (yuy2)
+ evas_gl_common_context_yuy2_push(gc,
+ im->tex,
+ sx, sy, sw, sh,
+ dx, dy, dw, dh,
+ r, g, b, a,
+ smooth);
+ else if (nv12)
+ evas_gl_common_context_nv12_push(gc,
+ im->tex,
+ sx, sy, sw, sh,
+ dx, dy, dw, dh,
+ r, g, b, a,
+ smooth);
else
evas_gl_common_context_image_push(gc,
im->tex,
nx, ny, nw, nh,
r, g, b, a,
smooth);
+ else if (yuy2)
+ evas_gl_common_context_yuy2_push(gc,
+ im->tex,
+ ssx, ssy, ssw, ssh,
+ nx, ny, nw, nh,
+ r, g, b, a,
+ smooth);
+ else if (nv12)
+ evas_gl_common_context_nv12_push(gc,
+ im->tex,
+ ssx, ssy, ssw, ssh,
+ nx, ny, nw, nh,
+ r, g, b, a,
+ smooth);
else
evas_gl_common_context_image_push(gc,
im->tex,
/////////////////////////////////////////////
#if defined (GLES_VARIETY_S3C6410)
+const unsigned int yuy2_frag_bin[] =
+{
+# include "shader/yuy2_frag_bin_s3c6410.h"
+};
+#endif
+
+const char yuy2_frag_glsl[] =
+#include "shader/yuy2_frag.h"
+ ;
+Evas_GL_Program_Source shader_yuy2_frag_src =
+{
+ yuy2_frag_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ yuy2_frag_bin, sizeof(yuy2_frag_bin)
+#else
+ NULL, 0
+#endif
+};
+
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int yuy2_vert_bin[] =
+{
+# include "shader/yuy2_vert_bin_s3c6410.h"
+};
+#endif
+const char yuy2_vert_glsl[] =
+#include "shader/yuy2_vert.h"
+ ;
+Evas_GL_Program_Source shader_yuy2_vert_src =
+{
+ yuy2_vert_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ yuy2_vert_bin, sizeof(yuy2_vert_bin)
+#else
+ NULL, 0
+#endif
+};
+
+/////////////////////////////////////////////
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int yuy2_nomul_frag_bin[] =
+{
+# include "shader/yuy2_nomul_frag_bin_s3c6410.h"
+};
+#endif
+
+const char yuy2_nomul_frag_glsl[] =
+#include "shader/yuy2_nomul_frag.h"
+ ;
+Evas_GL_Program_Source shader_yuy2_nomul_frag_src =
+{
+ yuy2_nomul_frag_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ yuy2_nomul_frag_bin, sizeof(yuy2_nomul_frag_bin)
+#else
+ NULL, 0
+#endif
+};
+
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int yuy2_nomul_vert_bin[] =
+{
+# include "shader/yuy2_nomul_vert_bin_s3c6410.h"
+};
+#endif
+const char yuy2_nomul_vert_glsl[] =
+#include "shader/yuy2_nomul_vert.h"
+ ;
+Evas_GL_Program_Source shader_yuy2_nomul_vert_src =
+{
+ yuy2_nomul_vert_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ yuy2_nomul_vert_bin, sizeof(yuy2_nomul_vert_bin)
+#else
+ NULL, 0
+#endif
+};
+
+/////////////////////////////////////////////
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int nv12_nomul_vert_bin[] =
+{
+# include "shader/nv12_nomul_vert_bin_s3c6410.h"
+};
+#endif
+const char nv12_nomul_vert_glsl[] =
+#include "shader/nv12_nomul_vert.h"
+ ;
+Evas_GL_Program_Source shader_nv12_nomul_vert_src =
+{
+ nv12_nomul_vert_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ nv12_nomul_vert_bin, sizeof(nv12_nomul_vert_bin)
+#else
+ NULL, 0
+#endif
+};
+
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int nv12_vert_bin[] =
+{
+# include "shader/nv12_vert_bin_s3c6410.h"
+};
+#endif
+const char nv12_vert_glsl[] =
+#include "shader/nv12_vert.h"
+ ;
+Evas_GL_Program_Source shader_nv12_vert_src =
+{
+ nv12_vert_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ nv12_vert_bin, sizeof(nv12_vert_bin)
+#else
+ NULL, 0
+#endif
+};
+
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int nv12_nomul_frag_bin[] =
+{
+# include "shader/nv12_nomul_frag_bin_s3c6410.h"
+};
+#endif
+
+const char nv12_frag_glsl[] =
+#include "shader/nv12_frag.h"
+ ;
+Evas_GL_Program_Source shader_nv12_frag_src =
+{
+ nv12_frag_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ nv12_frag_bin, sizeof(nv12_frag_bin)
+#else
+ NULL, 0
+#endif
+};
+
+#if defined (GLES_VARIETY_S3C6410)
+const unsigned int nv12_nomul_frag_bin[] =
+{
+# include "shader/nv12_nomul_frag_bin_s3c6410.h"
+};
+#endif
+
+const char nv12_nomul_frag_glsl[] =
+#include "shader/nv12_nomul_frag.h"
+ ;
+Evas_GL_Program_Source shader_nv12_nomul_frag_src =
+{
+ nv12_nomul_frag_glsl,
+#if defined (GLES_VARIETY_S3C6410)
+ nv12_nomul_frag_bin, sizeof(nv12_nomul_frag_bin)
+#else
+ NULL, 0
+#endif
+};
+
+/////////////////////////////////////////////
+#if defined (GLES_VARIETY_S3C6410)
const unsigned int yuv_nomul_frag_bin[] =
{
# include "shader/yuv_nomul_frag_bin_s3c6410.h"
return 1;
}
+#define SHADER_SOURCE_LINE(Big, Small) \
+ { SHADER_##Big, &(shader_##Small##_vert_src), &(shader_##Small##_frag_src), #Small }
+
+#define SHADER_SOURCE_FILTER_LINE(Big, Small) \
+ { SHADER_##Big, &(shader_img_vert_src), &(shader_##Small##_frag_src), #Small }
+
+static const struct {
+ Evas_GL_Shader id;
+ Evas_GL_Program_Source *vert;
+ Evas_GL_Program_Source *frag;
+ const char *name;
+} _shaders_source[] = {
+ SHADER_SOURCE_LINE(RECT, rect),
+ SHADER_SOURCE_LINE(FONT, font),
+ SHADER_SOURCE_LINE(IMG, img),
+ SHADER_SOURCE_LINE(IMG_NOMUL, img_nomul),
+ SHADER_SOURCE_LINE(IMG_BGRA, img_bgra),
+ SHADER_SOURCE_LINE(IMG_BGRA_NOMUL, img_bgra_nomul),
+ SHADER_SOURCE_LINE(IMG_MASK, img_mask),
+ SHADER_SOURCE_LINE(YUV, yuv),
+ SHADER_SOURCE_LINE(YUV_NOMUL, yuv_nomul),
+ SHADER_SOURCE_LINE(YUY2, yuy2),
+ SHADER_SOURCE_LINE(YUY2_NOMUL, yuy2_nomul),
+ SHADER_SOURCE_LINE(NV12, nv12),
+ SHADER_SOURCE_LINE(NV12_NOMUL, nv12_nomul),
+ SHADER_SOURCE_LINE(TEX, tex),
+ SHADER_SOURCE_LINE(TEX_NOMUL, tex_nomul),
+ /* Most of the filters use the image fragment shader */
+ SHADER_SOURCE_FILTER_LINE(FILTER_INVERT, filter_invert),
+ SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_NOMUL, filter_invert_nomul),
+ SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_BGRA, filter_invert_bgra),
+ SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_BGRA_NOMUL, filter_invert_bgra_nomul),
+ SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE, filter_greyscale),
+ SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_NOMUL, filter_greyscale_nomul),
+ SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_BGRA, filter_greyscale_bgra),
+ SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_BGRA_NOMUL, filter_greyscale_bgra_nomul),
+ SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA, filter_sepia),
+ SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_NOMUL, filter_sepia_nomul),
+ SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_BGRA, filter_sepia_bgra),
+ SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_BGRA_NOMUL, filter_sepia_bgra_nomul)/* , */
+ /* SHADER_SOURCE_LINE(FILTER_BLUR, filter_blur), */
+ /* SHADER_SOURCE_LINE(FILTER_BLUR_NOMUL, filter_blur_nomul), */
+ /* SHADER_SOURCE_LINE(FILTER_BLUR_BGRA, filter_blur_bgra), */
+ /* SHADER_SOURCE_LINE(FILTER_BLUR_BGRA_NOMUL, filter_blur_bgra_nomul) */
+};
+
static int
_evas_gl_common_shader_source_init(Evas_GL_Shared *shared)
{
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.rect),
- &(shader_rect_vert_src),
- &(shader_rect_frag_src),
- "rect")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.font),
- &(shader_font_vert_src),
- &(shader_font_frag_src),
- "font")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.img),
- &(shader_img_vert_src),
- &(shader_img_frag_src),
- "img")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.img_nomul),
- &(shader_img_nomul_vert_src),
- &(shader_img_nomul_frag_src),
- "img_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.img_bgra),
- &(shader_img_bgra_vert_src),
- &(shader_img_bgra_frag_src),
- "img_bgra")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.img_bgra_nomul),
- &(shader_img_bgra_nomul_vert_src),
- &(shader_img_bgra_nomul_frag_src),
- "img_bgra_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.img_mask),
- &(shader_img_mask_vert_src),
- &(shader_img_mask_frag_src),
- "img_mask")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.tex),
- &(shader_tex_vert_src),
- &(shader_tex_frag_src),
- "tex")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.tex_nomul),
- &(shader_tex_nomul_vert_src),
- &(shader_tex_nomul_frag_src),
- "tex_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.yuv),
- &(shader_yuv_vert_src),
- &(shader_yuv_frag_src),
- "yuv")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.yuv_nomul),
- &(shader_yuv_nomul_vert_src),
- &(shader_yuv_nomul_frag_src),
- "yuv_nomul")) return 0;
+ unsigned int i;
- /* Most of the filters use the image fragment shader */
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_invert),
- &(shader_img_vert_src),
- &(shader_filter_invert_frag_src),
- "filter_invert")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_invert_nomul),
- &(shader_img_vert_src),
- &(shader_filter_invert_nomul_frag_src),
- "filter_invert_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_invert_bgra),
- &(shader_img_vert_src),
- &(shader_filter_invert_bgra_frag_src),
- "filter_invert_bgra")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_invert_bgra_nomul),
- &(shader_img_vert_src),
- &(shader_filter_invert_bgra_nomul_frag_src),
- "filter_invert_bgra_nomul")) return 0;
-
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_sepia),
- &(shader_img_vert_src),
- &(shader_filter_sepia_frag_src),
- "filter_sepia")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_sepia_nomul),
- &(shader_img_vert_src),
- &(shader_filter_sepia_nomul_frag_src),
- "filter_sepia_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_sepia_bgra),
- &(shader_img_vert_src),
- &(shader_filter_sepia_bgra_frag_src),
- "filter_sepia_bgra")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_sepia_bgra_nomul),
- &(shader_img_vert_src),
- &(shader_filter_sepia_bgra_nomul_frag_src),
- "filter_sepia_bgra_nomul")) return 0;
-
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_greyscale),
- &(shader_img_vert_src),
- &(shader_filter_greyscale_frag_src),
- "filter_greyscale")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_greyscale_nomul),
- &(shader_img_vert_src),
- &(shader_filter_greyscale_nomul_frag_src),
- "filter_greyscale_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_greyscale_bgra),
- &(shader_img_vert_src),
- &(shader_filter_greyscale_bgra_frag_src),
- "filter_greyscale_bgra")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_greyscale_bgra_nomul),
- &(shader_img_vert_src),
- &(shader_filter_greyscale_bgra_nomul_frag_src),
- "filter_greyscale_bgra_nomul")) return 0;
-#if 0
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_blur),
- &(shader_filter_blur_vert_src),
- &(shader_filter_blur_frag_src),
- "filter_blur")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_blur_nomul),
- &(shader_filter_blur_vert_src),
- &(shader_filter_blur_nomul_frag_src),
- "filter_blur_nomul")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_blur_bgra),
- &(shader_filter_blur_vert_src),
- &(shader_filter_blur_bgra_frag_src),
- "filter_blur_bgra")) return 0;
- if (!_evas_gl_common_shader_program_source_init(&(shared->shader.filter_blur_bgra_nomul),
- &(shader_filter_blur_vert_src),
- &(shader_filter_blur_bgra_nomul_frag_src),
- "filter_blur_bgra_nomul")) return 0;
-#endif
+ for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i)
+ if (!_evas_gl_common_shader_program_source_init(&(shared->shader[_shaders_source[i].id]),
+ _shaders_source[i].vert,
+ _shaders_source[i].frag,
+ _shaders_source[i].name))
+ return 0;
return 1;
}
Eet_File *et = NULL;
char bin_dir_path[PATH_MAX];
char bin_file_path[PATH_MAX];
+ unsigned int i;
if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
return 0;
et = eet_open(bin_file_path, EET_FILE_MODE_READ);
if (!et) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.rect), "rect", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.font), "font", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.img), "img", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.img_nomul), "img_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.img_bgra), "img_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.img_bgra_nomul), "img_bgra_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.img_mask), "img_mask", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.tex), "tex", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.tex_nomul),"tex_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.yuv), "yuv", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.yuv_nomul), "yuv_nomul", et)) goto error;
-
- /* Most of the filters use the image fragment shader */
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_invert), "filter_invert", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_invert_nomul), "filter_invert_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_invert_bgra), "filter_invert_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_invert_bgra_nomul), "filter_invert_bgra_nomul", et)) goto error;
-
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_sepia), "filter_sepia", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_sepia_nomul), "filter_sepia_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_sepia_bgra), "filter_sepia_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_sepia_bgra_nomul), "filter_sepia_bgra_nomul", et)) goto error;
-
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_greyscale), "filter_greyscale", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_greyscale_nomul), "filter_greyscale_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_greyscale_bgra), "filter_greyscale_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_greyscale_bgra_nomul), "filter_greyscale_bgra_nomul", et)) goto error;
-#if 0
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_blur), "filter_blur", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_blur_nomul), "filter_blur_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_blur_bgra), "filter_blur_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_init(&(shared->shader.filter_blur_bgra_nomul), "filter_blur_bgra_nomul", et)) goto error;
-#endif
+ for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i)
+ if (!_evas_gl_common_shader_program_binary_init(&(shared->shader[_shaders_source[i].id]),
+ _shaders_source[i].name,
+ et))
+ goto error;
if (et) eet_close(et);
eet_shutdown();
char bin_dir_path[PATH_MAX];
char bin_file_path[PATH_MAX];
char tmp_file[PATH_MAX];
+ unsigned int i;
if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
res = _evas_gl_shader_file_mkpath(bin_dir_path);
et = eet_open(tmp_file, EET_FILE_MODE_WRITE);
if (!et) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.rect), "rect", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.font), "font", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.img), "img", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.img_nomul), "img_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.img_bgra), "img_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.img_bgra_nomul), "img_bgra_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.img_mask), "img_mask", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.tex), "tex", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.tex_nomul),"tex_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.yuv), "yuv", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.yuv_nomul), "yuv_nomul", et)) goto error;
- /* Most of the filters use the image fragment shader */
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_invert), "filter_invert", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_invert_nomul), "filter_invert_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_invert_bgra), "filter_invert_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_invert_bgra_nomul), "filter_invert_bgra_nomul", et)) goto error;
-
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_sepia), "filter_sepia", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_sepia_nomul), "filter_sepia_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_sepia_bgra), "filter_sepia_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_sepia_bgra_nomul), "filter_sepia_bgra_nomul", et)) goto error;
-
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_greyscale), "filter_greyscale", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_greyscale_nomul), "filter_greyscale_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_greyscale_bgra), "filter_greyscale_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_greyscale_bgra_nomul), "filter_greyscale_bgra_nomul", et)) goto error;
-#if 0
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_blur), "filter_blur", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_blur_nomul), "filter_blur_nomul", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_blur_bgra), "filter_blur_bgra", et)) goto error;
- if (!_evas_gl_common_shader_program_binary_save(&(shared->shader.filter_blur_bgra_nomul), "filter_blur_bgra_nomul", et)) goto error;
-#endif
+ for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i)
+ if (!_evas_gl_common_shader_program_binary_save(&(shared->shader[_shaders_source[i].id]),
+ _shaders_source[i].name,
+ et))
+ goto error;
if (eet_close(et) != EET_ERROR_NONE) goto error;
if (rename(tmp_file,bin_file_path) < 0) goto error;
static const GLenum bgr_ifmt = GL_RGB;
# endif
#endif
-static const GLenum alpha_fmt = GL_ALPHA;
-static const GLenum alpha_ifmt = GL_ALPHA;
-static const GLenum lum_fmt = GL_LUMINANCE;
-static const GLenum lum_ifmt = GL_LUMINANCE;
+static const GLenum alpha_fmt = GL_ALPHA;
+static const GLenum alpha_ifmt = GL_ALPHA;
+static const GLenum lum_fmt = GL_LUMINANCE;
+static const GLenum lum_ifmt = GL_LUMINANCE;
+static const GLenum lum_alpha_fmt = GL_LUMINANCE_ALPHA;
+static const GLenum lum_alpha_ifmt = GL_LUMINANCE_ALPHA;
+static const GLenum rgba8_ifmt = GL_RGBA;
+static const GLenum rgba8_fmt = GL_BGRA;
static struct {
struct {
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
int fmt; // EGL_MAP_GL_TEXTURE_RGBA_SEC or EGL_MAP_GL_TEXTURE_RGB_SEC or bust
int pixtype; // EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC or bust
+ int glformat;
int attr[] =
{
EGL_MAP_GL_TEXTURE_WIDTH_SEC, 32,
};
void *egldisplay;
+ if (intformat != format) return NULL;
+
+ switch (intformat)
+ {
+#ifdef EGL_MAP_GL_TEXTURE_LUMINANCE_SEC
+ case GL_LUMINANCE: attr[5] = EGL_MAP_GL_TEXTURE_LUMINANCE_SEC; break;
+#endif
+#ifdef EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC
+ case GL_LUMINANCE_ALPHA: attr[5] = EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC; break;
+#endif
+ case GL_RGBA: attr[5] = EGL_MAP_GL_TEXTURE_RGBA_SEC; break;
+ default: fprintf(stderr, "unknown format\n"); return NULL;
+ }
+
pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
if (!pt) return NULL;
h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
EGL_NO_CONTEXT,
EGL_MAP_GL_TEXTURE_2D_SEC,
0, attr);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
if (!pt->dyn.img)
{
+ glBindTexture(GL_TEXTURE_2D, 0);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
+ glDeleteTextures(1, &(pt->texture));
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ free(pt);
+ return NULL;
}
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_WIDTH_SEC,
- &(pt->dyn.w)) != EGL_TRUE)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
+ &(pt->dyn.w)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_HEIGHT_SEC,
- &(pt->dyn.h)) != EGL_TRUE)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
+ &(pt->dyn.h)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC,
- &(pt->dyn.stride)) != EGL_TRUE)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
+ &(pt->dyn.stride)) != EGL_TRUE) goto error;
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_FORMAT_SEC,
- &(fmt)) != EGL_TRUE)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
- if (fmt != EGL_MAP_GL_TEXTURE_RGBA_SEC)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
+ &(fmt)) != EGL_TRUE) goto error;
+
if (secsym_eglGetImageAttribSEC(egldisplay,
pt->dyn.img,
EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC,
- &(pixtype)) != EGL_TRUE)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
- if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC)
- {
- secsym_eglDestroyImage(egldisplay, pt->dyn.img);
- pt->dyn.img = NULL;
- GLERR(__FUNCTION__, __FILE__, __LINE__, "");
- return pt;
- }
+ &(pixtype)) != EGL_TRUE) goto error;
+
+ if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC) goto error;
glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
format = 0;
#endif
return pt;
+
+/* ERROR HANDLING */
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+error:
+ secsym_eglDestroyImage(egldisplay, pt->dyn.img);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ pt->dyn.img = NULL;
+ glBindTexture(GL_TEXTURE_2D, 0);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glDeleteTextures(1, &(pt->texture));
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ free(pt);
+ return NULL;
+#endif
}
void
static void
pt_unref(Evas_GL_Texture_Pool *pt)
{
+ if (!pt) return;
if (!pt->gc) return;
pt->references--;
if (pt->references != 0) return;
free(pt);
}
+static void
+pt_link(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, Evas_GL_Texture_Pool *pt)
+{
+ gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, pt);
+ pt->slot = -1;
+ pt->fslot = -1;
+ pt->whole = 1;
+ pt->allocations = eina_list_prepend(pt->allocations, tex);
+ pt->references++;
+}
+
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)
{
if (!tex) return;
tex->references--;
if (tex->references != 0) return;
- if (tex->pt)
+ if (tex->double_buffer.pt[0])
{
-// printf("tex->pt = %p\n", tex->pt);
-// printf("tex->pt->references = %i\n", tex->pt->references);
- tex->pt->allocations = eina_list_remove(tex->pt->allocations, tex);
- pt_unref(tex->pt);
+ tex->double_buffer.pt[0]->allocations = eina_list_remove(tex->double_buffer.pt[0]->allocations, tex);
+ tex->double_buffer.pt[1]->allocations = eina_list_remove(tex->double_buffer.pt[1]->allocations, tex);
+ tex->double_buffer.ptuv[0]->allocations = eina_list_remove(tex->double_buffer.ptuv[0]->allocations, tex);
+ tex->double_buffer.ptuv[1]->allocations = eina_list_remove(tex->double_buffer.ptuv[1]->allocations, tex);
+ }
+ else
+ {
+ if (tex->pt)
+ {
+ tex->pt->allocations = eina_list_remove(tex->pt->allocations, tex);
+ pt_unref(tex->pt);
+ }
+ if (tex->ptu)
+ {
+ tex->ptu->allocations = eina_list_remove(tex->ptu->allocations, tex);
+ pt_unref(tex->ptu);
+ }
+ if (tex->ptv)
+ {
+ tex->ptv->allocations = eina_list_remove(tex->ptv->allocations, tex);
+ pt_unref(tex->ptv);
+ }
+ if (tex->ptuv)
+ {
+ tex->ptuv->allocations = eina_list_remove(tex->ptuv->allocations, tex);
+ pt_unref(tex->ptuv);
+ }
}
- if (tex->ptu) pt_unref(tex->ptu);
- if (tex->ptv) pt_unref(tex->ptv);
free(tex);
}
#endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
-
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
pixels);
-
if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
{
glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
_tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat);
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
#else
unsigned int y;
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
if ((rows[1] - rows[0]) == (int)w)
_tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
else
glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat);
if ((rows[h + 1] - rows[h]) == (int)(w / 2))
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
else
glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
_tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
else
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
}
}
+
+static Evas_GL_Texture *
+_evas_gl_common_texture_y2uv_new(Evas_Engine_GL_Context *gc,
+ unsigned int yw, unsigned int yh,
+ unsigned int uvw, unsigned int uvh,
+ GLenum y_ifmt, GLenum y_fmt,
+ GLenum uv_ifmt, GLenum uv_fmt,
+ Eina_Bool dynamic)
+{
+ Evas_GL_Texture_Pool *pt[2] = { NULL, NULL };
+ Evas_GL_Texture_Pool *ptuv[2] = { NULL, NULL };
+ Evas_GL_Texture *tex;
+
+ if (!dynamic)
+ {
+ pt[0] = _pool_tex_new(gc, yw + 1, yh + 1, y_ifmt, y_fmt);
+ pt[1] = _pool_tex_new(gc, yw + 1, yh + 1, y_ifmt, y_fmt);
+
+ ptuv[0] = _pool_tex_new(gc, uvw + 1, uvh + 1, uv_ifmt, uv_fmt);
+ ptuv[1] = _pool_tex_new(gc, uvw + 1, uvh + 1, uv_ifmt, uv_fmt);
+ }
+ else
+ {
+ pt[0] = _pool_tex_dynamic_new(gc, yw + 1, yh + 1, y_ifmt, y_fmt);
+ pt[1] = _pool_tex_dynamic_new(gc, yw + 1, yh + 1, y_ifmt, y_fmt);
+
+ ptuv[0] = _pool_tex_dynamic_new(gc, uvw + 1, uvh + 1, uv_ifmt, uv_fmt);
+ ptuv[1] = _pool_tex_dynamic_new(gc, uvw + 1, uvh + 1, uv_ifmt, uv_fmt);
+ }
+
+ if (!pt[0] || !pt[1] || !ptuv[0] || !ptuv[1])
+ goto on_error;
+
+ tex = calloc(1, sizeof(Evas_GL_Texture));
+ if (!tex)
+ goto on_error;
+
+ tex->gc = gc;
+ tex->references = 1;
+ tex->pt = pt[0];
+ tex->ptuv = ptuv[0];
+ tex->dyn = dynamic;
+
+ pt_link(gc, tex, pt[0]);
+ pt_link(gc, tex, pt[1]);
+ pt_link(gc, tex, ptuv[0]);
+ pt_link(gc, tex, ptuv[1]);
+
+ tex->x = 0;
+ tex->y = 0;
+ tex->w = yw;
+ tex->h = yh;
+ tex->double_buffer.source = 0;
+ memcpy(tex->double_buffer.pt, pt, sizeof (Evas_GL_Texture_Pool *) * 2);
+ memcpy(tex->double_buffer.ptuv, ptuv, sizeof (Evas_GL_Texture_Pool *) * 2);
+
+ return tex;
+
+ on_error:
+ pt_unref(pt[0]);
+ pt_unref(pt[1]);
+ pt_unref(ptuv[0]);
+ pt_unref(ptuv[1]);
+ return NULL;
+}
+
+Evas_GL_Texture *
+evas_gl_common_texture_yuy2_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
+{
+ Evas_GL_Texture *tex;
+
+ tex = _evas_gl_common_texture_y2uv_new(gc, w, h, w / 2, h, lum_alpha_ifmt, lum_alpha_fmt, rgba8_ifmt, rgba8_fmt, 0);
+ evas_gl_common_texture_yuy2_update(tex, rows, w, h);
+ return tex;
+}
+
+Evas_GL_Texture *
+evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
+{
+ Evas_GL_Texture *tex;
+
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ tex = _evas_gl_common_texture_y2uv_new(gc, w, h, w / 2, h / 2, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 1);
+ if (!tex)
+#endif
+ tex = _evas_gl_common_texture_y2uv_new(gc, w, h, w / 2, h / 2, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 0);
+
+ evas_gl_common_texture_nv12_update(tex, rows, w, h);
+ return tex;
+}
+
+Evas_GL_Texture *
+evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
+{
+ Evas_GL_Texture *tex = NULL;
+
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ tex = _evas_gl_common_texture_y2uv_new(gc, w, h, w, h, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 1);
+ if (!tex)
+#endif
+ tex = _evas_gl_common_texture_y2uv_new(gc, w, h, w, h, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 0);
+
+ evas_gl_common_texture_nv12tiled_update(tex, rows, w, h);
+ return tex;
+}
+
+void
+evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
+{
+ if (!tex->pt) return;
+ // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
+ unsigned int y;
+
+ tex->double_buffer.source = 1 - tex->double_buffer.source;
+ tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
+ tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
+ if ((rows[1] - rows[0]) == (int)w * 4)
+ _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+ else
+ {
+ for (y = 0; y < h; y++)
+ _tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
+ }
+
+ glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat);
+ if ((rows[1] - rows[0]) == (int)(w * 2))
+ _tex_sub_2d(0, 0, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat, rows[0]);
+ else
+ {
+ for (y = 0; y < h; y++)
+ _tex_sub_2d(0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]);
+ }
+
+ if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
+ {
+ glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ }
+}
+
+void
+evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
+{
+ if (!tex->pt) return;
+
+ tex->double_buffer.source = 1 - tex->double_buffer.source;
+ tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
+ tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
+
+ // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
+#ifdef GL_UNPACK_ROW_LENGTH
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
+ _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+ glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
+ _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
+#else
+ unsigned int y;
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
+ if ((rows[1] - rows[0]) == (int)w)
+ _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
+ else
+ {
+ for (y = 0; y < h; y++)
+ _tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
+ }
+
+ glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ _tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
+ if ((rows[h + 1] - rows[h]) == (int)(w / 2))
+ _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
+ else
+ {
+ for (y = 0; y < (h / 2); y++)
+ _tex_sub_2d(0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
+ }
+#endif
+ if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
+ {
+ glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+ }
+}
+
+void
+evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
+{
+ unsigned int mb_x, mb_y, mb_w, mb_h;
+ unsigned int base_h;
+
+ if (!tex->pt) return;
+
+ tex->double_buffer.source = 1 - tex->double_buffer.source;
+ tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
+ tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
+
+ mb_w = w / 64 + (w % 64 ? 1 : 0);
+ mb_h = h / 32 + (h % 32 ? 1 : 0);
+
+#if ( defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) )
+ if (tex->dyn)
+ {
+ char *texture_addr;
+ char *tmp;
+
+ texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
+
+ /* Iterate each Y macroblock like we do in evas_convert_yuv.c */
+ for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
+ {
+ int step = 2;
+ int offset = 0;
+ int x = 0;
+ int rmb_x = 0;
+ int ry[2];
+
+ ry[0] = mb_y * 2 * 32 * tex->pt->dyn.stride;
+ ry[1] = ry[0] + 32 * tex->pt->dyn.stride;
+
+ for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
+ {
+ unsigned int i;
+
+ tmp = texture_addr + x + ry[offset];
+
+ for (i = 0; i < 32 * 64; i += 64, tmp += tex->pt->dyn.stride)
+ memcpy(tmp, rows[mb_y] + rmb_x + i, 64);
+
+ step++;
+ if ((step & 0x3) == 0)
+ {
+ offset = 1 - offset;
+ x -= 64;
+ }
+ else
+ {
+ x += 64;
+ }
+ }
+ }
+
+ if (mb_h & 0x1)
+ {
+ int rmb_x = 0;
+ int x = 0;
+ int ry;
+
+ ry = mb_y * 2 * 32 * tex->pt->dyn.stride;
+
+ for (mb_x = 0; mb_x < mb_w; mb_x++, x += 64, rmb_x += 64 * 32)
+ {
+ unsigned int i;
+
+ tmp = texture_addr + x + ry;
+
+ for (i = 0; i < 32 * 64; i += 64, tmp += tex->pt->dyn.stride)
+ memcpy(tmp, rows[mb_y] + rmb_x + i, 64);
+ }
+ }
+
+ secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
+
+ texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
+
+ /* Iterate each UV macroblock like we do in evas_convert_yuv.c */
+ base_h = (mb_h >> 1) + (mb_h & 0x1);
+
+ /* h is always a multiple of 32 */
+ mb_h = h / 2;
+ mb_h = (mb_h / 32 + (mb_h % 32 ? 1 : 0));
+
+ mb_w = w / 2;
+ mb_w = (mb_w / 32 + (mb_w % 32 ? 1 : 0));
+
+ for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
+ {
+ int step = 2;
+ int offset = 0;
+ int x = 0;
+ int rmb_x = 0;
+ int ry[2];
+
+ ry[0] = mb_y * 2 * 32 * tex->ptuv->dyn.stride;
+ ry[1] = ry[0] + 32 * tex->ptuv->dyn.stride;
+
+ for (mb_x = 0; mb_x < mb_w * 4; mb_x++, rmb_x += 64 * 32)
+ {
+ unsigned int i = 0;
+
+ tmp = texture_addr + x + ry[offset];
+
+ for (i = 0; i < 32 * 64; i += 64, tmp += tex->ptuv->dyn.stride)
+ memcpy(tmp, rows[mb_y + base_h] + rmb_x + i, 64);
+
+ step++;
+ if ((step & 0x3) == 0)
+ {
+ offset = 1 - offset;
+ x -= 64;
+ }
+ else
+ {
+ x += 64;
+ }
+ }
+ }
+
+ if (mb_h & 0x1)
+ {
+ int rmb_x = 0;
+ int x = 0;
+ int ry;
+
+ ry = mb_y * 2 * 32 * tex->ptuv->dyn.stride;
+
+ for (mb_x = 0; mb_x < mb_w * 2; mb_x++, x += 64, rmb_x += 64 * 32)
+ {
+ unsigned int i;
+
+ tmp = texture_addr + x + ry;
+
+ /* It has horizontaly half the pixels, but they are double the size*/
+ for (i = 0; i < 32 * 64; i += 64, tmp += tex->ptuv->dyn.stride)
+ memcpy(tmp, rows[mb_y + base_h] + rmb_x + i, 64);
+ }
+ }
+
+ secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
+ return ;
+ }
+#endif
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+
+ glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+
+ // We are telling the driver to not swizzle back the buffer as we are going to replace all pixel
+ _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
+
+ /* Iterate each Y macroblock like we do in evas_convert_yuv.c */
+ for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
+ {
+ int step = 2;
+ int offset = 0;
+ int x = 0;
+ int rmb_x = 0;
+ int ry[2];
+
+ ry[0] = mb_y * 2 * 32;
+ ry[1] = ry[0] + 32;
+
+ for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
+ {
+ _tex_sub_2d(x, ry[offset], 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
+
+ step++;
+ if ((step & 0x3) == 0)
+ {
+ offset = 1 - offset;
+ x -= 64;
+ }
+ else
+ {
+ x += 64;
+ }
+ }
+ }
+
+ if (mb_h & 0x1)
+ {
+ int rmb_x = 0;
+ int x = 0;
+ int ry;
+
+ ry = mb_y * 2 * 32;
+
+ for (mb_x = 0; mb_x < mb_w; mb_x++, x += 64, rmb_x += 64 * 32)
+ _tex_sub_2d(x, ry, 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
+ }
+
+ glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
+ GLERR(__FUNCTION__, __FILE__, __LINE__, "");
+
+ _tex_2d(tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat);
+
+ /* Iterate each UV macroblock like we do in evas_convert_yuv.c */
+ base_h = (mb_h >> 1) + (mb_h & 0x1);
+
+ /* h is always a multiple of 32 */
+ mb_h = h / 2;
+ mb_h = (mb_h / 32 + (mb_h % 32 ? 1 : 0));
+
+ mb_w = w / 2;
+ mb_w = (mb_w / 32 + (mb_w % 32 ? 1 : 0));
+
+ for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
+ {
+ int step = 2;
+ int offset = 0;
+ int x = 0;
+ int rmb_x = 0;
+ int ry[2];
+
+ ry[0] = mb_y * 2 * 32;
+ ry[1] = ry[0] + 32;
+
+ for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
+ {
+ _tex_sub_2d(x, ry[offset], 32, 32,
+ tex->ptuv->format, tex->ptuv->dataformat,
+ rows[mb_y + base_h] + rmb_x);
+ step++;
+ if ((step & 0x3) == 0)
+ {
+ offset = 1 - offset;
+ x -= 32;
+ }
+ else
+ {
+ x += 32;
+ }
+ }
+ }
+
+ if (mb_h & 0x1)
+ {
+ int rmb_x = 0;
+ int x = 0;
+ int ry;
+
+ ry = mb_y * 2 * 32;
+
+ for (mb_x = 0; mb_x < mb_w; mb_x++, x += 32, rmb_x += 64 * 32)
+ _tex_sub_2d(x, ry, 64, 32, tex->ptuv->format, tex->ptuv->dataformat, rows[mb_y + base_h] + rmb_x);
+ }
+}
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
uniform sampler1D gaussian;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
uniform sampler1D gaussian;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
uniform sampler1D gaussian;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
uniform sampler1D gaussian;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec2 tex_c;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec2 tex_c;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec2 tex_c;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex, texm;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex, texm;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec2 tex_c;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex;\n"
"varying vec2 tex_c;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex;
varying vec2 tex_c;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex, texu, texv;\n"
"varying vec4 col;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex, texu, texv;
varying vec4 col;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"uniform sampler2D tex, texu, texv;\n"
"varying vec2 tex_c, tex_c2, tex_c3;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
uniform sampler2D tex, texu, texv;
varying vec2 tex_c, tex_c2, tex_c3;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec2 tex_coord, tex_coord2, tex_coord3;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec2 tex_coord, tex_coord2, tex_coord3;
"#ifdef GL_ES\n"
-"precision mediump float;\n"
+"precision highp float;\n"
"#endif\n"
"attribute vec4 vertex;\n"
"attribute vec4 color;\n"
#ifdef GL_ES
-precision mediump float;
+precision highp float;
#endif
attribute vec4 vertex;
attribute vec4 color;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (im->tex) evas_gl_common_texture_free(im->tex);
im->tex = NULL;
if (im->cs.data)
return image;
}
im_old = image;
- if ((eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P601_PL) ||
- (eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P709_PL))
- w &= ~0x1;
+
+ switch (eng_image_colorspace_get(data, image))
+ {
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ w &= ~0x1;
+ break;
+ }
+
if ((im_old) && (im_old->im->cache_entry.w == w) && (im_old->im->cache_entry.h == h))
return image;
if (im_old)
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
*image_data = im->cs.data;
break;
default:
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (image_data != im->cs.data)
{
if (im->cs.data)
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (im->tex) evas_gl_common_texture_free(im->tex);
im->tex = NULL;
if (im->cs.data)
return image;
}
im_old = image;
- if ((eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P601_PL) ||
- (eng_image_colorspace_get(data, image) == EVAS_COLORSPACE_YCBCR422P709_PL))
- w &= ~0x1;
+
+ switch (eng_image_colorspace_get(data, image))
+ {
+ case EVAS_COLORSPACE_YCBCR422P601_PL:
+ case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
+ w &= ~0x1;
+ break;
+ }
+
if ((im_old) &&
((int)im_old->im->cache_entry.w == w) &&
((int)im_old->im->cache_entry.h == h))
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
eng_window_use(re->win);
- if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img))
+ if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) && (im->cs.space == EVAS_COLORSPACE_ARGB8888))
{
*image_data = im->tex->pt->dyn.data = glsym_eglMapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
eng_window_use(re->win);
#endif
+ /* Engine can be fail to create texture after cache drop like eng_image_content_hint_set function,
+ so it is need to add code which check im->im's NULL value*/
+
+ if (!im->im)
+ {
+ *image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+ return NULL;
+ }
+
error = evas_cache_image_load_data(&im->im->cache_entry);
switch (im->cs.space)
{
{
*image_data = NULL;
if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
- return im;
+ return NULL;
}
evas_gl_common_image_free(im);
im = im_new;
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
*image_data = im->cs.data;
break;
default:
im = image;
if (im->native.data) return image;
eng_window_use(re->win);
- if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.data))
+ if ((im->tex) && (im->tex->pt)
+ && (im->tex->pt->dyn.data)
+ && (im->cs.space == EVAS_COLORSPACE_ARGB8888))
{
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img);
#endif
if (im->tex->pt->dyn.data == image_data)
{
+ evas_gl_common_image_dirty(im, 0, 0, 0, 0);
return image;
}
else
break;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
+ case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (image_data != im->cs.data)
{
if (im->cs.data)
ctx->current_sfc = NULL;
sfc->current_ctx = NULL;
+ current_evgl_ctx = NULL;
return ret;
}
else
// Bind FBO
glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo);
+
+ sfc->fbo_attached = 1;
}
// Set the current surface/context
ctx->current_sfc = sfc;
sfc->current_ctx = ctx;
-
- current_evgl_ctx = ctx;
+ current_evgl_ctx = ctx;
return 1;
}
if (re->tb) evas_common_tilebuf_free(re->tb);
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
if (re->tmp_out) evas_cache_image_drop(&re->tmp_out->cache_entry);
- if (re->soft16_engine_image) evas_cache_engine_image_drop(&re->soft16_engine_image->cache_entry);
+ if (re->soft16_engine_image)
+ evas_cache_engine_image_drop(&re->soft16_engine_image->cache_entry);
+ if (re->cache) evas_cache_engine_image_shutdown(re->cache);
+
+ if (re->update_rects)
+ free(re->update_rects);
free(re);
evas_common_font_shutdown();
evas_common_image_shutdown();
evas_common_soft16_image_shutdown();
+
+ SDL_QuitSubSystem(SDL_INIT_VIDEO);
}
static void
Render_Engine *re = data;
SDL_Surface *surface;
- if ((re->w == w) && (re->h == h)) return;
+ if ((re->tb->outbuf_w == w) && (re->tb->outbuf_h == h)) return;
evas_cache_engine_image_drop(&re->soft16_engine_image->cache_entry);
re->cur_rect = re->rects;
if (re->rot != 0) _tmp_out_alloc(re); /* grows if required */
}
+
if (!re->cur_rect)
{
if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
_tmp_out_process(re, rect.x, rect.y, w, h);
++re->update_rects_count;
+
+ evas_common_cpu_end_opt();
}
static void
if (!eim) return 1;
im = (Soft16_Image *) eim->cache_entry.src;
- if (im->cache_entry.flags.alpha) return 1;
+ switch (eim->cache_entry.src->space)
+ {
+ case EVAS_COLORSPACE_ARGB8888:
+ if (im->cache_entry.flags.alpha) return 1;
+ default:
+ break;
+ }
return 0;
}
SDL_Engine_Image_Entry *eim;
eim = image;
- if (w) *w = eim->cache_entry.w;
- if (h) *h = eim->cache_entry.h;
+ if (w) *w = eim->cache_entry.src->w;
+ if (h) *h = eim->cache_entry.src->h;
}
static int
evas_engine_sdl16_image_colorspace_get(void *data __UNUSED__, void *image __UNUSED__)
{
- return EVAS_COLORSPACE_RGB565_A5P;
+ SDL_Engine_Image_Entry *eim = image;
+
+ if (!eim) return EVAS_COLORSPACE_RGB565_A5P;
+ return eim->cache_entry.src->space;
}
static void
evas_engine_sdl16_image_colorspace_set(void *data __UNUSED__, void *image __UNUSED__, int cspace __UNUSED__)
{
- /* FIXME: Not implemented. */
+ SDL_Engine_Image_Entry *eim = image;
+
+ if (!eim) return;
+ if (eim->cache_entry.src->space == cspace) return;
+
+ evas_cache_engine_image_colorspace(&eim->cache_entry, cspace, NULL);
}
static void*
SDL_Engine_Image_Entry *eim = image;
Soft16_Image *im;
int error;
-
+
if (!eim)
{
*image_data = NULL;
+ if (err) *err = EVAS_LOAD_ERROR_GENERIC;
return NULL;
}
im = (Soft16_Image *) eim->cache_entry.src;
- error = evas_cache_image_load_data(&im->cache_entry);
if (to_write)
- eim = (SDL_Engine_Image_Entry *) evas_cache_engine_image_alone(&eim->cache_entry,
- NULL);
+ eim = (SDL_Engine_Image_Entry *) evas_cache_engine_image_dirty(&eim->cache_entry,
+ 0, 0, eim->cache_entry.src->w, eim->cache_entry.src->h);
+ error = evas_cache_image_load_data(&im->cache_entry);
/* FIXME: Handle colorspace conversion correctly. */
if (image_data) *image_data = (DATA32 *) im->pixels;
if (im->cache_entry.flags.alpha == has_alpha) return eim;
- eim = (SDL_Engine_Image_Entry *) evas_cache_engine_image_alone(&eim->cache_entry,
- NULL);
-
- im = (Soft16_Image *) eim->cache_entry.src;
+ //eim = (SDL_Engine_Image_Entry *) evas_cache_engine_image_alone(&eim->cache_entry, NULL);
+ //im = (Soft16_Image *) eim->cache_entry.src;
im->cache_entry.flags.alpha = has_alpha;
eim = (SDL_Engine_Image_Entry *) evas_cache_engine_image_dirty(&eim->cache_entry, 0, 0, eim->cache_entry.w, eim->cache_entry.h);
dst_region_x, dst_region_y, dst_region_w, dst_region_h,
smooth);
+ evas_common_cpu_end_opt ();
if (mustlock_im)
SDL_UnlockSurface(eim->surface);
Soft16_Image *dst = (Soft16_Image *) eim->cache_entry.src;
int mustlock_im = 0;
- if (!im)
- im = (RGBA_Image *) evas_cache_image_empty(evas_common_image_cache_get());
- evas_cache_image_surface_alloc(&im->cache_entry, dst->cache_entry.w, dst->cache_entry.h);
-
if (eim->surface && SDL_MUSTLOCK(eim->surface))
{
mustlock_im = 1;
evas_common_soft16_font_glyph_new,
evas_common_soft16_font_glyph_free,
evas_common_soft16_font_glyph_draw);
- evas_common_font_draw(im, context, font, x, y, intl_props);
+ evas_common_font_draw((RGBA_Image *) eim->cache_entry.src, context, font, x, y, intl_props);
evas_common_draw_context_font_ext_set(context,
NULL,
NULL,
evas_common_soft16_line_draw((Soft16_Image *) eim->cache_entry.src,
context,
x1, y1, x2, y2);
+ evas_common_cpu_end_opt();
if (mustlock_im)
SDL_UnlockSurface(eim->surface);
im = (Soft16_Image *) eim->cache_entry.src;
evas_common_soft16_rectangle_draw(im, context, x, y, w, h);
+ evas_common_cpu_end_opt();
if (mustlock_im)
SDL_UnlockSurface(eim->surface);
}
evas_common_soft16_polygon_draw((Soft16_Image *) eim->cache_entry.src, context, polygon, x, y);
+ evas_common_cpu_end_opt();
if (mustlock_im)
SDL_UnlockSurface(eim->surface);
im = (Soft16_Image *) ie->src;
- if (im->pixels)
+ if (im)
{
- /* FIXME: Take care of CSPACE */
- sdl = SDL_CreateRGBSurfaceFrom(im->pixels,
- ie->w, ie->h,
- 16, ie->w * 2,
- RMASK565, GMASK565, BMASK565, AMASK565);
- eim->surface = sdl;
- eim->flags.engine_surface = 0;
+ evas_cache_image_load_data(&im->cache_entry);
+
+ if (im->pixels)
+ {
+ /* FIXME: Take care of CSPACE */
+ sdl = SDL_CreateRGBSurfaceFrom(im->pixels,
+ ie->w, ie->h,
+ 16, ie->w * 2,
+ RMASK565, GMASK565, BMASK565, AMASK565);
+ eim->surface = sdl;
+ eim->flags.engine_surface = 0;
+ }
}
return EVAS_LOAD_ERROR_NONE;
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
*image_data = im->cs.data;
break;
default:
case EVAS_COLORSPACE_YCBCR422P601_PL:
case EVAS_COLORSPACE_YCBCR422P709_PL:
case EVAS_COLORSPACE_YCBCR422601_PL:
+ case EVAS_COLORSPACE_YCBCR420NV12601_PL:
+ case EVAS_COLORSPACE_YCBCR420TM12601_PL:
if (image_data != im->cs.data)
{
if (im->cs.data)
Evas_Engine_Info_SDL* in;
in = (Evas_Engine_Info_SDL*) info;
free(in);
- in = NULL;
}
/* SDL engine output manipulation function */
{
Render_Engine* re = data;
- if (re->cache)
- evas_cache_engine_image_shutdown(re->cache);
-
- evas_common_tilebuf_free(re->tb);
+ if (re->tb)
+ evas_common_tilebuf_free(re->tb);
if (re->rects)
evas_common_tilebuf_free_render_rects(re->rects);
+ if (re->rgba_engine_image)
+ evas_cache_engine_image_drop(&re->rgba_engine_image->cache_entry);
+ if (re->cache)
+ evas_cache_engine_image_shutdown(re->cache);
if (re->update_rects)
free(re->update_rects);
re->cur_rect = EINA_INLIST_GET(re->rects);
}
if (!re->cur_rect)
- return NULL;
+ {
+ if (re->rects) evas_common_tilebuf_free_render_rects(re->rects);
+ re->rects = NULL;
+ return NULL;
+ }
tb_rect = (Tilebuf_Rect*) re->cur_rect;
*cx = *x = tb_rect->x;
}
static void
-evas_engine_sdl_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Eina_Unicode *text, const Evas_Text_Props *intl_props)
+evas_engine_sdl_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Evas_Text_Props *intl_props)
{
SDL_Engine_Image_Entry *eim = surface;
int mustlock_im = 0;
Render_Engine *re = calloc(1, sizeof(Render_Engine));
SDL_Surface *surface;
+ if (!re)
+ return NULL;
+
/* if we haven't initialized - init (automatic abort if already done) */
evas_common_cpu_init();
evas_common_blend_init();
re->cache = evas_cache_engine_image_init(&_sdl_cache_engine_image_cb, evas_common_image_cache_get());
if (!re->cache)
{
- CRIT("Evas_Cache_Engine_Image allocation failed!");
- exit(-1);
+ ERR("Evas_Cache_Engine_Image allocation failed!");
+ free (re);
+ return NULL;
}
re->tb = evas_common_tilebuf_new(w, h);
if (!surface)
{
- CRIT("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
- exit(-1);
+ ERR("SDL_SetVideoMode [ %i x %i x 32 ] failed.", w, h);
+ evas_cache_engine_image_shutdown(re->cache);
+ free (re);
+ return NULL;
}
SDL_SetAlpha(surface, SDL_SRCALPHA | SDL_RLEACCEL, 0);
if (!re->rgba_engine_image)
{
CRIT("RGBA_Image allocation from SDL failed");
- exit(-1);
+ evas_cache_engine_image_shutdown(re->cache);
+ free (re);
+ return NULL;
}
SDL_FillRect(surface, NULL, 0);
@evas_engine_software_xcb_cflags@
SOFTWARE_X11_SOURCES += \
+evas_xcb_xdefaults.c \
evas_xcb_outbuf.c \
evas_xcb_buffer.c \
evas_xcb_color.c \
evas_xlib_color.h \
evas_xcb_outbuf.h \
evas_xcb_buffer.h \
-evas_xcb_color.h
+evas_xcb_color.h \
+evas_xcb_xdefaults.h
+
#ifdef BUILD_ENGINE_SOFTWARE_XCB
# include "evas_xcb_outbuf.h"
# include "evas_xcb_color.h"
+# include "evas_xcb_xdefaults.h"
#endif
int _evas_engine_soft_x11_log_dom = -1;
int shape_dither, int destination_alpha)
{
Render_Engine *re;
+ int v = 0;
if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
evas_software_xcb_outbuf_init();
// FIXME: re->xrdb
- re->xr.dpi = 75000; // dpy * 1000
+ _evas_xcb_xdefaults_init();
+ v = _evas_xcb_xdefaults_int_get("Xft", "dpi");
+ _evas_xcb_xdefaults_shutdown();
+ if (v) re->xr.dpi = (v * 1000);
+ else re->xr.dpi = 75000; // dpy * 1000
+
evas_common_font_dpi_set(re->xr.dpi / 1000);
re->ob =
int w = 0, h = 0, alpha = 0;
const char *dot1 = NULL, *dot2 = NULL, *end, *p;
char *cmd = NULL, decoders[3][128], buf[4096];
- char *img_loader = "evas_image_loader"; // FIXME: specific path
+ char *loader = "/evas/utils/evas_image_loader";
+ char *img_loader = NULL;
+ const char *libdir;
// eg $libdir/evas/generic_loaders
int cmd_len, len, decoders_num = 0, try_count = 0;
int read_data = 0;
char *tmpfname = NULL, *shmfname = NULL;
-
DATA32 *body;
FILE *f;
- // enough for command + params excluding filem key and loadopts
- cmd_len = 1024 + strlen(img_loader);
+ libdir = _evas_module_libdir_get();
+ cmd_len = strlen(libdir);
+ cmd_len += strlen(loader);
+ img_loader = alloca(cmd_len + 1);
+ strcpy(img_loader, libdir);
+ strcat(img_loader, loader);
+ // params excluding file, key and loadopts
+ cmd_len += 1024;
cmd_len += strlen(file) * 2;
if (key) cmd_len += strlen(key) * 2;
- cmd = alloca(cmd_len);
+ cmd = alloca(cmd_len + 1);
len = strlen(file);
if (len < 1)
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
goto error;
}
- else /* find previous frame */
+ else
{
Gif_Frame *gif_frame = NULL;
ptr_src = new_frame->data;
typedef enum {
EXIF_BYTE_ALIGN_II,
EXIF_BYTE_ALIGN_MM
-}ExifByteAlign;
+} ExifByteAlign;
static int
-_get_orientation(const char *path)
+_get_orientation(void *map, size_t length)
{
- if (!path) return 0;
-
- /* open file and get 22type frome file */
-
- FILE *f;
- int size;
- unsigned char buf[4096];
- unsigned char orientation[2];
+ char *buf;
+ char orientation[2];
ExifByteAlign byte_align;
- int num_directory = 0;
- int i, j;
+ unsigned int num_directory = 0;
+ unsigned int i, j;
int direction;
- f = fopen (path, "rb");
- if (!f) return 0;
-
+ /* open file and get 22 byte frome file */
+ if (!map) return 0;
/* 1. read 22byte */
- size = fread (buf, 1, 22, f);
+ if (length < 22) return 0;
+ buf = (char *)map;
- if (size < 22)
- {
- fclose(f);
- return 0;
- }
-
- /* 2. check 2,3 bypte with APP1(0xFFE1) */
- if (memcmp(buf + 2, App1, sizeof (App1)))
- {
- fclose(f);
- return 0;
- }
+ /* 2. check 2,3 bypte with APP1(0xFFE1) */
+ if (memcmp(buf + 2, App1, sizeof (App1))) return 0;
/* 3. check 6~11bype with Exif Header (0x45786966 0000) */
- if (memcmp(buf + 6, ExifHeader, sizeof (ExifHeader)))
- {
- fclose(f);
- return 0;
- }
+ if (memcmp(buf + 6, ExifHeader, sizeof (ExifHeader))) return 0;
/* 4. get 12&13 byte get info of "II(0x4949)" or "MM(0x4d4d)" */
/* 5. get [20]&[21] get directory entry # */
if (!strncmp(buf + 12, "MM", 2))
{
byte_align = EXIF_BYTE_ALIGN_MM;
- num_directory = ((buf[20] << 8) + buf[21]);
+ num_directory = ((*(buf + 20) << 8) + *(buf + 21));
orientation[0] = 0x01;
orientation[1] = 0x12;
}
else if (!strncmp(buf + 12, "II", 2))
{
byte_align = EXIF_BYTE_ALIGN_II;
- num_directory = ((buf[21] << 8) + buf[20]);
+ num_directory = ((*(buf + 21) << 8) + *(buf + 20));
orientation[0] = 0x12;
orientation[1] = 0x01;
}
- else
- {
- fclose(f);
- return 0;
- }
+ else return 0;
+
+ buf = map + 22;
+
+ if (length < (12 * num_directory + 22)) return 0;
- if (fread(buf, 12, num_directory, f) > 4096)
- {
- fclose(f);
- return 0;
- }
- /* we get all info from file, close file first */
- fclose(f);
j = 0;
for (i = 0; i < num_directory; i++ )
{
/*get orientation tag */
if (byte_align == EXIF_BYTE_ALIGN_MM)
- direction = buf[j + 11];
- else direction = buf[j + 8];
+ direction = *(buf+ j + 11);
+ else direction = *(buf+ j + 8);
switch (direction)
{
case 3:
jerr.pub.output_message = _JPEGErrorHandler;
if (setjmp(jerr.setjmp_buffer))
{
- jpeg_destroy_decompress(&cinfo);
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- if (cinfo.saw_JFIF_marker)
- *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
- else
- *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
- return EINA_FALSE;
+ if (cinfo.saw_JFIF_marker)
+ *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+ else
+ *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+ return EINA_FALSE;
}
jpeg_create_decompress(&cinfo);
cinfo.dither_mode = JDITHER_ORDERED;
jpeg_start_decompress(&cinfo);
- /* head decoding */
+ /* rotation decoding */
if (ie->load_opts.orientation)
{
- degree = _get_orientation(ie->file);
+ degree = _get_orientation(map, length);
if (degree != 0)
{
ie->load_opts.degree = degree;
}
}
+
/* head decoding */
w = cinfo.output_width;
h = cinfo.output_height;
{
jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- if (IMG_TOO_BIG(w, h))
- *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
- else
- *error = EVAS_LOAD_ERROR_GENERIC;
- return EINA_FALSE;
+ if (IMG_TOO_BIG(w, h))
+ *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+ else
+ *error = EVAS_LOAD_ERROR_GENERIC;
+ return EINA_FALSE;
}
if (ie->load_opts.scale_down_by > 1)
{
- w /= ie->load_opts.scale_down_by;
- h /= ie->load_opts.scale_down_by;
+ w /= ie->load_opts.scale_down_by;
+ h /= ie->load_opts.scale_down_by;
}
else if (ie->load_opts.dpi > 0.0)
{
- w = (w * ie->load_opts.dpi) / 90.0;
- h = (h * ie->load_opts.dpi) / 90.0;
+ w = (w * ie->load_opts.dpi) / 90.0;
+ h = (h * ie->load_opts.dpi) / 90.0;
}
else if ((ie->load_opts.w > 0) && (ie->load_opts.h > 0))
{
ie->load_opts.h = load_opts_w;
}
- if (ie->load_opts.w > 0)
- {
- w2 = ie->load_opts.w;
- h2 = (ie->load_opts.w * h) / w;
- if ((ie->load_opts.h > 0) && (h2 > ie->load_opts.h))
- {
- unsigned int w3;
- h2 = ie->load_opts.h;
- w3 = (ie->load_opts.h * w) / h;
- if (w3 > w2)
- w2 = w3;
- }
- }
- else if (ie->load_opts.h > 0)
- {
- h2 = ie->load_opts.h;
- w2 = (ie->load_opts.h * w) / h;
- }
- w = w2;
- h = h2;
+ if (ie->load_opts.w > 0)
+ {
+ w2 = ie->load_opts.w;
+ h2 = (ie->load_opts.w * h) / w;
+ if ((ie->load_opts.h > 0) && (h2 > ie->load_opts.h))
+ {
+ unsigned int w3;
+ h2 = ie->load_opts.h;
+ w3 = (ie->load_opts.h * w) / h;
+ if (w3 > w2)
+ w2 = w3;
+ }
+ }
+ else if (ie->load_opts.h > 0)
+ {
+ h2 = ie->load_opts.h;
+ w2 = (ie->load_opts.h * w) / h;
+ }
+ w = w2;
+ h = h2;
if (change_wh)
{
ie->load_opts.w = load_opts_w;
if ((w != cinfo.output_width) || (h != cinfo.output_height))
{
- scalew = cinfo.output_width / w;
- scaleh = cinfo.output_height / h;
+ scalew = cinfo.output_width / w;
+ scaleh = cinfo.output_height / h;
- ie->scale = scalew;
- if (scaleh < scalew) ie->scale = scaleh;
+ ie->scale = scalew;
+ if (scaleh < scalew) ie->scale = scaleh;
- if (ie->scale > 8) ie->scale = 8;
- else if (ie->scale < 1) ie->scale = 1;
+ if (ie->scale > 8) ie->scale = 8;
+ else if (ie->scale < 1) ie->scale = 1;
- if (ie->scale == 3) ie->scale = 2;
- else if (ie->scale == 5) ie->scale = 4;
- else if (ie->scale == 6) ie->scale = 4;
- else if (ie->scale == 7) ie->scale = 4;
+ if (ie->scale == 3) ie->scale = 2;
+ else if (ie->scale == 5) ie->scale = 4;
+ else if (ie->scale == 6) ie->scale = 4;
+ else if (ie->scale == 7) ie->scale = 4;
}
if (ie->scale > 1)
{
- jpeg_destroy_decompress(&cinfo);
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- jpeg_create_decompress(&cinfo);
+ jpeg_create_decompress(&cinfo);
if (_evas_jpeg_membuf_src(&cinfo, map, length))
{
return EINA_FALSE;
}
- jpeg_read_header(&cinfo, TRUE);
- cinfo.do_fancy_upsampling = FALSE;
- cinfo.do_block_smoothing = FALSE;
- cinfo.scale_num = 1;
- cinfo.scale_denom = ie->scale;
- jpeg_calc_output_dimensions(&(cinfo));
- jpeg_start_decompress(&cinfo);
+ jpeg_read_header(&cinfo, TRUE);
+ cinfo.do_fancy_upsampling = FALSE;
+ cinfo.do_block_smoothing = FALSE;
+ cinfo.scale_num = 1;
+ cinfo.scale_denom = ie->scale;
+ jpeg_calc_output_dimensions(&(cinfo));
+ jpeg_start_decompress(&cinfo);
}
ie->w = cinfo.output_width;
ie->h = cinfo.output_height;
-
+
// be nice and clip region to image. if its totally outside, fail load
if ((ie->load_opts.region.w > 0) && (ie->load_opts.region.h > 0))
{
- unsigned int load_region_x, load_region_y,load_region_w,load_region_h;
+ unsigned int load_region_x, load_region_y, load_region_w, load_region_h;
if (ie->flags.rotated)
{
load_region_x = ie->load_opts.region.x;
ie->load_opts.region.w = load_region_h;
ie->load_opts.region.h = load_region_w;
break;
- case 180: //done
+ case 180:
ie->load_opts.region.x = w - (load_region_x+ load_region_w);
ie->load_opts.region.y = h - (load_region_y + load_region_h);
break;
- case 270: //done
+ case 270:
ie->load_opts.region.x = w - (load_region_y + load_region_h);
ie->load_opts.region.y = load_region_x;
ie->load_opts.region.w = load_region_h;
{
jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_GENERIC;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_GENERIC;
+ return EINA_FALSE;
}
ie->w = ie->load_opts.region.w;
ie->h = ie->load_opts.region.h;
ie->load_opts.region.h = load_region_h;
}
}
- /* end head decoding */
+/* end head decoding */
+
if (change_wh)
{
unsigned int tmp;
}
/*
- static double
- get_time(void)
- {
+static double
+get_time(void)
+{
struct timeval timev;
-
+
gettimeofday(&timev, NULL);
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
- }
- */
+}
+*/
static Eina_Bool
evas_image_load_file_data_jpeg_internal(Image_Entry *ie,
DATA32 *ptr2,*ptr_rotate;
unsigned int x, y, l, i, scans;
int region = 0;
- unsigned int tmp, load_region_x, load_region_y, load_region_w, load_region_h;/* for rotation decoding */
/* rotation setting */
+ unsigned int tmp, load_region_x, load_region_y, load_region_w, load_region_h;
int degree = 0;
Eina_Bool change_wh = EINA_FALSE;
Eina_Bool line_done = EINA_FALSE;
+
if (ie->flags.rotated)
{
degree = ie->load_opts.degree;
if (degree == 90 || degree == 270)
change_wh = EINA_TRUE;
}
+
cinfo.err = jpeg_std_error(&(jerr.pub));
jerr.pub.error_exit = _JPEGFatalErrorHandler;
jerr.pub.emit_message = _JPEGErrorHandler2;
jerr.pub.output_message = _JPEGErrorHandler;
if (setjmp(jerr.setjmp_buffer))
{
- jpeg_destroy_decompress(&cinfo);
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+ return EINA_FALSE;
}
jpeg_create_decompress(&cinfo);
if (ie->scale > 1)
{
- cinfo.scale_num = 1;
- cinfo.scale_denom = ie->scale;
+ cinfo.scale_num = 1;
+ cinfo.scale_denom = ie->scale;
}
/* Colorspace conversion options */
/* GRAYSCLAE => RGB YCbCr => RGB and YCCK => CMYK */
switch (cinfo.jpeg_color_space)
{
- case JCS_UNKNOWN:
- break;
- case JCS_GRAYSCALE:
- case JCS_RGB:
- case JCS_YCbCr:
- cinfo.out_color_space = JCS_RGB;
- break;
- case JCS_CMYK:
- case JCS_YCCK:
- cinfo.out_color_space = JCS_CMYK;
- break;
+ case JCS_UNKNOWN:
+ break;
+ case JCS_GRAYSCALE:
+ case JCS_RGB:
+ case JCS_YCbCr:
+ cinfo.out_color_space = JCS_RGB;
+ break;
+ case JCS_CMYK:
+ case JCS_YCCK:
+ cinfo.out_color_space = JCS_CMYK;
+ break;
}
- /* head decoding */
+/* head decoding */
jpeg_calc_output_dimensions(&(cinfo));
jpeg_start_decompress(&cinfo);
if ((ie->load_opts.region.w > 0) && (ie->load_opts.region.h > 0))
{
region = 1;
-#ifdef BUILD_LOADER_JPEG_REGION
if (ie->flags.rotated)
{
ie->load_opts.region.w = load_region_h;
ie->load_opts.region.h = load_region_w;
break;
- case 180: //done
+ case 180:
ie->load_opts.region.x = w - (load_region_x+ load_region_w);
ie->load_opts.region.y = h - (load_region_y + load_region_h);
break;
- case 270: //done
+ case 270:
ie->load_opts.region.x = w - (load_region_y + load_region_h);
ie->load_opts.region.y = load_region_x;
ie->load_opts.region.w = load_region_h;
}
}
+#ifdef BUILD_LOADER_JPEG_REGION
cinfo.region_x = ie->load_opts.region.x;
cinfo.region_y = ie->load_opts.region.y;
cinfo.region_w = ie->load_opts.region.w;
}
if ((!region) && ((w != ie->w) || (h != ie->h)))
{
- // race condition, the file could have change from when we call header
- // this test will not solve the problem with region code.
- jpeg_destroy_decompress(&cinfo);
+ // race condition, the file could have change from when we call header
+ // this test will not solve the problem with region code.
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_GENERIC;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_GENERIC;
+ return EINA_FALSE;
}
if ((region) &&
((ie->w != ie->load_opts.region.w) || (ie->h != ie->load_opts.region.h)))
((cinfo.output_components == 3) || (cinfo.output_components == 1))) ||
((cinfo.out_color_space == JCS_CMYK) && (cinfo.output_components == 4))))
{
- jpeg_destroy_decompress(&cinfo);
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+ return EINA_FALSE;
}
- /* end head decoding */
- /* data decoding */
+/* end head decoding */
+/* data decoding */
if (cinfo.rec_outbuf_height > 16)
{
- jpeg_destroy_decompress(&cinfo);
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+ return EINA_FALSE;
}
data = alloca(w * 16 * cinfo.output_components);
evas_cache_image_surface_alloc(ie, ie->w, ie->h);
if (ie->flags.loaded)
{
- jpeg_destroy_decompress(&cinfo);
+ jpeg_destroy_decompress(&cinfo);
_evas_jpeg_membuf_src_term(&cinfo);
- *error = EVAS_LOAD_ERROR_NONE;
+ *error = EVAS_LOAD_ERROR_NONE;
if (region && ie->flags.rotated)
{
ie->load_opts.region.x = load_region_x;
ie->load_opts.region.w = load_region_w;
ie->load_opts.region.h = load_region_h;
}
- return EINA_TRUE;
+ return EINA_TRUE;
}
if ((ie->flags.rotated) && change_wh)
{
ptr_rotate = ptr2;
}
else
- ptr2 = evas_cache_image_pixels(ie);
+ ptr2 = evas_cache_image_pixels(ie);
+
if (!ptr2)
{
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
if (cinfo.output_components == 4)
{
// FIXME: handle region
- for (i = 0; (int)i < cinfo.rec_outbuf_height; i++)
- line[i] = data + (i * w * 4);
- for (l = 0; l < h; l += cinfo.rec_outbuf_height)
- {
- jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
- scans = cinfo.rec_outbuf_height;
- if ((h - l) < scans) scans = h - l;
- ptr = data;
+ for (i = 0; (int)i < cinfo.rec_outbuf_height; i++)
+ line[i] = data + (i * w * 4);
+ for (l = 0; l < h; l += cinfo.rec_outbuf_height)
+ {
+ jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
+ scans = cinfo.rec_outbuf_height;
+ if ((h - l) < scans) scans = h - l;
+ ptr = data;
if (!region)
{
for (y = 0; y < scans; y++)
/* that is C is replaces by 255 - C, etc...*/
/* See the comment below for the computation of RGB values from CMYK ones. */
*ptr2 =
- (0xff000000) |
- ((ptr[0] * ptr[3] / 255) << 16) |
- ((ptr[1] * ptr[3] / 255) << 8) |
- ((ptr[2] * ptr[3] / 255));
+ (0xff000000) |
+ ((ptr[0] * ptr[3] / 255) << 16) |
+ ((ptr[1] * ptr[3] / 255) << 8) |
+ ((ptr[2] * ptr[3] / 255));
ptr += 4;
ptr2++;
}
/* B = (255 - Y) * (255 - K) / 255 */
/* with C, M, Y and K between 0 and 255. */
*ptr2 =
- (0xff000000) |
- (((255 - ptr[0]) * (255 - ptr[3]) / 255) << 16) |
- (((255 - ptr[1]) * (255 - ptr[3]) / 255) << 8) |
- (((255 - ptr[2]) * (255 - ptr[3]) / 255));
+ (0xff000000) |
+ (((255 - ptr[0]) * (255 - ptr[3]) / 255) << 16) |
+ (((255 - ptr[1]) * (255 - ptr[3]) / 255) << 8) |
+ (((255 - ptr[2]) * (255 - ptr[3]) / 255));
ptr += 4;
ptr2++;
}
}
- }
- }
+ }
+ }
else
{
// if line # > region last line, break
return EINA_FALSE;*/
}
// els if scan block intersects region start or later
- else if ((l + scans) >
+ else if ((l + scans) >
(ie->load_opts.region.y))
{
for (y = 0; y < scans; y++)
/* that is C is replaces by 255 - C, etc...*/
/* See the comment below for the computation of RGB values from CMYK ones. */
*ptr2 =
- (0xff000000) |
- ((ptr[0] * ptr[3] / 255) << 16) |
- ((ptr[1] * ptr[3] / 255) << 8) |
- ((ptr[2] * ptr[3] / 255));
+ (0xff000000) |
+ ((ptr[0] * ptr[3] / 255) << 16) |
+ ((ptr[1] * ptr[3] / 255) << 8) |
+ ((ptr[2] * ptr[3] / 255));
ptr += 4;
ptr2++;
}
/* B = (255 - Y) * (255 - K) / 255 */
/* with C, M, Y and K between 0 and 255. */
*ptr2 =
- (0xff000000) |
- (((255 - ptr[0]) * (255 - ptr[3]) / 255) << 16) |
- (((255 - ptr[1]) * (255 - ptr[3]) / 255) << 8) |
- (((255 - ptr[2]) * (255 - ptr[3]) / 255));
+ (0xff000000) |
+ (((255 - ptr[0]) * (255 - ptr[3]) / 255) << 16) |
+ (((255 - ptr[1]) * (255 - ptr[3]) / 255) << 8) |
+ (((255 - ptr[2]) * (255 - ptr[3]) / 255));
ptr += 4;
ptr2++;
}
}
}
}
- }
+ }
}
/* We handle then RGB with 3 components */
else if (cinfo.output_components == 3)
{
- /*
- double t;
- if (region)
- {
- // debug for now
- printf("R| %p %5ix%5i %s: %5i %5i %5ix%5i - ",
- ie,
- ie->w, ie->h,
- ie->file,
- ie->load_opts.region.x,
- ie->load_opts.region.y,
- ie->load_opts.region.w,
- ie->load_opts.region.h);
- }
+/*
+ double t;
+ if (region)
+ {
+ // debug for now
+ printf("R| %p %5ix%5i %s: %5i %5i %5ix%5i - ",
+ ie,
+ ie->w, ie->h,
+ ie->file,
+ ie->load_opts.region.x,
+ ie->load_opts.region.y,
+ ie->load_opts.region.w,
+ ie->load_opts.region.h);
+ }
t = get_time();
- */
+ */
for (i = 0; (int)i < cinfo.rec_outbuf_height; i++)
- line[i] = data + (i * w * 3);
- for (l = 0; l < h; l += cinfo.rec_outbuf_height)
- {
- jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
- scans = cinfo.rec_outbuf_height;
- if ((h - l) < scans) scans = h - l;
- ptr = data;
+ line[i] = data + (i * w * 3);
+ for (l = 0; l < h; l += cinfo.rec_outbuf_height)
+ {
+ jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
+ scans = cinfo.rec_outbuf_height;
+ if ((h - l) < scans) scans = h - l;
+ ptr = data;
if (!region)
{
for (y = 0; y < scans; y++)
ptr2++;
}
}
- }
+ }
else
{
// if line # > region last line, break
goto done;
}
// else if scan block intersects region start or later
- else if ((l + scans) >
+ else if ((l + scans) >
(ie->load_opts.region.y))
{
for (y = 0; y < scans; y++)
}
}
}
- }
- /*
- t = get_time() - t;
- printf("%3.3f\n", t);
- */
+ }
+/*
+ t = get_time() - t;
+ printf("%3.3f\n", t);
+ */
}
/* We finally handle RGB with 1 component */
else if (cinfo.output_components == 1)
{
- for (i = 0; (int)i < cinfo.rec_outbuf_height; i++)
- line[i] = data + (i * w);
- for (l = 0; l < h; l += cinfo.rec_outbuf_height)
- {
- jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
- scans = cinfo.rec_outbuf_height;
- if ((h - l) < scans) scans = h - l;
- ptr = data;
+ for (i = 0; (int)i < cinfo.rec_outbuf_height; i++)
+ line[i] = data + (i * w);
+ for (l = 0; l < h; l += cinfo.rec_outbuf_height)
+ {
+ jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
+ scans = cinfo.rec_outbuf_height;
+ if ((h - l) < scans) scans = h - l;
+ ptr = data;
if (!region)
{
for (y = 0; y < scans; y++)
ptr2++;
}
}
- }
+ }
else
{
// if line # > region last line, break
return EINA_TRUE;*/
}
// els if scan block intersects region start or later
- else if ((l + scans) >
+ else if ((l + scans) >
(ie->load_opts.region.y))
{
for (y = 0; y < scans; y++)
}
}
}
- }
+ }
}
/* if rotation operation need, rotate it */
done:
+
if (ie->flags.rotated)
{
DATA32 *data1, *data2, *to, *from;
ie->load_opts.region.h = load_region_h;
}
}
-
if (line_done)
{
jpeg_destroy_decompress(&cinfo);
if (!f)
{
- *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
+ return EINA_FALSE;
}
cinfo.err = jpeg_std_error(&(jerr.pub));
jerr.pub.error_exit = _JPEGFatalErrorHandler;
jerr.pub.output_message = _JPEGErrorHandler;
if (setjmp(jerr.setjmp_buffer))
{
- jpeg_destroy_decompress(&cinfo);
- *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
- return EINA_FALSE;
+ jpeg_destroy_decompress(&cinfo);
+ *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+ return EINA_FALSE;
}
jpeg_create_decompress(&cinfo);
jpeg_stdio_src(&cinfo, f);
cinfo.do_block_smoothing = FALSE;
jpeg_start_decompress(&cinfo);
- /* head decoding */
+/* head decoding */
ie->w = w = cinfo.output_width;
ie->h = h = cinfo.output_height;
- /* end head decoding */
- /* data decoding */
+/* end head decoding */
+/* data decoding */
if (cinfo.rec_outbuf_height > 16)
{
- jpeg_destroy_decompress(&cinfo);
- *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
- return EINA_FALSE;;
+ jpeg_destroy_decompress(&cinfo);
+ *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+ return EINA_FALSE;;
}
data = alloca(w * 16 * 3);
if (!ie->flags.loaded)
{
- jpeg_destroy_decompress(&cinfo);
- *error = EVAS_LOAD_ERROR_NONE;
- return EINA_TRUE;
+ jpeg_destroy_decompress(&cinfo);
+ *error = EVAS_LOAD_ERROR_NONE;
+ return EINA_TRUE;
}
ptr2 = evas_cache_image_pixels(ie);
prevy = 0;
if (cinfo.output_components == 3)
{
- for (i = 0; i < cinfo.rec_outbuf_height; i++)
- line[i] = data + (i * w * 3);
- for (l = 0; l < h; l += cinfo.rec_outbuf_height)
- {
- jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
- scans = cinfo.rec_outbuf_height;
- if ((h - l) < scans) scans = h - l;
- ptr = data;
- for (y = 0; y < scans; y++)
- {
- for (x = 0; x < w; x++)
- {
- *ptr2 =
- ((*ptr2) & 0x00ffffff) |
- (((ptr[0] + ptr[1] + ptr[2]) / 3) << 24);
- ptr += 3;
- ptr2++;
- }
- }
- }
+ for (i = 0; i < cinfo.rec_outbuf_height; i++)
+ line[i] = data + (i * w * 3);
+ for (l = 0; l < h; l += cinfo.rec_outbuf_height)
+ {
+ jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
+ scans = cinfo.rec_outbuf_height;
+ if ((h - l) < scans) scans = h - l;
+ ptr = data;
+ for (y = 0; y < scans; y++)
+ {
+ for (x = 0; x < w; x++)
+ {
+ *ptr2 =
+ ((*ptr2) & 0x00ffffff) |
+ (((ptr[0] + ptr[1] + ptr[2]) / 3) << 24);
+ ptr += 3;
+ ptr2++;
+ }
+ }
+ }
}
else if (cinfo.output_components == 1)
{
- for (i = 0; i < cinfo.rec_outbuf_height; i++)
- line[i] = data + (i * w);
- for (l = 0; l < h; l += cinfo.rec_outbuf_height)
- {
- jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
- scans = cinfo.rec_outbuf_height;
- if ((h - l) < scans) scans = h - l;
- ptr = data;
- for (y = 0; y < scans; y++)
- {
- for (x = 0; x < w; x++)
- {
- *ptr2 =
- ((*ptr2) & 0x00ffffff) |
- ((ptr[0]) << 24);
- ptr++;
- ptr2++;
- }
- }
- }
+ for (i = 0; i < cinfo.rec_outbuf_height; i++)
+ line[i] = data + (i * w);
+ for (l = 0; l < h; l += cinfo.rec_outbuf_height)
+ {
+ jpeg_read_scanlines(&cinfo, line, cinfo.rec_outbuf_height);
+ scans = cinfo.rec_outbuf_height;
+ if ((h - l) < scans) scans = h - l;
+ ptr = data;
+ for (y = 0; y < scans; y++)
+ {
+ for (x = 0; x < w; x++)
+ {
+ *ptr2 =
+ ((*ptr2) & 0x00ffffff) |
+ ((ptr[0]) << 24);
+ ptr++;
+ ptr2++;
+ }
+ }
+ }
}
- /* end data decoding */
+/* end data decoding */
jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
*error = EVAS_LOAD_ERROR_NONE;
f = eina_file_open(file, EINA_FALSE);
if (!f)
{
- *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
+ return EINA_FALSE;
}
map = eina_file_map_all(f, EINA_FILE_WILLNEED);
if (!map)
{
- *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
+ *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
goto on_error;
}
eina_file_map_free(f, map);
-on_error:
+ on_error:
eina_file_close(f);
return val;
}
f = eina_file_open(file, EINA_FALSE);
if (!f)
{
- *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
- return EINA_FALSE;
+ *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
+ return EINA_FALSE;
}
map = eina_file_map_all(f, EINA_FILE_WILLNEED);
if (!map)
eina_file_map_free(f, map);
-on_error:
+ on_error:
eina_file_close(f);
return val;
}
"jpeg",
"none",
{
- module_open,
- module_close
+ module_open,
+ module_close
}
};
fnode = evas_textblock_node_format_next_get(fnode);
fail_if (fnode);
+ /* Remove two pairs with the same name and same positions. */
+ evas_object_textblock_text_markup_set(tb, "<a><a>A</a></a>");
+ evas_textblock_cursor_pos_set(cur, 0);
+ evas_textblock_cursor_char_delete(cur);
+
+ fnode = evas_textblock_node_format_first_get(tb);
+ fail_if (fnode);
+
/* Try to remove a format that doesn't have a pair (with a bad mkup) */
evas_object_textblock_text_markup_set(tb, "a<b>b<i>c</>d</i>e");
evas_textblock_cursor_pos_set(cur, 2);