aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/gl_common
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/modules/engines/gl_common')
-rw-r--r--libraries/evas/src/modules/engines/gl_common/Makefile.am164
-rw-r--r--libraries/evas/src/modules/engines/gl_common/Makefile.in871
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_common.h659
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_context.c2723
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_filter.c181
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_font.c203
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_image.c968
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_line.c32
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_polygon.c307
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_private.h32
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c53
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_shader.c1262
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c1668
-rwxr-xr-xlibraries/evas/src/modules/engines/gl_common/shader/compile-s3c6410.sh47
-rwxr-xr-xlibraries/evas/src/modules/engines/gl_common/shader/compile-sgx.sh48
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur.h24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur.shd24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.h24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.shd24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.h24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.shd24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.h24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.shd24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.h20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.shd20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.h20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.shd20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.h18
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.shd18
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.h18
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.shd18
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_frag.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_frag.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_frag_bin_s3c6410.h9
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_frag_s3c6410.asm26
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_vert.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_vert.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/font_vert_bin_s3c6410.h20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag_bin_s3c6410.h11
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.h13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.shd13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag_bin_s3c6410.h10
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.h12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.shd12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert_bin_s3c6410.h17
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert_bin_s3c6410.h20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_frag.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_frag.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_frag_bin_s3c6410.h9
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_frag_s3c6410.asm26
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_mask_frag.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_mask_vert.h16
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.h13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.shd13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag_bin_s3c6410.h10
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.h12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.shd12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert_bin_s3c6410.h17
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_vert.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_vert.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/img_vert_bin_s3c6410.h20
-rwxr-xr-xlibraries/evas/src/modules/engines/gl_common/shader/make-c-bin.sh3
-rwxr-xr-xlibraries/evas/src/modules/engines/gl_common/shader/make-c-str.sh3
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.h31
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.shd31
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.h31
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.shd31
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.h16
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.shd16
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_frag.h13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_frag.shd13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_frag_bin_s3c6410.h6
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_frag_s3c6410.asm24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_vert.h12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_vert.shd12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/rect_vert_bin_s3c6410.h17
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_frag.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_frag.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_frag_bin_s3c6410.h9
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_frag_s3c6410.asm26
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.h13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.shd13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag_bin_s3c6410.h10
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.h12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.shd12
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert_bin_s3c6410.h17
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_vert.h15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_vert.shd15
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/tex_vert_bin_s3c6410.h20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd20
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h24
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm46
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h19
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd19
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag_bin_s3c6410.h23
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.h14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.shd14
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert_bin_s3c6410.h23
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.h17
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.shd17
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuv_vert_bin_s3c6410.h26
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.h30
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.shd30
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.h30
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.shd30
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.h13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.shd13
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.h16
-rw-r--r--libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.shd16
132 files changed, 11229 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/gl_common/Makefile.am b/libraries/evas/src/modules/engines/gl_common/Makefile.am
new file mode 100644
index 0000000..15acc02
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/Makefile.am
@@ -0,0 +1,164 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8@FREETYPE_CFLAGS@ \
9@PIXMAN_CFLAGS@ \
10@GL_EET_CFLAGS@ \
11@EINA_CFLAGS@
12
13if BUILD_ENGINE_GL_COMMON
14
15noinst_LTLIBRARIES = libevas_engine_gl_common.la
16libevas_engine_gl_common_la_SOURCES = \
17evas_gl_private.h \
18evas_gl_common.h \
19evas_gl_context.c \
20evas_gl_shader.c \
21evas_gl_rectangle.c \
22evas_gl_texture.c \
23evas_gl_image.c \
24evas_gl_font.c \
25evas_gl_polygon.c \
26evas_gl_line.c \
27evas_gl_filter.c \
28shader/rect_frag.h \
29shader/rect_frag_bin_s3c6410.h \
30shader/rect_vert.h \
31shader/rect_vert_bin_s3c6410.h \
32shader/font_frag.h \
33shader/font_frag_bin_s3c6410.h \
34shader/font_vert.h \
35shader/font_vert_bin_s3c6410.h \
36shader/img_frag.h \
37shader/img_frag_bin_s3c6410.h \
38shader/img_vert.h \
39shader/img_vert_bin_s3c6410.h \
40shader/img_nomul_frag.h \
41shader/img_nomul_frag_bin_s3c6410.h \
42shader/img_nomul_vert.h \
43shader/img_nomul_vert_bin_s3c6410.h \
44shader/img_bgra_frag.h \
45shader/img_bgra_frag_bin_s3c6410.h \
46shader/img_bgra_vert.h \
47shader/img_bgra_vert_bin_s3c6410.h \
48shader/img_bgra_nomul_frag.h \
49shader/img_bgra_nomul_frag_bin_s3c6410.h \
50shader/img_bgra_nomul_vert.h \
51shader/img_bgra_nomul_vert_bin_s3c6410.h \
52shader/img_mask_frag.h \
53shader/img_mask_vert.h \
54shader/nv12_nomul_vert.h \
55shader/nv12_vert.h \
56shader/nv12_nomul_frag.h \
57shader/nv12_frag.h \
58shader/yuv_frag.h \
59shader/yuv_frag_bin_s3c6410.h \
60shader/yuv_vert.h \
61shader/yuv_vert_bin_s3c6410.h \
62shader/yuv_nomul_frag.h \
63shader/yuv_nomul_frag_bin_s3c6410.h \
64shader/yuv_nomul_vert.h \
65shader/yuv_nomul_vert_bin_s3c6410.h \
66shader/tex_frag.h \
67shader/tex_frag_bin_s3c6410.h \
68shader/tex_vert.h \
69shader/tex_vert_bin_s3c6410.h \
70shader/tex_nomul_frag.h \
71shader/tex_nomul_frag_bin_s3c6410.h \
72shader/tex_nomul_vert.h \
73shader/tex_nomul_vert_bin_s3c6410.h \
74shader/filter_invert.h \
75shader/filter_invert_nomul.h \
76shader/filter_invert_bgra.h \
77shader/filter_invert_bgra_nomul.h \
78shader/filter_sepia.h \
79shader/filter_sepia_nomul.h \
80shader/filter_sepia_bgra.h \
81shader/filter_sepia_bgra_nomul.h \
82shader/filter_greyscale.h \
83shader/filter_greyscale_nomul.h \
84shader/filter_greyscale_bgra.h \
85shader/filter_greyscale_bgra_nomul.h \
86shader/filter_blur.h \
87shader/filter_blur_nomul.h \
88shader/filter_blur_bgra.h \
89shader/filter_blur_bgra_nomul.h \
90shader/yuy2_frag.h \
91shader/yuy2_vert.h \
92shader/yuy2_nomul_frag.h \
93shader/yuy2_nomul_vert.h
94
95libevas_engine_gl_common_la_LIBADD = @EINA_LIBS@ @GL_EET_LIBS@ @evas_engine_gl_common_libs@ @dlopen_libs@
96endif
97
98EXTRA_DIST = \
99shader/compile-s3c6410.sh \
100shader/compile-sgx.sh \
101shader/make-c-bin.sh \
102shader/make-c-str.sh \
103shader/rect_frag.shd \
104shader/rect_frag_s3c6410.asm \
105shader/rect_vert.shd \
106shader/font_frag.shd \
107shader/font_frag_s3c6410.asm \
108shader/font_vert.shd \
109shader/img_frag.shd \
110shader/img_frag_s3c6410.asm \
111shader/img_vert.shd \
112shader/img_nomul_frag.shd \
113shader/img_nomul_vert.shd \
114shader/img_bgra_vert.shd \
115shader/img_bgra_frag.shd \
116shader/img_bgra_vert.shd \
117shader/img_bgra_nomul_frag.shd \
118shader/img_bgra_nomul_vert.shd \
119shader/img_mask_frag.h \
120shader/img_mask_vert.h \
121shader/yuv_frag.shd \
122shader/yuv_frag_s3c6410.asm \
123shader/yuv_vert.shd \
124shader/yuv_nomul_frag.shd \
125shader/yuv_nomul_vert.shd \
126shader/tex_frag.shd \
127shader/tex_frag_s3c6410.asm \
128shader/tex_vert.shd \
129shader/tex_nomul_frag.shd \
130shader/tex_nomul_vert.shd \
131shader/filter_invert.shd \
132shader/filter_invert_nomul.shd \
133shader/filter_invert_bgra.shd \
134shader/filter_invert_bgra_nomul.shd \
135shader/filter_greyscale.shd \
136shader/filter_greyscale_nomul.shd \
137shader/filter_greyscale_bgra.shd \
138shader/filter_greyscale_bgra_nomul.shd \
139shader/filter_sepia.shd \
140shader/filter_sepia_nomul.shd \
141shader/filter_sepia_bgra.shd \
142shader/filter_sepia_bgra_nomul.shd \
143shader/filter_blur.shd \
144shader/filter_blur_nomul.shd \
145shader/filter_blur_bgra.shd \
146shader/filter_blur_bgra_nomul.shd \
147shader/nv12_frag.h \
148shader/nv12_frag.shd \
149shader/nv12_nomul_frag.h \
150shader/nv12_nomul_frag.shd \
151shader/nv12_nomul_vert.h \
152shader/nv12_nomul_vert.shd \
153shader/nv12_vert.h \
154shader/nv12_vert.shd \
155shader/yuy2_frag.h \
156shader/yuy2_frag.shd \
157shader/yuy2_nomul_frag.h \
158shader/yuy2_nomul_frag.shd \
159shader/yuy2_nomul_vert.h \
160shader/yuy2_nomul_vert.shd \
161shader/yuy2_vert.h \
162shader/yuy2_vert.shd
163
164
diff --git a/libraries/evas/src/modules/engines/gl_common/Makefile.in b/libraries/evas/src/modules/engines/gl_common/Makefile.in
new file mode 100644
index 0000000..61ed478
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/Makefile.in
@@ -0,0 +1,871 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/modules/engines/gl_common
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_engine_gl_common_la_DEPENDENCIES =
61am__libevas_engine_gl_common_la_SOURCES_DIST = evas_gl_private.h \
62 evas_gl_common.h evas_gl_context.c evas_gl_shader.c \
63 evas_gl_rectangle.c evas_gl_texture.c evas_gl_image.c \
64 evas_gl_font.c evas_gl_polygon.c evas_gl_line.c \
65 evas_gl_filter.c shader/rect_frag.h \
66 shader/rect_frag_bin_s3c6410.h shader/rect_vert.h \
67 shader/rect_vert_bin_s3c6410.h shader/font_frag.h \
68 shader/font_frag_bin_s3c6410.h shader/font_vert.h \
69 shader/font_vert_bin_s3c6410.h shader/img_frag.h \
70 shader/img_frag_bin_s3c6410.h shader/img_vert.h \
71 shader/img_vert_bin_s3c6410.h shader/img_nomul_frag.h \
72 shader/img_nomul_frag_bin_s3c6410.h shader/img_nomul_vert.h \
73 shader/img_nomul_vert_bin_s3c6410.h shader/img_bgra_frag.h \
74 shader/img_bgra_frag_bin_s3c6410.h shader/img_bgra_vert.h \
75 shader/img_bgra_vert_bin_s3c6410.h \
76 shader/img_bgra_nomul_frag.h \
77 shader/img_bgra_nomul_frag_bin_s3c6410.h \
78 shader/img_bgra_nomul_vert.h \
79 shader/img_bgra_nomul_vert_bin_s3c6410.h \
80 shader/img_mask_frag.h shader/img_mask_vert.h \
81 shader/nv12_nomul_vert.h shader/nv12_vert.h \
82 shader/nv12_nomul_frag.h shader/nv12_frag.h shader/yuv_frag.h \
83 shader/yuv_frag_bin_s3c6410.h shader/yuv_vert.h \
84 shader/yuv_vert_bin_s3c6410.h shader/yuv_nomul_frag.h \
85 shader/yuv_nomul_frag_bin_s3c6410.h shader/yuv_nomul_vert.h \
86 shader/yuv_nomul_vert_bin_s3c6410.h shader/tex_frag.h \
87 shader/tex_frag_bin_s3c6410.h shader/tex_vert.h \
88 shader/tex_vert_bin_s3c6410.h shader/tex_nomul_frag.h \
89 shader/tex_nomul_frag_bin_s3c6410.h shader/tex_nomul_vert.h \
90 shader/tex_nomul_vert_bin_s3c6410.h shader/filter_invert.h \
91 shader/filter_invert_nomul.h shader/filter_invert_bgra.h \
92 shader/filter_invert_bgra_nomul.h shader/filter_sepia.h \
93 shader/filter_sepia_nomul.h shader/filter_sepia_bgra.h \
94 shader/filter_sepia_bgra_nomul.h shader/filter_greyscale.h \
95 shader/filter_greyscale_nomul.h shader/filter_greyscale_bgra.h \
96 shader/filter_greyscale_bgra_nomul.h shader/filter_blur.h \
97 shader/filter_blur_nomul.h shader/filter_blur_bgra.h \
98 shader/filter_blur_bgra_nomul.h shader/yuy2_frag.h \
99 shader/yuy2_vert.h shader/yuy2_nomul_frag.h \
100 shader/yuy2_nomul_vert.h
101@BUILD_ENGINE_GL_COMMON_TRUE@am_libevas_engine_gl_common_la_OBJECTS = \
102@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_context.lo \
103@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_shader.lo \
104@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_rectangle.lo \
105@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_texture.lo \
106@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_image.lo evas_gl_font.lo \
107@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_polygon.lo \
108@BUILD_ENGINE_GL_COMMON_TRUE@ evas_gl_line.lo evas_gl_filter.lo
109libevas_engine_gl_common_la_OBJECTS = \
110 $(am_libevas_engine_gl_common_la_OBJECTS)
111AM_V_lt = $(am__v_lt_$(V))
112am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
113am__v_lt_0 = --silent
114@BUILD_ENGINE_GL_COMMON_TRUE@am_libevas_engine_gl_common_la_rpath =
115DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
116depcomp = $(SHELL) $(top_srcdir)/depcomp
117am__depfiles_maybe = depfiles
118am__mv = mv -f
119COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
120 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
121LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
122 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
123 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
124 $(AM_CFLAGS) $(CFLAGS)
125AM_V_CC = $(am__v_CC_$(V))
126am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
127am__v_CC_0 = @echo " CC " $@;
128AM_V_at = $(am__v_at_$(V))
129am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
130am__v_at_0 = @
131CCLD = $(CC)
132LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
133 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
134 $(AM_LDFLAGS) $(LDFLAGS) -o $@
135AM_V_CCLD = $(am__v_CCLD_$(V))
136am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
137am__v_CCLD_0 = @echo " CCLD " $@;
138AM_V_GEN = $(am__v_GEN_$(V))
139am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
140am__v_GEN_0 = @echo " GEN " $@;
141SOURCES = $(libevas_engine_gl_common_la_SOURCES)
142DIST_SOURCES = $(am__libevas_engine_gl_common_la_SOURCES_DIST)
143ETAGS = etags
144CTAGS = ctags
145DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
146ACLOCAL = @ACLOCAL@
147ALLOCA = @ALLOCA@
148AMTAR = @AMTAR@
149AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
150AR = @AR@
151AS = @AS@
152AUTOCONF = @AUTOCONF@
153AUTOHEADER = @AUTOHEADER@
154AUTOMAKE = @AUTOMAKE@
155AWK = @AWK@
156CC = @CC@
157CCDEPMODE = @CCDEPMODE@
158CFLAGS = @CFLAGS@
159CHECK_CFLAGS = @CHECK_CFLAGS@
160CHECK_LIBS = @CHECK_LIBS@
161CPP = @CPP@
162CPPFLAGS = @CPPFLAGS@
163CXX = @CXX@
164CXXCPP = @CXXCPP@
165CXXDEPMODE = @CXXDEPMODE@
166CXXFLAGS = @CXXFLAGS@
167CYGPATH_W = @CYGPATH_W@
168DEFS = @DEFS@
169DEPDIR = @DEPDIR@
170DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
171DIRECTFB_LIBS = @DIRECTFB_LIBS@
172DLLTOOL = @DLLTOOL@
173DSYMUTIL = @DSYMUTIL@
174DUMPBIN = @DUMPBIN@
175ECHO_C = @ECHO_C@
176ECHO_N = @ECHO_N@
177ECHO_T = @ECHO_T@
178ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
179ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
180EDB_CFLAGS = @EDB_CFLAGS@
181EDB_LIBS = @EDB_LIBS@
182EDJE_CFLAGS = @EDJE_CFLAGS@
183EDJE_LIBS = @EDJE_LIBS@
184EET_CFLAGS = @EET_CFLAGS@
185EET_LIBS = @EET_LIBS@
186EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
187EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
188EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
189EGREP = @EGREP@
190EINA_CFLAGS = @EINA_CFLAGS@
191EINA_LIBS = @EINA_LIBS@
192EVAS_CFLAGS = @EVAS_CFLAGS@
193EVAS_LIBS = @EVAS_LIBS@
194EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
195EVIL_CFLAGS = @EVIL_CFLAGS@
196EVIL_LIBS = @EVIL_LIBS@
197EXEEXT = @EXEEXT@
198FGREP = @FGREP@
199FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
200FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
201FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
202FREETYPE_LIBS = @FREETYPE_LIBS@
203FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
204FRIBIDI_LIBS = @FRIBIDI_LIBS@
205GL_EET_CFLAGS = @GL_EET_CFLAGS@
206GL_EET_LIBS = @GL_EET_LIBS@
207GREP = @GREP@
208HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
209HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
210INSTALL = @INSTALL@
211INSTALL_DATA = @INSTALL_DATA@
212INSTALL_PROGRAM = @INSTALL_PROGRAM@
213INSTALL_SCRIPT = @INSTALL_SCRIPT@
214INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
215LD = @LD@
216LDFLAGS = @LDFLAGS@
217LIBOBJS = @LIBOBJS@
218LIBS = @LIBS@
219LIBTOOL = @LIBTOOL@
220LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
221LINEBREAK_LIBS = @LINEBREAK_LIBS@
222LIPO = @LIPO@
223LN_S = @LN_S@
224LTLIBOBJS = @LTLIBOBJS@
225MAKEINFO = @MAKEINFO@
226MKDIR_P = @MKDIR_P@
227MODULE_ARCH = @MODULE_ARCH@
228NM = @NM@
229NMEDIT = @NMEDIT@
230OBJC = @OBJC@
231OBJCDEPMODE = @OBJCDEPMODE@
232OBJCFLAGS = @OBJCFLAGS@
233OBJDUMP = @OBJDUMP@
234OBJEXT = @OBJEXT@
235OTOOL = @OTOOL@
236OTOOL64 = @OTOOL64@
237PACKAGE = @PACKAGE@
238PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
239PACKAGE_NAME = @PACKAGE_NAME@
240PACKAGE_STRING = @PACKAGE_STRING@
241PACKAGE_TARNAME = @PACKAGE_TARNAME@
242PACKAGE_URL = @PACKAGE_URL@
243PACKAGE_VERSION = @PACKAGE_VERSION@
244PATH_SEPARATOR = @PATH_SEPARATOR@
245PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
246PIXMAN_LIBS = @PIXMAN_LIBS@
247PKG_CONFIG = @PKG_CONFIG@
248PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
249PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
250PNG_CFLAGS = @PNG_CFLAGS@
251PNG_LIBS = @PNG_LIBS@
252RANLIB = @RANLIB@
253SDL_CFLAGS = @SDL_CFLAGS@
254SDL_LIBS = @SDL_LIBS@
255SED = @SED@
256SET_MAKE = @SET_MAKE@
257SHELL = @SHELL@
258SHM_OPEN_LINK = @SHM_OPEN_LINK@
259STRIP = @STRIP@
260SVG_CFLAGS = @SVG_CFLAGS@
261SVG_LIBS = @SVG_LIBS@
262VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
263VALGRIND_LIBS = @VALGRIND_LIBS@
264VERSION = @VERSION@
265VMAJ = @VMAJ@
266WIN32_CFLAGS = @WIN32_CFLAGS@
267WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
268XCB_CFLAGS = @XCB_CFLAGS@
269XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
270XCB_GL_LIBS = @XCB_GL_LIBS@
271XCB_LIBS = @XCB_LIBS@
272XEXT_CFLAGS = @XEXT_CFLAGS@
273XEXT_LIBS = @XEXT_LIBS@
274XMKMF = @XMKMF@
275X_CFLAGS = @X_CFLAGS@
276X_EXTRA_LIBS = @X_EXTRA_LIBS@
277X_LIBS = @X_LIBS@
278X_PRE_LIBS = @X_PRE_LIBS@
279abs_builddir = @abs_builddir@
280abs_srcdir = @abs_srcdir@
281abs_top_builddir = @abs_top_builddir@
282abs_top_srcdir = @abs_top_srcdir@
283ac_ct_CC = @ac_ct_CC@
284ac_ct_CXX = @ac_ct_CXX@
285ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
286ac_ct_OBJC = @ac_ct_OBJC@
287altivec_cflags = @altivec_cflags@
288am__include = @am__include@
289am__leading_dot = @am__leading_dot@
290am__quote = @am__quote@
291am__tar = @am__tar@
292am__untar = @am__untar@
293bindir = @bindir@
294build = @build@
295build_alias = @build_alias@
296build_cpu = @build_cpu@
297build_os = @build_os@
298build_vendor = @build_vendor@
299builddir = @builddir@
300datadir = @datadir@
301datarootdir = @datarootdir@
302dlopen_libs = @dlopen_libs@
303docdir = @docdir@
304dvidir = @dvidir@
305edje_cc = @edje_cc@
306efl_doxygen = @efl_doxygen@
307efl_have_doxygen = @efl_have_doxygen@
308evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
309evas_engine_buffer_libs = @evas_engine_buffer_libs@
310evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
311evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
312evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
313evas_engine_directfb_libs = @evas_engine_directfb_libs@
314evas_engine_fb_cflags = @evas_engine_fb_cflags@
315evas_engine_fb_libs = @evas_engine_fb_libs@
316evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
317evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
318evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
319evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
320evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
321evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
322evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
323evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
324evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
325evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
326evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
327evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
328evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
329evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
330evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
331evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
332evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
333evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
334evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
335evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
336evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
337evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
338evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
339evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
340evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
341evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
342evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
343evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
344evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
345evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
346evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
347evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
348evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
349evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
350evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
351evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
352evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
353evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
354evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
355evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
356evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
357evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
358evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
359evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
360evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
361evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
362evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
363evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
364evas_image_loader_png_libs = @evas_image_loader_png_libs@
365evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
366evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
367evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
368evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
369evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
370evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
371evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
372evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
373evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
374evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
375evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
376evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
377exec_prefix = @exec_prefix@
378have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
379have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
380have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
381have_evas_engine_software_x11 = @have_evas_engine_software_x11@
382have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
383have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
384have_lcov = @have_lcov@
385host = @host@
386host_alias = @host_alias@
387host_cpu = @host_cpu@
388host_os = @host_os@
389host_vendor = @host_vendor@
390htmldir = @htmldir@
391includedir = @includedir@
392infodir = @infodir@
393install_sh = @install_sh@
394libdir = @libdir@
395libexecdir = @libexecdir@
396localedir = @localedir@
397localstatedir = @localstatedir@
398lt_ECHO = @lt_ECHO@
399lt_enable_auto_import = @lt_enable_auto_import@
400mandir = @mandir@
401mkdir_p = @mkdir_p@
402oldincludedir = @oldincludedir@
403pdfdir = @pdfdir@
404pkgconfig_requires_private = @pkgconfig_requires_private@
405prefix = @prefix@
406program_transform_name = @program_transform_name@
407psdir = @psdir@
408pthread_cflags = @pthread_cflags@
409pthread_libs = @pthread_libs@
410release_info = @release_info@
411requirement_evas = @requirement_evas@
412sbindir = @sbindir@
413sharedstatedir = @sharedstatedir@
414srcdir = @srcdir@
415sysconfdir = @sysconfdir@
416target_alias = @target_alias@
417top_build_prefix = @top_build_prefix@
418top_builddir = @top_builddir@
419top_srcdir = @top_srcdir@
420version_info = @version_info@
421MAINTAINERCLEANFILES = Makefile.in
422AM_CPPFLAGS = \
423-I. \
424-I$(top_srcdir)/src/lib \
425-I$(top_srcdir)/src/lib/include \
426@FREETYPE_CFLAGS@ \
427@PIXMAN_CFLAGS@ \
428@GL_EET_CFLAGS@ \
429@EINA_CFLAGS@
430
431@BUILD_ENGINE_GL_COMMON_TRUE@noinst_LTLIBRARIES = libevas_engine_gl_common.la
432@BUILD_ENGINE_GL_COMMON_TRUE@libevas_engine_gl_common_la_SOURCES = \
433@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_private.h \
434@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_common.h \
435@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_context.c \
436@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_shader.c \
437@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_rectangle.c \
438@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_texture.c \
439@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_image.c \
440@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_font.c \
441@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_polygon.c \
442@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_line.c \
443@BUILD_ENGINE_GL_COMMON_TRUE@evas_gl_filter.c \
444@BUILD_ENGINE_GL_COMMON_TRUE@shader/rect_frag.h \
445@BUILD_ENGINE_GL_COMMON_TRUE@shader/rect_frag_bin_s3c6410.h \
446@BUILD_ENGINE_GL_COMMON_TRUE@shader/rect_vert.h \
447@BUILD_ENGINE_GL_COMMON_TRUE@shader/rect_vert_bin_s3c6410.h \
448@BUILD_ENGINE_GL_COMMON_TRUE@shader/font_frag.h \
449@BUILD_ENGINE_GL_COMMON_TRUE@shader/font_frag_bin_s3c6410.h \
450@BUILD_ENGINE_GL_COMMON_TRUE@shader/font_vert.h \
451@BUILD_ENGINE_GL_COMMON_TRUE@shader/font_vert_bin_s3c6410.h \
452@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_frag.h \
453@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_frag_bin_s3c6410.h \
454@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_vert.h \
455@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_vert_bin_s3c6410.h \
456@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_nomul_frag.h \
457@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_nomul_frag_bin_s3c6410.h \
458@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_nomul_vert.h \
459@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_nomul_vert_bin_s3c6410.h \
460@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_frag.h \
461@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_frag_bin_s3c6410.h \
462@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_vert.h \
463@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_vert_bin_s3c6410.h \
464@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_nomul_frag.h \
465@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_nomul_frag_bin_s3c6410.h \
466@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_nomul_vert.h \
467@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_bgra_nomul_vert_bin_s3c6410.h \
468@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_mask_frag.h \
469@BUILD_ENGINE_GL_COMMON_TRUE@shader/img_mask_vert.h \
470@BUILD_ENGINE_GL_COMMON_TRUE@shader/nv12_nomul_vert.h \
471@BUILD_ENGINE_GL_COMMON_TRUE@shader/nv12_vert.h \
472@BUILD_ENGINE_GL_COMMON_TRUE@shader/nv12_nomul_frag.h \
473@BUILD_ENGINE_GL_COMMON_TRUE@shader/nv12_frag.h \
474@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_frag.h \
475@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_frag_bin_s3c6410.h \
476@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_vert.h \
477@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_vert_bin_s3c6410.h \
478@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_nomul_frag.h \
479@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_nomul_frag_bin_s3c6410.h \
480@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_nomul_vert.h \
481@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuv_nomul_vert_bin_s3c6410.h \
482@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_frag.h \
483@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_frag_bin_s3c6410.h \
484@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_vert.h \
485@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_vert_bin_s3c6410.h \
486@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_nomul_frag.h \
487@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_nomul_frag_bin_s3c6410.h \
488@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_nomul_vert.h \
489@BUILD_ENGINE_GL_COMMON_TRUE@shader/tex_nomul_vert_bin_s3c6410.h \
490@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_invert.h \
491@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_invert_nomul.h \
492@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_invert_bgra.h \
493@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_invert_bgra_nomul.h \
494@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_sepia.h \
495@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_sepia_nomul.h \
496@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_sepia_bgra.h \
497@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_sepia_bgra_nomul.h \
498@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_greyscale.h \
499@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_greyscale_nomul.h \
500@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_greyscale_bgra.h \
501@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_greyscale_bgra_nomul.h \
502@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_blur.h \
503@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_blur_nomul.h \
504@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_blur_bgra.h \
505@BUILD_ENGINE_GL_COMMON_TRUE@shader/filter_blur_bgra_nomul.h \
506@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuy2_frag.h \
507@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuy2_vert.h \
508@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuy2_nomul_frag.h \
509@BUILD_ENGINE_GL_COMMON_TRUE@shader/yuy2_nomul_vert.h
510
511@BUILD_ENGINE_GL_COMMON_TRUE@libevas_engine_gl_common_la_LIBADD = @EINA_LIBS@ @GL_EET_LIBS@ @evas_engine_gl_common_libs@ @dlopen_libs@
512EXTRA_DIST = \
513shader/compile-s3c6410.sh \
514shader/compile-sgx.sh \
515shader/make-c-bin.sh \
516shader/make-c-str.sh \
517shader/rect_frag.shd \
518shader/rect_frag_s3c6410.asm \
519shader/rect_vert.shd \
520shader/font_frag.shd \
521shader/font_frag_s3c6410.asm \
522shader/font_vert.shd \
523shader/img_frag.shd \
524shader/img_frag_s3c6410.asm \
525shader/img_vert.shd \
526shader/img_nomul_frag.shd \
527shader/img_nomul_vert.shd \
528shader/img_bgra_vert.shd \
529shader/img_bgra_frag.shd \
530shader/img_bgra_vert.shd \
531shader/img_bgra_nomul_frag.shd \
532shader/img_bgra_nomul_vert.shd \
533shader/img_mask_frag.h \
534shader/img_mask_vert.h \
535shader/yuv_frag.shd \
536shader/yuv_frag_s3c6410.asm \
537shader/yuv_vert.shd \
538shader/yuv_nomul_frag.shd \
539shader/yuv_nomul_vert.shd \
540shader/tex_frag.shd \
541shader/tex_frag_s3c6410.asm \
542shader/tex_vert.shd \
543shader/tex_nomul_frag.shd \
544shader/tex_nomul_vert.shd \
545shader/filter_invert.shd \
546shader/filter_invert_nomul.shd \
547shader/filter_invert_bgra.shd \
548shader/filter_invert_bgra_nomul.shd \
549shader/filter_greyscale.shd \
550shader/filter_greyscale_nomul.shd \
551shader/filter_greyscale_bgra.shd \
552shader/filter_greyscale_bgra_nomul.shd \
553shader/filter_sepia.shd \
554shader/filter_sepia_nomul.shd \
555shader/filter_sepia_bgra.shd \
556shader/filter_sepia_bgra_nomul.shd \
557shader/filter_blur.shd \
558shader/filter_blur_nomul.shd \
559shader/filter_blur_bgra.shd \
560shader/filter_blur_bgra_nomul.shd \
561shader/nv12_frag.h \
562shader/nv12_frag.shd \
563shader/nv12_nomul_frag.h \
564shader/nv12_nomul_frag.shd \
565shader/nv12_nomul_vert.h \
566shader/nv12_nomul_vert.shd \
567shader/nv12_vert.h \
568shader/nv12_vert.shd \
569shader/yuy2_frag.h \
570shader/yuy2_frag.shd \
571shader/yuy2_nomul_frag.h \
572shader/yuy2_nomul_frag.shd \
573shader/yuy2_nomul_vert.h \
574shader/yuy2_nomul_vert.shd \
575shader/yuy2_vert.h \
576shader/yuy2_vert.shd
577
578all: all-am
579
580.SUFFIXES:
581.SUFFIXES: .c .lo .o .obj
582$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
583 @for dep in $?; do \
584 case '$(am__configure_deps)' in \
585 *$$dep*) \
586 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
587 && { if test -f $@; then exit 0; else break; fi; }; \
588 exit 1;; \
589 esac; \
590 done; \
591 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/engines/gl_common/Makefile'; \
592 $(am__cd) $(top_srcdir) && \
593 $(AUTOMAKE) --gnu src/modules/engines/gl_common/Makefile
594.PRECIOUS: Makefile
595Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
596 @case '$?' in \
597 *config.status*) \
598 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
599 *) \
600 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
601 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
602 esac;
603
604$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
605 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
606
607$(top_srcdir)/configure: $(am__configure_deps)
608 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
609$(ACLOCAL_M4): $(am__aclocal_m4_deps)
610 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
611$(am__aclocal_m4_deps):
612
613clean-noinstLTLIBRARIES:
614 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
615 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
616 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
617 test "$$dir" != "$$p" || dir=.; \
618 echo "rm -f \"$${dir}/so_locations\""; \
619 rm -f "$${dir}/so_locations"; \
620 done
621libevas_engine_gl_common.la: $(libevas_engine_gl_common_la_OBJECTS) $(libevas_engine_gl_common_la_DEPENDENCIES)
622 $(AM_V_CCLD)$(LINK) $(am_libevas_engine_gl_common_la_rpath) $(libevas_engine_gl_common_la_OBJECTS) $(libevas_engine_gl_common_la_LIBADD) $(LIBS)
623
624mostlyclean-compile:
625 -rm -f *.$(OBJEXT)
626
627distclean-compile:
628 -rm -f *.tab.c
629
630@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_context.Plo@am__quote@
631@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_filter.Plo@am__quote@
632@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_font.Plo@am__quote@
633@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_image.Plo@am__quote@
634@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_line.Plo@am__quote@
635@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_polygon.Plo@am__quote@
636@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_rectangle.Plo@am__quote@
637@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_shader.Plo@am__quote@
638@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_gl_texture.Plo@am__quote@
639
640.c.o:
641@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
642@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
643@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
644@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
645@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
646@am__fastdepCC_FALSE@ $(COMPILE) -c $<
647
648.c.obj:
649@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
650@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
651@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
652@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
653@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
654@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
655
656.c.lo:
657@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
658@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
659@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
660@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
661@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
662@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
663
664mostlyclean-libtool:
665 -rm -f *.lo
666
667clean-libtool:
668 -rm -rf .libs _libs
669
670ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
671 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
672 unique=`for i in $$list; do \
673 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
674 done | \
675 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
676 END { if (nonempty) { for (i in files) print i; }; }'`; \
677 mkid -fID $$unique
678tags: TAGS
679
680TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
681 $(TAGS_FILES) $(LISP)
682 set x; \
683 here=`pwd`; \
684 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
685 unique=`for i in $$list; do \
686 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
687 done | \
688 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
689 END { if (nonempty) { for (i in files) print i; }; }'`; \
690 shift; \
691 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
692 test -n "$$unique" || unique=$$empty_fix; \
693 if test $$# -gt 0; then \
694 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
695 "$$@" $$unique; \
696 else \
697 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
698 $$unique; \
699 fi; \
700 fi
701ctags: CTAGS
702CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
703 $(TAGS_FILES) $(LISP)
704 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
705 unique=`for i in $$list; do \
706 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
707 done | \
708 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
709 END { if (nonempty) { for (i in files) print i; }; }'`; \
710 test -z "$(CTAGS_ARGS)$$unique" \
711 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
712 $$unique
713
714GTAGS:
715 here=`$(am__cd) $(top_builddir) && pwd` \
716 && $(am__cd) $(top_srcdir) \
717 && gtags -i $(GTAGS_ARGS) "$$here"
718
719distclean-tags:
720 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
721
722distdir: $(DISTFILES)
723 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
724 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
725 list='$(DISTFILES)'; \
726 dist_files=`for file in $$list; do echo $$file; done | \
727 sed -e "s|^$$srcdirstrip/||;t" \
728 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
729 case $$dist_files in \
730 */*) $(MKDIR_P) `echo "$$dist_files" | \
731 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
732 sort -u` ;; \
733 esac; \
734 for file in $$dist_files; do \
735 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
736 if test -d $$d/$$file; then \
737 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
738 if test -d "$(distdir)/$$file"; then \
739 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
740 fi; \
741 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
742 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
743 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
744 fi; \
745 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
746 else \
747 test -f "$(distdir)/$$file" \
748 || cp -p $$d/$$file "$(distdir)/$$file" \
749 || exit 1; \
750 fi; \
751 done
752check-am: all-am
753check: check-am
754all-am: Makefile $(LTLIBRARIES)
755installdirs:
756install: install-am
757install-exec: install-exec-am
758install-data: install-data-am
759uninstall: uninstall-am
760
761install-am: all-am
762 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
763
764installcheck: installcheck-am
765install-strip:
766 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
767 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
768 `test -z '$(STRIP)' || \
769 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
770mostlyclean-generic:
771
772clean-generic:
773
774distclean-generic:
775 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
776 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
777
778maintainer-clean-generic:
779 @echo "This command is intended for maintainers to use"
780 @echo "it deletes files that may require special tools to rebuild."
781 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
782clean: clean-am
783
784clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
785 mostlyclean-am
786
787distclean: distclean-am
788 -rm -rf ./$(DEPDIR)
789 -rm -f Makefile
790distclean-am: clean-am distclean-compile distclean-generic \
791 distclean-tags
792
793dvi: dvi-am
794
795dvi-am:
796
797html: html-am
798
799html-am:
800
801info: info-am
802
803info-am:
804
805install-data-am:
806
807install-dvi: install-dvi-am
808
809install-dvi-am:
810
811install-exec-am:
812
813install-html: install-html-am
814
815install-html-am:
816
817install-info: install-info-am
818
819install-info-am:
820
821install-man:
822
823install-pdf: install-pdf-am
824
825install-pdf-am:
826
827install-ps: install-ps-am
828
829install-ps-am:
830
831installcheck-am:
832
833maintainer-clean: maintainer-clean-am
834 -rm -rf ./$(DEPDIR)
835 -rm -f Makefile
836maintainer-clean-am: distclean-am maintainer-clean-generic
837
838mostlyclean: mostlyclean-am
839
840mostlyclean-am: mostlyclean-compile mostlyclean-generic \
841 mostlyclean-libtool
842
843pdf: pdf-am
844
845pdf-am:
846
847ps: ps-am
848
849ps-am:
850
851uninstall-am:
852
853.MAKE: install-am install-strip
854
855.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
856 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
857 distclean-compile distclean-generic distclean-libtool \
858 distclean-tags distdir dvi dvi-am html html-am info info-am \
859 install install-am install-data install-data-am install-dvi \
860 install-dvi-am install-exec install-exec-am install-html \
861 install-html-am install-info install-info-am install-man \
862 install-pdf install-pdf-am install-ps install-ps-am \
863 install-strip installcheck installcheck-am installdirs \
864 maintainer-clean maintainer-clean-generic mostlyclean \
865 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
866 pdf pdf-am ps ps-am tags uninstall uninstall-am
867
868
869# Tell versions [3.59,3.63) of GNU make to not export all variables.
870# Otherwise a system limit (for SysV at least) may be exceeded.
871.NOEXPORT:
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h b/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h
new file mode 100644
index 0000000..a088748
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h
@@ -0,0 +1,659 @@
1#ifndef EVAS_GL_COMMON_H
2#define EVAS_GL_COMMON_H
3
4#include "evas_common.h"
5#include "evas_private.h"
6#include "config.h"
7
8#include <stdio.h>
9#include <stdlib.h>
10#include <string.h>
11#include <math.h>
12#include <sys/time.h>
13#include <unistd.h>
14#include <Eet.h>
15
16#define GL_GLEXT_PROTOTYPES
17
18#ifdef BUILD_ENGINE_GL_QUARTZ
19# include <OpenGL/gl.h>
20# include <OpenGL/glext.h>
21#else
22# ifdef _EVAS_ENGINE_SDL_H
23# if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
24# include <SDL/SDL_opengles.h>
25# else
26# include <SDL/SDL_opengl.h>
27# endif
28# else
29# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
30# if defined(GLES_VARIETY_S3C6410)
31# include <GLES2/gl2.h>
32# elif defined(GLES_VARIETY_SGX)
33# include <GLES2/gl2.h>
34# include <GLES2/gl2ext.h>
35# endif
36# else
37# include <GL/gl.h>
38# include <GL/glext.h>
39# endif
40# endif
41#endif
42
43#ifndef GL_TEXTURE_RECTANGLE_NV
44# define GL_TEXTURE_RECTANGLE_NV 0x84F5
45#endif
46#ifndef GL_BGRA
47# define GL_BGRA 0x80E1
48#endif
49
50#ifndef EGL_NO_CONTEXT
51# define EGL_NO_CONTEXT 0
52#endif
53#ifndef EGL_NONE
54# define EGL_NONE 0x3038
55#endif
56#ifndef EGL_TRUE
57# define EGL_TRUE 1
58#endif
59#ifndef EGL_FALSE
60# define EGL_FALSE 0
61#endif
62
63#ifndef EGL_MAP_GL_TEXTURE_2D_SEC
64# define EGL_MAP_GL_TEXTURE_2D_SEC 0x3201
65#endif
66#ifndef EGL_MAP_GL_TEXTURE_HEIGHT_SEC
67# define EGL_MAP_GL_TEXTURE_HEIGHT_SEC 0x3202
68#endif
69#ifndef EGL_MAP_GL_TEXTURE_WIDTH_SEC
70# define EGL_MAP_GL_TEXTURE_WIDTH_SEC 0x3203
71#endif
72#ifndef EGL_MAP_GL_TEXTURE_FORMAT_SEC
73# define EGL_MAP_GL_TEXTURE_FORMAT_SEC 0x3204
74#endif
75#ifndef EGL_MAP_GL_TEXTURE_RGB_SEC
76# define EGL_MAP_GL_TEXTURE_RGB_SEC 0x3205
77#endif
78#ifndef EGL_MAP_GL_TEXTURE_RGBA_SEC
79# define EGL_MAP_GL_TEXTURE_RGBA_SEC 0x3206
80#endif
81#ifndef EGL_MAP_GL_TEXTURE_BGRA_SEC
82# define EGL_MAP_GL_TEXTURE_BGRA_SEC 0x3207
83#endif
84#ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_SEC
85# define EGL_MAP_GL_TEXTURE_LUMINANCE_SEC 0x3208
86#endif
87#ifndef EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC
88# define EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC 0x3209
89#endif
90#ifndef EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC
91# define EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC 0x320a
92#endif
93#ifndef EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC
94# define EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC 0x320b
95#endif
96#ifndef EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC
97# define EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC 0x320c
98#endif
99#ifndef GL_PROGRAM_BINARY_LENGTH
100# define GL_PROGRAM_BINARY_LENGTH 0x8741
101#endif
102#ifndef GL_NUM_PROGRAM_BINARY_FORMATS
103# define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
104#endif
105#ifndef GL_PROGRAM_BINARY_FORMATS
106# define GL_PROGRAM_BINARY_FORMATS 0x87FF
107#endif
108#ifndef GL_PROGRAM_BINARY_RETRIEVABLE_HINT
109# define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
110#endif
111
112#define SHAD_VERTEX 0
113#define SHAD_COLOR 1
114#define SHAD_TEXUV 2
115#define SHAD_TEXUV2 3
116#define SHAD_TEXUV3 4
117#define SHAD_TEXM 5
118
119typedef struct _Evas_GL_Program Evas_GL_Program;
120typedef struct _Evas_GL_Program_Source Evas_GL_Program_Source;
121typedef struct _Evas_GL_Shared Evas_GL_Shared;
122typedef struct _Evas_Engine_GL_Context Evas_Engine_GL_Context;
123typedef struct _Evas_GL_Texture_Pool Evas_GL_Texture_Pool;
124typedef struct _Evas_GL_Texture Evas_GL_Texture;
125typedef struct _Evas_GL_Image Evas_GL_Image;
126typedef struct _Evas_GL_Font_Texture Evas_GL_Font_Texture;
127typedef struct _Evas_GL_Polygon Evas_GL_Polygon;
128typedef struct _Evas_GL_Polygon_Point Evas_GL_Polygon_Point;
129
130typedef enum {
131 SHADER_RECT,
132 SHADER_FONT,
133 SHADER_IMG,
134 SHADER_IMG_NOMUL,
135 SHADER_IMG_BGRA,
136 SHADER_IMG_BGRA_NOMUL,
137 SHADER_IMG_MASK,
138 SHADER_YUV,
139 SHADER_YUV_NOMUL,
140 SHADER_YUY2,
141 SHADER_YUY2_NOMUL,
142 SHADER_NV12,
143 SHADER_NV12_NOMUL,
144 SHADER_TEX,
145 SHADER_TEX_NOMUL,
146 SHADER_FILTER_INVERT,
147 SHADER_FILTER_INVERT_NOMUL,
148 SHADER_FILTER_INVERT_BGRA,
149 SHADER_FILTER_INVERT_BGRA_NOMUL,
150 SHADER_FILTER_GREYSCALE,
151 SHADER_FILTER_GREYSCALE_NOMUL,
152 SHADER_FILTER_GREYSCALE_BGRA,
153 SHADER_FILTER_GREYSCALE_BGRA_NOMUL,
154 SHADER_FILTER_SEPIA,
155 SHADER_FILTER_SEPIA_NOMUL,
156 SHADER_FILTER_SEPIA_BGRA,
157 SHADER_FILTER_SEPIA_BGRA_NOMUL,
158 /* SHADER_FILTER_BLUR, */
159 /* SHADER_FILTER_BLUR_NOMUL, */
160 /* SHADER_FILTER_BLUR_BGRA, */
161 /* SHADER_FILTER_BLUR_BGRA_NOMUL, */
162 SHADER_LAST
163} Evas_GL_Shader;
164
165struct _Evas_GL_Program
166{
167 GLuint vert, frag, prog;
168
169 int tex_count;
170};
171
172struct _Evas_GL_Program_Source
173{
174 const char *src;
175 const unsigned int *bin;
176 int bin_size;
177};
178
179struct _Evas_GL_Shared
180{
181 Eina_List *images;
182
183 int images_size;
184
185 struct {
186 GLint max_texture_units;
187 GLint max_texture_size;
188 GLint max_vertex_elements;
189 GLfloat anisotropic;
190 Eina_Bool rgb : 1;
191 Eina_Bool bgra : 1;
192 Eina_Bool tex_npo2 : 1;
193 Eina_Bool tex_rect : 1;
194 Eina_Bool sec_image_map : 1;
195 Eina_Bool bin_program : 1;
196 // tuning params - per gpu/cpu combo?
197#define MAX_CUTOUT 512
198#define DEF_CUTOUT 512
199
200// FIXME bug with pipes > 1 right now, should default to 32
201#define MAX_PIPES 128
202#define DEF_PIPES 32
203#define DEF_PIPES_SGX_540 32
204#define DEF_PIPES_TEGRA_2 1
205
206#define MIN_ATLAS_ALLOC 16
207#define MAX_ATLAS_ALLOC 1024
208#define DEF_ATLAS_ALLOC 1024
209
210#define MIN_ATLAS_ALLOC_ALPHA 16
211#define MAX_ATLAS_ALLOC_ALPHA 4096
212#define DEF_ATLAS_ALLOC_ALPHA 4096
213
214#define MAX_ATLAS_W 512
215#define DEF_ATLAS_W 512
216
217#define MAX_ATLAS_H 512
218#define DEF_ATLAS_H 512
219
220#define MIN_ATLAS_SLOT 16
221#define MAX_ATLAS_SLOT 512
222#define DEF_ATLAS_SLOT 16
223
224 struct {
225 struct {
226 int max;
227 } cutout;
228 struct {
229 int max;
230 } pipes;
231 struct {
232 int max_alloc_size;
233 int max_alloc_alpha_size;
234 int max_w;
235 int max_h;
236 int slot_size;
237 } atlas;
238 } tune;
239 } info;
240
241 struct {
242 Eina_List *whole;
243 Eina_List *atlas[33][3];
244 } tex;
245
246 Eina_Hash *native_pm_hash;
247 Eina_Hash *native_tex_hash;
248
249 Evas_GL_Program shader[SHADER_LAST];
250
251 int references;
252 int w, h;
253 int rot;
254 int mflip;
255 // persp map
256 int foc, z0, px, py;
257 int ax, ay;
258};
259
260#define RTYPE_RECT 1
261#define RTYPE_IMAGE 2
262#define RTYPE_FONT 3
263#define RTYPE_YUV 4
264#define RTYPE_MAP 5 /* need to merge with image */
265#define RTYPE_IMASK 6
266#define RTYPE_YUY2 7
267#define RTYPE_NV12 8
268
269struct _Evas_Engine_GL_Context
270{
271 int references;
272 int w, h;
273 int rot;
274 int foc, z0, px, py;
275 RGBA_Draw_Context *dc;
276
277 Evas_GL_Shared *shared;
278
279 int flushnum;
280 struct {
281 int top_pipe;
282 struct {
283 GLuint cur_prog;
284 GLuint cur_tex, cur_texu, cur_texv;
285 GLuint cur_texm, cur_texmu, cur_texmv;
286 int render_op;
287 int cx, cy, cw, ch;
288 int smooth;
289 int blend;
290 int clip;
291 } current;
292 } state;
293
294 struct {
295 struct {
296 int x, y, w, h;
297 int type;
298 } region;
299 struct {
300 int x, y, w, h;
301 Eina_Bool active : 1;
302 } clip;
303 struct {
304 Evas_GL_Image *surface;
305 GLuint cur_prog;
306 GLuint cur_tex, cur_texu, cur_texv, cur_texm;
307 void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn;
308 int render_op;
309 int cx, cy, cw, ch;
310 int smooth;
311 int blend;
312 int clip;
313 } shader;
314 struct {
315 int num, alloc;
316 GLshort *vertex;
317 GLubyte *color;
318 GLfloat *texuv;
319 GLfloat *texuv2;
320 GLfloat *texuv3;
321 GLfloat *texm;
322 Eina_Bool line: 1;
323 Eina_Bool use_vertex : 1;
324 Eina_Bool use_color : 1;
325 Eina_Bool use_texuv : 1;
326 Eina_Bool use_texuv2 : 1;
327 Eina_Bool use_texuv3 : 1;
328 Eina_Bool use_texm : 1;
329 Evas_GL_Image *im;
330 } array;
331 } pipe[MAX_PIPES];
332
333 struct {
334 Eina_Bool size : 1;
335 } change;
336
337 Eina_Bool havestuff : 1;
338
339 Evas_GL_Image *def_surface;
340
341 /* If this is set: Force drawing with a particular filter */
342 GLuint filter_prog;
343
344#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
345// FIXME: hack. expose egl display to gl core for egl image sec extn.
346 void *egldisp;
347#endif
348};
349
350struct _Evas_GL_Texture_Pool
351{
352 Evas_Engine_GL_Context *gc;
353 GLuint texture, fb;
354 GLuint intformat, format, dataformat;
355 int w, h;
356 int references;
357 int slot, fslot;
358 struct {
359 void *img;
360 unsigned int *data;
361 int w, h;
362 int stride;
363 int checked_out;
364 } dyn;
365 Eina_List *allocations;
366 Eina_Bool whole : 1;
367 Eina_Bool render : 1;
368 Eina_Bool native : 1;
369 Eina_Bool dynamic : 1;
370};
371
372struct _Evas_GL_Texture
373{
374 Evas_Engine_GL_Context *gc;
375 Evas_GL_Image *im;
376 Evas_GL_Texture_Pool *pt, *ptu, *ptv, *ptuv;
377 int x, y, w, h;
378 double sx1, sy1, sx2, sy2;
379 int references;
380
381 struct
382 {
383 Evas_GL_Texture_Pool *pt[2], *ptuv[2];
384 int source;
385 } double_buffer;
386
387 Eina_Bool alpha : 1;
388 Eina_Bool dyn : 1;
389};
390
391struct _Evas_GL_Image
392{
393 Evas_Engine_GL_Context *gc;
394 RGBA_Image *im;
395 Evas_GL_Texture *tex;
396 RGBA_Image_Loadopts load_opts;
397 int references;
398 // if im->im == NULL, it's a render-surface so these here are used
399 int w, h;
400 struct {
401 int space;
402 void *data;
403 unsigned char no_free : 1;
404 } cs;
405
406 struct {
407 void *data;
408 struct {
409 void (*bind) (void *data, void *image);
410 void (*unbind) (void *data, void *image);
411 void (*free) (void *data, void *image);
412 void *data;
413 } func;
414 int yinvert;
415 int target;
416 int mipmap;
417 unsigned char loose : 1;
418 } native;
419
420 int scale_hint, content_hint;
421 int csize;
422
423 Eina_List *filtered;
424
425 unsigned char dirty : 1;
426 unsigned char cached : 1;
427 unsigned char alpha : 1;
428 unsigned char tex_only : 1;
429};
430
431struct _Evas_GL_Font_Texture
432{
433 Evas_GL_Texture *tex;
434};
435
436struct _Evas_GL_Polygon
437{
438 Eina_List *points;
439 Eina_Bool changed : 1;
440};
441
442struct _Evas_GL_Polygon_Point
443{
444 int x, y;
445};
446
447#if 0
448extern Evas_GL_Program_Source shader_rect_frag_src;
449extern Evas_GL_Program_Source shader_rect_vert_src;
450extern Evas_GL_Program_Source shader_font_frag_src;
451extern Evas_GL_Program_Source shader_font_vert_src;
452
453extern Evas_GL_Program_Source shader_img_frag_src;
454extern Evas_GL_Program_Source shader_img_vert_src;
455extern Evas_GL_Program_Source shader_img_nomul_frag_src;
456extern Evas_GL_Program_Source shader_img_nomul_vert_src;
457extern Evas_GL_Program_Source shader_img_bgra_frag_src;
458extern Evas_GL_Program_Source shader_img_bgra_vert_src;
459extern Evas_GL_Program_Source shader_img_bgra_nomul_frag_src;
460extern Evas_GL_Program_Source shader_img_bgra_nomul_vert_src;
461extern Evas_GL_Program_Source shader_img_mask_frag_src;
462extern Evas_GL_Program_Source shader_img_mask_vert_src;
463
464extern Evas_GL_Program_Source shader_yuv_frag_src;
465extern Evas_GL_Program_Source shader_yuv_vert_src;
466extern Evas_GL_Program_Source shader_yuv_nomul_frag_src;
467extern Evas_GL_Program_Source shader_yuv_nomul_vert_src;
468
469extern Evas_GL_Program_Source shader_yuy2_frag_src;
470extern Evas_GL_Program_Source shader_yuy2_vert_src;
471extern Evas_GL_Program_Source shader_yuy2_nomul_frag_src;
472extern Evas_GL_Program_Source shader_yuy2_nomul_vert_src;
473
474extern Evas_GL_Program_Source shader_tex_frag_src;
475extern Evas_GL_Program_Source shader_tex_vert_src;
476extern Evas_GL_Program_Source shader_tex_nomul_frag_src;
477extern Evas_GL_Program_Source shader_tex_nomul_vert_src;
478
479extern Evas_GL_Program_Source shader_filter_invert_frag_src;
480extern Evas_GL_Program_Source shader_filter_invert_nomul_frag_src;
481extern Evas_GL_Program_Source shader_filter_invert_bgra_frag_src;
482extern Evas_GL_Program_Source shader_filter_invert_bgra_nomul_frag_src;
483extern Evas_GL_Program_Source shader_filter_sepia_frag_src;
484extern Evas_GL_Program_Source shader_filter_sepia_nomul_frag_src;
485extern Evas_GL_Program_Source shader_filter_sepia_bgra_frag_src;
486extern Evas_GL_Program_Source shader_filter_sepia_bgra_nomul_frag_src;
487extern Evas_GL_Program_Source shader_filter_greyscale_frag_src;
488extern Evas_GL_Program_Source shader_filter_greyscale_nomul_frag_src;
489extern Evas_GL_Program_Source shader_filter_greyscale_bgra_frag_src;
490extern Evas_GL_Program_Source shader_filter_greyscale_bgra_nomul_frag_src;
491/* blur (annoyingly) needs (aka is faster with) a vertex shader */
492extern Evas_GL_Program_Source shader_filter_blur_vert_src;
493extern Evas_GL_Program_Source shader_filter_blur_frag_src;
494extern Evas_GL_Program_Source shader_filter_blur_nomul_frag_src;
495extern Evas_GL_Program_Source shader_filter_blur_bgra_frag_src;
496extern Evas_GL_Program_Source shader_filter_blur_bgra_nomul_frag_src;
497#endif
498
499void glerr(int err, const char *file, const char *func, int line, const char *op);
500
501Evas_Engine_GL_Context *evas_gl_common_context_new(void);
502void evas_gl_common_context_free(Evas_Engine_GL_Context *gc);
503void evas_gl_common_context_use(Evas_Engine_GL_Context *gc);
504void evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc);
505void evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot);
506void evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, Evas_GL_Image *surface);
507
508void evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
509 int x1, int y1, int x2, int y2,
510 int clip, int cx, int cy, int cw, int ch,
511 int r, int g, int b, int a);
512void evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
513 int x, int y, int w, int h,
514 int r, int g, int b, int a);
515void evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
516 Evas_GL_Texture *tex,
517 double sx, double sy, double sw, double sh,
518 int x, int y, int w, int h,
519 int r, int g, int b, int a,
520 Eina_Bool smooth, Eina_Bool tex_only);
521void evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
522 Evas_GL_Texture *tex,
523 Evas_GL_Texture *texm,
524 double sx, double sy, double sw, double sh,
525 double sxm, double sym, double swm, double shm,
526 int x, int y, int w, int h,
527 int r, int g, int b, int a,
528 Eina_Bool smooth);
529
530
531void evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
532 Evas_GL_Texture *tex,
533 double sx, double sy, double sw, double sh,
534 int x, int y, int w, int h,
535 int r, int g, int b, int a);
536void evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
537 Evas_GL_Texture *tex,
538 double sx, double sy, double sw, double sh,
539 int x, int y, int w, int h,
540 int r, int g, int b, int a,
541 Eina_Bool smooth);
542void evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
543 Evas_GL_Texture *tex,
544 double sx, double sy, double sw, double sh,
545 int x, int y, int w, int h,
546 int r, int g, int b, int a,
547 Eina_Bool smooth);
548void evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
549 Evas_GL_Texture *tex,
550 double sx, double sy, double sw, double sh,
551 int x, int y, int w, int h,
552 int r, int g, int b, int a,
553 Eina_Bool smooth);
554void evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
555 Evas_GL_Texture *tex,
556 int npoints,
557 RGBA_Map_Point *p,
558 int clip, int cx, int cy, int cw, int ch,
559 int r, int g, int b, int a,
560 Eina_Bool smooth,
561 Eina_Bool tex_only,
562 Evas_Colorspace cspace);
563void evas_gl_common_context_flush(Evas_Engine_GL_Context *gc);
564
565int evas_gl_common_shader_program_init(Evas_GL_Shared *shared);
566void evas_gl_common_shader_program_init_done(void);
567void evas_gl_common_shader_program_shutdown(Evas_GL_Program *p);
568
569void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h);
570
571void evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt);
572Evas_GL_Texture *evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im);
573Evas_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);
574Evas_GL_Texture *evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
575Evas_GL_Texture *evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
576void evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im);
577void evas_gl_common_texture_free(Evas_GL_Texture *tex);
578Evas_GL_Texture *evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
579void evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, unsigned int w, unsigned int h, int fh);
580Evas_GL_Texture *evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
581void evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
582Evas_GL_Texture *evas_gl_common_texture_yuy2_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
583void evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h);
584Evas_GL_Texture *evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
585void evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
586Evas_GL_Texture *evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h);
587void evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **row, unsigned int w, unsigned int h);
588
589void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc);
590
591void evas_gl_common_image_ref(Evas_GL_Image *im);
592void evas_gl_common_image_unref(Evas_GL_Image *im);
593Evas_GL_Image *evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
594Evas_GL_Image *evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
595Evas_GL_Image *evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace);
596Evas_GL_Image *evas_gl_common_image_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace);
597Evas_GL_Image *evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha);
598void evas_gl_common_image_native_enable(Evas_GL_Image *im);
599void evas_gl_common_image_native_disable(Evas_GL_Image *im);
600void evas_gl_common_image_scale_hint_set(Evas_GL_Image *im, int hint);
601void evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint);
602void evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc);
603void evas_gl_common_image_free(Evas_GL_Image *im);
604Evas_GL_Image *evas_gl_common_image_surface_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha);
605void evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
606void evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im);
607void evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int npoints, RGBA_Map_Point *p, int smooth, int level);
608void evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
609
610void *evas_gl_font_texture_new(void *gc, RGBA_Font_Glyph *fg);
611void evas_gl_font_texture_free(void *);
612void evas_gl_font_texture_draw(void *gc, void *surface, void *dc, RGBA_Font_Glyph *fg, int x, int y);
613
614Evas_GL_Polygon *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
615Evas_GL_Polygon *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
616void evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
617
618void evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2);
619
620#if 0 // filtering disabled
621void evas_gl_common_filter_draw(Evas_Engine_GL_Context *context, Evas_GL_Image *im, Evas_Filter_Info *filter);
622Filtered_Image *evas_gl_common_image_filtered_get(Evas_GL_Image *im, uint8_t *key, size_t keylen);
623Filtered_Image *evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_Image *fimage, uint8_t *key, size_t keylen);
624void evas_gl_common_image_filtered_free(Evas_GL_Image *im, Filtered_Image *);
625#endif
626
627extern void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
628extern void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);
629extern void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e);
630extern void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b);
631extern void (*glsym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei *c, GLenum *d, void *e);
632extern void (*glsym_glProgramBinary) (GLuint a, GLenum b, const void *c, GLint d);
633extern void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d);
634
635#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
636extern void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e);
637extern unsigned int (*secsym_eglDestroyImage) (void *a, void *b);
638extern void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b);
639extern void *(*secsym_eglMapImageSEC) (void *a, void *b);
640extern unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b);
641extern unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d);
642#endif
643
644//#define GL_ERRORS 1
645
646#ifdef GL_ERRORS
647# define GLERR(fn, fl, ln, op) \
648 { \
649 int __gl_err = glGetError(); \
650 if (__gl_err != GL_NO_ERROR) glerr(__gl_err, fl, fn, ln, op); \
651 }
652#else
653# define GLERR(fn, fl, ln, op)
654#endif
655
656Eina_Bool evas_gl_common_module_open(void);
657void evas_gl_common_module_close(void);
658
659#endif
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_context.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_context.c
new file mode 100644
index 0000000..62e72bd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_context.c
@@ -0,0 +1,2723 @@
1#include "evas_gl_private.h"
2
3#ifdef HAVE_DLSYM
4# include <dlfcn.h> /* dlopen,dlclose,etc */
5#else
6# error gl_common should not get compiled if dlsym is not found on the system!
7#endif
8
9#define PRG_INVALID 0xffffffff
10#define GLPIPES 1
11
12static int sym_done = 0;
13int _evas_engine_GL_common_log_dom = -1;
14
15typedef void (*glsym_func_void) ();
16
17void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b) = NULL;
18void (*glsym_glBindFramebuffer) (GLenum a, GLuint b) = NULL;
19void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e) = NULL;
20void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b) = NULL;
21void (*glsym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei *c, GLenum *d, void *e) = NULL;
22void (*glsym_glProgramBinary) (GLuint a, GLenum b, const void *c, GLint d) = NULL;
23void (*glsym_glProgramParameteri) (GLuint a, GLuint b, GLint d) = NULL;
24
25#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
26// just used for finding symbols :)
27typedef void (*_eng_fn) (void);
28
29typedef _eng_fn (*secsym_func_eng_fn) ();
30typedef unsigned int (*secsym_func_uint) ();
31typedef void *(*secsym_func_void_ptr) ();
32
33static _eng_fn (*secsym_eglGetProcAddress) (const char *a) = NULL;
34
35void *(*secsym_eglCreateImage) (void *a, void *b, GLenum c, void *d, const int *e) = NULL;
36unsigned int (*secsym_eglDestroyImage) (void *a, void *b) = NULL;
37void (*secsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
38void *(*secsym_eglMapImageSEC) (void *a, void *b) = NULL;
39unsigned int (*secsym_eglUnmapImageSEC) (void *a, void *b) = NULL;
40unsigned int (*secsym_eglGetImageAttribSEC) (void *a, void *b, int c, int *d) = NULL;
41#endif
42
43static int dbgflushnum = -1;
44
45static void
46sym_missing(void)
47{
48 ERR("GL symbols missing!");
49}
50
51static void
52gl_symbols(void)
53{
54 if (sym_done) return;
55 sym_done = 1;
56
57 /* FIXME: If using the SDL engine, we should use SDL_GL_GetProcAddress
58 * instead of dlsym
59 * if (!dst) dst = (typ)SDL_GL_GetProcAddress(sym)
60 */
61#define FINDSYM(dst, sym, typ) if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
62#define FALLBAK(dst, typ) if (!dst) dst = (typ)sym_missing;
63
64 FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void);
65 FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffersEXT", glsym_func_void);
66 FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffersARB", glsym_func_void);
67 FALLBAK(glsym_glGenFramebuffers, glsym_func_void);
68
69 FINDSYM(glsym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void);
70 FINDSYM(glsym_glBindFramebuffer, "glBindFramebufferEXT", glsym_func_void);
71 FINDSYM(glsym_glBindFramebuffer, "glBindFramebufferARB", glsym_func_void);
72 FALLBAK(glsym_glBindFramebuffer, glsym_func_void);
73
74 FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2D", glsym_func_void);
75 FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2DEXT", glsym_func_void);
76 FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2DARB", glsym_func_void);
77 FALLBAK(glsym_glFramebufferTexture2D, glsym_func_void);
78
79 FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffers", glsym_func_void);
80 FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffersEXT", glsym_func_void);
81 FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffersARB", glsym_func_void);
82 FALLBAK(glsym_glDeleteFramebuffers, glsym_func_void);
83
84 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinary", glsym_func_void);
85 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryEXT", glsym_func_void);
86 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryARB", glsym_func_void);
87 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryOES", glsym_func_void);
88
89 FINDSYM(glsym_glProgramBinary, "glProgramBinary", glsym_func_void);
90 FINDSYM(glsym_glProgramBinary, "glProgramBinaryEXT", glsym_func_void);
91 FINDSYM(glsym_glProgramBinary, "glProgramBinaryARB", glsym_func_void);
92
93 FINDSYM(glsym_glProgramParameteri, "glProgramParameteri", glsym_func_void);
94 FINDSYM(glsym_glProgramParameteri, "glProgramParameteriEXT", glsym_func_void);
95 FINDSYM(glsym_glProgramParameteri, "glProgramParameteriARB", glsym_func_void);
96
97#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
98#undef FINDSYM
99#define FINDSYM(dst, sym, typ) \
100 if ((!dst) && (secsym_eglGetProcAddress)) dst = (typ)secsym_eglGetProcAddress(sym); \
101 if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym)
102// yes - gl core looking for egl stuff. i know it's odd. a reverse-layer thing
103// but it will work as the egl/glx layer calls gl core common stuff and thus
104// these symbols will work. making the glx/egl + x11 layer do this kind-of is
105// wrong as this is not x11 (output) layer specific like the native surface
106// stuff. this is generic zero-copy textures for gl
107
108 FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddress", secsym_func_eng_fn);
109 FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddressEXT", secsym_func_eng_fn);
110 FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddressARB", secsym_func_eng_fn);
111 FINDSYM(secsym_eglGetProcAddress, "eglGetProcAddressKHR", secsym_func_eng_fn);
112
113 FINDSYM(secsym_eglCreateImage, "eglCreateImage", secsym_func_void_ptr);
114 FINDSYM(secsym_eglCreateImage, "eglCreateImageEXT", secsym_func_void_ptr);
115 FINDSYM(secsym_eglCreateImage, "eglCreateImageARB", secsym_func_void_ptr);
116 FINDSYM(secsym_eglCreateImage, "eglCreateImageKHR", secsym_func_void_ptr);
117
118 FINDSYM(secsym_eglDestroyImage, "eglDestroyImage", secsym_func_uint);
119 FINDSYM(secsym_eglDestroyImage, "eglDestroyImageEXT", secsym_func_uint);
120 FINDSYM(secsym_eglDestroyImage, "eglDestroyImageARB", secsym_func_uint);
121 FINDSYM(secsym_eglDestroyImage, "eglDestroyImageKHR", secsym_func_uint);
122
123 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinary", glsym_func_void);
124 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryEXT", glsym_func_void);
125 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryARB", glsym_func_void);
126 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryOES", glsym_func_void);
127 FINDSYM(glsym_glGetProgramBinary, "glGetProgramBinaryKHR", glsym_func_void);
128
129 FINDSYM(glsym_glProgramBinary, "glProgramBinary", glsym_func_void);
130 FINDSYM(glsym_glProgramBinary, "glProgramBinaryEXT", glsym_func_void);
131 FINDSYM(glsym_glProgramBinary, "glProgramBinaryARB", glsym_func_void);
132 FINDSYM(glsym_glProgramBinary, "glProgramBinaryOES", glsym_func_void);
133 FINDSYM(glsym_glProgramBinary, "glProgramBinaryKHR", glsym_func_void);
134
135 FINDSYM(glsym_glProgramParameteri, "glProgramParameteri", glsym_func_void);
136 FINDSYM(glsym_glProgramParameteri, "glProgramParameteriEXT", glsym_func_void);
137 FINDSYM(glsym_glProgramParameteri, "glProgramParameteriARB", glsym_func_void);
138 FINDSYM(glsym_glProgramParameteri, "glProgramParameteriOES", glsym_func_void);
139 FINDSYM(glsym_glProgramParameteri, "glProgramParameteriKHR", glsym_func_void);
140
141 FINDSYM(secsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", glsym_func_void);
142
143 FINDSYM(secsym_eglMapImageSEC, "eglMapImageSEC", secsym_func_void_ptr);
144
145 FINDSYM(secsym_eglUnmapImageSEC, "eglUnmapImageSEC", secsym_func_uint);
146
147 FINDSYM(secsym_eglGetImageAttribSEC, "eglGetImageAttribSEC", secsym_func_uint);
148#endif
149}
150
151static void shader_array_flush(Evas_Engine_GL_Context *gc);
152
153static Evas_Engine_GL_Context *_evas_gl_common_context = NULL;
154static Evas_GL_Shared *shared = NULL;
155
156void
157glerr(int err, const char *file, const char *func, int line, const char *op)
158{
159 const char *errmsg;
160 char buf[32];
161
162 switch (err)
163 {
164 case GL_INVALID_ENUM:
165 errmsg = "GL_INVALID_ENUM";
166 break;
167 case GL_INVALID_VALUE:
168 errmsg = "GL_INVALID_VALUE";
169 break;
170 case GL_INVALID_OPERATION:
171 errmsg = "GL_INVALID_OPERATION";
172 break;
173 case GL_OUT_OF_MEMORY:
174 errmsg = "GL_OUT_OF_MEMORY";
175 break;
176 default:
177 snprintf(buf, sizeof(buf), "%#x", err);
178 errmsg = buf;
179 }
180
181 eina_log_print(_evas_engine_GL_common_log_dom, EINA_LOG_LEVEL_ERR,
182 file, func, line, "%s: %s", op, errmsg);
183}
184
185static void
186matrix_ortho(GLfloat *m,
187 GLfloat l, GLfloat r,
188 GLfloat t, GLfloat b,
189 GLfloat near, GLfloat far,
190 int rot, int vw, int vh,
191 int foc, GLfloat orth)
192{
193 GLfloat rotf;
194 GLfloat cosv, sinv;
195 GLfloat tx, ty;
196
197 rotf = (((rot / 90) & 0x3) * M_PI) / 2.0;
198
199 tx = -0.5 * (1.0 - orth);
200 ty = -0.5 * (1.0 - orth);
201
202 if (rot == 90)
203 {
204 tx += -(vw * 1.0);
205 ty += -(vh * 0.0);
206 }
207 if (rot == 180)
208 {
209 tx += -(vw * 1.0);
210 ty += -(vh * 1.0);
211 }
212 if (rot == 270)
213 {
214 tx += -(vw * 0.0);
215 ty += -(vh * 1.0);
216 }
217
218 cosv = cos(rotf);
219 sinv = sin(rotf);
220
221 m[0] = (2.0 / (r - l)) * ( cosv);
222 m[1] = (2.0 / (r - l)) * ( sinv);
223 m[2] = 0.0;
224 m[3] = 0.0;
225
226 m[4] = (2.0 / (t - b)) * (-sinv);
227 m[5] = (2.0 / (t - b)) * ( cosv);
228 m[6] = 0.0;
229 m[7] = 0.0;
230
231 m[8] = 0.0;
232 m[9] = 0.0;
233 m[10] = -(2.0 / (far - near));
234 m[11] = 1.0 / (GLfloat)foc;
235
236 m[12] = (m[0] * tx) + (m[4] * ty) - ((r + l) / (r - l));
237 m[13] = (m[1] * tx) + (m[5] * ty) - ((t + b) / (t - b));
238 m[14] = (m[2] * tx) + (m[6] * ty) - ((near + far) / (far - near));
239 m[15] = (m[3] * tx) + (m[7] * ty) + orth;
240}
241
242static int
243_evas_gl_common_version_check()
244{
245 char *version;
246 char *tmp;
247 char *tmp2;
248 int major;
249 int minor;
250
251 /*
252 * glGetString returns a string describing the current GL connection.
253 * GL_VERSION is used to get the version of the connection
254 */
255
256 version = (char *)glGetString(GL_VERSION);
257
258 /*
259 * OpengL ES
260 *
261 * 1.* : The form is:
262 *
263 * OpenGL ES-<profile> <major>.<minor>
264 *
265 * where <profile> is either "CM" or "CL". The minor can be followed by the vendor
266 * specific information
267 *
268 * 2.0 : The form is:
269 *
270 * OpenGL<space>ES<space><version number><space><vendor-specific information>
271 */
272
273 /* OpenGL ES 1.* ? */
274
275 if ((tmp = strstr(version, "OpenGL ES-CM ")) || (tmp = strstr(version, "OpenGL ES-CL ")))
276 {
277 /* Not supported */
278 return 0;
279 }
280
281 /* OpenGL ES 2.* ? */
282
283 if ((tmp = strstr(version, "OpenGL ES ")))
284 {
285 /* Supported */
286 return 1;
287 }
288
289 /*
290 * OpenGL
291 *
292 * The GL_VERSION and GL_SHADING_LANGUAGE_VERSION strings begin with a
293 * version number. The version number uses one of these forms:
294 *
295 * major_number.minor_number
296 * major_number.minor_number.release_number
297 *
298 * Vendor-specific information may follow the version number. Its format
299 * depends on the implementation, but a space always separates the
300 * version number and the vendor-specific information.
301 */
302
303 /* glGetString() returns a static string, and we are going to */
304 /* modify it, so we get a copy first */
305 version = strdup(version);
306 if (!version)
307 return 0;
308
309 tmp = strchr(version, '.');
310 /* the first '.' always exists */
311 *tmp = '\0';
312 major = atoi(version);
313 /* FIXME: maybe we can assume that minor in only a cipher */
314 tmp2 = ++tmp;
315 while ((*tmp != '.') && (*tmp != ' ') && (*tmp != '\0'))
316 tmp++;
317 /* *tmp is '\0' : version is major_number.minor_number */
318 /* *tmp is '.' : version is major_number.minor_number.release_number */
319 /* *tmp is ' ' : version is major_number.minor_number followed by vendor */
320 *tmp = '\0';
321 minor = atoi(tmp2);
322 free(version);
323
324 if (((major == 1) && (minor >= 4)) || (major >= 2))
325 return 1;
326
327 return 0;
328}
329
330static void
331_evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc)
332{
333 GLfloat proj[16];
334 unsigned int i;
335 int w = 1, h = 1, m = 1, rot = 1, foc = 0;
336
337 EINA_SAFETY_ON_NULL_RETURN(gc);
338 foc = gc->foc;
339 // surface in pipe 0 will be the same as all pipes
340 if ((gc->pipe[0].shader.surface == gc->def_surface) ||
341 (!gc->pipe[0].shader.surface))
342 {
343 w = gc->w;
344 h = gc->h;
345 rot = gc->rot;
346 }
347 else
348 {
349 w = gc->pipe[0].shader.surface->w;
350 h = gc->pipe[0].shader.surface->h;
351 rot = 0;
352 m = -1;
353 }
354
355 if ((!gc->change.size) ||
356 ((gc->shared->w == w) && (gc->shared->h == h) &&
357 (gc->shared->rot == rot) && (gc->shared->foc == gc->foc) &&
358 (gc->shared->mflip == m)))
359 return;
360
361 gc->shared->w = w;
362 gc->shared->h = h;
363 gc->shared->rot = rot;
364 gc->shared->mflip = m;
365 gc->shared->foc = foc;
366 gc->shared->z0 = gc->z0;
367 gc->shared->px = gc->px;
368 gc->shared->py = gc->py;
369 gc->change.size = 0;
370
371 if (foc == 0)
372 {
373 if ((rot == 0) || (rot == 180))
374 glViewport(0, 0, w, h);
375 else
376 glViewport(0, 0, h, w);
377 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
378 // std matrix
379 if (m == 1)
380 matrix_ortho(proj,
381 0, w, 0, h,
382 -1000000.0, 1000000.0,
383 rot, w, h,
384 1, 1.0);
385 // v flipped matrix for render-to-texture
386 else
387 matrix_ortho(proj,
388 0, w, h, 0,
389 -1000000.0, 1000000.0,
390 rot, w, h,
391 1, 1.0);
392 }
393 else
394 {
395 int px, py, vx, vy, vw = 0, vh = 0, ax = 0, ay = 0, ppx = 0, ppy = 0;
396
397 px = gc->shared->px;
398 py = gc->shared->py;
399
400 if ((rot == 0 ) || (rot == 90 )) ppx = px;
401 else if ((rot == 180) || (rot == 270)) ppx = w - px;
402 if ((rot == 0 ) || (rot == 270)) ppy = py;
403 else if ((rot == 90 ) || (rot == 180)) ppy = h - py;
404
405 vx = ((w / 2) - ppx);
406 if (vx >= 0)
407 {
408 vw = w + (2 * vx);
409 if ((rot == 0 ) || (rot == 90 )) ax = 2 * vx;
410 else if ((rot == 180) || (rot == 270)) ax = 0;
411 }
412 else
413 {
414 vw = w - (2 * vx);
415 if ((rot == 0 ) || (rot == 90 )) ax = 0;
416 else if ((rot == 180) || (rot == 270)) ax = ppx - px;
417 vx = 0;
418 }
419
420 vy = ((h / 2) - ppy);
421 if (vy < 0)
422 {
423 vh = h - (2 * vy);
424 if ((rot == 0 )) ay = 0;
425 else if ((rot == 90 ) || (rot == 180) || (rot == 270)) ay = ppy - py;
426 vy = -vy;
427 }
428 else
429 {
430 vh = h + (2 * vy);
431 if ((rot == 0 ) || (rot == 270)) ay = 2 * vy;
432 else if ((rot == 90 ) || (rot == 180)) ay = 0;
433 vy = 0;
434 }
435
436 if (m == -1) ay = vy * 2;
437
438 if ((rot == 0) || (rot == 180))
439 glViewport(-2 * vx, -2 * vy, vw, vh);
440 else
441 glViewport(-2 * vy, -2 * vx, vh, vw);
442 if (m == 1)
443 matrix_ortho(proj, 0, vw, 0, vh,
444 -1000000.0, 1000000.0,
445 rot, vw, vh,
446 foc, 0.0);
447 else
448 matrix_ortho(proj, 0, vw, vh, 0,
449 -1000000.0, 1000000.0,
450 rot, vw, vh,
451 foc, 0.0);
452 gc->shared->ax = ax;
453 gc->shared->ay = ay;
454 }
455
456 for (i = 0; i < SHADER_LAST; ++i)
457 {
458 glUseProgram(gc->shared->shader[i].prog);
459 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
460 glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader[i].prog, "mvp"), 1, GL_FALSE, proj);
461 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
462 }
463
464 if (gc->state.current.cur_prog == PRG_INVALID)
465 glUseProgram(gc->shared->shader[0].prog);
466 else glUseProgram(gc->state.current.cur_prog);
467 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
468}
469
470Evas_Engine_GL_Context *
471evas_gl_common_context_new(void)
472{
473 Evas_Engine_GL_Context *gc;
474 const char *s;
475 int i;
476
477#if 1
478 if (_evas_gl_common_context)
479 {
480 _evas_gl_common_context->references++;
481 return _evas_gl_common_context;
482 }
483#endif
484 if (!_evas_gl_common_version_check())
485 return NULL;
486 gc = calloc(1, sizeof(Evas_Engine_GL_Context));
487 if (!gc) return NULL;
488
489 gl_symbols();
490
491 gc->references = 1;
492
493 _evas_gl_common_context = gc;
494
495 for (i = 0; i < MAX_PIPES; i++)
496 gc->pipe[i].shader.render_op = EVAS_RENDER_BLEND;
497
498 if (!shared)
499 {
500 const GLubyte *ext;
501
502 shared = calloc(1, sizeof(Evas_GL_Shared));
503 ext = glGetString(GL_EXTENSIONS);
504 if (ext)
505 {
506 if (getenv("EVAS_GL_INFO"))
507 fprintf(stderr, "EXT:\n%s\n", ext);
508 if ((strstr((char *)ext, "GL_ARB_texture_non_power_of_two")) ||
509 (strstr((char *)ext, "OES_texture_npot")) ||
510 (strstr((char *)ext, "GL_IMG_texture_npot")))
511 shared->info.tex_npo2 = 1;
512 if ((strstr((char *)ext, "GL_NV_texture_rectangle")) ||
513 (strstr((char *)ext, "GL_EXT_texture_rectangle")) ||
514 (strstr((char *)ext, "GL_ARB_texture_rectangle")))
515 shared->info.tex_rect = 1;
516 if ((strstr((char *)ext, "GL_ARB_get_program_binary")) ||
517 (strstr((char *)ext, "GL_OES_get_program_binary")))
518 shared->info.bin_program = 1;
519#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
520 if ((strstr((char *)ext, "GL_EXT_texture_filter_anisotropic")))
521 glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,
522 &(shared->info.anisotropic));
523#endif
524#ifdef GL_BGRA
525 if ((strstr((char *)ext, "GL_EXT_bgra")) ||
526 (strstr((char *)ext, "GL_EXT_texture_format_BGRA8888")))
527 shared->info.bgra = 1;
528#endif
529#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
530 // FIXME: there should be an extension name/string to check for
531 // not just symbols in the lib
532 i = 0;
533 s = getenv("EVAS_GL_NO_MAP_IMAGE_SEC");
534 if (s) i = atoi(s);
535 if (!i)
536 {
537 // test for all needed symbols - be "conservative" and
538 // need all of it
539 if ((secsym_eglCreateImage) &&
540 (secsym_eglDestroyImage) &&
541 (secsym_glEGLImageTargetTexture2DOES) &&
542 (secsym_eglMapImageSEC) &&
543 (secsym_eglUnmapImageSEC) &&
544 (secsym_eglGetImageAttribSEC))
545 shared->info.sec_image_map = 1;
546 }
547#endif
548 }
549 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,
550 &(shared->info.max_texture_units));
551 glGetIntegerv(GL_MAX_TEXTURE_SIZE,
552 &(shared->info.max_texture_size));
553 shared->info.max_vertex_elements = 6 * 100000;
554#ifdef GL_MAX_ELEMENTS_VERTICES
555/* only applies to glDrawRangeElements. don't really need to get it.
556 glGetIntegerv(GL_MAX_ELEMENTS_VERTICES,
557 &(shared->info.max_vertex_elements));
558 */
559#endif
560 s = getenv("EVAS_GL_VERTEX_MAX");
561 if (s) shared->info.max_vertex_elements = atoi(s);
562 if (shared->info.max_vertex_elements < 6)
563 shared->info.max_vertex_elements = 6;
564
565 // magic numbers that are a result of imperical testing and getting
566 // "best case" performance across a range of systems
567 shared->info.tune.cutout.max = DEF_CUTOUT;
568 shared->info.tune.pipes.max = DEF_PIPES;
569 shared->info.tune.atlas.max_alloc_size = DEF_ATLAS_ALLOC;
570 shared->info.tune.atlas.max_alloc_alpha_size = DEF_ATLAS_ALLOC_ALPHA;
571 shared->info.tune.atlas.max_w = DEF_ATLAS_W;
572 shared->info.tune.atlas.max_h = DEF_ATLAS_H;
573 shared->info.tune.atlas.slot_size = DEF_ATLAS_SLOT;
574
575 // per gpu hacks. based on impirical measurement of some known gpu's
576 s = (const char *)glGetString(GL_RENDERER);
577 if (s)
578 {
579 if (strstr(s, "PowerVR SGX 540"))
580 shared->info.tune.pipes.max = DEF_PIPES_SGX_540;
581 else if (strstr(s, "NVIDIA Tegra"))
582 shared->info.tune.pipes.max = DEF_PIPES_TEGRA_2;
583 }
584
585#define GETENVOPT(name, tune_param, min, max) \
586 do { \
587 const char *__v = getenv(name); \
588 if (__v) { \
589 shared->info.tune.tune_param = atoi(__v); \
590 if (shared->info.tune.tune_param > max) \
591 shared->info.tune.tune_param = max; \
592 else if (shared->info.tune.tune_param < min) \
593 shared->info.tune.tune_param = min; \
594 } \
595 } while (0)
596
597 GETENVOPT("EVAS_GL_CUTOUT_MAX", cutout.max, -1, 0x7fffffff);
598 GETENVOPT("EVAS_GL_PIPES_MAX", pipes.max, 1, MAX_PIPES);
599 GETENVOPT("EVAS_GL_ATLAS_ALLOC_SIZE", atlas.max_alloc_size, MIN_ATLAS_ALLOC, MAX_ATLAS_ALLOC);
600 GETENVOPT("EVAS_GL_ATLAS_ALLOC_ALPHA_SIZE", atlas.max_alloc_alpha_size, MIN_ATLAS_ALLOC_ALPHA, MAX_ATLAS_ALLOC_ALPHA);
601 GETENVOPT("EVAS_GL_ATLAS_MAX_W", atlas.max_w, 0, MAX_ATLAS_W);
602 GETENVOPT("EVAS_GL_ATLAS_MAX_H", atlas.max_h, 0, MAX_ATLAS_H);
603 GETENVOPT("EVAS_GL_ATLAS_SLOT_SIZE", atlas.slot_size, MIN_ATLAS_SLOT, MAX_ATLAS_SLOT);
604 s = (const char *)getenv("EVAS_GL_GET_PROGRAM_BINARY");
605 if (s)
606 {
607 if (atoi(s) == 0) shared->info.bin_program = 0;
608 }
609
610 if (getenv("EVAS_GL_INFO"))
611 fprintf(stderr,
612 "max tex size %ix%i\n"
613 "max units %i\n"
614 "non-power-2 tex %i\n"
615 "rect tex %i\n"
616 "bgra : %i\n"
617 "max ansiotropic filtering: %3.3f\n"
618 "egl sec map image: %i\n"
619 "max vertex count: %i\n"
620 "\n"
621 "(can set EVAS_GL_VERTEX_MAX EVAS_GL_NO_MAP_IMAGE_SEC EVAS_GL_INFO EVAS_GL_MEMINFO )\n"
622 "\n"
623 "EVAS_GL_GET_PROGRAM_BINARY: %i\n"
624 "EVAS_GL_CUTOUT_MAX: %i\n"
625 "EVAS_GL_PIPES_MAX: %i\n"
626 "EVAS_GL_ATLAS_ALLOC_SIZE: %i\n"
627 "EVAS_GL_ATLAS_ALLOC_ALPHA_SIZE: %i\n"
628 "EVAS_GL_ATLAS_MAX_W x EVAS_GL_ATLAS_MAX_H: %i x %i\n"
629 "EVAS_GL_ATLAS_SLOT_SIZE: %i\n"
630 ,
631 (int)shared->info.max_texture_size, (int)shared->info.max_texture_size,
632 (int)shared->info.max_texture_units,
633 (int)shared->info.tex_npo2,
634 (int)shared->info.tex_rect,
635 (int)shared->info.bgra,
636 (double)shared->info.anisotropic,
637 (int)shared->info.sec_image_map,
638 (int)shared->info.max_vertex_elements,
639
640 (int)shared->info.bin_program,
641 (int)shared->info.tune.cutout.max,
642 (int)shared->info.tune.pipes.max,
643 (int)shared->info.tune.atlas.max_alloc_size,
644 (int)shared->info.tune.atlas.max_alloc_alpha_size,
645 (int)shared->info.tune.atlas.max_w, (int)shared->info.tune.atlas.max_h,
646 (int)shared->info.tune.atlas.slot_size
647 );
648
649 glDisable(GL_DEPTH_TEST);
650 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
651 glEnable(GL_DITHER);
652 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
653 glDisable(GL_BLEND);
654 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
655 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
656 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
657 // no dest alpha
658// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
659// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
660 glDepthMask(GL_FALSE);
661 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
662
663 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
664 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
665 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
666 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
667 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
668 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
669 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
670 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
671#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
672 if (shared->info.anisotropic > 0.0)
673 {
674 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
675 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
676 }
677#endif
678
679 glEnableVertexAttribArray(SHAD_VERTEX);
680 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
681 glEnableVertexAttribArray(SHAD_COLOR);
682 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
683
684 if (!evas_gl_common_shader_program_init(shared)) goto error;
685
686#define SHADER_TEXTURE_ADD(Shared, Shader, Name) \
687 glUseProgram(Shared->shader[SHADER_##Shader].prog); \
688 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); \
689 glUniform1i(glGetUniformLocation(Shared->shader[SHADER_##Shader].prog, #Name), Shared->shader[SHADER_##Shader].tex_count++); \
690 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
691
692 SHADER_TEXTURE_ADD(shared, YUV, tex);
693 SHADER_TEXTURE_ADD(shared, YUV, texu);
694 SHADER_TEXTURE_ADD(shared, YUV, texv);
695
696 SHADER_TEXTURE_ADD(shared, YUY2, tex);
697 SHADER_TEXTURE_ADD(shared, YUY2, texuv);
698
699 SHADER_TEXTURE_ADD(shared, NV12, tex);
700 SHADER_TEXTURE_ADD(shared, NV12, texuv);
701
702 SHADER_TEXTURE_ADD(shared, YUV_NOMUL, tex);
703 SHADER_TEXTURE_ADD(shared, YUV_NOMUL, texu);
704 SHADER_TEXTURE_ADD(shared, YUV_NOMUL, texv);
705
706 SHADER_TEXTURE_ADD(shared, YUY2_NOMUL, tex);
707 SHADER_TEXTURE_ADD(shared, YUY2_NOMUL, texuv);
708
709 SHADER_TEXTURE_ADD(shared, NV12_NOMUL, tex);
710 SHADER_TEXTURE_ADD(shared, NV12_NOMUL, texuv);
711
712 SHADER_TEXTURE_ADD(shared, IMG_MASK, tex);
713 SHADER_TEXTURE_ADD(shared, IMG_MASK, texm);
714
715 if (gc->state.current.cur_prog == PRG_INVALID)
716 glUseProgram(gc->shared->shader[0].prog);
717 else glUseProgram(gc->state.current.cur_prog);
718 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
719
720 evas_gl_common_shader_program_init_done();
721 // in shader:
722 // uniform sampler2D tex[8];
723 //
724 // in code:
725 // GLuint texes[8];
726 // GLint loc = glGetUniformLocation(prog, "tex");
727 // glUniform1iv(loc, 8, texes);
728
729 shared->native_pm_hash = eina_hash_int32_new(NULL);
730 shared->native_tex_hash = eina_hash_int32_new(NULL);
731 }
732 gc->shared = shared;
733 gc->shared->references++;
734 _evas_gl_common_viewport_set(gc);
735
736 gc->def_surface = evas_gl_common_image_surface_new(gc, 1, 1, 1);
737
738 return gc;
739 error:
740 evas_gl_common_context_free(gc);
741 return NULL;
742}
743
744void
745evas_gl_common_context_free(Evas_Engine_GL_Context *gc)
746{
747 int i, j;
748 Eina_List *l;
749
750 gc->references--;
751 if (gc->references > 0) return;
752 if (gc->shared) gc->shared->references--;
753
754 if (gc->def_surface) evas_gl_common_image_free(gc->def_surface);
755
756 if (gc->shared)
757 {
758 for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
759 {
760 if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
761 if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
762 if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
763 if (gc->pipe[i].array.texm) free(gc->pipe[i].array.texm);
764 if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2);
765 if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
766 }
767 }
768
769 if ((gc->shared) && (gc->shared->references == 0))
770 {
771 Evas_GL_Texture_Pool *pt;
772
773 for (i = 0; i < SHADER_LAST; ++i)
774 evas_gl_common_shader_program_shutdown(&(gc->shared->shader[i]));
775
776 while (gc->shared->images)
777 {
778 evas_gl_common_image_free(gc->shared->images->data);
779 }
780
781 EINA_LIST_FOREACH(gc->shared->tex.whole, l, pt)
782 evas_gl_texture_pool_empty(pt);
783 for (i = 0; i < 33; i++)
784 {
785 for (j = 0; j < 3; j++)
786 {
787 EINA_LIST_FOREACH(gc->shared->tex.atlas[i][j], l, pt)
788 evas_gl_texture_pool_empty(pt);
789 }
790 }
791 eina_hash_free(gc->shared->native_pm_hash);
792 eina_hash_free(gc->shared->native_tex_hash);
793 free(gc->shared);
794 shared = NULL;
795 }
796 if (gc == _evas_gl_common_context) _evas_gl_common_context = NULL;
797 free(gc);
798}
799
800void
801evas_gl_common_context_use(Evas_Engine_GL_Context *gc)
802{
803 if (_evas_gl_common_context == gc) return;
804 _evas_gl_common_context = gc;
805 if (gc) _evas_gl_common_viewport_set(gc);
806}
807
808void
809evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc)
810{
811 int i;
812
813 if (dbgflushnum < 0)
814 {
815 dbgflushnum = 0;
816 if (getenv("EVAS_GL_DBG")) dbgflushnum = 1;
817 }
818 if (dbgflushnum) printf("----prev-flushnum: %i -----------------------------------\n", gc->flushnum);
819
820 gc->flushnum = 0;
821 gc->state.current.cur_prog = 0;
822 gc->state.current.cur_tex = 0;
823 gc->state.current.cur_texu = 0;
824 gc->state.current.cur_texv = 0;
825 gc->state.current.cur_texm = 0;
826 gc->state.current.cur_texmu = 0;
827 gc->state.current.cur_texmv = 0;
828 gc->state.current.render_op = 0;
829 gc->state.current.smooth = 0;
830 gc->state.current.blend = 0;
831 gc->state.current.clip = 0;
832 gc->state.current.cx = 0;
833 gc->state.current.cy = 0;
834 gc->state.current.cw = 0;
835 gc->state.current.ch = 0;
836
837 for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
838 {
839 gc->pipe[i].region.x = 0;
840 gc->pipe[i].region.y = 0;
841 gc->pipe[i].region.w = 0;
842 gc->pipe[i].region.h = 0;
843 gc->pipe[i].region.type = 0;
844 gc->pipe[i].clip.active = 0;
845 gc->pipe[i].clip.x = 0;
846 gc->pipe[i].clip.y = 0;
847 gc->pipe[i].clip.w = 0;
848 gc->pipe[i].clip.h = 0;
849 gc->pipe[i].shader.surface = NULL;
850 gc->pipe[i].shader.cur_prog = 0;
851 gc->pipe[i].shader.cur_tex = 0;
852 gc->pipe[i].shader.cur_texu = 0;
853 gc->pipe[i].shader.cur_texv = 0;
854 gc->pipe[i].shader.cur_texm = 0;
855 gc->pipe[i].shader.render_op = EVAS_RENDER_BLEND;
856 gc->pipe[i].shader.smooth = 0;
857 gc->pipe[i].shader.blend = 0;
858 gc->pipe[i].shader.clip = 0;
859 gc->pipe[i].shader.cx = 0;
860 gc->pipe[i].shader.cy = 0;
861 gc->pipe[i].shader.cw = 0;
862 gc->pipe[i].shader.ch = 0;
863 }
864 gc->change.size = 1;
865
866 glDisable(GL_SCISSOR_TEST);
867 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
868 glScissor(0, 0, 0, 0);
869 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
870
871 glDisable(GL_DEPTH_TEST);
872 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
873 glEnable(GL_DITHER);
874 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
875 glDisable(GL_BLEND);
876 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
877 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
878 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
879 // no dest alpha
880// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // dest alpha
881// glBlendFunc(GL_SRC_ALPHA, GL_ONE); // ???
882 glDepthMask(GL_FALSE);
883 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
884
885 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
886 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
887 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
888 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
889 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
890 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
891 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
892 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
893#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
894 if (shared->info.anisotropic > 0.0)
895 {
896 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
897 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
898 }
899#endif
900
901 glEnableVertexAttribArray(SHAD_VERTEX);
902 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
903 glEnableVertexAttribArray(SHAD_COLOR);
904 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
905 if (gc->state.current.cur_prog == PRG_INVALID)
906 glUseProgram(gc->shared->shader[0].prog);
907 else glUseProgram(gc->state.current.cur_prog);
908 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
909
910 glActiveTexture(GL_TEXTURE0);
911 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
912 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
913 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
914
915 _evas_gl_common_viewport_set(gc);
916}
917
918void
919evas_gl_common_context_resize(Evas_Engine_GL_Context *gc, int w, int h, int rot)
920{
921 if ((gc->w == w) && (gc->h == h) && (gc->rot == rot)) return;
922 evas_gl_common_context_flush(gc);
923 gc->change.size = 1;
924 gc->rot = rot;
925 gc->w = w;
926 gc->h = h;
927 if (_evas_gl_common_context == gc) _evas_gl_common_viewport_set(gc);
928}
929
930void
931evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc,
932 Evas_GL_Image *surface)
933{
934 if (surface == gc->pipe[0].shader.surface) return;
935
936 evas_gl_common_context_flush(gc);
937
938 gc->state.current.cur_prog = PRG_INVALID;
939 gc->state.current.cur_tex = -1;
940 gc->state.current.cur_texu = -1;
941 gc->state.current.cur_texv = -1;
942 gc->state.current.render_op = -1;
943 gc->state.current.smooth = -1;
944 gc->state.current.blend = -1;
945 gc->state.current.clip = -1;
946 gc->state.current.cx = -1;
947 gc->state.current.cy = -1;
948 gc->state.current.cw = -1;
949 gc->state.current.ch = -1;
950
951 gc->pipe[0].shader.surface = surface;
952 gc->change.size = 1;
953#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
954# ifndef GL_FRAMEBUFFER
955# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
956# endif
957#else
958# ifndef GL_FRAMEBUFFER
959# define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
960# endif
961#endif
962 if (gc->pipe[0].shader.surface == gc->def_surface)
963 {
964 glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
965 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
966 }
967 else
968 {
969 glsym_glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
970 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
971 }
972 _evas_gl_common_viewport_set(gc);
973}
974
975#define PUSH_VERTEX(n, x, y, z) \
976 gc->pipe[n].array.vertex[nv++] = x; \
977 gc->pipe[n].array.vertex[nv++] = y; \
978 gc->pipe[n].array.vertex[nv++] = z
979#define PUSH_COLOR(n, r, g, b, a) \
980 gc->pipe[n].array.color[nc++] = r; \
981 gc->pipe[n].array.color[nc++] = g; \
982 gc->pipe[n].array.color[nc++] = b; \
983 gc->pipe[n].array.color[nc++] = a
984#define PUSH_TEXUV(n, u, v) \
985 gc->pipe[n].array.texuv[nu++] = u; \
986 gc->pipe[n].array.texuv[nu++] = v
987#define PUSH_TEXUV2(n, u, v) \
988 gc->pipe[n].array.texuv2[nu2++] = u; \
989 gc->pipe[n].array.texuv2[nu2++] = v
990#define PUSH_TEXUV3(n, u, v) \
991 gc->pipe[n].array.texuv3[nu3++] = u; \
992 gc->pipe[n].array.texuv3[nu3++] = v
993#define PUSH_TEXM(n, u, v) \
994 gc->pipe[n].array.texm[nm++] = u; \
995 gc->pipe[n].array.texm[nm++] = v
996
997
998static inline void
999array_alloc(Evas_Engine_GL_Context *gc, int n)
1000{
1001 gc->havestuff = EINA_TRUE;
1002 if (gc->pipe[n].array.num <= gc->pipe[n].array.alloc) return;
1003 gc->pipe[n].array.alloc += 6 * 1024;
1004 if (gc->pipe[n].array.use_vertex)
1005 gc->pipe[n].array.vertex = realloc(gc->pipe[n].array.vertex,
1006 gc->pipe[n].array.alloc * sizeof(GLshort) * 3);
1007 if (gc->pipe[n].array.use_color)
1008 gc->pipe[n].array.color = realloc(gc->pipe[n].array.color,
1009 gc->pipe[n].array.alloc * sizeof(GLubyte) * 4);
1010 if (gc->pipe[n].array.use_texuv)
1011 gc->pipe[n].array.texuv = realloc(gc->pipe[n].array.texuv,
1012 gc->pipe[n].array.alloc * sizeof(GLfloat) * 2);
1013 if (gc->pipe[n].array.use_texm)
1014 gc->pipe[n].array.texm = realloc(gc->pipe[n].array.texm,
1015 gc->pipe[n].array.alloc * sizeof(GLfloat) * 2);
1016 if (gc->pipe[n].array.use_texuv2)
1017 gc->pipe[n].array.texuv2 = realloc(gc->pipe[n].array.texuv2,
1018 gc->pipe[n].array.alloc * sizeof(GLfloat) * 2);
1019 if (gc->pipe[n].array.use_texuv3)
1020 gc->pipe[n].array.texuv3 = realloc(gc->pipe[n].array.texuv3,
1021 gc->pipe[n].array.alloc * sizeof(GLfloat) * 2);
1022}
1023
1024#ifdef GLPIPES
1025static int
1026pipe_region_intersects(Evas_Engine_GL_Context *gc, int n,
1027 int x, int y, int w, int h)
1028{
1029 int i, rx, ry, rw, rh, ii;
1030
1031 rx = gc->pipe[n].region.x;
1032 ry = gc->pipe[n].region.y;
1033 rw = gc->pipe[n].region.w;
1034 rh = gc->pipe[n].region.h;
1035 if (!RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh))
1036 return 0;
1037
1038 // a hack for now. map pipes use their whole bounding box for intersects
1039 // which at worst case reduces to old pipeline flushes, but cheaper than
1040 // full quad region or triangle intersects right now
1041 if (gc->pipe[n].region.type == RTYPE_MAP) return 1;
1042
1043 for (i = 0,
1044 ii = 0;
1045
1046 i < gc->pipe[n].array.num;
1047
1048 i += (3 * 2),
1049 ii += (3 * 3 * 2))
1050 { // tri 1...
1051 // 0, 1, 2 < top left
1052 // 3, 4, 5 < top right
1053 // 6. 7, 8 < bottom left
1054 rx = gc->pipe[n].array.vertex[ii + 0];
1055 ry = gc->pipe[n].array.vertex[ii + 1];
1056 rw = gc->pipe[n].array.vertex[ii + 3] - rx;
1057 rh = gc->pipe[n].array.vertex[ii + 7] - ry;
1058 if (RECTS_INTERSECT(x, y, w, h, rx, ry, rw, rh))
1059 return 1;
1060 }
1061 return 0;
1062}
1063#endif
1064
1065static void
1066pipe_region_expand(Evas_Engine_GL_Context *gc, int n,
1067 int x, int y, int w, int h)
1068{
1069 int x1, y1, x2, y2;
1070
1071 if (gc->pipe[n].region.w <= 0)
1072 {
1073 gc->pipe[n].region.x = x;
1074 gc->pipe[n].region.y = y;
1075 gc->pipe[n].region.w = w;
1076 gc->pipe[n].region.h = h;
1077 return;
1078 }
1079 x1 = gc->pipe[n].region.x;
1080 y1 = gc->pipe[n].region.y;
1081 x2 = gc->pipe[n].region.x + gc->pipe[n].region.w;
1082 y2 = gc->pipe[n].region.y + gc->pipe[n].region.h;
1083 if (x < x1) x1 = x;
1084 if (y < y1) y1 = y;
1085 if ((x + w) > x2) x2 = x + w;
1086 if ((y + h) > y2) y2 = y + h;
1087 gc->pipe[n].region.x = x1;
1088 gc->pipe[n].region.y = y1;
1089 gc->pipe[n].region.w = x2 - x1;
1090 gc->pipe[n].region.h = y2 - y1;
1091}
1092
1093static Eina_Bool
1094vertex_array_size_check(Evas_Engine_GL_Context *gc, int pn, int n)
1095{
1096 return 1;
1097// this fixup breaks for expedite test 32. why?
1098 if ((gc->pipe[pn].array.num + n) > gc->shared->info.max_vertex_elements)
1099 {
1100 shader_array_flush(gc);
1101 return 0;
1102 }
1103 return 1;
1104}
1105
1106static inline Evas_GL_Shader
1107evas_gl_common_shader_choice(int npoints __UNUSED__,
1108 RGBA_Map_Point *p,
1109 int r, int g, int b, int a,
1110 Evas_GL_Shader nomul,
1111 Evas_GL_Shader mul)
1112{
1113 if ((a == 255) && (r == 255) && (g == 255) && (b == 255))
1114 {
1115 if (!p) return nomul;
1116
1117 if ((p[0].col == 0xffffffff) && (p[1].col == 0xffffffff) &&
1118 (p[2].col == 0xffffffff) && (p[3].col == 0xffffffff))
1119 return nomul;
1120 }
1121 return mul;
1122}
1123
1124static int
1125_evas_gl_common_context_push(int rtype,
1126 Evas_Engine_GL_Context *gc,
1127 Evas_GL_Texture *tex,
1128 Evas_GL_Texture *texm,
1129 GLuint prog,
1130 int x, int y, int w, int h,
1131 Eina_Bool blend,
1132 Eina_Bool smooth,
1133 Eina_Bool clip,
1134 int cx, int cy, int cw, int ch)
1135{
1136 int pn = 0;
1137
1138#ifdef GLPIPES
1139 again:
1140#endif
1141 vertex_array_size_check(gc, gc->state.top_pipe, 6);
1142 pn = gc->state.top_pipe;
1143#ifdef GLPIPES
1144 if (!((pn == 0) && (gc->pipe[pn].array.num == 0)))
1145 {
1146 int found = 0;
1147 int i;
1148
1149 for (i = pn; i >= 0; i--)
1150 {
1151 if ((gc->pipe[i].region.type == rtype)
1152 && (!tex || gc->pipe[i].shader.cur_tex == tex->pt->texture)
1153 && (!texm || gc->pipe[i].shader.cur_texm == texm->pt->texture)
1154 && (gc->pipe[i].shader.cur_prog == prog)
1155 && (gc->pipe[i].shader.smooth == smooth)
1156 && (gc->pipe[i].shader.blend == blend)
1157 && (gc->pipe[i].shader.render_op == gc->dc->render_op)
1158 && (gc->pipe[i].shader.clip == clip)
1159 && (!clip || ((gc->pipe[i].shader.cx == cx)
1160 && (gc->pipe[i].shader.cy == cy)
1161 && (gc->pipe[i].shader.cw == cw)
1162 && (gc->pipe[i].shader.ch == ch))))
1163 {
1164 found = 1;
1165 pn = i;
1166 break;
1167 }
1168 if (pipe_region_intersects(gc, i, x, y, w, h)) break;
1169 }
1170 if (!found)
1171 {
1172 pn = gc->state.top_pipe + 1;
1173 if (pn >= gc->shared->info.tune.pipes.max)
1174 {
1175 shader_array_flush(gc);
1176 goto again;
1177 }
1178 gc->state.top_pipe = pn;
1179 }
1180 }
1181 if ((tex) && (((tex->im) && (tex->im->native.data)) || tex->pt->dyn.img))
1182 {
1183 if (gc->pipe[pn].array.im != tex->im)
1184 {
1185 shader_array_flush(gc);
1186 pn = gc->state.top_pipe;
1187 gc->pipe[pn].array.im = tex->im;
1188 goto again;
1189 }
1190 }
1191#else
1192 if (!((gc->pipe[pn].region.type == rtype)
1193 && (!tex || gc->pipe[pn].shader.cur_tex == tex->pt->texture)
1194 && (!texm || gc->pipe[pn].shader.cur_texm == texm->pt->texture)
1195 && (gc->pipe[pn].shader.cur_prog == prog)
1196 && (gc->pipe[pn].shader.smooth == smooth)
1197 && (gc->pipe[pn].shader.blend == blend)
1198 && (gc->pipe[pn].shader.render_op == gc->dc->render_op)
1199 && (gc->pipe[pn].shader.clip == clip)
1200 && (!clip || ((gc->pipe[pn].shader.cx == cx)
1201 && (gc->pipe[pn].shader.cy == cy)
1202 && (gc->pipe[pn].shader.cw == cw)
1203 && (gc->pipe[pn].shader.ch == ch)))))
1204 {
1205 shader_array_flush(gc);
1206 }
1207 if ((tex) && (((tex->im) && (tex->im->native.data)) || tex->pt->dyn.img))
1208 {
1209 if (gc->pipe[pn].array.im != tex->im)
1210 {
1211 shader_array_flush(gc);
1212 gc->pipe[pn].array.im = tex->im;
1213 }
1214 }
1215#endif
1216
1217 return pn;
1218}
1219
1220void
1221evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
1222 int x1, int y1, int x2, int y2,
1223 int clip, int cx, int cy, int cw, int ch,
1224 int r, int g, int b, int a)
1225{
1226 int pnum, nv, nc, nu, nt, i;
1227 Eina_Bool blend = 0;
1228 GLuint prog = gc->shared->shader[SHADER_RECT].prog;
1229 int pn = 0;
1230
1231 if (a < 255) blend = 1;
1232 if (gc->dc->render_op == EVAS_RENDER_COPY) blend = 0;
1233
1234 shader_array_flush(gc);
1235 vertex_array_size_check(gc, gc->state.top_pipe, 2);
1236 pn = gc->state.top_pipe;
1237 gc->pipe[pn].shader.cur_tex = 0;
1238 gc->pipe[pn].shader.cur_prog = prog;
1239 gc->pipe[pn].shader.blend = blend;
1240 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1241 gc->pipe[pn].shader.clip = clip;
1242 gc->pipe[pn].shader.cx = cx;
1243 gc->pipe[pn].shader.cy = cy;
1244 gc->pipe[pn].shader.cw = cw;
1245 gc->pipe[pn].shader.ch = ch;
1246
1247 gc->pipe[pn].array.line = 1;
1248 gc->pipe[pn].array.use_vertex = 1;
1249 gc->pipe[pn].array.use_color = 1;
1250 gc->pipe[pn].array.use_texuv = 0;
1251 gc->pipe[pn].array.use_texuv2 = 0;
1252 gc->pipe[pn].array.use_texuv3 = 0;
1253
1254 pnum = gc->pipe[pn].array.num;
1255 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nt = pnum * 4;
1256 gc->pipe[pn].array.num += 2;
1257 array_alloc(gc, pn);
1258
1259 PUSH_VERTEX(pn, x1, y1, 0);
1260 PUSH_VERTEX(pn, x2, y2, 0);
1261
1262 for (i = 0; i < 2; i++)
1263 {
1264 PUSH_COLOR(pn, r, g, b, a);
1265 }
1266
1267 shader_array_flush(gc);
1268 gc->pipe[pn].array.line = 0;
1269 gc->pipe[pn].array.use_vertex = 0;
1270 gc->pipe[pn].array.use_color = 0;
1271 gc->pipe[pn].array.use_texuv = 0;
1272 gc->pipe[pn].array.use_texuv2 = 0;
1273 gc->pipe[pn].array.use_texuv3 = 0;
1274}
1275
1276void
1277evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
1278 int x, int y, int w, int h,
1279 int r, int g, int b, int a)
1280{
1281 int pnum, nv, nc, nu, nt, i;
1282 Eina_Bool blend = 0;
1283 GLuint prog = gc->shared->shader[SHADER_RECT].prog;
1284 int pn = 0;
1285
1286 if (gc->dc->mask.mask)
1287 {
1288 RGBA_Draw_Context *dc;
1289 dc = gc->dc;
1290 Evas_GL_Image *im;
1291 im = (void *)dc->mask.mask;
1292 evas_gl_common_context_font_push(gc, im->tex,
1293 x - dc->mask.x,y - dc->mask.y,
1294 dc->mask.w,dc->mask.h,
1295 x,y,w,h,r,g,b,a);
1296 return;
1297 }
1298
1299 if (a < 255) blend = 1;
1300 if (gc->dc->render_op == EVAS_RENDER_COPY) blend = 0;
1301
1302again:
1303 vertex_array_size_check(gc, gc->state.top_pipe, 6);
1304 pn = gc->state.top_pipe;
1305#ifdef GLPIPES
1306 if ((pn == 0) && (gc->pipe[pn].array.num == 0))
1307 {
1308 gc->pipe[pn].region.type = RTYPE_RECT;
1309 gc->pipe[pn].shader.cur_tex = 0;
1310 gc->pipe[pn].shader.cur_prog = prog;
1311 gc->pipe[pn].shader.blend = blend;
1312 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1313 gc->pipe[pn].shader.clip = 0;
1314 gc->pipe[pn].shader.cx = 0;
1315 gc->pipe[pn].shader.cy = 0;
1316 gc->pipe[pn].shader.cw = 0;
1317 gc->pipe[pn].shader.ch = 0;
1318 gc->pipe[pn].array.line = 0;
1319 gc->pipe[pn].array.use_vertex = 1;
1320 gc->pipe[pn].array.use_color = 1;
1321 gc->pipe[pn].array.use_texuv = 0;
1322 gc->pipe[pn].array.use_texuv2 = 0;
1323 gc->pipe[pn].array.use_texuv3 = 0;
1324 }
1325 else
1326 {
1327 int found = 0;
1328
1329 for (i = pn; i >= 0; i--)
1330 {
1331 if ((gc->pipe[i].region.type == RTYPE_RECT)
1332 && (gc->pipe[i].shader.cur_tex == 0)
1333 && (gc->pipe[i].shader.cur_prog == prog)
1334 && (gc->pipe[i].shader.blend == blend)
1335 && (gc->pipe[i].shader.render_op == gc->dc->render_op)
1336 && (gc->pipe[i].shader.clip == 0)
1337 )
1338 {
1339 found = 1;
1340 pn = i;
1341 break;
1342 }
1343 if (pipe_region_intersects(gc, i, x, y, w, h)) break;
1344 }
1345 if (!found)
1346 {
1347 pn = gc->state.top_pipe + 1;
1348 if (pn >= gc->shared->info.tune.pipes.max)
1349 {
1350 shader_array_flush(gc);
1351 goto again;
1352 }
1353 gc->state.top_pipe = pn;
1354 gc->pipe[pn].region.type = RTYPE_RECT;
1355 gc->pipe[pn].shader.cur_tex = 0;
1356 gc->pipe[pn].shader.cur_prog = prog;
1357 gc->pipe[pn].shader.blend = blend;
1358 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1359 gc->pipe[pn].shader.clip = 0;
1360 gc->pipe[pn].shader.cx = 0;
1361 gc->pipe[pn].shader.cy = 0;
1362 gc->pipe[pn].shader.cw = 0;
1363 gc->pipe[pn].shader.ch = 0;
1364 gc->pipe[pn].array.line = 0;
1365 gc->pipe[pn].array.use_vertex = 1;
1366 gc->pipe[pn].array.use_color = 1;
1367 gc->pipe[pn].array.use_texuv = 0;
1368 gc->pipe[pn].array.use_texuv2 = 0;
1369 gc->pipe[pn].array.use_texuv3 = 0;
1370 }
1371 }
1372#else
1373 if ((gc->pipe[pn].shader.cur_tex != 0)
1374 || (gc->pipe[pn].shader.cur_prog != prog)
1375 || (gc->pipe[pn].shader.blend != blend)
1376 || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
1377 || (gc->pipe[pn].shader.clip != 0)
1378 )
1379 {
1380 shader_array_flush(gc);
1381 pn = gc->state.top_pipe;
1382 gc->pipe[pn].shader.cur_tex = 0;
1383 gc->pipe[pn].shader.cur_prog = prog;
1384 gc->pipe[pn].shader.blend = blend;
1385 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1386 gc->pipe[pn].shader.clip = 0;
1387 gc->pipe[pn].shader.cx = 0;
1388 gc->pipe[pn].shader.cy = 0;
1389 gc->pipe[pn].shader.cw = 0;
1390 gc->pipe[pn].shader.ch = 0;
1391 }
1392
1393 gc->pipe[pn].region.type = RTYPE_RECT;
1394 gc->pipe[pn].array.line = 0;
1395 gc->pipe[pn].array.use_vertex = 1;
1396 gc->pipe[pn].array.use_color = 1;
1397 gc->pipe[pn].array.use_texuv = 0;
1398 gc->pipe[pn].array.use_texuv2 = 0;
1399 gc->pipe[pn].array.use_texuv3 = 0;
1400#endif
1401
1402 pipe_region_expand(gc, pn, x, y, w, h);
1403
1404 pnum = gc->pipe[pn].array.num;
1405 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nt = pnum * 4;
1406 gc->pipe[pn].array.num += 6;
1407 array_alloc(gc, pn);
1408
1409 PUSH_VERTEX(pn, x , y , 0);
1410 PUSH_VERTEX(pn, x + w, y , 0);
1411 PUSH_VERTEX(pn, x , y + h, 0);
1412
1413 PUSH_VERTEX(pn, x + w, y , 0);
1414 PUSH_VERTEX(pn, x + w, y + h, 0);
1415 PUSH_VERTEX(pn, x , y + h, 0);
1416
1417 for (i = 0; i < 6; i++)
1418 {
1419 PUSH_COLOR(pn, r, g, b, a);
1420 }
1421}
1422
1423void
1424evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
1425 Evas_GL_Texture *tex,
1426 double sx, double sy, double sw, double sh,
1427 int x, int y, int w, int h,
1428 int r, int g, int b, int a,
1429 Eina_Bool smooth, Eina_Bool tex_only)
1430{
1431 int pnum, nv, nc, nu, nu2, nt, i;
1432 GLfloat tx1, tx2, ty1, ty2;
1433 Eina_Bool blend = 1;
1434 GLuint prog = gc->shared->shader[SHADER_IMG].prog;
1435 int pn = 0;
1436
1437 if (!tex->alpha) blend = 0;
1438 if (a < 255) blend = 1;
1439
1440 if (gc->filter_prog)
1441 {
1442 prog = gc->filter_prog;
1443 }
1444 else if (tex_only)
1445 {
1446 if (tex->pt->dyn.img)
1447 {
1448 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1449 SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA)].prog;
1450 }
1451 else
1452 {
1453 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1454 SHADER_TEX_NOMUL, SHADER_TEX)].prog;
1455 }
1456 }
1457 else
1458 {
1459 if (tex->gc->shared->info.bgra)
1460 {
1461 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1462 SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA)].prog;
1463 }
1464 else
1465 {
1466 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1467 SHADER_IMG_NOMUL, SHADER_IMG)].prog;
1468 }
1469 }
1470
1471 pn = _evas_gl_common_context_push(RTYPE_IMAGE,
1472 gc, tex, NULL,
1473 prog,
1474 x, y, w, h,
1475 blend,
1476 smooth,
1477 0, 0, 0, 0, 0);
1478
1479 gc->pipe[pn].region.type = RTYPE_IMAGE;
1480 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
1481 gc->pipe[pn].shader.cur_prog = prog;
1482 gc->pipe[pn].shader.smooth = smooth;
1483 gc->pipe[pn].shader.blend = blend;
1484 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1485 gc->pipe[pn].shader.clip = 0;
1486 gc->pipe[pn].shader.cx = 0;
1487 gc->pipe[pn].shader.cy = 0;
1488 gc->pipe[pn].shader.cw = 0;
1489 gc->pipe[pn].shader.ch = 0;
1490 gc->pipe[pn].array.line = 0;
1491 gc->pipe[pn].array.use_vertex = 1;
1492 // if nomul... dont need this
1493 gc->pipe[pn].array.use_color = 1;
1494 gc->pipe[pn].array.use_texuv = 1;
1495 gc->pipe[pn].array.use_texuv2 = 0;
1496 gc->pipe[pn].array.use_texuv3 = 0;
1497
1498 pipe_region_expand(gc, pn, x, y, w, h);
1499
1500 pnum = gc->pipe[pn].array.num;
1501 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nu2 = pnum * 2;
1502 nt = pnum * 4;
1503 gc->pipe[pn].array.num += 6;
1504 array_alloc(gc, pn);
1505
1506 if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
1507 {
1508 tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
1509 ty1 = 1.0 - ((double)(tex->y) + sy) / (double)tex->pt->h;
1510 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
1511 ty2 = 1.0 - ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
1512 }
1513 else
1514 {
1515 tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
1516 ty1 = ((double)(tex->y) + sy) / (double)tex->pt->h;
1517 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
1518 ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
1519 }
1520
1521 PUSH_VERTEX(pn, x , y , 0);
1522 PUSH_VERTEX(pn, x + w, y , 0);
1523 PUSH_VERTEX(pn, x , y + h, 0);
1524
1525 PUSH_TEXUV(pn, tx1, ty1);
1526 PUSH_TEXUV(pn, tx2, ty1);
1527 PUSH_TEXUV(pn, tx1, ty2);
1528
1529 PUSH_VERTEX(pn, x + w, y , 0);
1530 PUSH_VERTEX(pn, x + w, y + h, 0);
1531 PUSH_VERTEX(pn, x , y + h, 0);
1532
1533 PUSH_TEXUV(pn, tx2, ty1);
1534 PUSH_TEXUV(pn, tx2, ty2);
1535 PUSH_TEXUV(pn, tx1, ty2);
1536
1537 // if nomul... dont need this
1538 for (i = 0; i < 6; i++)
1539 {
1540 PUSH_COLOR(pn, r, g, b, a);
1541 }
1542}
1543
1544void
1545evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
1546 Evas_GL_Texture *tex,
1547 Evas_GL_Texture *texm,
1548 double sx, double sy, double sw, double sh,
1549 double sxm, double sym, double swm,double shm,
1550 int x, int y, int w, int h,
1551 int r, int g, int b, int a,
1552 Eina_Bool smooth)
1553{
1554 int pnum, nv, nc, nu, nm, nt, i;
1555 GLfloat tx1, tx2, ty1, ty2;
1556 GLfloat txm1, txm2, tym1, tym2;
1557 Eina_Bool blend = 1;
1558 GLuint prog = gc->shared->shader[SHADER_IMG_MASK].prog;
1559 int pn = 0;
1560
1561#if 0
1562 if (tex->gc->shared->info.bgra)
1563 {
1564 prog = gc->shared->shader[SHADER_IMG_MASK].prog;
1565 }
1566 else
1567 {
1568#warning Nash: FIXME: Need two shaders?
1569 printf("Not good: Need other texture\n");
1570 prog = gc->shared->shader[SHADER_IMG].prog;
1571 }
1572#endif
1573
1574 pn = _evas_gl_common_context_push(RTYPE_IMASK,
1575 gc, tex, texm,
1576 prog,
1577 x, y, w, h,
1578 blend,
1579 smooth,
1580 0, 0, 0, 0, 0);
1581
1582 gc->pipe[pn].region.type = RTYPE_IMASK;
1583 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
1584 gc->pipe[pn].shader.cur_texm = texm->pt->texture;
1585 gc->pipe[pn].shader.cur_prog = prog;
1586 gc->pipe[pn].shader.smooth = smooth;
1587 gc->pipe[pn].shader.blend = blend;
1588 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1589 gc->pipe[pn].shader.clip = 0;
1590 gc->pipe[pn].shader.cx = 0;
1591 gc->pipe[pn].shader.cy = 0;
1592 gc->pipe[pn].shader.cw = 0;
1593 gc->pipe[pn].shader.ch = 0;
1594 gc->pipe[pn].array.line = 0;
1595 gc->pipe[pn].array.use_vertex = 1;
1596 // if nomul... dont need this
1597 gc->pipe[pn].array.use_color = 1;
1598 gc->pipe[pn].array.use_texuv = 1;
1599 gc->pipe[pn].array.use_texuv2 = 0;
1600 gc->pipe[pn].array.use_texuv3 = 0;
1601 gc->pipe[pn].array.use_texm = 1;
1602
1603 pipe_region_expand(gc, pn, x, y, w, h);
1604
1605 pnum = gc->pipe[pn].array.num;
1606 nv = pnum * 3; nc = pnum * 4; nm = pnum * 2; nu = pnum * 2;
1607 nt = pnum * 4;
1608 gc->pipe[pn].array.num += 6;
1609 array_alloc(gc, pn);
1610
1611 if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
1612 {
1613 tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
1614 ty1 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
1615 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
1616 ty2 = ((double)(tex->y) + sy) / (double)tex->pt->h;
1617
1618 txm1 = ((double)(texm->x) + sxm) / (double)texm->pt->w;
1619 tym1 = ((double)(texm->y) + sym + shm) / (double)texm->pt->h;
1620 txm2 = ((double)(texm->x) + sxm + swm) / (double)texm->pt->w;
1621 tym2 = ((double)(texm->y) + sym) / (double)texm->pt->h;
1622 }
1623 else
1624 {
1625 tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
1626 ty1 = ((double)(tex->y) + sy) / (double)tex->pt->h;
1627 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
1628 ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
1629
1630 txm1 = (texm->x + sxm) / (double)texm->pt->w;
1631 tym1 = (texm->y + sym) / (double)texm->pt->h;
1632 txm2 = (texm->x + sxm + swm) / (double)texm->pt->w;
1633 tym2 = (texm->y + sym + shm) / (double)texm->pt->h;
1634 }
1635 // printf(" %3.6lf %3.6lf %3.6lf %3.6lf\n",sx,sy,sw,sh);
1636 // printf("m%3.6lf %3.6lf %3.6lf %3.6lf\n",sxm,sym,swm,shm);
1637 // printf(" %3f %3f %3f %3f\n",tx1,ty1,tx2,ty2);
1638 // printf("m%3f %3f %3f %3f\n",txm1,tym1,txm2,tym2);
1639
1640 PUSH_VERTEX(pn, x , y , 0);
1641 PUSH_VERTEX(pn, x + w, y , 0);
1642 PUSH_VERTEX(pn, x , y + h, 0);
1643
1644 PUSH_TEXUV(pn, tx1, ty1);
1645 PUSH_TEXUV(pn, tx2, ty1);
1646 PUSH_TEXUV(pn, tx1, ty2);
1647
1648 PUSH_TEXM(pn, txm1, tym1);
1649 PUSH_TEXM(pn, txm2, tym1);
1650 PUSH_TEXM(pn, txm1, tym2);
1651
1652 PUSH_VERTEX(pn, x + w, y , 0);
1653 PUSH_VERTEX(pn, x + w, y + h, 0);
1654 PUSH_VERTEX(pn, x , y + h, 0);
1655
1656 PUSH_TEXUV(pn, tx2, ty1);
1657 PUSH_TEXUV(pn, tx2, ty2);
1658 PUSH_TEXUV(pn, tx1, ty2);
1659
1660 PUSH_TEXM(pn, txm2, tym1);
1661 PUSH_TEXM(pn, txm2, tym2);
1662 PUSH_TEXM(pn, txm1, tym2);
1663
1664 // if nomul... dont need this
1665 for (i = 0; i < 6; i++)
1666 {
1667 PUSH_COLOR(pn, r, g, b, a);
1668 }
1669}
1670
1671
1672void
1673evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
1674 Evas_GL_Texture *tex,
1675 double sx, double sy, double sw, double sh,
1676 int x, int y, int w, int h,
1677 int r, int g, int b, int a)
1678{
1679 int pnum, nv, nc, nu, nt, i;
1680 GLfloat tx1, tx2, ty1, ty2;
1681 GLuint prog = gc->shared->shader[SHADER_FONT].prog;
1682 int pn = 0;
1683
1684 pn = _evas_gl_common_context_push(RTYPE_FONT,
1685 gc, tex, NULL,
1686 prog,
1687 x, y, w, h,
1688 1,
1689 0,
1690 0, 0, 0, 0, 0);
1691
1692 gc->pipe[pn].region.type = RTYPE_FONT;
1693 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
1694 gc->pipe[pn].shader.cur_prog = prog;
1695 gc->pipe[pn].shader.smooth = 0;
1696 gc->pipe[pn].shader.blend = 1;
1697 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1698 gc->pipe[pn].shader.clip = 0;
1699 gc->pipe[pn].shader.cx = 0;
1700 gc->pipe[pn].shader.cy = 0;
1701 gc->pipe[pn].shader.cw = 0;
1702 gc->pipe[pn].shader.ch = 0;
1703 gc->pipe[pn].array.line = 0;
1704 gc->pipe[pn].array.use_vertex = 1;
1705 gc->pipe[pn].array.use_color = 1;
1706 gc->pipe[pn].array.use_texuv = 1;
1707 gc->pipe[pn].array.use_texuv2 = 0;
1708 gc->pipe[pn].array.use_texuv3 = 0;
1709
1710 pipe_region_expand(gc, pn, x, y, w, h);
1711
1712 pnum = gc->pipe[pn].array.num;
1713 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nt = pnum * 4;
1714 gc->pipe[pn].array.num += 6;
1715 array_alloc(gc, pn);
1716
1717 if (sw == 0.0)
1718 {
1719 tx1 = tex->sx1;
1720 ty1 = tex->sy1;
1721 tx2 = tex->sx2;
1722 ty2 = tex->sy2;
1723 }
1724 else
1725 {
1726 tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
1727 ty1 = ((double)(tex->y) + sy) / (double)tex->pt->h;
1728 tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
1729 ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
1730 }
1731
1732 PUSH_VERTEX(pn, x , y , 0);
1733 PUSH_VERTEX(pn, x + w, y , 0);
1734 PUSH_VERTEX(pn, x , y + h, 0);
1735
1736 PUSH_TEXUV(pn, tx1, ty1);
1737 PUSH_TEXUV(pn, tx2, ty1);
1738 PUSH_TEXUV(pn, tx1, ty2);
1739
1740 PUSH_VERTEX(pn, x + w, y , 0);
1741 PUSH_VERTEX(pn, x + w, y + h, 0);
1742 PUSH_VERTEX(pn, x , y + h, 0);
1743
1744 PUSH_TEXUV(pn, tx2, ty1);
1745 PUSH_TEXUV(pn, tx2, ty2);
1746 PUSH_TEXUV(pn, tx1, ty2);
1747
1748 for (i = 0; i < 6; i++)
1749 {
1750 PUSH_COLOR(pn, r, g, b, a);
1751 }
1752}
1753
1754void
1755evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
1756 Evas_GL_Texture *tex,
1757 double sx, double sy, double sw, double sh,
1758 int x, int y, int w, int h,
1759 int r, int g, int b, int a,
1760 Eina_Bool smooth)
1761{
1762 int pnum, nv, nc, nu, nu2, nu3, nt, i;
1763 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
1764 Eina_Bool blend = 0;
1765 GLuint prog;
1766 int pn = 0;
1767
1768 if (a < 255) blend = 1;
1769
1770 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1771 SHADER_YUV_NOMUL, SHADER_YUV)].prog;
1772
1773 pn = _evas_gl_common_context_push(RTYPE_YUV,
1774 gc, tex, NULL,
1775 prog,
1776 x, y, w, h,
1777 blend,
1778 smooth,
1779 0, 0, 0, 0, 0);
1780
1781 gc->pipe[pn].region.type = RTYPE_YUV;
1782 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
1783 gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
1784 gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
1785 gc->pipe[pn].shader.cur_prog = prog;
1786 gc->pipe[pn].shader.smooth = smooth;
1787 gc->pipe[pn].shader.blend = blend;
1788 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1789 gc->pipe[pn].shader.clip = 0;
1790 gc->pipe[pn].shader.cx = 0;
1791 gc->pipe[pn].shader.cy = 0;
1792 gc->pipe[pn].shader.cw = 0;
1793 gc->pipe[pn].shader.ch = 0;
1794 gc->pipe[pn].array.line = 0;
1795 gc->pipe[pn].array.use_vertex = 1;
1796 gc->pipe[pn].array.use_color = 1;
1797 gc->pipe[pn].array.use_texuv = 1;
1798 gc->pipe[pn].array.use_texuv2 = 1;
1799 gc->pipe[pn].array.use_texuv3 = 1;
1800
1801 pipe_region_expand(gc, pn, x, y, w, h);
1802
1803 pnum = gc->pipe[pn].array.num;
1804 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2;
1805 nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
1806 gc->pipe[pn].array.num += 6;
1807 array_alloc(gc, pn);
1808
1809 tx1 = (sx) / (double)tex->pt->w;
1810 ty1 = (sy) / (double)tex->pt->h;
1811 tx2 = (sx + sw) / (double)tex->pt->w;
1812 ty2 = (sy + sh) / (double)tex->pt->h;
1813
1814 t2x1 = ((sx) / 2) / (double)tex->ptu->w;
1815 t2y1 = ((sy) / 2) / (double)tex->ptu->h;
1816 t2x2 = ((sx + sw) / 2) / (double)tex->ptu->w;
1817 t2y2 = ((sy + sh) / 2) / (double)tex->ptu->h;
1818
1819 PUSH_VERTEX(pn, x , y , 0);
1820 PUSH_VERTEX(pn, x + w, y , 0);
1821 PUSH_VERTEX(pn, x , y + h, 0);
1822
1823 PUSH_TEXUV(pn, tx1, ty1);
1824 PUSH_TEXUV(pn, tx2, ty1);
1825 PUSH_TEXUV(pn, tx1, ty2);
1826
1827 PUSH_TEXUV2(pn, t2x1, t2y1);
1828 PUSH_TEXUV2(pn, t2x2, t2y1);
1829 PUSH_TEXUV2(pn, t2x1, t2y2);
1830
1831 PUSH_TEXUV3(pn, t2x1, t2y1);
1832 PUSH_TEXUV3(pn, t2x2, t2y1);
1833 PUSH_TEXUV3(pn, t2x1, t2y2);
1834
1835 PUSH_VERTEX(pn, x + w, y , 0);
1836 PUSH_VERTEX(pn, x + w, y + h, 0);
1837 PUSH_VERTEX(pn, x , y + h, 0);
1838
1839 PUSH_TEXUV(pn, tx2, ty1);
1840 PUSH_TEXUV(pn, tx2, ty2);
1841 PUSH_TEXUV(pn, tx1, ty2);
1842
1843 PUSH_TEXUV2(pn, t2x2, t2y1);
1844 PUSH_TEXUV2(pn, t2x2, t2y2);
1845 PUSH_TEXUV2(pn, t2x1, t2y2);
1846
1847 PUSH_TEXUV3(pn, t2x2, t2y1);
1848 PUSH_TEXUV3(pn, t2x2, t2y2);
1849 PUSH_TEXUV3(pn, t2x1, t2y2);
1850
1851 for (i = 0; i < 6; i++)
1852 {
1853 PUSH_COLOR(pn, r, g, b, a);
1854 }
1855}
1856
1857void
1858evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
1859 Evas_GL_Texture *tex,
1860 double sx, double sy, double sw, double sh,
1861 int x, int y, int w, int h,
1862 int r, int g, int b, int a,
1863 Eina_Bool smooth)
1864{
1865 int pnum, nv, nc, nu, nu2, nu3, nt, i;
1866 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
1867 Eina_Bool blend = 0;
1868 GLuint prog;
1869 int pn = 0;
1870
1871 if (a < 255) blend = 1;
1872
1873 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1874 SHADER_YUY2_NOMUL, SHADER_YUY2)].prog;
1875
1876 pn = _evas_gl_common_context_push(RTYPE_YUY2,
1877 gc, tex, NULL,
1878 prog,
1879 x, y, w, h,
1880 blend,
1881 smooth,
1882 0, 0, 0, 0, 0);
1883
1884 gc->pipe[pn].region.type = RTYPE_YUY2;
1885 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
1886 gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
1887 gc->pipe[pn].shader.cur_prog = prog;
1888 gc->pipe[pn].shader.smooth = smooth;
1889 gc->pipe[pn].shader.blend = blend;
1890 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1891 gc->pipe[pn].shader.clip = 0;
1892 gc->pipe[pn].shader.cx = 0;
1893 gc->pipe[pn].shader.cy = 0;
1894 gc->pipe[pn].shader.cw = 0;
1895 gc->pipe[pn].shader.ch = 0;
1896 gc->pipe[pn].array.line = 0;
1897 gc->pipe[pn].array.use_vertex = 1;
1898 gc->pipe[pn].array.use_color = 1;
1899 gc->pipe[pn].array.use_texuv = 1;
1900 gc->pipe[pn].array.use_texuv2 = 1;
1901 gc->pipe[pn].array.use_texuv3 = 0;
1902
1903 pipe_region_expand(gc, pn, x, y, w, h);
1904
1905 pnum = gc->pipe[pn].array.num;
1906 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2;
1907 nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
1908 gc->pipe[pn].array.num += 6;
1909 array_alloc(gc, pn);
1910
1911 tx1 = (sx) / (double)tex->pt->w;
1912 ty1 = (sy) / (double)tex->pt->h;
1913 tx2 = (sx + sw) / (double)tex->pt->w;
1914 ty2 = (sy + sh) / (double)tex->pt->h;
1915
1916 t2x1 = sx / (double)tex->ptuv->w;
1917 t2y1 = sy / (double)tex->ptuv->h;
1918 t2x2 = (sx + sw) / (double)tex->ptuv->w;
1919 t2y2 = (sy + sh) / (double)tex->ptuv->h;
1920
1921 PUSH_VERTEX(pn, x , y , 0);
1922 PUSH_VERTEX(pn, x + w, y , 0);
1923 PUSH_VERTEX(pn, x , y + h, 0);
1924
1925 PUSH_TEXUV(pn, tx1, ty1);
1926 PUSH_TEXUV(pn, tx2, ty1);
1927 PUSH_TEXUV(pn, tx1, ty2);
1928
1929 PUSH_TEXUV2(pn, t2x1, t2y1);
1930 PUSH_TEXUV2(pn, t2x2, t2y1);
1931 PUSH_TEXUV2(pn, t2x1, t2y2);
1932
1933 PUSH_VERTEX(pn, x + w, y , 0);
1934 PUSH_VERTEX(pn, x + w, y + h, 0);
1935 PUSH_VERTEX(pn, x , y + h, 0);
1936
1937 PUSH_TEXUV(pn, tx2, ty1);
1938 PUSH_TEXUV(pn, tx2, ty2);
1939 PUSH_TEXUV(pn, tx1, ty2);
1940
1941 PUSH_TEXUV2(pn, t2x2, t2y1);
1942 PUSH_TEXUV2(pn, t2x2, t2y2);
1943 PUSH_TEXUV2(pn, t2x1, t2y2);
1944
1945 for (i = 0; i < 6; i++)
1946 {
1947 PUSH_COLOR(pn, r, g, b, a);
1948 }
1949}
1950
1951void
1952evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
1953 Evas_GL_Texture *tex,
1954 double sx, double sy, double sw, double sh,
1955 int x, int y, int w, int h,
1956 int r, int g, int b, int a,
1957 Eina_Bool smooth)
1958{
1959 int pnum, nv, nc, nu, nu2, nu3, nt, i;
1960 GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2;
1961 Eina_Bool blend = 0;
1962 GLuint prog;
1963 int pn = 0;
1964
1965 if (a < 255) blend = 1;
1966
1967 prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a,
1968 SHADER_NV12_NOMUL, SHADER_NV12)].prog;
1969
1970 pn = _evas_gl_common_context_push(RTYPE_NV12,
1971 gc, tex, NULL,
1972 prog,
1973 x, y, w, h,
1974 blend,
1975 smooth,
1976 0, 0, 0, 0, 0);
1977
1978 gc->pipe[pn].region.type = RTYPE_NV12;
1979 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
1980 gc->pipe[pn].shader.cur_tex_dyn = tex->pt->dyn.img;
1981 gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
1982 gc->pipe[pn].shader.cur_texu_dyn = tex->ptuv->dyn.img;
1983 gc->pipe[pn].shader.cur_prog = prog;
1984 gc->pipe[pn].shader.smooth = smooth;
1985 gc->pipe[pn].shader.blend = blend;
1986 gc->pipe[pn].shader.render_op = gc->dc->render_op;
1987 gc->pipe[pn].shader.clip = 0;
1988 gc->pipe[pn].shader.cx = 0;
1989 gc->pipe[pn].shader.cy = 0;
1990 gc->pipe[pn].shader.cw = 0;
1991 gc->pipe[pn].shader.ch = 0;
1992 gc->pipe[pn].array.line = 0;
1993 gc->pipe[pn].array.use_vertex = 1;
1994 gc->pipe[pn].array.use_color = 1;
1995 gc->pipe[pn].array.use_texuv = 1;
1996 gc->pipe[pn].array.use_texuv2 = 1;
1997 gc->pipe[pn].array.use_texuv3 = 0;
1998
1999 pipe_region_expand(gc, pn, x, y, w, h);
2000
2001 pnum = gc->pipe[pn].array.num;
2002 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2;
2003 nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
2004 gc->pipe[pn].array.num += 6;
2005 array_alloc(gc, pn);
2006
2007 tx1 = (sx) / (double)tex->pt->w;
2008 ty1 = (sy) / (double)tex->pt->h;
2009 tx2 = (sx + sw) / (double)tex->pt->w;
2010 ty2 = (sy + sh) / (double)tex->pt->h;
2011
2012 t2x1 = sx / (double)tex->ptuv->w;
2013 t2y1 = sy / (double)tex->ptuv->h;
2014 t2x2 = (sx + sw) / (double)tex->ptuv->w;
2015 t2y2 = (sy + sh) / (double)tex->ptuv->h;
2016
2017 PUSH_VERTEX(pn, x , y , 0);
2018 PUSH_VERTEX(pn, x + w, y , 0);
2019 PUSH_VERTEX(pn, x , y + h, 0);
2020
2021 PUSH_TEXUV(pn, tx1, ty1);
2022 PUSH_TEXUV(pn, tx2, ty1);
2023 PUSH_TEXUV(pn, tx1, ty2);
2024
2025 PUSH_TEXUV2(pn, t2x1, t2y1);
2026 PUSH_TEXUV2(pn, t2x2, t2y1);
2027 PUSH_TEXUV2(pn, t2x1, t2y2);
2028
2029 PUSH_VERTEX(pn, x + w, y , 0);
2030 PUSH_VERTEX(pn, x + w, y + h, 0);
2031 PUSH_VERTEX(pn, x , y + h, 0);
2032
2033 PUSH_TEXUV(pn, tx2, ty1);
2034 PUSH_TEXUV(pn, tx2, ty2);
2035 PUSH_TEXUV(pn, tx1, ty2);
2036
2037 PUSH_TEXUV2(pn, t2x2, t2y1);
2038 PUSH_TEXUV2(pn, t2x2, t2y2);
2039 PUSH_TEXUV2(pn, t2x1, t2y2);
2040
2041 for (i = 0; i < 6; i++)
2042 {
2043 PUSH_COLOR(pn, r, g, b, a);
2044 }
2045}
2046
2047void
2048evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
2049 Evas_GL_Texture *tex,
2050 int npoints,
2051 RGBA_Map_Point *p,
2052 int clip, int cx, int cy, int cw, int ch,
2053 int r, int g, int b, int a,
2054 Eina_Bool smooth, Eina_Bool tex_only,
2055 Evas_Colorspace cspace)
2056{
2057 int pnum, nv, nc, nu, nu2, nu3, nt, i;
2058 const int points[6] = { 0, 1, 2, 0, 2, 3 };
2059 int x = 0, y = 0, w = 0, h = 0, px = 0, py = 0;
2060 GLfloat tx[4], ty[4], t2x[4], t2y[4];
2061 Eina_Bool blend = 1;
2062 DATA32 cmul;
2063 GLuint prog = gc->shared->shader[SHADER_IMG].prog;
2064 Eina_Bool utexture = EINA_FALSE;
2065 Eina_Bool uvtexture = EINA_FALSE;
2066 int pn = 0;
2067 int flat = 0;
2068
2069 if (!tex->alpha) blend = 0;
2070 if (a < 255) blend = 1;
2071 if (npoints != 4)
2072 {
2073 // FIXME: nash - you didn't fix this for n points. its still all
2074 // 4 point stuff!!! grrrr.
2075 abort();
2076 }
2077 if ((A_VAL(&(p[0].col)) < 0xff) || (A_VAL(&(p[1].col)) < 0xff) ||
2078 (A_VAL(&(p[2].col)) < 0xff) || (A_VAL(&(p[3].col)) < 0xff))
2079 blend = 1;
2080
2081 if ((p[0].z == p[1].z) && (p[1].z == p[2].z) && (p[2].z == p[3].z))
2082 flat = 1;
2083
2084 if (!clip) cx = cy = cw = ch = 0;
2085
2086 if (!flat)
2087 {
2088 if (p[0].foc <= 0) flat = 1;
2089 }
2090
2091 switch (cspace)
2092 {
2093 case EVAS_COLORSPACE_YCBCR422P601_PL:
2094 case EVAS_COLORSPACE_YCBCR422P709_PL:
2095 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2096 SHADER_YUV_NOMUL, SHADER_YUV)].prog;
2097 utexture = EINA_TRUE;
2098 break;
2099 case EVAS_COLORSPACE_YCBCR422601_PL:
2100 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2101 SHADER_YUY2_NOMUL, SHADER_YUY2)].prog;
2102 uvtexture = EINA_TRUE;
2103 break;
2104 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
2105 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
2106 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2107 SHADER_NV12_NOMUL, SHADER_NV12)].prog;
2108 uvtexture = EINA_TRUE;
2109 break;
2110
2111 default:
2112 if (tex_only)
2113 {
2114 if (tex->pt->dyn.img)
2115 {
2116 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2117 SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA)].prog;
2118 }
2119 else
2120 {
2121 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2122 SHADER_TEX_NOMUL, SHADER_TEX)].prog;
2123 }
2124 }
2125 else
2126 {
2127 if (tex->gc->shared->info.bgra)
2128 {
2129 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2130 SHADER_IMG_BGRA_NOMUL,
2131 SHADER_IMG_BGRA)].prog;
2132 }
2133 else
2134 {
2135 prog = gc->shared->shader[evas_gl_common_shader_choice(npoints, p, r, g, b, a,
2136 SHADER_IMG_NOMUL,
2137 SHADER_IMG)].prog;
2138 }
2139 }
2140 }
2141
2142 x = w = (p[0].x >> FP);
2143 y = h = (p[0].y >> FP);
2144 for (i = 0; i < 4; i++)
2145 {
2146 tx[i] = ((double)(tex->x) + (((double)p[i].u) / FP1)) /
2147 (double)tex->pt->w;
2148 ty[i] = ((double)(tex->y) + (((double)p[i].v) / FP1)) /
2149 (double)tex->pt->h;
2150 px = (p[i].x >> FP);
2151 if (px < x) x = px;
2152 else if (px > w) w = px;
2153 py = (p[i].y >> FP);
2154 if (py < y) y = py;
2155 else if (py > h) h = py;
2156 if (utexture)
2157 {
2158 t2x[i] = ((((double)p[i].u / 2) / FP1)) / (double)tex->ptu->w;
2159 t2y[i] = ((((double)p[i].v / 2) / FP1)) / (double)tex->ptu->h;
2160 }
2161 else if (uvtexture)
2162 {
2163 t2x[i] = ((((double)p[i].u / 2) / FP1)) / (double)tex->ptuv->w;
2164 t2y[i] = ((((double)p[i].v / 2) / FP1)) / (double)tex->ptuv->h;
2165 }
2166 }
2167 w = w - x;
2168 h = h - y;
2169
2170 if (clip)
2171 {
2172 int nx = x, ny = y, nw = w, nh = h;
2173
2174 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, cx, cy, cw, ch);
2175 if ((nx == x) && (ny == y) && (nw == w) && (nh == h))
2176 {
2177 clip = 0; cx = 0; cy = 0; cw = 0; ch = 0;
2178 }
2179 x = nx; y = nw; w = nw; h = nh;
2180 }
2181
2182 if (!flat)
2183 {
2184 shader_array_flush(gc);
2185 gc->foc = p[0].foc >> FP;
2186 gc->z0 = p[0].z0 >> FP;
2187 gc->px = p[0].px >> FP;
2188 gc->py = p[0].py >> FP;
2189 gc->change.size = 1;
2190 _evas_gl_common_viewport_set(gc);
2191 }
2192
2193 pn = _evas_gl_common_context_push(RTYPE_MAP,
2194 gc, tex, NULL,
2195 prog,
2196 x, y, w, h,
2197 blend,
2198 smooth,
2199 clip, cx, cy, cw, ch);
2200 gc->pipe[pn].region.type = RTYPE_MAP;
2201 gc->pipe[pn].shader.cur_tex = tex->pt->texture;
2202 if (utexture)
2203 {
2204 gc->pipe[pn].shader.cur_texu = tex->ptu->texture;
2205 gc->pipe[pn].shader.cur_texu_dyn = tex->ptu->dyn.img;
2206 gc->pipe[pn].shader.cur_texv = tex->ptv->texture;
2207 gc->pipe[pn].shader.cur_texv_dyn = tex->ptv->dyn.img;
2208 }
2209 else if (uvtexture)
2210 {
2211 gc->pipe[pn].shader.cur_texu = tex->ptuv->texture;
2212 gc->pipe[pn].shader.cur_texu_dyn = tex->ptuv->dyn.img;
2213 }
2214 gc->pipe[pn].shader.cur_prog = prog;
2215 gc->pipe[pn].shader.smooth = smooth;
2216 gc->pipe[pn].shader.blend = blend;
2217 gc->pipe[pn].shader.render_op = gc->dc->render_op;
2218 gc->pipe[pn].shader.clip = clip;
2219 gc->pipe[pn].shader.cx = cx;
2220 gc->pipe[pn].shader.cy = cy;
2221 gc->pipe[pn].shader.cw = cw;
2222 gc->pipe[pn].shader.ch = ch;
2223 gc->pipe[pn].array.line = 0;
2224 gc->pipe[pn].array.use_vertex = 1;
2225 gc->pipe[pn].array.use_color = 1;
2226 gc->pipe[pn].array.use_texuv = 1;
2227 gc->pipe[pn].array.use_texuv2 = (utexture || uvtexture) ? 1 : 0;
2228 gc->pipe[pn].array.use_texuv3 = (utexture) ? 1 : 0;
2229
2230 pipe_region_expand(gc, pn, x, y, w, h);
2231
2232 pnum = gc->pipe[pn].array.num;
2233 nv = pnum * 3; nc = pnum * 4; nu = pnum * 2; nu2 = pnum * 2;
2234 nu2 = pnum * 2; nu3 = pnum * 2; nt = pnum * 4;
2235 gc->pipe[pn].array.num += 6;
2236 array_alloc(gc, pn);
2237
2238 if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
2239 {
2240 for (i = 0; i < 4; i++)
2241 {
2242 ty[i] = 1.0 - ty[i];
2243 if (utexture || uvtexture)
2244 t2y[i] = 1.0 - t2y[i];
2245 }
2246 }
2247
2248 cmul = ARGB_JOIN(a, r, g, b);
2249 for (i = 0; i < 6; i++)
2250 {
2251 DATA32 cl = MUL4_SYM(cmul, p[points[i]].col);
2252 if (flat)
2253 {
2254 PUSH_VERTEX(pn,
2255 (p[points[i]].x >> FP),
2256 (p[points[i]].y >> FP),
2257 0);
2258 }
2259 else
2260 {
2261 PUSH_VERTEX(pn,
2262 (p[points[i]].fx) + gc->shared->ax,
2263 (p[points[i]].fy) + gc->shared->ay,
2264 (p[points[i]].fz)
2265 + (gc->shared->foc - gc->shared->z0));
2266 }
2267 PUSH_TEXUV(pn,
2268 tx[points[i]],
2269 ty[points[i]]);
2270 if (utexture)
2271 {
2272 PUSH_TEXUV2(pn,
2273 t2x[points[i]],
2274 t2y[points[i]]);
2275 PUSH_TEXUV3(pn,
2276 t2x[points[i]],
2277 t2y[points[i]]);
2278 }
2279 else if (uvtexture)
2280 {
2281 PUSH_TEXUV2(pn,
2282 t2x[points[i]],
2283 t2y[points[i]]);
2284 }
2285
2286 PUSH_COLOR(pn,
2287 R_VAL(&cl),
2288 G_VAL(&cl),
2289 B_VAL(&cl),
2290 A_VAL(&cl));
2291 }
2292 if (!flat)
2293 {
2294 shader_array_flush(gc);
2295 gc->foc = 0;
2296 gc->z0 = 0;
2297 gc->px = 0;
2298 gc->py = 0;
2299 gc->change.size = 1;
2300 _evas_gl_common_viewport_set(gc);
2301 }
2302}
2303
2304void
2305evas_gl_common_context_flush(Evas_Engine_GL_Context *gc)
2306{
2307 shader_array_flush(gc);
2308}
2309
2310static void
2311scissor_rot(Evas_Engine_GL_Context *gc __UNUSED__,
2312 int rot, int gw, int gh, int cx, int cy, int cw, int ch)
2313{
2314 switch (rot)
2315 {
2316 case 0: // UP this way: ^
2317 glScissor(cx, cy, cw, ch);
2318 break;
2319 case 90: // UP this way: <
2320 glScissor(gh - (cy + ch), cx, ch, cw);
2321 break;
2322 case 180: // UP this way: v
2323 glScissor(gw - (cx + cw), gh - (cy + ch), cw, ch);
2324 break;
2325 case 270: // UP this way: >
2326 glScissor(cy, gw - (cx + cw), ch, cw);
2327 break;
2328 default: // assume up is up
2329 glScissor(cx, cy, cw, ch);
2330 break;
2331 }
2332}
2333
2334static void
2335shader_array_flush(Evas_Engine_GL_Context *gc)
2336{
2337 int i, gw, gh, setclip, cy, fbo = 0, done = 0;
2338
2339 if (!gc->havestuff) return;
2340 gw = gc->w;
2341 gh = gc->h;
2342 if (!((gc->pipe[0].shader.surface == gc->def_surface) ||
2343 (!gc->pipe[0].shader.surface)))
2344 {
2345 gw = gc->pipe[0].shader.surface->w;
2346 gh = gc->pipe[0].shader.surface->h;
2347 fbo = 1;
2348 }
2349 for (i = 0; i < gc->shared->info.tune.pipes.max; i++)
2350 {
2351 if (gc->pipe[i].array.num <= 0) break;
2352 setclip = 0;
2353 done++;
2354 gc->flushnum++;
2355 GLERR(__FUNCTION__, __FILE__, __LINE__, "<flush err>");
2356 if (gc->pipe[i].shader.cur_prog != gc->state.current.cur_prog)
2357 {
2358 glUseProgram(gc->pipe[i].shader.cur_prog);
2359 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2360 }
2361
2362 if (gc->pipe[i].shader.cur_tex != gc->state.current.cur_tex)
2363 {
2364#if 0
2365 if (gc->pipe[i].shader.cur_tex)
2366 {
2367 glEnable(GL_TEXTURE_2D);
2368 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2369 }
2370 else
2371 {
2372 glDisable(GL_TEXTURE_2D);
2373 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2374 }
2375#endif
2376 glActiveTexture(GL_TEXTURE0);
2377 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2378 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_tex);
2379 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2380 }
2381 if (gc->pipe[i].array.im)
2382 {
2383#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
2384 if (gc->pipe[i].array.im->tex->pt->dyn.img)
2385 {
2386 secsym_glEGLImageTargetTexture2DOES
2387 (GL_TEXTURE_2D, gc->pipe[i].array.im->tex->pt->dyn.img);
2388 }
2389 else
2390#endif
2391 {
2392 if (!gc->pipe[i].array.im->native.loose)
2393 {
2394 if (gc->pipe[i].array.im->native.func.bind)
2395 gc->pipe[i].array.im->native.func.bind(gc->pipe[i].array.im->native.func.data,
2396 gc->pipe[i].array.im);
2397 }
2398 }
2399 }
2400 if (gc->pipe[i].shader.render_op != gc->state.current.render_op)
2401 {
2402 switch (gc->pipe[i].shader.render_op)
2403 {
2404 case EVAS_RENDER_BLEND: /**< default op: d = d*(1-sa) + s */
2405 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
2406 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2407 break;
2408 case EVAS_RENDER_COPY: /**< d = s */
2409 gc->pipe[i].shader.blend = 0;
2410 glBlendFunc(GL_ONE, GL_ONE);
2411 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2412 break;
2413 // FIXME: fix blend funcs below!
2414 case EVAS_RENDER_BLEND_REL: /**< d = d*(1 - sa) + s*da */
2415 case EVAS_RENDER_COPY_REL: /**< d = s*da */
2416 case EVAS_RENDER_ADD: /**< d = d + s */
2417 case EVAS_RENDER_ADD_REL: /**< d = d + s*da */
2418 case EVAS_RENDER_SUB: /**< d = d - s */
2419 case EVAS_RENDER_SUB_REL: /**< d = d - s*da */
2420 case EVAS_RENDER_TINT: /**< d = d*s + d*(1 - sa) + s*(1 - da) */
2421 case EVAS_RENDER_TINT_REL: /**< d = d*(1 - sa + s) */
2422 case EVAS_RENDER_MASK: /**< d = d*sa */
2423 case EVAS_RENDER_MUL: /**< d = d*s */
2424 default:
2425 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
2426 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2427 break;
2428 }
2429 }
2430 if (gc->pipe[i].shader.blend != gc->state.current.blend)
2431 {
2432 if (gc->pipe[i].shader.blend)
2433 {
2434 glEnable(GL_BLEND);
2435 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2436 }
2437 else
2438 {
2439 glDisable(GL_BLEND);
2440 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2441 }
2442 }
2443 if ((gc->pipe[i].shader.smooth != gc->state.current.smooth) ||
2444 (gc->pipe[i].shader.cur_tex != gc->state.current.cur_tex))
2445 {
2446 if (gc->pipe[i].shader.smooth)
2447 {
2448#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
2449 if (shared->info.anisotropic > 0.0)
2450 {
2451 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, shared->info.anisotropic);
2452 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2453 }
2454#endif
2455 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
2456 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2457 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
2458 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2459 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
2460 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2461 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
2462 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2463 }
2464 else
2465 {
2466#ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
2467 if (shared->info.anisotropic > 0.0)
2468 {
2469 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0);
2470 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2471 }
2472#endif
2473 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
2474 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2475 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
2476 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2477 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
2478 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2479 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
2480 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2481 }
2482 }
2483 if (gc->pipe[i].shader.clip != gc->state.current.clip)
2484 {
2485
2486 if (gc->pipe[i].shader.clip)
2487 {
2488 cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch;
2489 if (fbo) cy = gc->pipe[i].shader.cy;
2490 glEnable(GL_SCISSOR_TEST);
2491 if (!fbo)
2492 scissor_rot(gc, gc->rot, gw, gh,
2493 gc->pipe[i].shader.cx,
2494 cy,
2495 gc->pipe[i].shader.cw,
2496 gc->pipe[i].shader.ch);
2497 else
2498 glScissor(gc->pipe[i].shader.cx, cy,
2499 gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
2500 setclip = 1;
2501 }
2502 else
2503 {
2504 glDisable(GL_SCISSOR_TEST);
2505 glScissor(0, 0, 0, 0);
2506 }
2507 }
2508 if ((gc->pipe[i].shader.clip) && (!setclip))
2509 {
2510 if ((gc->pipe[i].shader.cx != gc->state.current.cx) ||
2511 (gc->pipe[i].shader.cy != gc->state.current.cy) ||
2512 (gc->pipe[i].shader.cw != gc->state.current.cw) ||
2513 (gc->pipe[i].shader.ch != gc->state.current.ch))
2514 {
2515 cy = gh - gc->pipe[i].shader.cy - gc->pipe[i].shader.ch;
2516 if (fbo) cy = gc->pipe[i].shader.cy;
2517 if (!fbo)
2518 scissor_rot(gc, gc->rot, gw, gh,
2519 gc->pipe[i].shader.cx,
2520 cy,
2521 gc->pipe[i].shader.cw,
2522 gc->pipe[i].shader.ch);
2523 else
2524 glScissor(gc->pipe[i].shader.cx, cy,
2525 gc->pipe[i].shader.cw, gc->pipe[i].shader.ch);
2526 }
2527 }
2528
2529 glVertexAttribPointer(SHAD_VERTEX, 3, GL_SHORT, GL_FALSE, 0, gc->pipe[i].array.vertex);
2530 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2531 glVertexAttribPointer(SHAD_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, gc->pipe[i].array.color);
2532 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2533 if (gc->pipe[i].array.use_texuv)
2534 {
2535 glEnableVertexAttribArray(SHAD_TEXUV);
2536 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2537 glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv);
2538 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2539 }
2540 else
2541 {
2542 glDisableVertexAttribArray(SHAD_TEXUV);
2543 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2544 }
2545
2546 if (gc->pipe[i].array.line)
2547 {
2548 glDisableVertexAttribArray(SHAD_TEXUV);
2549 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2550 glDisableVertexAttribArray(SHAD_TEXUV2);
2551 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2552 glDisableVertexAttribArray(SHAD_TEXUV3);
2553 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2554 glDrawArrays(GL_LINES, 0, gc->pipe[i].array.num);
2555 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2556 }
2557 else
2558 {
2559 if (gc->pipe[i].array.use_texm)
2560 {
2561 glEnableVertexAttribArray(SHAD_TEXM);
2562 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2563 glVertexAttribPointer(SHAD_TEXM, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texm);
2564 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2565 glActiveTexture(GL_TEXTURE1);
2566 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2567 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texm);
2568 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2569 glActiveTexture(GL_TEXTURE0);
2570 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2571 }
2572 else
2573 {
2574 glDisableVertexAttribArray(SHAD_TEXM);
2575 }
2576 if ((gc->pipe[i].array.use_texuv2) && (gc->pipe[i].array.use_texuv3))
2577 {
2578 glEnableVertexAttribArray(SHAD_TEXUV2);
2579 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2580 glEnableVertexAttribArray(SHAD_TEXUV3);
2581 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2582 glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
2583 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2584 glVertexAttribPointer(SHAD_TEXUV3, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv3);
2585 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2586
2587 glActiveTexture(GL_TEXTURE1);
2588 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2589 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
2590 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2591#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
2592 if (gc->pipe[i].shader.cur_texu_dyn)
2593 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
2594#endif
2595
2596 glActiveTexture(GL_TEXTURE2);
2597 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2598 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv);
2599 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2600#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
2601 if (gc->pipe[i].shader.cur_texv_dyn)
2602 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texv_dyn);
2603#endif
2604 glActiveTexture(GL_TEXTURE0);
2605 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2606 }
2607 else if (gc->pipe[i].array.use_texuv2)
2608 {
2609 glEnableVertexAttribArray(SHAD_TEXUV2);
2610 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2611 glVertexAttribPointer(SHAD_TEXUV2, 2, GL_FLOAT, GL_FALSE, 0, gc->pipe[i].array.texuv2);
2612 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2613
2614 glActiveTexture(GL_TEXTURE1);
2615 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2616 glBindTexture(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu);
2617 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2618#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
2619 if (gc->pipe[i].shader.cur_texu_dyn)
2620 secsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, gc->pipe[i].shader.cur_texu_dyn);
2621#endif
2622 glActiveTexture(GL_TEXTURE0);
2623 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2624 }
2625 else
2626 {
2627 glDisableVertexAttribArray(SHAD_TEXUV2);
2628 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2629 glDisableVertexAttribArray(SHAD_TEXUV3);
2630 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2631 }
2632 if (dbgflushnum)
2633 {
2634 const char *types[6] =
2635 {"----", "RECT", "IMAG", "FONT", "YUV-", "MAP"};
2636 printf(" DRAW#%3i %4i -> %p[%4ix%4i] @ %4ix%4i -{ tex %4i type %s }-\n",
2637 i,
2638 gc->pipe[i].array.num / 6,
2639 gc->pipe[0].shader.surface,
2640 gc->pipe[0].shader.surface->w,
2641 gc->pipe[0].shader.surface->h,
2642 gw, gh,
2643 gc->pipe[i].shader.cur_tex,
2644 types[gc->pipe[i].region.type]
2645 );
2646 }
2647 glDrawArrays(GL_TRIANGLES, 0, gc->pipe[i].array.num);
2648 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
2649 }
2650 if (gc->pipe[i].array.im)
2651 {
2652 if (!gc->pipe[i].array.im->native.loose)
2653 {
2654 if (gc->pipe[i].array.im->native.func.unbind)
2655 gc->pipe[i].array.im->native.func.unbind(gc->pipe[i].array.im->native.func.data,
2656 gc->pipe[i].array.im);
2657 }
2658 gc->pipe[i].array.im = NULL;
2659 }
2660
2661 gc->state.current.cur_prog = gc->pipe[i].shader.cur_prog;
2662 gc->state.current.cur_tex = gc->pipe[i].shader.cur_tex;
2663 gc->state.current.render_op = gc->pipe[i].shader.render_op;
2664 gc->state.current.cx = gc->pipe[i].shader.cx;
2665 gc->state.current.cy = gc->pipe[i].shader.cy;
2666 gc->state.current.cw = gc->pipe[i].shader.cw;
2667 gc->state.current.ch = gc->pipe[i].shader.ch;
2668 gc->state.current.smooth = gc->pipe[i].shader.smooth;
2669 gc->state.current.blend = gc->pipe[i].shader.blend;
2670 gc->state.current.clip = gc->pipe[i].shader.clip;
2671
2672 if (gc->pipe[i].array.vertex) free(gc->pipe[i].array.vertex);
2673 if (gc->pipe[i].array.color) free(gc->pipe[i].array.color);
2674 if (gc->pipe[i].array.texuv) free(gc->pipe[i].array.texuv);
2675 if (gc->pipe[i].array.texm) free(gc->pipe[i].array.texm);
2676 if (gc->pipe[i].array.texuv2) free(gc->pipe[i].array.texuv2);
2677 if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
2678
2679 gc->pipe[i].array.vertex = NULL;
2680 gc->pipe[i].array.color = NULL;
2681 gc->pipe[i].array.texuv = NULL;
2682 gc->pipe[i].array.texm = NULL;
2683 gc->pipe[i].array.texuv2 = NULL;
2684 gc->pipe[i].array.texuv3 = NULL;
2685
2686 gc->pipe[i].array.num = 0;
2687 gc->pipe[i].array.alloc = 0;
2688
2689 gc->pipe[i].region.x = 0;
2690 gc->pipe[i].region.y = 0;
2691 gc->pipe[i].region.w = 0;
2692 gc->pipe[i].region.h = 0;
2693 gc->pipe[i].region.type = 0;
2694 }
2695 gc->state.top_pipe = 0;
2696 if (dbgflushnum)
2697 {
2698 if (done > 0) printf("DONE (pipes): %i\n", done);
2699 }
2700 gc->havestuff = EINA_FALSE;
2701}
2702
2703Eina_Bool
2704evas_gl_common_module_open(void)
2705{
2706 if (_evas_engine_GL_common_log_dom < 0)
2707 _evas_engine_GL_common_log_dom = eina_log_domain_register
2708 ("evas-gl_common", EVAS_DEFAULT_LOG_COLOR);
2709 if (_evas_engine_GL_common_log_dom < 0)
2710 {
2711 EINA_LOG_ERR("Can not create a module log domain.");
2712 return EINA_FALSE;
2713 }
2714 return EINA_TRUE;
2715}
2716
2717void
2718evas_gl_common_module_close(void)
2719{
2720 if (_evas_engine_GL_common_log_dom < 0) return;
2721 eina_log_domain_unregister(_evas_engine_GL_common_log_dom);
2722 _evas_engine_GL_common_log_dom = -1;
2723}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_filter.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_filter.c
new file mode 100644
index 0000000..a9d18d8
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_filter.c
@@ -0,0 +1,181 @@
1#include "evas_gl_private.h"
2
3#if 0 // filtering disabled
4void
5evas_gl_common_filter_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, Evas_Filter_Info *filter)
6{
7 RGBA_Draw_Context *dc;
8 GLuint prog;
9 int r,g,b,a;
10 int nomul, bgra;
11
12 dc = gc->dc;
13
14 if (dc->mul.use)
15 {
16 a = (dc->mul.col >> 24) & 0xff;
17 r = (dc->mul.col >> 16) & 0xff;
18 g = (dc->mul.col >> 8 ) & 0xff;
19 b = (dc->mul.col ) & 0xff;
20 }
21 else
22 {
23 r = g = b = a = 255;
24 }
25
26 nomul = (a == 255 && r == 255 && g == 255 && b == 255) ? 1 : 0;
27 bgra = (gc->shared->info.bgra) ? 1 : 0;
28
29 /* FIXME: This should so be a table */
30#if 0
31 if (filter->filter == EVAS_FILTER_BLUR)
32 {
33 if (bgra)
34 {
35 if (nomul)
36 prog = gc->shared->shader.filter_blur_bgra_nomul.prog;
37 else
38 prog = gc->shared->shader.filter_blur_bgra.prog;
39 }
40 else
41 {
42 if (a == 255 && r == 255 && g == 255 && b == 255)
43 prog = gc->shared->shader.filter_blur_nomul.prog;
44 else
45 prog = gc->shared->shader.filter_blur.prog;
46 }
47 }
48 else
49#endif
50 if (filter->filter == EVAS_FILTER_INVERT)
51 {
52 if (bgra)
53 {
54 if (nomul)
55 prog = gc->shared->shader.filter_invert_bgra_nomul.prog;
56 else
57 prog = gc->shared->shader.filter_invert_bgra.prog;
58 }
59 else
60 {
61 if (a == 255 && r == 255 && g == 255 && b == 255)
62 prog = gc->shared->shader.filter_invert_nomul.prog;
63 else
64 prog = gc->shared->shader.filter_invert.prog;
65 }
66 }
67 else if (filter->filter == EVAS_FILTER_SEPIA)
68 {
69 if (bgra)
70 {
71 if (nomul)
72 prog = gc->shared->shader.filter_sepia_bgra_nomul.prog;
73 else
74 prog = gc->shared->shader.filter_sepia_bgra.prog;
75 }
76 else
77 {
78 if (nomul)
79 prog = gc->shared->shader.filter_sepia_nomul.prog;
80 else
81 prog = gc->shared->shader.filter_sepia.prog;
82 }
83
84 }
85 else /*if (filter->filter == EVAS_FILTER_GREYSCALE)*/
86 {
87 printf("BGRA: %s Nomul: %s\n",bgra?"true":"false",nomul?"nomul":"mul");
88 if (bgra)
89 {
90 if (nomul)
91 prog = gc->shared->shader.filter_greyscale_bgra_nomul.prog;
92 else
93 prog = gc->shared->shader.filter_greyscale_bgra.prog;
94 }
95 else
96 {
97 if (nomul)
98 prog = gc->shared->shader.filter_greyscale_nomul.prog;
99 else
100 prog = gc->shared->shader.filter_greyscale.prog;
101 }
102
103 }
104
105 printf("Prog: %d %d %d\n",prog,im->w,im->h);
106 gc->filter_prog = prog;
107 evas_gl_common_image_update(gc, im);
108 evas_gl_common_context_image_push(gc, im->tex, 0, 0, im->w, im->h,
109 0, 0, im->w, im->h,
110 r,g,b,a,
111 1, im->tex_only);
112 gc->filter_prog = 0;
113}
114
115
116Filtered_Image *
117evas_gl_common_image_filtered_get(Evas_GL_Image *im, uint8_t *key, size_t len)
118{
119 Filtered_Image *fi;
120 Eina_List *l;
121
122 for (l = im->filtered ; l ; l = l->next)
123 {
124 fi = l->data;
125 if (fi->keylen != len) continue;
126 if (memcmp(key, fi->key, len) != 0) continue;
127 fi->ref ++;
128 return fi;
129 }
130
131 return NULL;
132}
133
134Filtered_Image *
135evas_gl_common_image_filtered_save(Evas_GL_Image *im, Evas_GL_Image *fimage,
136 uint8_t *key, size_t keylen)
137{
138 Filtered_Image *fi;
139 Eina_List *l;
140
141 for (l = im->filtered ; l ; l = l->next)
142 {
143 fi = l->data;
144 if (fi->keylen != keylen) continue;
145 if (memcmp(key, fi->key, keylen) != 0) continue;
146
147 fi->image = (void *)fimage;
148 fi->ref ++;
149 return fi;
150 }
151
152 fi = calloc(1,sizeof(Filtered_Image));
153 if (!fi) return NULL;
154
155 fi->keylen = keylen;
156 fi->key = malloc(keylen);
157 memcpy(fi->key, key, keylen);
158 fi->image = (void *)fimage;
159 fi->ref = 1;
160
161 im->filtered = eina_list_prepend(im->filtered, fi);
162
163 return fi;
164}
165
166void
167evas_gl_common_image_filtered_free(Evas_GL_Image *image, Filtered_Image *fi)
168{
169 fi->ref --;
170 if (fi->ref) return;
171
172 free(fi->key);
173 evas_gl_common_image_free((void *)fi->image);
174 fi->image = NULL;
175
176 image->filtered = eina_list_remove(image->filtered, fi);
177}
178#endif
179
180
181/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_font.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_font.c
new file mode 100644
index 0000000..e5f3a4a
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_font.c
@@ -0,0 +1,203 @@
1#include "evas_gl_private.h"
2
3void *
4evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
5{
6 Evas_Engine_GL_Context *gc = context;
7 Evas_GL_Texture *tex;
8 DATA8 *data;
9 int w, h, j, nw;
10 DATA8 *ndata;
11 int fh;
12
13 if (fg->ext_dat) return fg->ext_dat; // FIXME: one engine at a time can do this :(
14
15 w = fg->glyph_out->bitmap.width;
16 h = fg->glyph_out->bitmap.rows;
17 if ((w == 0) || (h == 0)) return NULL;
18
19 data = fg->glyph_out->bitmap.buffer;
20 j = fg->glyph_out->bitmap.pitch;
21 if (j < w) j = w;
22
23 nw = ((w + 3) / 4) * 4;
24 ndata = alloca(nw *h);
25 if (!ndata) return NULL;
26 if (fg->glyph_out->bitmap.num_grays == 256)
27 {
28 int x, y;
29 DATA8 *p1, *p2;
30
31 for (y = 0; y < h; y++)
32 {
33 p1 = data + (j * y);
34 p2 = ndata + (nw * y);
35 for (x = 0; x < w; x++)
36 {
37 *p2 = *p1;
38 p1++;
39 p2++;
40 }
41 }
42 }
43 else if (fg->glyph_out->bitmap.num_grays == 0)
44 {
45 DATA8 *tmpbuf = NULL, *dp, *tp, bits;
46 int bi, bj, end;
47 const DATA8 bitrepl[2] = {0x0, 0xff};
48
49 tmpbuf = alloca(w);
50 if (tmpbuf)
51 {
52 int x, y;
53 DATA8 *p1, *p2;
54
55 for (y = 0; y < h; y++)
56 {
57 p1 = tmpbuf;
58 p2 = ndata + (nw * y);
59 tp = tmpbuf;
60 dp = data + (y * fg->glyph_out->bitmap.pitch);
61 for (bi = 0; bi < w; bi += 8)
62 {
63 bits = *dp;
64 if ((w - bi) < 8) end = w - bi;
65 else end = 8;
66 for (bj = 0; bj < end; bj++)
67 {
68 *tp = bitrepl[(bits >> (7 - bj)) & 0x1];
69 tp++;
70 }
71 dp++;
72 }
73 for (x = 0; x < w; x++)
74 {
75 *p2 = *p1;
76 p1++;
77 p2++;
78 }
79 }
80 }
81 }
82// fh = h;
83 fh = fg->fi->max_h;
84 tex = evas_gl_common_texture_alpha_new(gc, ndata, w, h, fh);
85 tex->sx1 = ((double)(tex->x)) / (double)tex->pt->w;
86 tex->sy1 = ((double)(tex->y)) / (double)tex->pt->h;
87 tex->sx2 = ((double)(tex->x + tex->w)) / (double)tex->pt->w;
88 tex->sy2 = ((double)(tex->y + tex->h)) / (double)tex->pt->h;
89 return tex;
90}
91
92void
93evas_gl_font_texture_free(void *tex)
94{
95 if (!tex) return;
96 evas_gl_common_texture_free(tex);
97}
98
99void
100evas_gl_font_texture_draw(void *context, void *surface __UNUSED__, void *draw_context, RGBA_Font_Glyph *fg, int x, int y)
101{
102 Evas_Engine_GL_Context *gc = context;
103 RGBA_Draw_Context *dc = draw_context;
104 Evas_GL_Texture *tex;
105 Cutout_Rects *rects;
106 Cutout_Rect *rct;
107 int r, g, b, a;
108 double ssx, ssy, ssw, ssh;
109 int c, cx, cy, cw, ch;
110 int i;
111 int sx, sy, sw, sh;
112
113 if (dc != gc->dc) return;
114 tex = fg->ext_dat;
115 if (!tex) return;
116 a = (dc->col.col >> 24) & 0xff;
117 if (a == 0) return;
118 r = (dc->col.col >> 16) & 0xff;
119 g = (dc->col.col >> 8 ) & 0xff;
120 b = (dc->col.col ) & 0xff;
121 sx = 0; sy = 0; sw = tex->w, sh = tex->h;
122 if ((!gc->dc->cutout.rects) ||
123 ((gc->shared->info.tune.cutout.max > 0) &&
124 (gc->dc->cutout.active > gc->shared->info.tune.cutout.max)))
125 {
126 if (gc->dc->clip.use)
127 {
128 int nx, ny, nw, nh;
129
130 nx = x; ny = y; nw = tex->w; nh = tex->h;
131 RECTS_CLIP_TO_RECT(nx, ny, nw, nh,
132 gc->dc->clip.x, gc->dc->clip.y,
133 gc->dc->clip.w, gc->dc->clip.h);
134 if ((nw < 1) || (nh < 1)) return;
135 if ((nx == x) && (ny == y) && (nw == tex->w) && (nh == tex->h))
136 {
137 evas_gl_common_context_font_push(gc, tex,
138 0.0, 0.0, 0.0, 0.0,
139// sx, sy, sw, sh,
140 x, y, tex->w, tex->h,
141 r, g, b, a);
142 return;
143 }
144 ssx = (double)sx + ((double)(sw * (nx - x)) / (double)(tex->w));
145 ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(tex->h));
146 ssw = ((double)sw * (double)(nw)) / (double)(tex->w);
147 ssh = ((double)sh * (double)(nh)) / (double)(tex->h);
148 evas_gl_common_context_font_push(gc, tex,
149 ssx, ssy, ssw, ssh,
150 nx, ny, nw, nh,
151 r, g, b, a);
152 }
153 else
154 {
155 evas_gl_common_context_font_push(gc, tex,
156 0.0, 0.0, 0.0, 0.0,
157// sx, sy, sw, sh,
158 x, y, tex->w, tex->h,
159 r, g, b, a);
160 }
161 return;
162 }
163 /* save out clip info */
164 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
165 evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
166 evas_common_draw_context_clip_clip(gc->dc, x, y, tex->w, tex->h);
167 /* our clip is 0 size.. abort */
168 if ((gc->dc->clip.w <= 0) || (gc->dc->clip.h <= 0))
169 {
170 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
171 return;
172 }
173 rects = evas_common_draw_context_apply_cutouts(dc);
174 for (i = 0; i < rects->active; ++i)
175 {
176 int nx, ny, nw, nh;
177
178 rct = rects->rects + i;
179 nx = x; ny = y; nw = tex->w; nh = tex->h;
180 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, rct->x, rct->y, rct->w, rct->h);
181 if ((nw < 1) || (nh < 1)) continue;
182 if ((nx == x) && (ny == y) && (nw == tex->w) && (nh == tex->h))
183 {
184 evas_gl_common_context_font_push(gc, tex,
185 0.0, 0.0, 0.0, 0.0,
186// sx, sy, sw, sh,
187 x, y, tex->w, tex->h,
188 r, g, b, a);
189 continue;
190 }
191 ssx = (double)sx + ((double)(sw * (nx - x)) / (double)(tex->w));
192 ssy = (double)sy + ((double)(sh * (ny - y)) / (double)(tex->h));
193 ssw = ((double)sw * (double)(nw)) / (double)(tex->w);
194 ssh = ((double)sh * (double)(nh)) / (double)(tex->h);
195 evas_gl_common_context_font_push(gc, tex,
196 ssx, ssy, ssw, ssh,
197 nx, ny, nw, nh,
198 r, g, b, a);
199 }
200 evas_common_draw_context_apply_clear_cutouts(rects);
201 /* restore clip info */
202 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
203}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_image.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_image.c
new file mode 100644
index 0000000..1d4b1f8
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_image.c
@@ -0,0 +1,968 @@
1#include "evas_gl_private.h"
2
3void
4evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc)
5{
6 Eina_List *l;
7 Evas_GL_Image *im;
8
9 EINA_LIST_FOREACH(gc->shared->images, l, im)
10 {
11 if (im->im) evas_cache_image_unload_data(&im->im->cache_entry);
12 if (im->tex)
13 {
14 if (!im->tex->pt->dyn.img)
15 {
16 evas_gl_common_texture_free(im->tex);
17 im->tex = NULL;
18 }
19 }
20 }
21}
22
23static void
24_evas_gl_image_cache_trim(Evas_Engine_GL_Context *gc)
25{
26 int size = evas_common_image_get_cache();
27
28 while (gc->shared->images_size > size)
29 {
30 Evas_GL_Image *im2;
31 Eina_List *l = NULL;
32
33 EINA_LIST_REVERSE_FOREACH(gc->shared->images, l, im2)
34 {
35 if (im2->references == 0)
36 {
37 im2->cached = 0;
38 im2->gc->shared->images =
39 eina_list_remove_list(im2->gc->shared->images, l);
40 im2->gc->shared->images_size -= (im2->csize);
41 evas_gl_common_image_free(im2);
42 l = NULL;
43 break;
44 }
45 }
46 if ((gc->shared->images_size > size) && (l))
47 {
48// printf("EEK %i > %i, no 0 ref imgs\n",
49// gc->shared->images_size, size);
50 break;
51 }
52 if (!gc->shared->images)
53 {
54// printf("EEK %i > %i, no imgs\n",
55// gc->shared->images_size, size);
56 break;
57 }
58 }
59}
60
61static Eina_Bool
62_evas_gl_image_cache_add(Evas_GL_Image *im)
63{
64 if (im->references == 0)
65 {
66 im->csize = im->w * im->h * 4;
67 im->gc->shared->images_size += im->csize;
68 _evas_gl_image_cache_trim(im->gc);
69 return EINA_TRUE;
70 }
71 else
72 {
73 im->gc->shared->images = eina_list_remove(im->gc->shared->images, im);
74 im->cached = 0;
75 }
76 return EINA_FALSE;
77}
78
79void
80evas_gl_common_image_ref(Evas_GL_Image *im)
81{
82 if (im->references == 0)
83 {
84 im->gc->shared->images_size -= (im->csize);
85 }
86 im->references++;
87}
88
89void
90evas_gl_common_image_unref(Evas_GL_Image *im)
91{
92 im->references--;
93 if (im->references == 0)
94 {
95 _evas_gl_image_cache_add(im);
96 }
97}
98
99Evas_GL_Image *
100evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error)
101{
102 Evas_GL_Image *im;
103 RGBA_Image *im_im;
104 Eina_List *l;
105
106 im_im = evas_common_load_image_from_file(file, key, lo, error);
107 if (!im_im) return NULL;
108
109 /* i'd LOVe to do this, but we can't because we load to load header
110 * to get image size to know if its too big or not! so this disallows
111 * us to know that - photocam thus suffers
112 if (((int)im_im->cache_entry.w > gc->shared->info.max_texture_size) ||
113 ((int)im_im->cache_entry.h > gc->shared->info.max_texture_size))
114 {
115 evas_cache_image_drop(&(im_im->cache_entry));
116 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
117 return NULL;
118 }
119 */
120
121 // FIXME: keep unreffed shared images around
122 EINA_LIST_FOREACH(gc->shared->images, l, im)
123 {
124 if (im->im == im_im)
125 {
126// why did i put this here? i think to free the rgba pixel data once a texture
127// exists.
128// evas_cache_image_drop(&(im_im->cache_entry));
129 gc->shared->images = eina_list_remove_list(gc->shared->images, l);
130 gc->shared->images = eina_list_prepend(gc->shared->images, im);
131 evas_gl_common_image_ref(im);
132 *error = EVAS_LOAD_ERROR_NONE;
133 return im;
134 }
135 }
136
137 im = calloc(1, sizeof(Evas_GL_Image));
138 if (!im)
139 {
140 evas_cache_image_drop(&(im_im->cache_entry));
141 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
142 return NULL;
143 }
144 im->references = 1;
145 im->im = im_im;
146 im->gc = gc;
147 im->cached = 1;
148 im->cs.space = EVAS_COLORSPACE_ARGB8888;
149 im->alpha = im->im->cache_entry.flags.alpha;
150 im->w = im->im->cache_entry.w;
151 im->h = im->im->cache_entry.h;
152 if (lo) im->load_opts = *lo;
153 gc->shared->images = eina_list_prepend(gc->shared->images, im);
154 return im;
155}
156
157Evas_GL_Image *
158evas_gl_common_image_new_from_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace)
159{
160 Evas_GL_Image *im;
161 Eina_List *l;
162
163 if (((int)w > gc->shared->info.max_texture_size) ||
164 ((int)h > gc->shared->info.max_texture_size))
165 return NULL;
166
167 if (data)
168 {
169 EINA_LIST_FOREACH(gc->shared->images, l, im)
170 {
171 if (((void *)(im->im->image.data) == (void *)data) &&
172 (im->im->cache_entry.w == w) &&
173 (im->im->cache_entry.h == h))
174 {
175 gc->shared->images = eina_list_remove_list(gc->shared->images, l);
176 gc->shared->images = eina_list_prepend(gc->shared->images, im);
177 evas_gl_common_image_ref(im);
178 return im;
179 }
180 }
181 }
182 im = calloc(1, sizeof(Evas_GL_Image));
183 if (!im) return NULL;
184 im->references = 1;
185 im->im = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(),
186 w, h, data, alpha, cspace);
187 if (!im->im)
188 {
189 free(im);
190 return NULL;
191 }
192 im->gc = gc;
193 im->cs.space = cspace;
194 im->alpha = im->im->cache_entry.flags.alpha;
195 im->w = im->im->cache_entry.w;
196 im->h = im->im->cache_entry.h;
197 switch (cspace)
198 {
199 case EVAS_COLORSPACE_ARGB8888:
200 break;
201 case EVAS_COLORSPACE_YCBCR422P601_PL:
202 case EVAS_COLORSPACE_YCBCR422P709_PL:
203 if (im->tex) evas_gl_common_texture_free(im->tex);
204 im->tex = NULL;
205 im->cs.data = data;
206 im->cs.no_free = 1;
207 break;
208 default:
209 abort();
210 break;
211 }
212 return im;
213}
214
215Evas_GL_Image *
216evas_gl_common_image_new_from_copied_data(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, DATA32 *data, int alpha, int cspace)
217{
218 Evas_GL_Image *im;
219
220 if (((int)w > gc->shared->info.max_texture_size) ||
221 ((int)h > gc->shared->info.max_texture_size))
222 return NULL;
223
224 im = calloc(1, sizeof(Evas_GL_Image));
225 if (!im) return NULL;
226 im->references = 1;
227 im->im = (RGBA_Image *) evas_cache_image_copied_data(evas_common_image_cache_get(),
228 w, h, data, alpha, cspace);
229 if (!im->im)
230 {
231 free(im);
232 return NULL;
233 }
234 im->gc = gc;
235 im->cs.space = cspace;
236 im->alpha = im->im->cache_entry.flags.alpha;
237 im->w = im->im->cache_entry.w;
238 im->h = im->im->cache_entry.h;
239 switch (cspace)
240 {
241 case EVAS_COLORSPACE_ARGB8888:
242 break;
243 case EVAS_COLORSPACE_YCBCR422P601_PL:
244 case EVAS_COLORSPACE_YCBCR422P709_PL:
245 if (im->tex) evas_gl_common_texture_free(im->tex);
246 im->tex = NULL;
247 im->cs.no_free = 0;
248 if (im->im->cache_entry.h > 0)
249 im->cs.data = calloc(1, im->im->cache_entry.h * sizeof(unsigned char *) * 2);
250 if ((data) && (im->cs.data))
251 memcpy(im->cs.data, data, im->im->cache_entry.h * sizeof(unsigned char *) * 2);
252 break;
253 default:
254 abort();
255 break;
256 }
257 return im;
258}
259
260Evas_GL_Image *
261evas_gl_common_image_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, int cspace)
262{
263 Evas_GL_Image *im;
264
265 if (((int)w > gc->shared->info.max_texture_size) ||
266 ((int)h > gc->shared->info.max_texture_size))
267 return NULL;
268
269 im = calloc(1, sizeof(Evas_GL_Image));
270 if (!im) return NULL;
271 im->references = 1;
272 im->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
273 if (!im->im)
274 {
275 free(im);
276 return NULL;
277 }
278 im->gc = gc;
279 im->im->cache_entry.flags.alpha = alpha ? 1 : 0;
280 im->cs.space = cspace;
281 im->alpha = im->im->cache_entry.flags.alpha;
282 im->im->cache_entry.w = w;
283 im->im->cache_entry.h = h;
284 im->w = im->im->cache_entry.w;
285 im->h = im->im->cache_entry.h;
286 evas_cache_image_colorspace(&im->im->cache_entry, cspace);
287 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry, w, h);
288 switch (cspace)
289 {
290 case EVAS_COLORSPACE_ARGB8888:
291 break;
292 case EVAS_COLORSPACE_YCBCR422P601_PL:
293 case EVAS_COLORSPACE_YCBCR422P709_PL:
294 case EVAS_COLORSPACE_YCBCR422601_PL:
295 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
296 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
297// if (im->tex) evas_gl_common_texture_free(im->tex);
298 im->tex = NULL;
299 im->cs.no_free = 0;
300 if (im->im->cache_entry.h > 0)
301 im->cs.data = calloc(1, im->im->cache_entry.h * sizeof(unsigned char *) * 2);
302 break;
303 default:
304 abort();
305 break;
306 }
307 return im;
308}
309
310Evas_GL_Image *
311evas_gl_common_image_alpha_set(Evas_GL_Image *im, int alpha)
312{
313 if (!im) return NULL;
314 if (im->alpha == alpha) return im;
315 im->alpha = alpha;
316 if (!im->im) return im;
317 im->im->cache_entry.flags.alpha = alpha ? 1 : 0;
318 if (im->tex)
319 {
320 evas_gl_common_texture_free(im->tex);
321 im->tex = NULL;
322 }
323 if (!im->tex)
324 im->tex = evas_gl_common_texture_new(im->gc, im->im);
325 return im;
326}
327
328void
329evas_gl_common_image_native_enable(Evas_GL_Image *im)
330{
331 if (im->cs.data)
332 {
333 if (!im->cs.no_free) free(im->cs.data);
334 im->cs.data = NULL;
335 }
336 im->cs.no_free = 0;
337 if (im->cached)
338 {
339 if (im->references == 0)
340 im->gc->shared->images_size -= (im->csize);
341 im->gc->shared->images = eina_list_remove(im->gc->shared->images, im);
342 im->cached = 0;
343 }
344 if (im->im)
345 {
346 evas_cache_image_drop(&im->im->cache_entry);
347 im->im = NULL;
348 }
349 if (im->tex)
350 {
351 evas_gl_common_texture_free(im->tex);
352 im->tex = NULL;
353 }
354
355 im->cs.space = EVAS_COLORSPACE_ARGB8888;
356 im->tex = evas_gl_common_texture_native_new(im->gc, im->w, im->h, im->alpha, im);
357 im->tex_only = 1;
358}
359
360void
361evas_gl_common_image_native_disable(Evas_GL_Image *im)
362{
363 if (im->im)
364 {
365 evas_cache_image_drop(&im->im->cache_entry);
366 im->im = NULL;
367 }
368 if (im->tex)
369 {
370 evas_gl_common_texture_free(im->tex);
371 im->tex = NULL;
372 }
373 im->tex_only = 0;
374
375 im->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
376 im->im->cache_entry.flags.alpha = im->alpha;
377 im->cs.space = EVAS_COLORSPACE_ARGB8888;
378 evas_cache_image_colorspace(&im->im->cache_entry, im->cs.space);
379 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry, im->w, im->h);
380 if (!im->tex)
381 im->tex = evas_gl_common_texture_new(im->gc, im->im);
382}
383
384void
385evas_gl_common_image_scale_hint_set(Evas_GL_Image *im, int hint)
386{
387 im->scale_hint = hint;
388 // FIXME: take advantage of this even in gl (eg if image is
389 // 1600x1200 but we always use it at 800x600 or even less - drop
390 // the texture res down for "non dynamic" stuff to save memory)
391}
392
393void
394evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
395{
396 if (im->content_hint == hint) return;
397 im->content_hint = hint;
398 if (!im->gc) return;
399 if (!im->gc->shared->info.sec_image_map) return;
400 if (!im->gc->shared->info.bgra) return;
401 // does not handle yuv yet.
402 if (im->cs.space != EVAS_COLORSPACE_ARGB8888) return;
403 if (im->content_hint == EVAS_IMAGE_CONTENT_HINT_DYNAMIC)
404 {
405 if (im->cs.data)
406 {
407 if (!im->cs.no_free) free(im->cs.data);
408 im->cs.data = NULL;
409 }
410 im->cs.no_free = 0;
411 if (im->cached)
412 {
413 if (im->references == 0)
414 im->gc->shared->images_size -= im->csize;
415 im->gc->shared->images = eina_list_remove(im->gc->shared->images, im);
416 im->cached = 0;
417 }
418 if (im->im)
419 {
420 evas_cache_image_drop(&im->im->cache_entry);
421 im->im = NULL;
422 }
423 if (im->tex)
424 {
425 evas_gl_common_texture_free(im->tex);
426 im->tex = NULL;
427 }
428 im->tex = evas_gl_common_texture_dynamic_new(im->gc, im);
429 im->tex_only = 1;
430 }
431 else
432 {
433 if (im->im)
434 {
435 evas_cache_image_drop(&im->im->cache_entry);
436 im->im = NULL;
437 }
438 if (im->tex)
439 {
440 evas_gl_common_texture_free(im->tex);
441 im->tex = NULL;
442 }
443 im->tex_only = 0;
444
445 im->im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
446 im->im->cache_entry.flags.alpha = im->alpha;
447 im->cs.space = EVAS_COLORSPACE_ARGB8888;
448 evas_cache_image_colorspace(&im->im->cache_entry, im->cs.space);
449 im->im = (RGBA_Image *)evas_cache_image_size_set(&im->im->cache_entry, im->w, im->h);
450 if (!im->tex)
451 im->tex = evas_gl_common_texture_new(im->gc, im->im);
452 }
453}
454
455void
456evas_gl_common_image_cache_flush(Evas_Engine_GL_Context *gc)
457{
458 _evas_gl_image_cache_trim(gc);
459}
460
461void
462evas_gl_common_image_free(Evas_GL_Image *im)
463{
464#if 0 // filtering disabled
465 Filtered_Image *fi;
466#endif
467
468 evas_gl_common_context_flush(im->gc);
469 im->references--;
470 if (im->references > 0) return;
471
472 if (im->native.func.free)
473 im->native.func.free(im->native.func.data, im);
474
475 if (im->cs.data)
476 {
477 if (!im->cs.no_free) free(im->cs.data);
478 }
479 if (im->cached)
480 {
481 if (_evas_gl_image_cache_add(im)) return;
482 }
483 if (im->im) evas_cache_image_drop(&im->im->cache_entry);
484 if (im->tex) evas_gl_common_texture_free(im->tex);
485
486#if 0 // filtering disabled
487 EINA_LIST_FREE(im->filtered, fi)
488 {
489 free(fi->key);
490 evas_gl_common_image_free((Evas_GL_Image *)fi->image);
491 free(fi);
492 }
493#endif
494
495 free(im);
496}
497
498Evas_GL_Image *
499evas_gl_common_image_surface_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha)
500{
501 Evas_GL_Image *im;
502
503 if (((int)w > gc->shared->info.max_texture_size) ||
504 ((int)h > gc->shared->info.max_texture_size))
505 return NULL;
506
507 im = calloc(1, sizeof(Evas_GL_Image));
508 if (!im) return NULL;
509 im->references = 1;
510 im->gc = gc;
511 im->cs.space = EVAS_COLORSPACE_ARGB8888;
512 im->alpha = alpha;
513 im->w = w;
514 im->h = h;
515 im->tex = evas_gl_common_texture_render_new(gc, w, h, alpha);
516 im->tex_only = 1;
517 return im;
518}
519
520void
521evas_gl_common_image_dirty(Evas_GL_Image *im, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
522{
523 if ((w == 0) && (h == 0) && (x == 0) && (y == 0))
524 {
525 w = im->w;
526 h = im->h;
527 }
528 if (im->im)
529 {
530 im->im = (RGBA_Image *)evas_cache_image_dirty(&im->im->cache_entry, x, y, w, h);
531 }
532 im->dirty = 1;
533}
534
535void
536evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
537{
538 Image_Entry *ie;
539 if (!im->im) return;
540 ie = (Image_Entry *)(im->im);
541/*
542 if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
543 (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
544 {
545 // SOFTWARE convert. do multi texture later
546 if ((im->cs.data) && (*((unsigned char **)im->cs.data)))
547 {
548 if (im->dirty || !im->im->image.data)
549 {
550 free(im->im->image.data);
551 im->im->image.data = malloc(im->im->cache_entry.w * im->im->cache_entry.h * sizeof(DATA32));
552 if (im->im->image.data)
553 evas_common_convert_yuv_420p_601_rgba(im->cs.data,
554 (void *)im->im->image.data,
555 im->im->cache_entry.w, im->im->cache_entry.h);
556 }
557 }
558 space = EVAS_COLORSPACE_ARGB8888;
559 }
560 else
561 */
562 switch (im->cs.space)
563 {
564 case EVAS_COLORSPACE_ARGB8888:
565 if ((im->tex) &&
566 ((im->dirty) || (ie->flags.animated)))
567 {
568 evas_cache_image_load_data(&im->im->cache_entry);
569 evas_gl_common_texture_update(im->tex, im->im);
570 evas_cache_image_unload_data(&im->im->cache_entry);
571 }
572 if (!im->tex)
573 {
574 evas_cache_image_load_data(&im->im->cache_entry);
575 im->tex = evas_gl_common_texture_new(gc, im->im);
576 evas_cache_image_unload_data(&im->im->cache_entry);
577 }
578 im->dirty = 0;
579 if (!im->tex) return;
580 break;
581 case EVAS_COLORSPACE_YCBCR422P601_PL:
582 case EVAS_COLORSPACE_YCBCR422P709_PL:
583 if ((im->tex) && (im->dirty))
584 {
585 evas_gl_common_texture_yuv_update(im->tex, im->cs.data,
586 im->im->cache_entry.w,
587 im->im->cache_entry.h);
588 im->dirty = 0;
589 }
590 if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
591 {
592 im->tex = evas_gl_common_texture_yuv_new(gc, im->cs.data,
593 im->im->cache_entry.w,
594 im->im->cache_entry.h);
595 im->dirty = 0;
596 }
597 if (!im->tex) return;
598 break;
599 case EVAS_COLORSPACE_YCBCR422601_PL:
600 if ((im->tex) && (im->dirty))
601 {
602 evas_gl_common_texture_yuy2_update(im->tex, im->cs.data,
603 im->im->cache_entry.w,
604 im->im->cache_entry.h);
605 im->dirty = 0;
606 }
607 if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
608 {
609 im->tex = evas_gl_common_texture_yuy2_new(gc, im->cs.data,
610 im->im->cache_entry.w,
611 im->im->cache_entry.h);
612 im->dirty = 0;
613 }
614 if (!im->tex) return;
615 break;
616 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
617 if ((im->tex) && (im->dirty))
618 {
619 evas_gl_common_texture_nv12_update(im->tex, im->cs.data,
620 im->im->cache_entry.w,
621 im->im->cache_entry.h);
622 im->dirty = 0;
623 }
624 if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
625 {
626 im->tex = evas_gl_common_texture_nv12_new(gc, im->cs.data,
627 im->im->cache_entry.w,
628 im->im->cache_entry.h);
629 im->dirty = 0;
630 }
631 if (!im->tex) return;
632 break;
633 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
634 if ((im->tex) && (im->dirty))
635 {
636 evas_gl_common_texture_nv12tiled_update(im->tex, im->cs.data,
637 im->im->cache_entry.w,
638 im->im->cache_entry.h);
639 im->dirty = 0;
640 }
641 if ((!im->tex) && (im->cs.data) && (*((unsigned char **)im->cs.data)))
642 {
643 im->tex = evas_gl_common_texture_nv12tiled_new(gc, im->cs.data,
644 im->im->cache_entry.w,
645 im->im->cache_entry.h);
646 im->dirty = 0;
647 }
648 if (!im->tex) return;
649 break;
650 default:
651 ERR("unhandled img format colorspace=%d", im->cs.space);
652 break;
653 }
654}
655
656void
657evas_gl_common_image_map_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im,
658 int npoints, RGBA_Map_Point *p, int smooth, int level __UNUSED__)
659{
660 RGBA_Draw_Context *dc;
661 int r, g, b, a;
662 int c, cx, cy, cw, ch;
663
664 dc = gc->dc;
665 if (dc->mul.use)
666 {
667 a = (dc->mul.col >> 24) & 0xff;
668 r = (dc->mul.col >> 16) & 0xff;
669 g = (dc->mul.col >> 8 ) & 0xff;
670 b = (dc->mul.col ) & 0xff;
671 }
672 else
673 {
674 r = g = b = a = 255;
675 }
676
677 evas_gl_common_image_update(gc, im);
678
679 c = gc->dc->clip.use;
680 cx = gc->dc->clip.x; cy = gc->dc->clip.y;
681 cw = gc->dc->clip.w; ch = gc->dc->clip.h;
682 im->tex->im = im;
683
684 evas_gl_common_context_image_map_push(gc, im->tex, npoints, p,
685 c, cx, cy, cw, ch,
686 r, g, b, a, smooth, im->tex_only,
687 im->cs.space);
688}
689
690void
691evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth)
692{
693 RGBA_Draw_Context *dc;
694 Evas_GL_Image *imm;
695 int r, g, b, a;
696 double ssx, ssy, ssw, ssh;
697 double mssx, mssy, mssw, mssh;
698 Cutout_Rects *rects;
699 Cutout_Rect *rct;
700 int c, cx, cy, cw, ch;
701 int i;
702 int yuv = 0;
703 int yuy2 = 0;
704 int nv12 = 0;
705
706 if (sw < 1) sw = 1;
707 if (sh < 1) sh = 1;
708 dc = gc->dc;
709 imm = (Evas_GL_Image *)dc->mask.mask;
710 if (dc->mul.use)
711 {
712 a = (dc->mul.col >> 24) & 0xff;
713 r = (dc->mul.col >> 16) & 0xff;
714 g = (dc->mul.col >> 8 ) & 0xff;
715 b = (dc->mul.col ) & 0xff;
716 }
717 else
718 {
719 r = g = b = a = 255;
720 }
721
722 evas_gl_common_image_update(gc, im);
723 if (!im->tex)
724 {
725 evas_gl_common_rect_draw(gc, dx, dy, dw, dh);
726 return;
727 }
728 if (imm)
729 {
730 evas_gl_common_image_update(gc, imm);
731 if (!imm->tex) imm = NULL; /* Turn of mask on error */
732 }
733
734 if ((im->cs.space == EVAS_COLORSPACE_YCBCR422P601_PL) ||
735 (im->cs.space == EVAS_COLORSPACE_YCBCR422P709_PL))
736 yuv = 1;
737 if (im->cs.space == EVAS_COLORSPACE_YCBCR422601_PL)
738 yuy2 = 1;
739 if ((im->cs.space == EVAS_COLORSPACE_YCBCR420NV12601_PL) ||
740 (im->cs.space == EVAS_COLORSPACE_YCBCR420TM12601_PL))
741 nv12 = 1;
742
743 im->tex->im = im;
744 if (imm) imm->tex->im = imm;
745 if ((!gc->dc->cutout.rects) ||
746 ((gc->shared->info.tune.cutout.max > 0) &&
747 (gc->dc->cutout.active > gc->shared->info.tune.cutout.max)))
748 {
749 if (gc->dc->clip.use)
750 {
751 int nx, ny, nw, nh;
752 double scalex,scaley;
753
754 nx = dx; ny = dy; nw = dw; nh = dh;
755 RECTS_CLIP_TO_RECT(nx, ny, nw, nh,
756 gc->dc->clip.x, gc->dc->clip.y,
757 gc->dc->clip.w, gc->dc->clip.h);
758 if ((nw < 1) || (nh < 1)) return;
759 if ((!imm) && (nx == dx) && (ny == dy) && (nw == dw) && (nh == dh))
760 {
761 if (yuv)
762 evas_gl_common_context_yuv_push(gc,
763 im->tex,
764 sx, sy, sw, sh,
765 dx, dy, dw, dh,
766 r, g, b, a,
767 smooth);
768 else if (yuy2)
769 evas_gl_common_context_yuy2_push(gc,
770 im->tex,
771 sx, sy, sw, sh,
772 dx, dy, dw, dh,
773 r, g, b, a,
774 smooth);
775 else if (nv12)
776 evas_gl_common_context_nv12_push(gc,
777 im->tex,
778 sx, sy, sw, sh,
779 dx, dy, dw, dh,
780 r, g, b, a,
781 smooth);
782 else
783
784 evas_gl_common_context_image_push(gc,
785 im->tex,
786 sx, sy, sw, sh,
787 dx, dy, dw, dh,
788 r, g, b, a,
789 smooth, im->tex_only);
790 return;
791 }
792
793 ssx = (double)sx + ((double)(sw * (nx - dx)) / (double)(dw));
794 ssy = (double)sy + ((double)(sh * (ny - dy)) / (double)(dh));
795 ssw = ((double)sw * (double)(nw)) / (double)(dw);
796 ssh = ((double)sh * (double)(nh)) / (double)(dh);
797 if (imm)
798 {
799 /* Correct ones here */
800 scalex = imm->w / (double)dc->mask.w;
801 scaley = imm->h / (double)dc->mask.h;
802 mssx = scalex * (nx - dc->mask.x);
803 mssy = scaley * (ny - dc->mask.y);
804 mssw = scalex * nw;
805 mssh = scaley * nh;
806
807 /* No yuv + imm I'm afraid */
808 evas_gl_common_context_image_mask_push(gc,
809 im->tex,
810 imm->tex,
811 ssx, ssy, ssw, ssh,
812 mssx, mssy, mssw, mssh,
813 //dc->mask.x, dc->mask.y, dc->mask.w, dc->mask.h,
814 nx, ny, nw, nh,
815 r, g, b, a,
816 smooth);
817 }
818 else if (yuv)
819 evas_gl_common_context_yuv_push(gc,
820 im->tex,
821 ssx, ssy, ssw, ssh,
822 nx, ny, nw, nh,
823 r, g, b, a,
824 smooth);
825 else if (yuy2)
826 evas_gl_common_context_yuy2_push(gc,
827 im->tex,
828 ssx, ssy, ssw, ssh,
829 nx, ny, nw, nh,
830 r, g, b, a,
831 smooth);
832 else if (nv12)
833 evas_gl_common_context_nv12_push(gc,
834 im->tex,
835 ssx, ssy, ssw, ssh,
836 nx, ny, nw, nh,
837 r, g, b, a,
838 smooth);
839 else
840 evas_gl_common_context_image_push(gc,
841 im->tex,
842 ssx, ssy, ssw, ssh,
843 nx, ny, nw, nh,
844 r, g, b, a,
845 smooth, im->tex_only);
846 }
847 else
848 {
849 if (yuv)
850 evas_gl_common_context_yuv_push(gc,
851 im->tex,
852 sx, sy, sw, sh,
853 dx, dy, dw, dh,
854 r, g, b, a,
855 smooth);
856 else if (yuy2)
857 evas_gl_common_context_yuy2_push(gc,
858 im->tex,
859 sx, sy, sw, sh,
860 dx, dy, dw, dh,
861 r, g, b, a,
862 smooth);
863 else if (nv12)
864 evas_gl_common_context_nv12_push(gc,
865 im->tex,
866 sx, sy, sw, sh,
867 dx, dy, dw, dh,
868 r, g, b, a,
869 smooth);
870 else
871 evas_gl_common_context_image_push(gc,
872 im->tex,
873 sx, sy, sw, sh,
874 dx, dy, dw, dh,
875 r, g, b, a,
876 smooth, im->tex_only);
877 }
878 return;
879 }
880
881 /* save out clip info */
882 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
883 evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
884 evas_common_draw_context_clip_clip(gc->dc, dx, dy, dw, dh);
885 /* our clip is 0 size.. abort */
886 if ((gc->dc->clip.w <= 0) || (gc->dc->clip.h <= 0))
887 {
888 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
889 return;
890 }
891 rects = evas_common_draw_context_apply_cutouts(dc);
892 for (i = 0; i < rects->active; ++i)
893 {
894 int nx, ny, nw, nh;
895
896 rct = rects->rects + i;
897 nx = dx; ny = dy; nw = dw; nh = dh;
898 RECTS_CLIP_TO_RECT(nx, ny, nw, nh, rct->x, rct->y, rct->w, rct->h);
899 if ((nw < 1) || (nh < 1)) continue;
900 if ((nx == dx) && (ny == dy) && (nw == dw) && (nh == dh))
901 {
902 if (yuv)
903 evas_gl_common_context_yuv_push(gc,
904 im->tex,
905 sx, sy, sw, sh,
906 dx, dy, dw, dh,
907 r, g, b, a,
908 smooth);
909 else if (yuy2)
910 evas_gl_common_context_yuy2_push(gc,
911 im->tex,
912 sx, sy, sw, sh,
913 dx, dy, dw, dh,
914 r, g, b, a,
915 smooth);
916 else if (nv12)
917 evas_gl_common_context_nv12_push(gc,
918 im->tex,
919 sx, sy, sw, sh,
920 dx, dy, dw, dh,
921 r, g, b, a,
922 smooth);
923 else
924 evas_gl_common_context_image_push(gc,
925 im->tex,
926 sx, sy, sw, sh,
927 dx, dy, dw, dh,
928 r, g, b, a,
929 smooth, im->tex_only);
930 continue;
931 }
932 ssx = (double)sx + ((double)(sw * (nx - dx)) / (double)(dw));
933 ssy = (double)sy + ((double)(sh * (ny - dy)) / (double)(dh));
934 ssw = ((double)sw * (double)(nw)) / (double)(dw);
935 ssh = ((double)sh * (double)(nh)) / (double)(dh);
936 if (yuv)
937 evas_gl_common_context_yuv_push(gc,
938 im->tex,
939 ssx, ssy, ssw, ssh,
940 nx, ny, nw, nh,
941 r, g, b, a,
942 smooth);
943 else if (yuy2)
944 evas_gl_common_context_yuy2_push(gc,
945 im->tex,
946 ssx, ssy, ssw, ssh,
947 nx, ny, nw, nh,
948 r, g, b, a,
949 smooth);
950 else if (nv12)
951 evas_gl_common_context_nv12_push(gc,
952 im->tex,
953 ssx, ssy, ssw, ssh,
954 nx, ny, nw, nh,
955 r, g, b, a,
956 smooth);
957 else
958 evas_gl_common_context_image_push(gc,
959 im->tex,
960 ssx, ssy, ssw, ssh,
961 nx, ny, nw, nh,
962 r, g, b, a,
963 smooth, im->tex_only);
964 }
965 evas_common_draw_context_apply_clear_cutouts(rects);
966 /* restore clip info */
967 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
968}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_line.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_line.c
new file mode 100644
index 0000000..48499ea
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_line.c
@@ -0,0 +1,32 @@
1#include "evas_gl_private.h"
2
3void
4evas_gl_common_line_draw(Evas_Engine_GL_Context *gc, int x1, int y1, int x2, int y2)
5{
6 RGBA_Draw_Context *dc;
7 int r, g, b, a;
8 int c, cx, cy, cw, ch;
9
10 dc = gc->dc;
11 if (dc->mul.use)
12 {
13 a = (dc->mul.col >> 24) & 0xff;
14 r = (dc->mul.col >> 16) & 0xff;
15 g = (dc->mul.col >> 8 ) & 0xff;
16 b = (dc->mul.col ) & 0xff;
17 }
18 else
19 {
20 r = g = b = a = 255;
21 }
22
23 glFlush();
24
25 c = gc->dc->clip.use;
26 cx = gc->dc->clip.x; cy = gc->dc->clip.y;
27 cw = gc->dc->clip.w; ch = gc->dc->clip.h;
28
29 evas_gl_common_context_line_push(gc, x1, y1, x2, y2,
30 c, cx, cy, cw, ch,
31 r, g, b, a);
32}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_polygon.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_polygon.c
new file mode 100644
index 0000000..06647cd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_polygon.c
@@ -0,0 +1,307 @@
1#include "evas_gl_private.h"
2
3// FIXME: this is a verbatim copy of the software poly renderer. it just
4// use gl to draw 1 pixel high spans like software does. this is to make
5// sure rendering correctness matches the software engine but also to save
6// time in coming up with a good triangulation algorithm. if you want to
7// feel free to turn this into a real triangulation system and use gl to its
8// fullest, but as such polygons are used so little, it's not worth it.
9
10typedef struct _RGBA_Span RGBA_Span;
11typedef struct _RGBA_Edge RGBA_Edge;
12typedef struct _RGBA_Vertex RGBA_Vertex;
13
14struct _RGBA_Span
15{
16 EINA_INLIST;
17 int x, y, w;
18};
19
20struct _RGBA_Edge
21{
22 double x, dx;
23 int i;
24};
25
26struct _RGBA_Vertex
27{
28 double x, y;
29 int i;
30};
31
32#define POLY_EDGE_DEL(_i) \
33 { \
34 int _j; \
35 \
36 for (_j = 0; (_j < num_active_edges) && (edges[_j].i != _i); _j++); \
37 if (_j < num_active_edges) \
38 { \
39 num_active_edges--; \
40 memmove(&(edges[_j]), &(edges[_j + 1]), \
41 (num_active_edges - _j) * sizeof(RGBA_Edge)); \
42 } \
43 }
44
45#define POLY_EDGE_ADD(_i, _y) \
46 { \
47 int _j; \
48 float _dx; \
49 RGBA_Vertex *_p, *_q; \
50 if (_i < (n - 1)) _j = _i + 1; \
51 else _j = 0; \
52 if (point[_i].y < point[_j].y) \
53 { \
54 _p = &(point[_i]); \
55 _q = &(point[_j]); \
56 } \
57 else \
58 { \
59 _p = &(point[_j]); \
60 _q = &(point[_i]); \
61 } \
62 edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \
63 edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \
64 edges[num_active_edges].i = _i; \
65 num_active_edges++; \
66 }
67
68Evas_GL_Polygon *
69evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y)
70{
71 Evas_GL_Polygon_Point *pt;
72
73 if (!poly) poly = calloc(1, sizeof(Evas_GL_Polygon));
74 if (!poly) return NULL;
75 pt = calloc(1, sizeof(Evas_GL_Polygon_Point));
76 if (!pt) return NULL;
77 pt->x = x;
78 pt->y = y;
79 poly->points = eina_list_append(poly->points, pt);
80 poly->changed = 1;
81 return poly;
82}
83
84Evas_GL_Polygon *
85evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly)
86{
87 if (!poly) return NULL;
88 while (poly->points)
89 {
90 Evas_GL_Polygon_Point *pt;
91
92 pt = poly->points->data;
93 poly->points = eina_list_remove(poly->points, pt);
94 free(pt);
95 }
96 free(poly);
97 return NULL;
98}
99
100static int
101polygon_point_sorter(const void *a, const void *b)
102{
103 RGBA_Vertex *p, *q;
104
105 p = (RGBA_Vertex *)a;
106 q = (RGBA_Vertex *)b;
107 if (p->y <= q->y) return -1;
108 return 1;
109}
110
111static int
112polygon_edge_sorter(const void *a, const void *b)
113{
114 RGBA_Edge *p, *q;
115
116 p = (RGBA_Edge *)a;
117 q = (RGBA_Edge *)b;
118 if (p->x <= q->x) return -1;
119 return 1;
120}
121
122void
123evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int dx, int dy)
124{
125 Cutout_Rects *rects;
126 Cutout_Rect *r;
127 int c, cx, cy, cw, ch, cr, cg, cb, ca, i;
128 int x = 0, y = 0, w = 0, h = 0;
129
130 Eina_List *l;
131 int n, k, num_active_edges, y0, y1, *sorted_index, j;
132 RGBA_Edge *edges;
133 RGBA_Vertex *point;
134 Evas_GL_Polygon_Point *pt;
135 Eina_Inlist *spans;
136
137 /* save out clip info */
138 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
139
140 ca = (gc->dc->col.col >> 24) & 0xff;
141 if (ca <= 0) return;
142 cr = (gc->dc->col.col >> 16) & 0xff;
143 cg = (gc->dc->col.col >> 8 ) & 0xff;
144 cb = (gc->dc->col.col ) & 0xff;
145
146 n = eina_list_count(poly->points);
147 if (n < 3) return;
148 edges = malloc(sizeof(RGBA_Edge) * n);
149 if (!edges) return;
150 point = malloc(sizeof(RGBA_Vertex) * n);
151 if (!point)
152 {
153 free(edges);
154 return;
155 }
156 sorted_index = malloc(sizeof(int) * n);
157 if (!sorted_index)
158 {
159 free(edges);
160 free(point);
161 return;
162 }
163
164 k = 0;
165 EINA_LIST_FOREACH(poly->points, l, pt)
166 {
167 point[k].x = pt->x + dx;
168 point[k].y = pt->y + dy;
169 point[k].i = k;
170 k++;
171 }
172 qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
173 for (k = 0; k < n; k++) sorted_index[k] = point[k].i;
174 k = 0;
175
176 EINA_LIST_FOREACH(poly->points, l, pt)
177 {
178 point[k].x = pt->x + dx;
179 point[k].y = pt->y + dy;
180 point[k].i = k;
181 k++;
182 }
183
184 y0 = MAX(cy, ceil(point[sorted_index[0]].y - 0.5));
185 y1 = MIN(cy + ch - 1, floor(point[sorted_index[n - 1]].y - 0.5));
186
187 k = 0;
188 num_active_edges = 0;
189 spans = NULL;
190
191 for (y = y0; y <= y1; y++)
192 {
193 for (; (k < n) && (point[sorted_index[k]].y <= ((double)y + 0.5)); k++)
194 {
195 i = sorted_index[k];
196
197 if (i > 0) j = i - 1;
198 else j = n - 1;
199 if (point[j].y <= ((double)y - 0.5))
200 {
201 POLY_EDGE_DEL(j)
202 }
203 else if (point[j].y > ((double)y + 0.5))
204 {
205 POLY_EDGE_ADD(j, y)
206 }
207 if (i < (n - 1)) j = i + 1;
208 else j = 0;
209 if (point[j].y <= ((double)y - 0.5))
210 {
211 POLY_EDGE_DEL(i)
212 }
213 else if (point[j].y > ((double)y + 0.5))
214 {
215 POLY_EDGE_ADD(i, y)
216 }
217 }
218
219 qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
220
221 for (j = 0; j < num_active_edges; j += 2)
222 {
223 int x0, x1;
224
225 x0 = ceil(edges[j].x - 0.5);
226 if (j < (num_active_edges - 1))
227 x1 = floor(edges[j + 1].x - 0.5);
228 else
229 x1 = x0;
230 if ((x1 >= cx) && (x0 < (cx + cw)) && (x0 <= x1))
231 {
232 RGBA_Span *span;
233
234 if (x0 < cx) x0 = cx;
235 if (x1 >= (cx + cw)) x1 = cx + cw - 1;
236 span = malloc(sizeof(RGBA_Span));
237 spans = eina_inlist_append(spans, EINA_INLIST_GET(span));
238 span->y = y;
239 span->x = x0;
240 span->w = (x1 - x0) + 1;
241 }
242 edges[j].x += edges[j].dx;
243 edges[j + 1].x += edges[j + 1].dx;
244 }
245 }
246
247 free(edges);
248 free(point);
249 free(sorted_index);
250
251 evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
252
253 if (spans)
254 {
255 RGBA_Span *span;
256
257 /* no cutouts - cut right to the chase */
258 if (!gc->dc->cutout.rects)
259 {
260 EINA_INLIST_FOREACH(spans, span)
261 {
262 x = span->x;
263 y = span->y;
264 w = span->w;
265 h = 1;
266 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca);
267 }
268 }
269 else
270 {
271 evas_common_draw_context_clip_clip(gc->dc, x, y, w, h);
272 /* our clip is 0 size.. abort */
273 if ((gc->dc->clip.w > 0) && (gc->dc->clip.h > 0))
274 {
275 rects = evas_common_draw_context_apply_cutouts(gc->dc);
276 for (i = 0; i < rects->active; ++i)
277 {
278 r = rects->rects + i;
279 if ((r->w > 0) && (r->h > 0))
280 {
281 EINA_INLIST_FOREACH(spans, span)
282 {
283 x = span->x;
284 y = span->y;
285 w = span->w;
286 h = 1;
287 RECTS_CLIP_TO_RECT(x, y, w, h, r->x, r->y, r->w, r->h);
288 if ((w > 0) && (h > 0))
289 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca);
290 }
291 }
292 }
293 evas_common_draw_context_apply_clear_cutouts(rects);
294 }
295 }
296 while (spans)
297 {
298 span = (RGBA_Span *)spans;
299 spans = eina_inlist_remove(spans, spans);
300 free(span);
301 }
302 }
303
304 /* restore clip info */
305 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
306
307}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_private.h b/libraries/evas/src/modules/engines/gl_common/evas_gl_private.h
new file mode 100644
index 0000000..a178823
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_private.h
@@ -0,0 +1,32 @@
1#ifndef _EVAS_GL_PRIVATE_H
2#define _EVAS_GL_PRIVATE_H
3#include "evas_gl_common.h"
4
5extern int _evas_engine_GL_common_log_dom;
6
7#ifdef ERR
8# undef ERR
9#endif
10#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_GL_common_log_dom, __VA_ARGS__)
11
12#ifdef DBG
13# undef DBG
14#endif
15#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_GL_common_log_dom, __VA_ARGS__)
16
17#ifdef INF
18# undef INF
19#endif
20#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_GL_common_log_dom, __VA_ARGS__)
21
22#ifdef WRN
23# undef WRN
24#endif
25#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_GL_common_log_dom, __VA_ARGS__)
26
27#ifdef CRIT
28# undef CRIT
29#endif
30#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_GL_common_log_dom, __VA_ARGS__)
31
32#endif
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c
new file mode 100644
index 0000000..1903314
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c
@@ -0,0 +1,53 @@
1#include "evas_gl_private.h"
2
3void
4evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
5{
6 Cutout_Rects *rects;
7 Cutout_Rect *r;
8 int c, cx, cy, cw, ch, cr, cg, cb, ca, i;
9
10 if ((w <= 0) || (h <= 0)) return;
11 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, gc->w, gc->h))) return;
12 /* save out clip info */
13 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
14
15 ca = (gc->dc->col.col >> 24) & 0xff;
16 if ((gc->dc->render_op != EVAS_RENDER_COPY) && (ca <= 0)) return;
17 cr = (gc->dc->col.col >> 16) & 0xff;
18 cg = (gc->dc->col.col >> 8 ) & 0xff;
19 cb = (gc->dc->col.col ) & 0xff;
20 evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
21 /* no cutouts - cut right to the chase */
22 if ((gc->dc) && (gc->dc->clip.use))
23 {
24 RECTS_CLIP_TO_RECT(x, y, w, h,
25 gc->dc->clip.x, gc->dc->clip.y,
26 gc->dc->clip.w, gc->dc->clip.h);
27 }
28
29 if (!gc->dc->cutout.rects)
30 {
31 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca);
32 }
33 else
34 {
35 evas_common_draw_context_clip_clip(gc->dc, x, y, w, h);
36 /* our clip is 0 size.. abort */
37 if ((gc->dc->clip.w > 0) && (gc->dc->clip.h > 0))
38 {
39 rects = evas_common_draw_context_apply_cutouts(gc->dc);
40 for (i = 0; i < rects->active; ++i)
41 {
42 r = rects->rects + i;
43 if ((r->w > 0) && (r->h > 0))
44 {
45 evas_gl_common_context_rectangle_push(gc, r->x, r->y, r->w, r->h, cr, cg, cb, ca);
46 }
47 }
48 evas_common_draw_context_apply_clear_cutouts(rects);
49 }
50 }
51 /* restore clip info */
52 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
53}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_shader.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_shader.c
new file mode 100644
index 0000000..6666ac5
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_shader.c
@@ -0,0 +1,1262 @@
1#include "evas_gl_private.h"
2
3/////////////////////////////////////////////
4#if defined (GLES_VARIETY_S3C6410)
5const unsigned int rect_frag_bin[] =
6{
7# include "shader/rect_frag_bin_s3c6410.h"
8};
9#endif
10
11const char rect_frag_glsl[] =
12#include "shader/rect_frag.h"
13 ;
14Evas_GL_Program_Source shader_rect_frag_src =
15{
16 rect_frag_glsl,
17#if defined (GLES_VARIETY_S3C6410)
18 rect_frag_bin, sizeof(rect_frag_bin)
19#else
20 NULL, 0
21#endif
22};
23
24#if defined (GLES_VARIETY_S3C6410)
25const unsigned int rect_vert_bin[] =
26{
27# include "shader/rect_vert_bin_s3c6410.h"
28};
29#endif
30const char rect_vert_glsl[] =
31#include "shader/rect_vert.h"
32 ;
33Evas_GL_Program_Source shader_rect_vert_src =
34{
35 rect_vert_glsl,
36#if defined (GLES_VARIETY_S3C6410)
37 rect_vert_bin, sizeof(rect_vert_bin)
38#else
39 NULL, 0
40#endif
41};
42
43/////////////////////////////////////////////
44#if defined (GLES_VARIETY_S3C6410)
45const unsigned int font_frag_bin[] =
46{
47# include "shader/font_frag_bin_s3c6410.h"
48};
49#endif
50
51const char font_frag_glsl[] =
52#include "shader/font_frag.h"
53 ;
54Evas_GL_Program_Source shader_font_frag_src =
55{
56 font_frag_glsl,
57#if defined (GLES_VARIETY_S3C6410)
58 font_frag_bin, sizeof(font_frag_bin)
59#else
60 NULL, 0
61#endif
62};
63
64#if defined (GLES_VARIETY_S3C6410)
65const unsigned int font_vert_bin[] =
66{
67# include "shader/font_vert_bin_s3c6410.h"
68};
69#endif
70const char font_vert_glsl[] =
71#include "shader/font_vert.h"
72 ;
73Evas_GL_Program_Source shader_font_vert_src =
74{
75 font_vert_glsl,
76#if defined (GLES_VARIETY_S3C6410)
77 font_vert_bin, sizeof(font_vert_bin)
78#else
79 NULL, 0
80#endif
81};
82
83/////////////////////////////////////////////
84#if defined (GLES_VARIETY_S3C6410)
85const unsigned int yuv_frag_bin[] =
86{
87# include "shader/yuv_frag_bin_s3c6410.h"
88};
89#endif
90
91const char yuv_frag_glsl[] =
92#include "shader/yuv_frag.h"
93 ;
94Evas_GL_Program_Source shader_yuv_frag_src =
95{
96 yuv_frag_glsl,
97#if defined (GLES_VARIETY_S3C6410)
98 yuv_frag_bin, sizeof(yuv_frag_bin)
99#else
100 NULL, 0
101#endif
102};
103
104#if defined (GLES_VARIETY_S3C6410)
105const unsigned int yuv_vert_bin[] =
106{
107# include "shader/yuv_vert_bin_s3c6410.h"
108};
109#endif
110const char yuv_vert_glsl[] =
111#include "shader/yuv_vert.h"
112 ;
113Evas_GL_Program_Source shader_yuv_vert_src =
114{
115 yuv_vert_glsl,
116#if defined (GLES_VARIETY_S3C6410)
117 yuv_vert_bin, sizeof(yuv_vert_bin)
118#else
119 NULL, 0
120#endif
121};
122
123/////////////////////////////////////////////
124#if defined (GLES_VARIETY_S3C6410)
125const unsigned int yuy2_frag_bin[] =
126{
127# include "shader/yuy2_frag_bin_s3c6410.h"
128};
129#endif
130
131const char yuy2_frag_glsl[] =
132#include "shader/yuy2_frag.h"
133 ;
134Evas_GL_Program_Source shader_yuy2_frag_src =
135{
136 yuy2_frag_glsl,
137#if defined (GLES_VARIETY_S3C6410)
138 yuy2_frag_bin, sizeof(yuy2_frag_bin)
139#else
140 NULL, 0
141#endif
142};
143
144#if defined (GLES_VARIETY_S3C6410)
145const unsigned int yuy2_vert_bin[] =
146{
147# include "shader/yuy2_vert_bin_s3c6410.h"
148};
149#endif
150const char yuy2_vert_glsl[] =
151#include "shader/yuy2_vert.h"
152 ;
153Evas_GL_Program_Source shader_yuy2_vert_src =
154{
155 yuy2_vert_glsl,
156#if defined (GLES_VARIETY_S3C6410)
157 yuy2_vert_bin, sizeof(yuy2_vert_bin)
158#else
159 NULL, 0
160#endif
161};
162
163/////////////////////////////////////////////
164#if defined (GLES_VARIETY_S3C6410)
165const unsigned int yuy2_nomul_frag_bin[] =
166{
167# include "shader/yuy2_nomul_frag_bin_s3c6410.h"
168};
169#endif
170
171const char yuy2_nomul_frag_glsl[] =
172#include "shader/yuy2_nomul_frag.h"
173 ;
174Evas_GL_Program_Source shader_yuy2_nomul_frag_src =
175{
176 yuy2_nomul_frag_glsl,
177#if defined (GLES_VARIETY_S3C6410)
178 yuy2_nomul_frag_bin, sizeof(yuy2_nomul_frag_bin)
179#else
180 NULL, 0
181#endif
182};
183
184#if defined (GLES_VARIETY_S3C6410)
185const unsigned int yuy2_nomul_vert_bin[] =
186{
187# include "shader/yuy2_nomul_vert_bin_s3c6410.h"
188};
189#endif
190const char yuy2_nomul_vert_glsl[] =
191#include "shader/yuy2_nomul_vert.h"
192 ;
193Evas_GL_Program_Source shader_yuy2_nomul_vert_src =
194{
195 yuy2_nomul_vert_glsl,
196#if defined (GLES_VARIETY_S3C6410)
197 yuy2_nomul_vert_bin, sizeof(yuy2_nomul_vert_bin)
198#else
199 NULL, 0
200#endif
201};
202
203/////////////////////////////////////////////
204#if defined (GLES_VARIETY_S3C6410)
205const unsigned int nv12_nomul_vert_bin[] =
206{
207# include "shader/nv12_nomul_vert_bin_s3c6410.h"
208};
209#endif
210const char nv12_nomul_vert_glsl[] =
211#include "shader/nv12_nomul_vert.h"
212 ;
213Evas_GL_Program_Source shader_nv12_nomul_vert_src =
214{
215 nv12_nomul_vert_glsl,
216#if defined (GLES_VARIETY_S3C6410)
217 nv12_nomul_vert_bin, sizeof(nv12_nomul_vert_bin)
218#else
219 NULL, 0
220#endif
221};
222
223#if defined (GLES_VARIETY_S3C6410)
224const unsigned int nv12_vert_bin[] =
225{
226# include "shader/nv12_vert_bin_s3c6410.h"
227};
228#endif
229const char nv12_vert_glsl[] =
230#include "shader/nv12_vert.h"
231 ;
232Evas_GL_Program_Source shader_nv12_vert_src =
233{
234 nv12_vert_glsl,
235#if defined (GLES_VARIETY_S3C6410)
236 nv12_vert_bin, sizeof(nv12_vert_bin)
237#else
238 NULL, 0
239#endif
240};
241
242#if defined (GLES_VARIETY_S3C6410)
243const unsigned int nv12_nomul_frag_bin[] =
244{
245# include "shader/nv12_nomul_frag_bin_s3c6410.h"
246};
247#endif
248
249const char nv12_frag_glsl[] =
250#include "shader/nv12_frag.h"
251 ;
252Evas_GL_Program_Source shader_nv12_frag_src =
253{
254 nv12_frag_glsl,
255#if defined (GLES_VARIETY_S3C6410)
256 nv12_frag_bin, sizeof(nv12_frag_bin)
257#else
258 NULL, 0
259#endif
260};
261
262#if defined (GLES_VARIETY_S3C6410)
263const unsigned int nv12_nomul_frag_bin[] =
264{
265# include "shader/nv12_nomul_frag_bin_s3c6410.h"
266};
267#endif
268
269const char nv12_nomul_frag_glsl[] =
270#include "shader/nv12_nomul_frag.h"
271 ;
272Evas_GL_Program_Source shader_nv12_nomul_frag_src =
273{
274 nv12_nomul_frag_glsl,
275#if defined (GLES_VARIETY_S3C6410)
276 nv12_nomul_frag_bin, sizeof(nv12_nomul_frag_bin)
277#else
278 NULL, 0
279#endif
280};
281
282/////////////////////////////////////////////
283#if defined (GLES_VARIETY_S3C6410)
284const unsigned int yuv_nomul_frag_bin[] =
285{
286# include "shader/yuv_nomul_frag_bin_s3c6410.h"
287};
288#endif
289
290const char yuv_nomul_frag_glsl[] =
291#include "shader/yuv_nomul_frag.h"
292 ;
293Evas_GL_Program_Source shader_yuv_nomul_frag_src =
294{
295 yuv_nomul_frag_glsl,
296#if defined (GLES_VARIETY_S3C6410)
297 yuv_nomul_frag_bin, sizeof(yuv_nomul_frag_bin)
298#else
299 NULL, 0
300#endif
301};
302
303#if defined (GLES_VARIETY_S3C6410)
304const unsigned int yuv_nomul_vert_bin[] =
305{
306# include "shader/yuv_nomul_vert_bin_s3c6410.h"
307};
308#endif
309const char yuv_nomul_vert_glsl[] =
310#include "shader/yuv_nomul_vert.h"
311 ;
312Evas_GL_Program_Source shader_yuv_nomul_vert_src =
313{
314 yuv_nomul_vert_glsl,
315#if defined (GLES_VARIETY_S3C6410)
316 yuv_nomul_vert_bin, sizeof(yuv_nomul_vert_bin)
317#else
318 NULL, 0
319#endif
320};
321
322/////////////////////////////////////////////
323#if defined (GLES_VARIETY_S3C6410)
324const unsigned int tex_frag_bin[] =
325{
326# include "shader/tex_frag_bin_s3c6410.h"
327};
328#endif
329
330const char tex_frag_glsl[] =
331#include "shader/tex_frag.h"
332 ;
333Evas_GL_Program_Source shader_tex_frag_src =
334{
335 tex_frag_glsl,
336#if defined (GLES_VARIETY_S3C6410)
337 tex_frag_bin, sizeof(tex_frag_bin)
338#else
339 NULL, 0
340#endif
341};
342
343#if defined (GLES_VARIETY_S3C6410)
344const unsigned int tex_vert_bin[] =
345{
346# include "shader/tex_vert_bin_s3c6410.h"
347};
348#endif
349const char tex_vert_glsl[] =
350#include "shader/tex_vert.h"
351 ;
352Evas_GL_Program_Source shader_tex_vert_src =
353{
354 tex_vert_glsl,
355#if defined (GLES_VARIETY_S3C6410)
356 tex_vert_bin, sizeof(tex_vert_bin)
357#else
358 NULL, 0
359#endif
360};
361
362/////////////////////////////////////////////
363#if defined (GLES_VARIETY_S3C6410)
364const unsigned int tex_nomul_frag_bin[] =
365{
366# include "shader/tex_nomul_frag_bin_s3c6410.h"
367};
368#endif
369
370const char tex_nomul_frag_glsl[] =
371#include "shader/tex_nomul_frag.h"
372 ;
373Evas_GL_Program_Source shader_tex_nomul_frag_src =
374{
375 tex_nomul_frag_glsl,
376#if defined (GLES_VARIETY_S3C6410)
377 tex_nomul_frag_bin, sizeof(tex_nomul_frag_bin)
378#else
379 NULL, 0
380#endif
381};
382
383#if defined (GLES_VARIETY_S3C6410)
384const unsigned int tex_nomul_vert_bin[] =
385{
386# include "shader/tex_nomul_vert_bin_s3c6410.h"
387};
388#endif
389const char tex_nomul_vert_glsl[] =
390#include "shader/tex_nomul_vert.h"
391 ;
392Evas_GL_Program_Source shader_tex_nomul_vert_src =
393{
394 tex_nomul_vert_glsl,
395#if defined (GLES_VARIETY_S3C6410)
396 tex_nomul_vert_bin, sizeof(tex_nomul_vert_bin)
397#else
398 NULL, 0
399#endif
400};
401
402/////////////////////////////////////////////
403#if defined (GLES_VARIETY_S3C6410)
404const unsigned int img_frag_bin[] =
405{
406# include "shader/img_frag_bin_s3c6410.h"
407};
408#endif
409
410const char img_frag_glsl[] =
411#include "shader/img_frag.h"
412 ;
413Evas_GL_Program_Source shader_img_frag_src =
414{
415 img_frag_glsl,
416#if defined (GLES_VARIETY_S3C6410)
417 img_frag_bin, sizeof(img_frag_bin)
418#else
419 NULL, 0
420#endif
421};
422
423#if defined (GLES_VARIETY_S3C6410)
424const unsigned int img_vert_bin[] =
425{
426# include "shader/img_vert_bin_s3c6410.h"
427};
428#endif
429const char img_vert_glsl[] =
430#include "shader/img_vert.h"
431 ;
432Evas_GL_Program_Source shader_img_vert_src =
433{
434 img_vert_glsl,
435#if defined (GLES_VARIETY_S3C6410)
436 img_vert_bin, sizeof(img_vert_bin)
437#else
438 NULL, 0
439#endif
440};
441
442/////////////////////////////////////////////
443#if defined (GLES_VARIETY_S3C6410)
444const unsigned int img_nomul_frag_bin[] =
445{
446# include "shader/img_nomul_frag_bin_s3c6410.h"
447};
448#endif
449
450const char img_nomul_frag_glsl[] =
451#include "shader/img_nomul_frag.h"
452 ;
453Evas_GL_Program_Source shader_img_nomul_frag_src =
454{
455 img_nomul_frag_glsl,
456#if defined (GLES_VARIETY_S3C6410)
457 img_nomul_frag_bin, sizeof(img_nomul_frag_bin)
458#else
459 NULL, 0
460#endif
461};
462
463#if defined (GLES_VARIETY_S3C6410)
464const unsigned int img_nomul_vert_bin[] =
465{
466# include "shader/img_nomul_vert_bin_s3c6410.h"
467};
468#endif
469const char img_nomul_vert_glsl[] =
470#include "shader/img_nomul_vert.h"
471 ;
472Evas_GL_Program_Source shader_img_nomul_vert_src =
473{
474 img_nomul_vert_glsl,
475#if defined (GLES_VARIETY_S3C6410)
476 img_nomul_vert_bin, sizeof(img_nomul_vert_bin)
477#else
478 NULL, 0
479#endif
480};
481
482/////////////////////////////////////////////
483#if defined (GLES_VARIETY_S3C6410)
484const unsigned int img_bgra_frag_bin[] =
485{
486# include "shader/img_bgra_frag_bin_s3c6410.h"
487};
488#endif
489
490const char img_bgra_frag_glsl[] =
491#include "shader/img_bgra_frag.h"
492 ;
493Evas_GL_Program_Source shader_img_bgra_frag_src =
494{
495 img_bgra_frag_glsl,
496#if defined (GLES_VARIETY_S3C6410)
497 img_bgra_frag_bin, sizeof(img_bgra_frag_bin)
498#else
499 NULL, 0
500#endif
501};
502
503#if defined (GLES_VARIETY_S3C6410)
504const unsigned int img_bgra_vert_bin[] =
505{
506# include "shader/img_bgra_vert_bin_s3c6410.h"
507};
508#endif
509const char img_bgra_vert_glsl[] =
510#include "shader/img_bgra_vert.h"
511 ;
512Evas_GL_Program_Source shader_img_bgra_vert_src =
513{
514 img_bgra_vert_glsl,
515#if defined (GLES_VARIETY_S3C6410)
516 img_bgra_vert_bin, sizeof(img_bgra_vert_bin)
517#else
518 NULL, 0
519#endif
520};
521
522
523/////////////////////////////////////////////
524#if defined (GLES_VARIETY_S3C6410)
525const unsigned int img_mask_frag_bin[] =
526{
527# include "shader/img_mask_frag_bin_s3c6410.h"
528};
529#endif
530
531const char img_mask_frag_glsl[] =
532#include "shader/img_mask_frag.h"
533 ;
534Evas_GL_Program_Source shader_img_mask_frag_src =
535{
536 img_mask_frag_glsl,
537#if defined (GLES_VARIETY_S3C6410)
538 img_mask_frag_bin, sizeof(img_mask_frag_bin)
539#else
540 NULL, 0
541#endif
542};
543
544#if defined (GLES_VARIETY_S3C6410)
545const unsigned int img_mask_vert_bin[] =
546{
547# include "shader/img_mask_vert_bin_s3c6410.h"
548};
549#endif
550const char img_mask_vert_glsl[] =
551#include "shader/img_mask_vert.h"
552 ;
553Evas_GL_Program_Source shader_img_mask_vert_src =
554{
555 img_mask_vert_glsl,
556#if defined (GLES_VARIETY_S3C6410)
557 img_mask_vert_bin, sizeof(img_mask_vert_bin)
558#else
559 NULL, 0
560#endif
561};
562
563
564/////////////////////////////////////////////
565#if defined (GLES_VARIETY_S3C6410)
566const unsigned int img_bgra_nomul_frag_bin[] =
567{
568# include "shader/img_bgra_nomul_frag_bin_s3c6410.h"
569};
570#endif
571
572const char img_bgra_nomul_frag_glsl[] =
573#include "shader/img_bgra_nomul_frag.h"
574 ;
575Evas_GL_Program_Source shader_img_bgra_nomul_frag_src =
576{
577 img_bgra_nomul_frag_glsl,
578#if defined (GLES_VARIETY_S3C6410)
579 img_bgra_nomul_frag_bin, sizeof(img_bgra_nomul_frag_bin)
580#else
581 NULL, 0
582#endif
583};
584
585#if defined (GLES_VARIETY_S3C6410)
586const unsigned int img_bgra_nomul_vert_bin[] =
587{
588# include "shader/img_bgra_nomul_vert_bin_s3c6410.h"
589};
590#endif
591const char img_bgra_nomul_vert_glsl[] =
592#include "shader/img_bgra_nomul_vert.h"
593 ;
594Evas_GL_Program_Source shader_img_bgra_nomul_vert_src =
595{
596 img_bgra_nomul_vert_glsl,
597#if defined (GLES_VARIETY_S3C6410)
598 img_bgra_nomul_vert_bin, sizeof(img_bgra_nomul_vert_bin)
599#else
600 NULL, 0
601#endif
602};
603
604/////////////////////////////////////////////
605const char filter_invert_frag_glsl[] =
606#include "shader/filter_invert.h"
607 ;
608Evas_GL_Program_Source shader_filter_invert_frag_src =
609{
610 filter_invert_frag_glsl,
611 NULL, 0
612};
613
614const char filter_invert_nomul_frag_glsl[] =
615#include "shader/filter_invert_nomul.h"
616 ;
617Evas_GL_Program_Source shader_filter_invert_nomul_frag_src =
618{
619 filter_invert_nomul_frag_glsl,
620 NULL, 0
621};
622
623const char filter_invert_bgra_frag_glsl[] =
624#include "shader/filter_invert_bgra.h"
625 ;
626Evas_GL_Program_Source shader_filter_invert_bgra_frag_src =
627{
628 filter_invert_bgra_frag_glsl,
629 NULL, 0
630};
631const char filter_invert_bgra_nomul_frag_glsl[] =
632#include "shader/filter_invert_bgra_nomul.h"
633 ;
634Evas_GL_Program_Source shader_filter_invert_bgra_nomul_frag_src =
635{
636 filter_invert_bgra_nomul_frag_glsl,
637 NULL, 0
638};
639
640/////////////////////////////////////////////
641const char filter_greyscale_frag_glsl[] =
642#include "shader/filter_greyscale.h"
643 ;
644Evas_GL_Program_Source shader_filter_greyscale_frag_src =
645{
646 filter_greyscale_frag_glsl,
647 NULL, 0
648};
649
650const char filter_greyscale_nomul_frag_glsl[] =
651#include "shader/filter_greyscale_nomul.h"
652 ;
653Evas_GL_Program_Source shader_filter_greyscale_nomul_frag_src =
654{
655 filter_greyscale_nomul_frag_glsl,
656 NULL, 0
657};
658
659const char filter_greyscale_bgra_frag_glsl[] =
660#include "shader/filter_greyscale_bgra.h"
661 ;
662Evas_GL_Program_Source shader_filter_greyscale_bgra_frag_src =
663{
664 filter_greyscale_bgra_frag_glsl,
665 NULL, 0
666};
667const char filter_greyscale_bgra_nomul_frag_glsl[] =
668#include "shader/filter_greyscale_bgra_nomul.h"
669 ;
670Evas_GL_Program_Source shader_filter_greyscale_bgra_nomul_frag_src =
671{
672 filter_greyscale_bgra_nomul_frag_glsl,
673 NULL, 0
674};
675
676/////////////////////////////////////////////
677const char filter_sepia_frag_glsl[] =
678#include "shader/filter_sepia.h"
679 ;
680Evas_GL_Program_Source shader_filter_sepia_frag_src =
681{
682 filter_sepia_frag_glsl,
683 NULL, 0
684};
685
686const char filter_sepia_nomul_frag_glsl[] =
687#include "shader/filter_sepia_nomul.h"
688 ;
689Evas_GL_Program_Source shader_filter_sepia_nomul_frag_src =
690{
691 filter_sepia_nomul_frag_glsl,
692 NULL, 0
693};
694
695const char filter_sepia_bgra_frag_glsl[] =
696#include "shader/filter_sepia_bgra.h"
697 ;
698Evas_GL_Program_Source shader_filter_sepia_bgra_frag_src =
699{
700 filter_sepia_bgra_frag_glsl,
701 NULL, 0
702};
703const char filter_sepia_bgra_nomul_frag_glsl[] =
704#include "shader/filter_sepia_bgra_nomul.h"
705 ;
706Evas_GL_Program_Source shader_filter_sepia_bgra_nomul_frag_src =
707{
708 filter_sepia_bgra_nomul_frag_glsl,
709 NULL, 0
710};
711
712/////////////////////////////////////////////
713#if 0
714 Blur is a work in progress currently.
715 Mostly because GPUs are so hopeless.
716const char filter_blur_vert_glsl[] =
717#include "shader/filter_blur_vert.h"
718 ;
719
720Evas_GL_Program_Source shader_filter_blur_vert_src =
721{
722 filter_blur_vert_glsl,
723 NULL, 0
724};
725
726const char filter_blur_frag_glsl[] =
727#include "shader/filter_blur.h"
728 ;
729Evas_GL_Program_Source shader_filter_blur_frag_src =
730{
731 filter_blur_frag_glsl,
732 NULL, 0
733};
734
735const char filter_blur_nomul_frag_glsl[] =
736#include "shader/filter_blur_nomul.h"
737 ;
738Evas_GL_Program_Source shader_filter_blur_nomul_frag_src =
739{
740 filter_blur_nomul_frag_glsl,
741 NULL, 0
742};
743
744const char filter_blur_bgra_frag_glsl[] =
745#include "shader/filter_blur_bgra.h"
746 ;
747Evas_GL_Program_Source shader_filter_blur_bgra_frag_src =
748{
749 filter_blur_bgra_frag_glsl,
750 NULL, 0
751};
752const char filter_blur_bgra_nomul_frag_glsl[] =
753#include "shader/filter_blur_bgra_nomul.h"
754 ;
755Evas_GL_Program_Source shader_filter_blur_bgra_nomul_frag_src =
756{
757 filter_blur_bgra_nomul_frag_glsl,
758 NULL, 0
759};
760
761#endif
762
763
764
765/////////////////////////////////////////////
766static void
767gl_compile_link_error(GLuint target, const char *action)
768{
769 int loglen = 0, chars = 0;
770 char *logtxt;
771
772 /* Shader info log */
773 glGetShaderiv(target, GL_INFO_LOG_LENGTH, &loglen);
774 if (loglen > 0)
775 {
776 logtxt = calloc(loglen, sizeof(char));
777 if (logtxt)
778 {
779 glGetShaderInfoLog(target, loglen, &chars, logtxt);
780 ERR("Failed to %s: %s", action, logtxt);
781 free(logtxt);
782 }
783 }
784
785 /* Program info log */
786 glGetProgramiv(target, GL_INFO_LOG_LENGTH, &loglen);
787 if (loglen > 0)
788 {
789 logtxt = calloc(loglen, sizeof(char));
790 if (logtxt)
791 {
792 glGetProgramInfoLog(target, loglen, &chars, logtxt);
793 ERR("Failed to %s: %s", action, logtxt);
794 free(logtxt);
795 }
796 }
797}
798
799static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
800
801static Eina_Bool
802_evas_gl_shader_file_is_dir(const char *file)
803{
804 struct stat st;
805
806 if (stat(file, &st) < 0) return EINA_FALSE;
807 if (S_ISDIR(st.st_mode)) return EINA_TRUE;
808 return EINA_FALSE;
809}
810
811static Eina_Bool
812_evas_gl_shader_file_mkdir(const char *dir)
813{
814 /* evas gl shader only call this function when the dir is not exist */
815 if (mkdir(dir, default_mode) < 0) return EINA_FALSE;
816 return EINA_TRUE;
817}
818
819static Eina_Bool
820_evas_gl_shader_file_exists(const char *file)
821{
822 struct stat st;
823 if (!file) return EINA_FALSE;
824 if (stat(file, &st) < 0) return EINA_FALSE;
825 return EINA_TRUE;
826}
827
828static inline Eina_Bool
829_evas_gl_shader_file_mkpath_if_not_exists(const char *path)
830{
831 struct stat st;
832
833 if (stat(path, &st) < 0)
834 return _evas_gl_shader_file_mkdir(path);
835 else if (!S_ISDIR(st.st_mode))
836 return EINA_FALSE;
837 else
838 return EINA_TRUE;
839}
840
841static Eina_Bool
842_evas_gl_shader_file_mkpath(const char *path)
843{
844 char ss[PATH_MAX];
845 unsigned int i;
846
847 if (_evas_gl_shader_file_is_dir(path)) return EINA_TRUE;
848
849 for (i = 0; path[i]; ss[i] = path[i], i++)
850 {
851 if (i == sizeof(ss) - 1) return EINA_FALSE;
852 if ((path[i] == '/') && (i > 0))
853 {
854 ss[i] = 0;
855 if (!_evas_gl_shader_file_mkpath_if_not_exists(ss))
856 return EINA_FALSE;
857 }
858 }
859 ss[i] = 0;
860 return _evas_gl_shader_file_mkpath_if_not_exists(ss);
861}
862
863static int
864_evas_gl_shader_dir_check(char *bin_shader_dir, int num)
865{
866 char *home = NULL;
867 char *subdir = ".cache/evas_gl_common_shaders";
868
869 home = getenv("HOME");
870 if ((!home) || (!home[0])) return 0;
871
872 snprintf(bin_shader_dir, num, "%s/%s", home, subdir);
873 return _evas_gl_shader_file_exists(bin_shader_dir);
874}
875
876static int
877_evas_gl_shader_file_check(const char *bin_shader_dir, char *bin_shader_file, int dir_num)
878{
879 char before_name[PATH_MAX];
880 char after_name[PATH_MAX];
881 int new_path_len = 0;
882 int i = 0, j = 0;
883
884 char *vendor = NULL;
885 char *driver = NULL;
886 char *version = NULL;
887
888 vendor = (char *)glGetString(GL_VENDOR);
889 driver = (char *)glGetString(GL_RENDERER);
890 version = (char *)glGetString(GL_VERSION);
891
892 new_path_len = snprintf(before_name, sizeof(before_name), "%s::%s::%s::%s::binary_shader.eet", vendor, version, driver, MODULE_ARCH);
893
894 /* remove '/' from file name */
895 for (i = 0; i < new_path_len; i++)
896 {
897 if (before_name[i] != '/')
898 {
899 after_name[j] = before_name[i];
900 j++;
901 }
902 }
903 after_name[j] = 0;
904
905 snprintf(bin_shader_file, dir_num, "%s/%s", bin_shader_dir, after_name);
906
907 return _evas_gl_shader_file_exists(bin_shader_file);
908}
909
910static int
911_evas_gl_common_shader_program_binary_init(Evas_GL_Program *p,
912 const char *pname,
913 Eet_File *ef)
914{
915 int res = 0, num = 0, length = 0;
916 int *formats = NULL;
917 void *data = NULL;
918 GLint ok = 0;
919
920 if (!ef) return res;
921
922 data = eet_read(ef, pname, &length);
923 if ((!data) || (length <= 0)) goto finish;
924
925 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num);
926 if (num <= 0) goto finish;
927
928 formats = calloc(num, sizeof(int));
929 if (!formats) goto finish;
930
931 glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats);
932 if (!formats[0]) goto finish;
933
934 p->prog = glCreateProgram();
935
936 glsym_glProgramBinary(p->prog, formats[0], data, length);
937
938 glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
939 glBindAttribLocation(p->prog, SHAD_COLOR, "color");
940 glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
941 glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
942 glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
943 glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
944
945 glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
946 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
947 if (!ok)
948 {
949 gl_compile_link_error(p->prog, "load a program object");
950 ERR("Abort load of program (%s)", pname);
951 goto finish;
952 }
953
954 res = 1;
955
956finish:
957 if (formats) free(formats);
958 if (data) free(data);
959 if ((!res) && (p->prog))
960 {
961 glDeleteProgram(p->prog);
962 p->prog = 0;
963 }
964 return res;
965}
966
967static int
968_evas_gl_common_shader_program_binary_save(Evas_GL_Program *p,
969 const char *pname,
970 Eet_File *ef)
971{
972 void* data = NULL;
973 GLenum format;
974 int length = 0, size = 0;
975
976 if (!glsym_glGetProgramBinary) return 0;
977
978 glGetProgramiv(p->prog, GL_PROGRAM_BINARY_LENGTH, &length);
979 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
980 if (length <= 0) return 0;
981
982 data = malloc(length);
983 if (!data) return 0;
984
985 glsym_glGetProgramBinary(p->prog, length, &size, &format, data);
986 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
987
988 if (length != size)
989 {
990 free(data);
991 return 0;
992 }
993
994 if (eet_write(ef, pname, data, length, 0) < 0)
995 {
996 if (data) free(data);
997 return 0;
998 }
999 if (data) free(data);
1000 return 1;
1001}
1002
1003static int
1004_evas_gl_common_shader_program_source_init(Evas_GL_Program *p,
1005 Evas_GL_Program_Source *vert,
1006 Evas_GL_Program_Source *frag,
1007 const char *name)
1008{
1009 GLint ok;
1010
1011 p->vert = glCreateShader(GL_VERTEX_SHADER);
1012 p->frag = glCreateShader(GL_FRAGMENT_SHADER);
1013#if defined (GLES_VARIETY_S3C6410)
1014 glShaderBinary(1, &(p->vert), 0, vert->bin, vert->bin_size);
1015 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1016 glShaderBinary(1, &(p->frag), 0, frag->bin, frag->bin_size);
1017 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1018#else
1019 glShaderSource(p->vert, 1,
1020 (const char **)&(vert->src), NULL);
1021 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1022 glCompileShader(p->vert);
1023 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1024 ok = 0;
1025 glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok);
1026 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1027 if (!ok)
1028 {
1029 gl_compile_link_error(p->vert, "compile vertex shader");
1030 ERR("Abort compile of shader vert (%s): %s", name, vert->src);
1031 return 0;
1032 }
1033 glShaderSource(p->frag, 1,
1034 (const char **)&(frag->src), NULL);
1035 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1036 glCompileShader(p->frag);
1037 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1038 ok = 0;
1039 glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok);
1040 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1041 if (!ok)
1042 {
1043 gl_compile_link_error(p->frag, "compile fragment shader");
1044 ERR("Abort compile of shader frag (%s): %s", name, frag->src);
1045 return 0;
1046 }
1047#endif
1048 p->prog = glCreateProgram();
1049#if defined(GLES_VARIETY_S3C6410) || defined(GLES_VARIETY_SGX)
1050#else
1051 if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri))
1052 glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT,
1053 GL_TRUE);
1054#endif
1055 glAttachShader(p->prog, p->vert);
1056 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1057 glAttachShader(p->prog, p->frag);
1058 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1059
1060 glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex");
1061 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1062 glBindAttribLocation(p->prog, SHAD_COLOR, "color");
1063 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1064 glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord");
1065 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1066 glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2");
1067 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1068 glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3");
1069 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1070 glBindAttribLocation(p->prog, SHAD_TEXM, "tex_coordm");
1071 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1072
1073 glLinkProgram(p->prog);
1074 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1075 ok = 0;
1076 glGetProgramiv(p->prog, GL_LINK_STATUS, &ok);
1077 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1078 if (!ok)
1079 {
1080 gl_compile_link_error(p->prog, "link fragment and vertex shaders");
1081 ERR("Abort compile of shader frag (%s): %s", name, frag->src);
1082 ERR("Abort compile of shader vert (%s): %s", name, vert->src);
1083 return 0;
1084 }
1085 return 1;
1086}
1087
1088#define SHADER_SOURCE_LINE(Big, Small) \
1089 { SHADER_##Big, &(shader_##Small##_vert_src), &(shader_##Small##_frag_src), #Small }
1090
1091#define SHADER_SOURCE_FILTER_LINE(Big, Small) \
1092 { SHADER_##Big, &(shader_img_vert_src), &(shader_##Small##_frag_src), #Small }
1093
1094static const struct {
1095 Evas_GL_Shader id;
1096 Evas_GL_Program_Source *vert;
1097 Evas_GL_Program_Source *frag;
1098 const char *name;
1099} _shaders_source[] = {
1100 SHADER_SOURCE_LINE(RECT, rect),
1101 SHADER_SOURCE_LINE(FONT, font),
1102 SHADER_SOURCE_LINE(IMG, img),
1103 SHADER_SOURCE_LINE(IMG_NOMUL, img_nomul),
1104 SHADER_SOURCE_LINE(IMG_BGRA, img_bgra),
1105 SHADER_SOURCE_LINE(IMG_BGRA_NOMUL, img_bgra_nomul),
1106 SHADER_SOURCE_LINE(IMG_MASK, img_mask),
1107 SHADER_SOURCE_LINE(YUV, yuv),
1108 SHADER_SOURCE_LINE(YUV_NOMUL, yuv_nomul),
1109 SHADER_SOURCE_LINE(YUY2, yuy2),
1110 SHADER_SOURCE_LINE(YUY2_NOMUL, yuy2_nomul),
1111 SHADER_SOURCE_LINE(NV12, nv12),
1112 SHADER_SOURCE_LINE(NV12_NOMUL, nv12_nomul),
1113 SHADER_SOURCE_LINE(TEX, tex),
1114 SHADER_SOURCE_LINE(TEX_NOMUL, tex_nomul),
1115 /* Most of the filters use the image fragment shader */
1116 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT, filter_invert),
1117 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_NOMUL, filter_invert_nomul),
1118 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_BGRA, filter_invert_bgra),
1119 SHADER_SOURCE_FILTER_LINE(FILTER_INVERT_BGRA_NOMUL, filter_invert_bgra_nomul),
1120 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE, filter_greyscale),
1121 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_NOMUL, filter_greyscale_nomul),
1122 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_BGRA, filter_greyscale_bgra),
1123 SHADER_SOURCE_FILTER_LINE(FILTER_GREYSCALE_BGRA_NOMUL, filter_greyscale_bgra_nomul),
1124 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA, filter_sepia),
1125 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_NOMUL, filter_sepia_nomul),
1126 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_BGRA, filter_sepia_bgra),
1127 SHADER_SOURCE_FILTER_LINE(FILTER_SEPIA_BGRA_NOMUL, filter_sepia_bgra_nomul)/* , */
1128 /* SHADER_SOURCE_LINE(FILTER_BLUR, filter_blur), */
1129 /* SHADER_SOURCE_LINE(FILTER_BLUR_NOMUL, filter_blur_nomul), */
1130 /* SHADER_SOURCE_LINE(FILTER_BLUR_BGRA, filter_blur_bgra), */
1131 /* SHADER_SOURCE_LINE(FILTER_BLUR_BGRA_NOMUL, filter_blur_bgra_nomul) */
1132};
1133
1134static int
1135_evas_gl_common_shader_source_init(Evas_GL_Shared *shared)
1136{
1137 unsigned int i;
1138
1139 for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i)
1140 if (!_evas_gl_common_shader_program_source_init(&(shared->shader[_shaders_source[i].id]),
1141 _shaders_source[i].vert,
1142 _shaders_source[i].frag,
1143 _shaders_source[i].name))
1144 return 0;
1145
1146 return 1;
1147}
1148
1149static int
1150_evas_gl_common_shader_binary_init(Evas_GL_Shared *shared)
1151{
1152 /* check eet */
1153 Eet_File *et = NULL;
1154 char bin_dir_path[PATH_MAX];
1155 char bin_file_path[PATH_MAX];
1156 unsigned int i;
1157
1158 if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
1159 return 0;
1160
1161 if (!_evas_gl_shader_file_check(bin_dir_path, bin_file_path,
1162 sizeof(bin_dir_path)))
1163 return 0;
1164
1165 /* use eet */
1166 if (!eet_init()) return 0;
1167 et = eet_open(bin_file_path, EET_FILE_MODE_READ);
1168 if (!et) goto error;
1169
1170 for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i)
1171 if (!_evas_gl_common_shader_program_binary_init(&(shared->shader[_shaders_source[i].id]),
1172 _shaders_source[i].name,
1173 et))
1174 goto error;
1175
1176 if (et) eet_close(et);
1177 eet_shutdown();
1178 return 1;
1179
1180error:
1181 if (et) eet_close(et);
1182 eet_shutdown();
1183 return 0;
1184}
1185
1186static int
1187_evas_gl_common_shader_binary_save(Evas_GL_Shared *shared)
1188{
1189 /* check eet */
1190 Eet_File *et = NULL; //check eet file
1191 int tmpfd;
1192 int res = 0;
1193 char bin_dir_path[PATH_MAX];
1194 char bin_file_path[PATH_MAX];
1195 char tmp_file[PATH_MAX];
1196 unsigned int i;
1197
1198 if (!_evas_gl_shader_dir_check(bin_dir_path, sizeof(bin_dir_path)))
1199 res = _evas_gl_shader_file_mkpath(bin_dir_path);
1200 if (!res) return 0; /* we can't make directory */
1201
1202 _evas_gl_shader_file_check(bin_dir_path, bin_file_path,
1203 sizeof(bin_dir_path));
1204
1205 /* use mkstemp for writing */
1206 snprintf(tmp_file, sizeof(tmp_file), "%s.XXXXXX", bin_file_path);
1207 tmpfd = mkstemp(tmp_file);
1208 if (tmpfd < 0) goto error;
1209 close(tmpfd);
1210
1211 /* use eet */
1212 if (!eet_init()) goto error;
1213
1214 et = eet_open(tmp_file, EET_FILE_MODE_WRITE);
1215 if (!et) goto error;
1216
1217 for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i)
1218 if (!_evas_gl_common_shader_program_binary_save(&(shared->shader[_shaders_source[i].id]),
1219 _shaders_source[i].name,
1220 et))
1221 goto error;
1222
1223 if (eet_close(et) != EET_ERROR_NONE) goto error;
1224 if (rename(tmp_file,bin_file_path) < 0) goto error;
1225 eet_shutdown();
1226 return 1;
1227
1228error:
1229 if (et) eet_close(et);
1230 if (_evas_gl_shader_file_exists(tmp_file)) unlink(tmp_file);
1231 eet_shutdown();
1232 return 0;
1233}
1234
1235int
1236evas_gl_common_shader_program_init(Evas_GL_Shared *shared)
1237{
1238 // gl support binary shader and get env of binary shader path
1239 if (shared->info.bin_program &&
1240 _evas_gl_common_shader_binary_init(shared)) return 1;
1241 /* compile all shader.*/
1242 if (!_evas_gl_common_shader_source_init(shared)) return 0;
1243 /* success compile all shader. if gl support binary shader, we need to save */
1244 if (shared->info.bin_program) _evas_gl_common_shader_binary_save(shared);
1245 return 1;
1246}
1247
1248void
1249evas_gl_common_shader_program_init_done(void)
1250{
1251#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
1252 glReleaseShaderCompiler();
1253#endif
1254}
1255
1256void
1257evas_gl_common_shader_program_shutdown(Evas_GL_Program *p)
1258{
1259 if (p->vert) glDeleteShader(p->vert);
1260 if (p->frag) glDeleteShader(p->frag);
1261 if (p->prog) glDeleteProgram(p->prog);
1262}
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c
new file mode 100644
index 0000000..c99f4bd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c
@@ -0,0 +1,1668 @@
1#include "evas_gl_private.h"
2
3static const GLenum rgba_fmt = GL_RGBA;
4static const GLenum rgba_ifmt = GL_RGBA;
5//#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
6//static const GLenum rgb_fmt = GL_RGBA;
7//static const GLenum rgb_ifmt = GL_RGBA;
8//#else
9static const GLenum rgb_fmt = GL_RGBA;
10static const GLenum rgb_ifmt = GL_RGB;
11//#endif
12#ifdef GL_BGRA
13# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
14static const GLenum bgra_fmt = GL_BGRA;
15static const GLenum bgra_ifmt = GL_BGRA;
16static const GLenum bgr_fmt = GL_BGRA;
17static const GLenum bgr_ifmt = GL_BGRA;
18# else
19static const GLenum bgra_fmt = GL_BGRA;
20static const GLenum bgra_ifmt = GL_RGBA;
21static const GLenum bgr_fmt = GL_BGRA;
22static const GLenum bgr_ifmt = GL_RGB;
23# endif
24#endif
25static const GLenum alpha_fmt = GL_ALPHA;
26static const GLenum alpha_ifmt = GL_ALPHA;
27static const GLenum lum_fmt = GL_LUMINANCE;
28static const GLenum lum_ifmt = GL_LUMINANCE;
29static const GLenum lum_alpha_fmt = GL_LUMINANCE_ALPHA;
30static const GLenum lum_alpha_ifmt = GL_LUMINANCE_ALPHA;
31static const GLenum rgba8_ifmt = GL_RGBA;
32static const GLenum rgba8_fmt = GL_BGRA;
33
34static struct {
35 struct {
36 int num, pix;
37 } c, a, v, r, n, d;
38} texinfo = {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}};
39
40static void
41_print_tex_count(void)
42{
43 if (getenv("EVAS_GL_MEMINFO"))
44 {
45 fprintf(stderr,
46 "T: c:%i/%ik | a:%i/%ik | v:%i/%ik | r:%i/%ik | n:%i/%ik | d:%i/%ik\n",
47 texinfo.c.num, (texinfo.c.pix * 4) / 1024,
48 texinfo.a.num, (texinfo.a.pix ) / 1024,
49 texinfo.v.num, (texinfo.v.pix ) / 1024,
50 texinfo.r.num, (texinfo.r.pix * 4) / 1024,
51 texinfo.n.num, (texinfo.n.pix * 4) / 1024,
52 texinfo.d.num, (texinfo.d.pix * 4) / 1024
53 );
54 }
55}
56
57static int
58_nearest_pow2(int num)
59{
60 unsigned int n = num - 1;
61 n |= n >> 1;
62 n |= n >> 2;
63 n |= n >> 4;
64 n |= n >> 8;
65 n |= n >> 16;
66 return n + 1;
67}
68
69static void
70_tex_adjust(Evas_Engine_GL_Context *gc, int *w, int *h)
71{
72 if (gc->shared->info.tex_npo2) return;
73 /*if (gc->shared->info.tex_rect) return;*/
74 *w = _nearest_pow2(*w);
75 *h = _nearest_pow2(*h);
76}
77
78static int
79_tex_round_slot(Evas_Engine_GL_Context *gc, int h)
80{
81 if (!gc->shared->info.tex_npo2)
82 h = _nearest_pow2(h);
83 return (h + gc->shared->info.tune.atlas.slot_size - 1) /
84 gc->shared->info.tune.atlas.slot_size;
85}
86
87static int
88_tex_format_index(GLuint format)
89{
90 switch (format)
91 {
92 case GL_RGBA:
93#ifdef GL_BGRA
94 case GL_BGRA:
95#endif
96 return 0;
97 case GL_RGB:
98 return 1;
99 case GL_ALPHA:
100 return 2;
101 case GL_LUMINANCE: // never used in atlas
102 return 3;
103 default:
104 return 0;
105 }
106 return 0;
107}
108
109static void
110_tex_2d(int intfmt, int w, int h, int fmt, int type)
111{
112 int intfmtret = -1;
113 glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
114 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
115#ifdef GL_TEXTURE_INTERNAL_FORMAT
116// this is not in opengles!!! hrrrm
117 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
118 GL_TEXTURE_INTERNAL_FORMAT, &intfmtret);
119 if (intfmtret != intfmt)
120 {
121 ERR("Fail tex alloc %ix%i", w, h);
122// XXX send async err to evas
123 }
124#endif
125}
126
127static void
128_tex_sub_2d(int x, int y, int w, int h, int fmt, int type, const void *pix)
129{
130 glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, fmt, type, pix);
131 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
132}
133
134static Evas_GL_Texture_Pool *
135_pool_tex_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, GLenum format)
136{
137 Evas_GL_Texture_Pool *pt;
138
139 pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
140 if (!pt) return NULL;
141 h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
142 _tex_adjust(gc, &w, &h);
143 pt->gc = gc;
144 pt->w = w;
145 pt->h = h;
146 pt->intformat = intformat;
147 pt->format = format;
148 pt->dataformat = GL_UNSIGNED_BYTE;
149 pt->references = 0;
150
151 if (format == alpha_fmt)
152 {
153 texinfo.a.num++;
154 texinfo.a.pix += pt->w * pt->h;
155 }
156 else if (format == lum_fmt)
157 {
158 texinfo.v.num++;
159 texinfo.v.pix += pt->w * pt->h;
160 }
161 else
162 {
163 texinfo.c.num++;
164 texinfo.c.pix += pt->w * pt->h;
165 }
166
167 _print_tex_count();
168
169 glGenTextures(1, &(pt->texture));
170 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
171 glBindTexture(GL_TEXTURE_2D, pt->texture);
172 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
173 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
174 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
175 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
176 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
177 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
178 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
179 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
180 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
181 _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
182 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
183 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
184 return pt;
185}
186
187static int
188_pool_tex_alloc(Evas_GL_Texture_Pool *pt, int w, int h __UNUSED__, int *u, int *v, Eina_List **l_after)
189{
190 Eina_List *l;
191 Evas_GL_Texture *tex, *tex2;
192 int nx, d, b;
193
194 if (pt->allocations)
195 {
196 tex = pt->allocations->data;
197 // if firest tex is not at left edge...
198 if (tex->x > (0 + 1))
199 {
200 if ((tex->x - 1) >= w)
201 {
202 *u = 0;
203 *v = 0;
204 *l_after = NULL;
205 return 1;
206 }
207 }
208 }
209 EINA_LIST_FOREACH(pt->allocations, l, tex)
210 {
211 b = tex->x + tex->w + 2;
212 if (l->next)
213 {
214 tex2 = l->next->data;
215 nx = tex2->x - 1;
216 }
217 else
218 nx = pt->w - 1;
219 d = nx - b;
220 if (d >= w)
221 {
222 *u = b;
223 *v = 0;
224 *l_after = l;
225 return 1;
226 }
227 }
228 *l_after = NULL;
229 return 0;
230}
231
232static Evas_GL_Texture_Pool *
233_pool_tex_find(Evas_Engine_GL_Context *gc, int w, int h,
234 int intformat, int format, int *u, int *v,
235 Eina_List **l_after, int atlas_w)
236{
237 Evas_GL_Texture_Pool *pt = NULL;
238 Eina_List *l;
239 int th, th2;
240
241 if (atlas_w > gc->shared->info.max_texture_size)
242 atlas_w = gc->shared->info.max_texture_size;
243 if ((w > gc->shared->info.tune.atlas.max_w) ||
244 (h > gc->shared->info.tune.atlas.max_h))
245 {
246 pt = _pool_tex_new(gc, w, h, intformat, format);
247 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, pt);
248 pt->slot = -1;
249 pt->fslot = -1;
250 pt->whole = 1;
251 *u = 0;
252 *v = 0;
253 *l_after = NULL;
254 return pt;
255 }
256
257 th = _tex_round_slot(gc, h);
258 th2 = _tex_format_index(intformat);
259 EINA_LIST_FOREACH(gc->shared->tex.atlas[th][th2], l, pt)
260 {
261 if (_pool_tex_alloc(pt, w, h, u, v, l_after))
262 {
263 gc->shared->tex.atlas[th][th2] =
264 eina_list_remove_list(gc->shared->tex.atlas[th][th2], l);
265 gc->shared->tex.atlas[th][th2] =
266 eina_list_prepend(gc->shared->tex.atlas[th][th2], pt);
267 return pt;
268 }
269 }
270 pt = _pool_tex_new(gc, atlas_w, h, intformat, format);
271 gc->shared->tex.atlas[th][th2] =
272 eina_list_prepend(gc->shared->tex.atlas[th][th2], pt);
273 pt->slot = th;
274 pt->fslot = th2;
275 *u = 0;
276 *v = 0;
277 *l_after = NULL;
278 return pt;
279}
280
281Evas_GL_Texture *
282evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im)
283{
284 Evas_GL_Texture *tex;
285 Eina_List *l_after = NULL;
286 int u = 0, v = 0;
287
288 tex = calloc(1, sizeof(Evas_GL_Texture));
289 if (!tex) return NULL;
290
291 tex->gc = gc;
292 tex->references = 1;
293
294 if (im->cache_entry.flags.alpha)
295 {
296 if (gc->shared->info.bgra)
297 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
298 im->cache_entry.h + 1, bgra_ifmt, bgra_fmt,
299 &u, &v, &l_after,
300 gc->shared->info.tune.atlas.max_alloc_size);
301 else
302 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 2,
303 im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
304 &u, &v, &l_after,
305 gc->shared->info.tune.atlas.max_alloc_size);
306 tex->alpha = 1;
307 }
308 else
309 {
310 if (gc->shared->info.bgra)
311 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
312 im->cache_entry.h + 1, bgr_ifmt, bgr_fmt,
313 &u, &v, &l_after,
314 gc->shared->info.tune.atlas.max_alloc_size);
315 else
316#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
317 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
318 im->cache_entry.h + 1, rgba_ifmt, rgba_fmt,
319 &u, &v, &l_after,
320 gc->shared->info.tune.atlas.max_alloc_size);
321#else
322 tex->pt = _pool_tex_find(gc, im->cache_entry.w + 3,
323 im->cache_entry.h + 1, rgb_ifmt, rgb_fmt,
324 &u, &v, &l_after,
325 gc->shared->info.tune.atlas.max_alloc_size);
326#endif
327 }
328 if (!tex->pt)
329 {
330 free(tex);
331 return NULL;
332 }
333 tex->x = u + 1;
334 tex->y = v;
335 tex->w = im->cache_entry.w;
336 tex->h = im->cache_entry.h;
337 if (l_after)
338 tex->pt->allocations =
339 eina_list_append_relative_list(tex->pt->allocations, tex, l_after);
340 else
341 tex->pt->allocations =
342 eina_list_prepend(tex->pt->allocations, tex);
343 tex->pt->references++;
344 evas_gl_common_texture_update(tex, im);
345 return tex;
346}
347
348static Evas_GL_Texture_Pool *
349_pool_tex_render_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format)
350{
351 Evas_GL_Texture_Pool *pt;
352
353 pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
354 if (!pt) return NULL;
355 h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
356 _tex_adjust(gc, &w, &h);
357 pt->gc = gc;
358 pt->w = w;
359 pt->h = h;
360 pt->intformat = intformat;
361 pt->format = format;
362 pt->dataformat = GL_UNSIGNED_BYTE;
363 pt->render = 1;
364 pt->references = 0;
365#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
366# ifndef GL_FRAMEBUFFER
367# define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
368# endif
369# ifndef GL_COLOR_ATTACHMENT0
370# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
371# endif
372#else
373# ifndef GL_FRAMEBUFFER
374# define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
375# endif
376# ifndef GL_COLOR_ATTACHMENT0
377# define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
378# endif
379#endif
380 texinfo.r.num++;
381 texinfo.r.pix += pt->w * pt->h;
382
383 _print_tex_count();
384
385 glGenTextures(1, &(pt->texture));
386 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
387 glBindTexture(GL_TEXTURE_2D, pt->texture);
388 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
389 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
390 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
391 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
392 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
393 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
394 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
395 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
396 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
397 _tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
398
399 glsym_glGenFramebuffers(1, &(pt->fb));
400 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
401 glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
402 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
403 glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
404 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
405 glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
406 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
407
408 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
409 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
410 return pt;
411}
412
413static Evas_GL_Texture_Pool *
414_pool_tex_native_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format, Evas_GL_Image *im)
415{
416 Evas_GL_Texture_Pool *pt;
417
418 pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
419 if (!pt) return NULL;
420 pt->gc = gc;
421#ifdef GL_TEXTURE_RECTANGLE_ARB
422 if (im->native.target == GL_TEXTURE_RECTANGLE_ARB)
423 {
424 printf("REEEEEEEEECT\n");
425 pt->w = w;
426 pt->h = h;
427 }
428 else
429#endif
430 {
431 // FIXME: handle po2 only textures
432 pt->w = w;
433 pt->h = h;
434 }
435 pt->intformat = intformat;
436 pt->format = format;
437 pt->dataformat = GL_UNSIGNED_BYTE;
438 pt->references = 0;
439 pt->native = 1;
440 texinfo.n.num++;
441 texinfo.n.pix += pt->w * pt->h;
442
443 _print_tex_count();
444
445 glGenTextures(1, &(pt->texture));
446 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
447 glBindTexture(im->native.target, pt->texture);
448 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
449
450#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
451#else
452 if (im->native.loose)
453 {
454 if (im->native.func.bind)
455 im->native.func.bind(im->native.func.data, im);
456 }
457#endif
458
459 glTexParameteri(im->native.target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
460 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
461 glTexParameteri(im->native.target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
462 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
463 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
464 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
465 glTexParameteri(im->native.target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
466 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
467 glBindTexture(im->native.target, 0);
468 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
469 glBindTexture(im->native.target, gc->pipe[0].shader.cur_tex);
470 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
471 return pt;
472}
473
474static Evas_GL_Texture_Pool *
475_pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, int format)
476{
477 Evas_GL_Texture_Pool *pt = NULL;
478
479#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
480 int fmt; // EGL_MAP_GL_TEXTURE_RGBA_SEC or EGL_MAP_GL_TEXTURE_RGB_SEC or bust
481 int pixtype; // EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC or bust
482 int glformat;
483 int attr[] =
484 {
485 EGL_MAP_GL_TEXTURE_WIDTH_SEC, 32,
486 EGL_MAP_GL_TEXTURE_HEIGHT_SEC, 32,
487 EGL_MAP_GL_TEXTURE_FORMAT_SEC, EGL_MAP_GL_TEXTURE_RGBA_SEC,
488 EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC, EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC,
489 EGL_NONE
490 };
491 void *egldisplay;
492
493 if (intformat != format) return NULL;
494
495 switch (intformat)
496 {
497#ifdef EGL_MAP_GL_TEXTURE_LUMINANCE_SEC
498 case GL_LUMINANCE: attr[5] = EGL_MAP_GL_TEXTURE_LUMINANCE_SEC; break;
499#endif
500#ifdef EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC
501 case GL_LUMINANCE_ALPHA: attr[5] = EGL_MAP_GL_TEXTURE_LUMINANCE_ALPHA_SEC; break;
502#endif
503 case GL_RGBA: attr[5] = EGL_MAP_GL_TEXTURE_RGBA_SEC; break;
504 case GL_BGRA: attr[5] = EGL_MAP_GL_TEXTURE_BGRA_SEC; break;
505 default: fprintf(stderr, "unknown format\n"); return NULL;
506 }
507
508 pt = calloc(1, sizeof(Evas_GL_Texture_Pool));
509 if (!pt) return NULL;
510 h = _tex_round_slot(gc, h) * gc->shared->info.tune.atlas.slot_size;
511 _tex_adjust(gc, &w, &h);
512 pt->gc = gc;
513 pt->w = w;
514 pt->h = h;
515 pt->intformat = intformat;
516 pt->format = format;
517 pt->dataformat = GL_UNSIGNED_BYTE;
518 pt->render = 1;
519 pt->references = 0;
520 texinfo.d.num++;
521 texinfo.d.pix += pt->w * pt->h;
522
523 _print_tex_count();
524
525 glGenTextures(1, &(pt->texture));
526 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
527 glBindTexture(GL_TEXTURE_2D, pt->texture);
528 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
529 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
530 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
531 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
532 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
533 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
534 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
535 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
536 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
537
538 egldisplay = pt->gc->egldisp;
539
540 attr[1] = pt->w;
541 attr[3] = pt->h;
542
543 // FIXME: seems a bit slower than i'd like - maybe too many flushes?
544 // FIXME: YCbCr no support as yet
545 pt->dyn.img = secsym_eglCreateImage(egldisplay,
546 EGL_NO_CONTEXT,
547 EGL_MAP_GL_TEXTURE_2D_SEC,
548 0, attr);
549 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
550 if (!pt->dyn.img)
551 {
552 glBindTexture(GL_TEXTURE_2D, 0);
553 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
554 glDeleteTextures(1, &(pt->texture));
555 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
556 free(pt);
557 return NULL;
558 }
559 if (secsym_eglGetImageAttribSEC(egldisplay,
560 pt->dyn.img,
561 EGL_MAP_GL_TEXTURE_WIDTH_SEC,
562 &(pt->dyn.w)) != EGL_TRUE) goto error;
563 if (secsym_eglGetImageAttribSEC(egldisplay,
564 pt->dyn.img,
565 EGL_MAP_GL_TEXTURE_HEIGHT_SEC,
566 &(pt->dyn.h)) != EGL_TRUE) goto error;
567 if (secsym_eglGetImageAttribSEC(egldisplay,
568 pt->dyn.img,
569 EGL_MAP_GL_TEXTURE_STRIDE_IN_BYTES_SEC,
570 &(pt->dyn.stride)) != EGL_TRUE) goto error;
571 if (secsym_eglGetImageAttribSEC(egldisplay,
572 pt->dyn.img,
573 EGL_MAP_GL_TEXTURE_FORMAT_SEC,
574 &(fmt)) != EGL_TRUE) goto error;
575
576 if (secsym_eglGetImageAttribSEC(egldisplay,
577 pt->dyn.img,
578 EGL_MAP_GL_TEXTURE_PIXEL_TYPE_SEC,
579 &(pixtype)) != EGL_TRUE) goto error;
580
581 if (pixtype != EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC) goto error;
582
583 glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex);
584 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
585#else
586 gc = NULL;
587 w = 0;
588 h = 0;
589 intformat = 0;
590 format = 0;
591#endif
592 return pt;
593
594/* ERROR HANDLING */
595#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
596error:
597 secsym_eglDestroyImage(egldisplay, pt->dyn.img);
598 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
599 pt->dyn.img = NULL;
600 glBindTexture(GL_TEXTURE_2D, 0);
601 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
602 glDeleteTextures(1, &(pt->texture));
603 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
604 free(pt);
605 return NULL;
606#endif
607}
608
609void
610evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
611{
612 if (!pt->gc) return;
613
614 if (pt->format == alpha_fmt)
615 {
616 texinfo.a.num--;
617 texinfo.a.pix -= pt->w * pt->h;
618 }
619 else if (pt->format == lum_fmt)
620 {
621 texinfo.v.num--;
622 texinfo.v.pix -= pt->w * pt->h;
623 }
624 else if (pt->dyn.img)
625 {
626 texinfo.d.num--;
627 texinfo.d.pix -= pt->w * pt->h;
628 }
629 else if (pt->render)
630 {
631 texinfo.r.num--;
632 texinfo.r.pix -= pt->w * pt->h;
633 }
634 else if (pt->native)
635 {
636 texinfo.n.num--;
637 texinfo.n.pix -= pt->w * pt->h;
638 }
639 else
640 {
641 texinfo.c.num--;
642 texinfo.c.pix -= pt->w * pt->h;
643 }
644
645 _print_tex_count();
646
647#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
648 if (pt->dyn.img)
649 {
650 if (pt->dyn.checked_out > 0)
651 secsym_eglUnmapImageSEC(pt->gc->egldisp, pt->dyn.img);
652 secsym_eglDestroyImage(pt->gc->egldisp, pt->dyn.img);
653 pt->dyn.img = NULL;
654 pt->dyn.data = NULL;
655 pt->dyn.w = 0;
656 pt->dyn.h = 0;
657 pt->dyn.stride = 0;
658 pt->dyn.checked_out = 0;
659 }
660#endif
661
662 glDeleteTextures(1, &(pt->texture));
663 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
664 if (pt->fb)
665 {
666 glsym_glDeleteFramebuffers(1, &(pt->fb));
667 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
668 pt->fb = 0;
669 }
670 while (pt->allocations)
671 pt->allocations =
672 eina_list_remove_list(pt->allocations, pt->allocations);
673 pt->texture = 0;
674 pt->gc = NULL;
675 pt->w = 0;
676 pt->h = 0;
677}
678
679static void
680pt_unref(Evas_GL_Texture_Pool *pt)
681{
682 if (!pt) return;
683 if (!pt->gc) return;
684 pt->references--;
685 if (pt->references != 0) return;
686
687 if (!((pt->render) || (pt->native)))
688 {
689 if (pt->whole)
690 pt->gc->shared->tex.whole =
691 eina_list_remove(pt->gc->shared->tex.whole, pt);
692 else
693 pt->gc->shared->tex.atlas [pt->slot][pt->fslot] =
694 eina_list_remove(pt->gc->shared->tex.atlas[pt->slot][pt->fslot], pt);
695 }
696 evas_gl_texture_pool_empty(pt);
697 free(pt);
698}
699
700static void
701pt_link(Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, Evas_GL_Texture_Pool *pt)
702{
703 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, pt);
704 pt->slot = -1;
705 pt->fslot = -1;
706 pt->whole = 1;
707 pt->allocations = eina_list_prepend(pt->allocations, tex);
708 pt->references++;
709}
710
711Evas_GL_Texture *
712evas_gl_common_texture_native_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha, Evas_GL_Image *im)
713{
714 Evas_GL_Texture *tex;
715
716 tex = calloc(1, sizeof(Evas_GL_Texture));
717 if (!tex) return NULL;
718
719 tex->gc = gc;
720 tex->references = 1;
721 tex->alpha = alpha;
722 if (alpha)
723 {
724 if (gc->shared->info.bgra)
725 tex->pt = _pool_tex_native_new(gc, w, h, rgba_ifmt, rgba_fmt, im);
726 else
727 tex->pt = _pool_tex_native_new(gc, w, h, rgba_ifmt, rgba_fmt, im);
728 }
729 else
730 {
731 if (gc->shared->info.bgra)
732 tex->pt = _pool_tex_native_new(gc, w, h, rgb_ifmt, rgb_fmt, im);
733 else
734 tex->pt = _pool_tex_native_new(gc, w, h, rgb_ifmt, rgb_fmt, im);
735 }
736 if (!tex->pt)
737 {
738 free(tex);
739 return NULL;
740 }
741 tex->x = 0;
742 tex->y = 0;
743 tex->w = w;
744 tex->h = h;
745 tex->pt->references++;
746 return tex;
747}
748
749Evas_GL_Texture *
750evas_gl_common_texture_render_new(Evas_Engine_GL_Context *gc, unsigned int w, unsigned int h, int alpha)
751{
752 Evas_GL_Texture *tex;
753
754 tex = calloc(1, sizeof(Evas_GL_Texture));
755 if (!tex) return NULL;
756
757 tex->gc = gc;
758 tex->references = 1;
759 tex->alpha = alpha;
760 if (alpha)
761 {
762 if (gc->shared->info.bgra)
763 tex->pt = _pool_tex_render_new(gc, w, h, rgba_ifmt, rgba_fmt);
764 else
765 tex->pt = _pool_tex_render_new(gc, w, h, rgba_ifmt, rgba_fmt);
766 }
767 else
768 {
769 if (gc->shared->info.bgra)
770 tex->pt = _pool_tex_render_new(gc, w, h, rgb_ifmt, rgb_fmt);
771 else
772 tex->pt = _pool_tex_render_new(gc, w, h, rgb_ifmt, rgb_fmt);
773 }
774 if (!tex->pt)
775 {
776 free(tex);
777 return NULL;
778 }
779 tex->x = 0;
780 tex->y = 0;
781 tex->w = w;
782 tex->h = h;
783 tex->pt->references++;
784 return tex;
785}
786
787Evas_GL_Texture *
788evas_gl_common_texture_dynamic_new(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
789{
790 Evas_GL_Texture *tex;
791
792 tex = calloc(1, sizeof(Evas_GL_Texture));
793 if (!tex) return NULL;
794
795 tex->gc = gc;
796 tex->references = 1;
797 tex->alpha = im->alpha;
798 tex->x = 0;
799 tex->y = 0;
800 tex->w = im->w;
801 tex->h = im->h;
802 if (tex->alpha)
803 {
804 if (gc->shared->info.bgra)
805 tex->pt = _pool_tex_dynamic_new(gc, tex->w, tex->h, bgra_ifmt, bgra_fmt);
806 else
807 tex->pt = _pool_tex_dynamic_new(gc, tex->w, tex->h, bgra_ifmt, bgra_fmt);
808 }
809 else
810 {
811 if (gc->shared->info.bgra)
812 tex->pt = _pool_tex_dynamic_new(gc, tex->w, tex->h, bgra_ifmt, bgra_fmt);
813 else
814 tex->pt = _pool_tex_dynamic_new(gc, tex->w, tex->h, bgra_ifmt, bgra_fmt);
815 }
816 if (!tex->pt)
817 {
818 free(tex);
819 return NULL;
820 }
821 tex->pt->references++;
822 return tex;
823}
824
825void
826evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
827{
828 GLuint fmt;
829
830 if (tex->alpha != im->cache_entry.flags.alpha)
831 {
832 tex->pt->allocations = eina_list_remove(tex->pt->allocations, tex);
833 pt_unref(tex->pt);
834 tex->alpha = im->cache_entry.flags.alpha;
835 if (tex->alpha)
836 {
837 if (tex->gc->shared->info.bgra)
838 tex->pt = _pool_tex_render_new(tex->gc, tex->w, tex->h, bgra_ifmt, bgra_fmt);
839 else
840 tex->pt = _pool_tex_render_new(tex->gc, tex->w, tex->h, rgba_ifmt, rgba_fmt);
841 }
842 else
843 {
844 if (tex->gc->shared->info.bgra)
845 tex->pt = _pool_tex_render_new(tex->gc, tex->w, tex->h, bgr_ifmt, bgr_fmt);
846 else
847 tex->pt = _pool_tex_render_new(tex->gc, tex->w, tex->h, rgb_ifmt, rgb_fmt);
848 }
849 }
850 if (!tex->pt) return;
851 if (!im->image.data) return;
852
853 fmt = tex->pt->format;
854 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
855 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
856#ifdef GL_UNPACK_ROW_LENGTH
857 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
858 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
859#endif
860 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
861 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
862
863// printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
864 // +-+
865 // +-+
866 //
867 _tex_sub_2d(tex->x, tex->y,
868 im->cache_entry.w, im->cache_entry.h,
869 fmt, tex->pt->dataformat,
870 im->image.data);
871 // xxx
872 // xxx
873 // ---
874 _tex_sub_2d(tex->x, tex->y + im->cache_entry.h,
875 im->cache_entry.w, 1,
876 fmt, tex->pt->dataformat,
877 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w));
878 // xxx
879 // xxx
880 // o
881 _tex_sub_2d(tex->x - 1, tex->y + im->cache_entry.h,
882 1, 1,
883 fmt, tex->pt->dataformat,
884 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w));
885 // xxx
886 // xxx
887 // o
888 _tex_sub_2d(tex->x + im->cache_entry.w, tex->y + im->cache_entry.h,
889 1, 1,
890 fmt, tex->pt->dataformat,
891 im->image.data + ((im->cache_entry.h - 1) * im->cache_entry.w) + (im->cache_entry.w - 1));
892#ifdef GL_UNPACK_ROW_LENGTH
893 glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
894 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
895 // |xxx
896 // |xxx
897 //
898 _tex_sub_2d(tex->x - 1, tex->y,
899 1, im->cache_entry.h,
900 fmt, tex->pt->dataformat,
901 im->image.data);
902 // xxx|
903 // xxx|
904 //
905 _tex_sub_2d(tex->x + im->cache_entry.w, tex->y,
906 1, im->cache_entry.h,
907 fmt, tex->pt->dataformat,
908 im->image.data + (im->cache_entry.w - 1));
909#else
910 {
911 DATA32 *tpix, *ps, *pd;
912 int i;
913
914 tpix = alloca(im->cache_entry.h * sizeof(DATA32));
915 pd = tpix;
916 ps = im->image.data;
917 for (i = 0; i < im->cache_entry.h; i++)
918 {
919 *pd = *ps;
920 pd++;
921 ps += im->cache_entry.w;
922 }
923 // |xxx
924 // |xxx
925 //
926 _tex_sub_2d(tex->x - 1, tex->y,
927 1, im->cache_entry.h,
928 fmt, tex->pt->dataformat,
929 tpix);
930 pd = tpix;
931 ps = im->image.data + (im->cache_entry.w - 1);
932 for (i = 0; i < im->cache_entry.h; i++)
933 {
934 *pd = *ps;
935 pd++;
936 ps += im->cache_entry.w;
937 }
938 // xxx|
939 // xxx|
940 //
941 _tex_sub_2d(tex->x + im->cache_entry.w, tex->y,
942 1, im->cache_entry.h,
943 fmt, tex->pt->dataformat,
944 tpix);
945 }
946#endif
947 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
948 {
949 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
950 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
951 }
952}
953
954void
955evas_gl_common_texture_free(Evas_GL_Texture *tex)
956{
957 if (!tex) return;
958 tex->references--;
959 if (tex->references != 0) return;
960 if (tex->double_buffer.pt[0])
961 {
962 tex->double_buffer.pt[0]->allocations = eina_list_remove(tex->double_buffer.pt[0]->allocations, tex);
963 tex->double_buffer.pt[1]->allocations = eina_list_remove(tex->double_buffer.pt[1]->allocations, tex);
964 tex->double_buffer.ptuv[0]->allocations = eina_list_remove(tex->double_buffer.ptuv[0]->allocations, tex);
965 tex->double_buffer.ptuv[1]->allocations = eina_list_remove(tex->double_buffer.ptuv[1]->allocations, tex);
966 }
967 else
968 {
969 if (tex->pt)
970 {
971 tex->pt->allocations = eina_list_remove(tex->pt->allocations, tex);
972 pt_unref(tex->pt);
973 }
974 if (tex->ptu)
975 {
976 tex->ptu->allocations = eina_list_remove(tex->ptu->allocations, tex);
977 pt_unref(tex->ptu);
978 }
979 if (tex->ptv)
980 {
981 tex->ptv->allocations = eina_list_remove(tex->ptv->allocations, tex);
982 pt_unref(tex->ptv);
983 }
984 if (tex->ptuv)
985 {
986 tex->ptuv->allocations = eina_list_remove(tex->ptuv->allocations, tex);
987 pt_unref(tex->ptuv);
988 }
989 }
990 free(tex);
991}
992
993Evas_GL_Texture *
994evas_gl_common_texture_alpha_new(Evas_Engine_GL_Context *gc, DATA8 *pixels,
995 unsigned int w, unsigned int h, int fh)
996{
997 Evas_GL_Texture *tex;
998 Eina_List *l_after = NULL;
999 int u = 0, v = 0;
1000
1001 tex = calloc(1, sizeof(Evas_GL_Texture));
1002 if (!tex) return NULL;
1003
1004 tex->gc = gc;
1005 tex->references = 1;
1006 tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v,
1007 &l_after,
1008 gc->shared->info.tune.atlas.max_alloc_alpha_size);
1009 if (!tex->pt)
1010 {
1011 free(tex);
1012 return NULL;
1013 }
1014 tex->x = u + 1;
1015 tex->y = v;
1016 tex->w = w;
1017 tex->h = h;
1018 if (l_after)
1019 tex->pt->allocations =
1020 eina_list_append_relative_list(tex->pt->allocations, tex, l_after);
1021 else
1022 tex->pt->allocations = eina_list_prepend(tex->pt->allocations, tex);
1023 tex->pt->references++;
1024 evas_gl_common_texture_alpha_update(tex, pixels, w, h, fh);
1025 return tex;
1026}
1027
1028void
1029evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
1030 unsigned int w, unsigned int h, int fh __UNUSED__)
1031{
1032 if (!tex->pt) return;
1033 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1034 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1035#ifdef GL_UNPACK_ROW_LENGTH
1036 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
1037 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1038#endif
1039 glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
1040 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1041 _tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
1042 pixels);
1043 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1044 {
1045 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1046 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1047 }
1048}
1049
1050Evas_GL_Texture *
1051evas_gl_common_texture_yuv_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
1052{
1053 Evas_GL_Texture *tex;
1054
1055 tex = calloc(1, sizeof(Evas_GL_Texture));
1056 if (!tex) return NULL;
1057
1058 tex->gc = gc;
1059 tex->references = 1;
1060 tex->ptu = _pool_tex_new(gc, w / 2 + 1, h / 2 + 1, lum_ifmt, lum_fmt);
1061 if (!tex->ptu)
1062 {
1063 free(tex);
1064 return NULL;
1065 }
1066 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->ptu);
1067 tex->ptu->slot = -1;
1068 tex->ptu->fslot = -1;
1069 tex->ptu->whole = 1;
1070 tex->ptv = _pool_tex_new(gc, tex->ptu->w, tex->ptu->h, lum_ifmt, lum_fmt);
1071 if (!tex->ptv)
1072 {
1073 pt_unref(tex->pt);
1074 pt_unref(tex->ptu);
1075 free(tex);
1076 return NULL;
1077 }
1078 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->ptv);
1079 tex->ptv->slot = -1;
1080 tex->ptv->fslot = -1;
1081 tex->ptv->whole = 1;
1082 tex->pt = _pool_tex_new(gc, tex->ptu->w * 2, tex->ptu->h * 2, lum_ifmt, lum_fmt);
1083 if (!tex->pt)
1084 {
1085 free(tex);
1086 return NULL;
1087 }
1088 gc->shared->tex.whole = eina_list_prepend(gc->shared->tex.whole, tex->pt);
1089 tex->pt->slot = -1;
1090 tex->pt->fslot = -1;
1091 tex->pt->whole = 1;
1092 tex->x = 0;
1093 tex->y = 0;
1094 tex->w = w;
1095 tex->h = h;
1096 tex->pt->allocations = eina_list_prepend(tex->pt->allocations, tex);
1097 tex->ptu->allocations = eina_list_prepend(tex->ptu->allocations, tex);
1098 tex->ptv->allocations = eina_list_prepend(tex->ptv->allocations, tex);
1099 tex->pt->references++;
1100 tex->ptu->references++;
1101 tex->ptv->references++;
1102 evas_gl_common_texture_yuv_update(tex, rows, w, h);
1103 return tex;
1104}
1105
1106void
1107evas_gl_common_texture_yuv_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
1108{
1109 if (!tex->pt) return;
1110 // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
1111#ifdef GL_UNPACK_ROW_LENGTH
1112 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
1113 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1114 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1115 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1116 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1117 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1118 _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
1119 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1120 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
1121 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1122 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
1123 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1124 _tex_2d(tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat);
1125 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
1126 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
1127 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1128 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + (h / 2) + 1] - rows[h + (h / 2)]);
1129 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1130 _tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
1131 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
1132#else
1133 unsigned int y;
1134
1135 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1136 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1137 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1138 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1139 _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
1140 if ((rows[1] - rows[0]) == (int)w)
1141 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1142 else
1143 {
1144 for (y = 0; y < h; y++)
1145 _tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
1146 }
1147
1148 glBindTexture(GL_TEXTURE_2D, tex->ptu->texture);
1149 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1150 _tex_2d(tex->ptu->intformat, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat);
1151 if ((rows[h + 1] - rows[h]) == (int)(w / 2))
1152 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptu->format, tex->ptu->dataformat, rows[h]);
1153 else
1154 {
1155 for (y = 0; y < (h / 2); y++)
1156 _tex_sub_2d(0, y, w / 2, 1, tex->ptu->format, tex->ptu->dataformat, rows[h + y]);
1157 }
1158
1159 glBindTexture(GL_TEXTURE_2D, tex->ptv->texture);
1160 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1161 _tex_2d(tex->ptv->intformat, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat);
1162 if ((rows[h + (h / 2) + 1] - rows[h + (h / 2)]) == (int)(w / 2))
1163 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2)]);
1164 else
1165 {
1166 for (y = 0; y < (h / 2); y++)
1167 _tex_sub_2d(0, y, w / 2, 1, tex->ptv->format, tex->ptv->dataformat, rows[h + (h / 2) + y]);
1168 }
1169#endif
1170 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1171 {
1172 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1173 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1174 }
1175}
1176
1177static Evas_GL_Texture *
1178_evas_gl_common_texture_y2uv_new(Evas_Engine_GL_Context *gc,
1179 unsigned int yw, unsigned int yh,
1180 Eina_Bool uv2w, Eina_Bool uv2h,
1181 GLenum y_ifmt, GLenum y_fmt,
1182 GLenum uv_ifmt, GLenum uv_fmt,
1183 Eina_Bool dynamic)
1184{
1185 Evas_GL_Texture_Pool *pt[2] = { NULL, NULL };
1186 Evas_GL_Texture_Pool *ptuv[2] = { NULL, NULL };
1187 Evas_GL_Texture *tex;
1188 unsigned int uvw, uvh;
1189
1190 uvw = uv2w ? yw / 2 + 1 : yw + 1;
1191 uvh = uv2h ? yh / 2 + 1 : yh + 1;
1192
1193 if (!dynamic)
1194 {
1195 ptuv[0] = _pool_tex_new(gc, uvw, uvh, uv_ifmt, uv_fmt);
1196 ptuv[1] = _pool_tex_new(gc, uvw, uvh, uv_ifmt, uv_fmt);
1197
1198 if (ptuv[0] && ptuv[1])
1199 {
1200 pt[0] = _pool_tex_new(gc,
1201 ptuv[0]->w * (uv2w ? 2 : 1),
1202 ptuv[0]->h * (uv2h ? 2 : 1),
1203 y_ifmt, y_fmt);
1204 pt[1] = _pool_tex_new(gc,
1205 ptuv[1]->w * (uv2w ? 2 : 1),
1206 ptuv[1]->h * (uv2h ? 2 : 1),
1207 y_ifmt, y_fmt);
1208 }
1209 }
1210 else
1211 {
1212 ptuv[0] = _pool_tex_dynamic_new(gc, uvw, uvh, uv_ifmt, uv_fmt);
1213 ptuv[1] = _pool_tex_dynamic_new(gc, uvw, uvh, uv_ifmt, uv_fmt);
1214
1215 if (ptuv[0] && ptuv[1])
1216 {
1217 pt[0] = _pool_tex_dynamic_new(gc,
1218 ptuv[0]->w * (uv2w ? 2 : 1),
1219 ptuv[0]->h * (uv2h ? 2 : 1),
1220 y_ifmt, y_fmt);
1221 pt[1] = _pool_tex_dynamic_new(gc,
1222 ptuv[1]->w * (uv2w ? 2 : 1),
1223 ptuv[1]->h * (uv2h ? 2 : 1),
1224 y_ifmt, y_fmt);
1225 }
1226 }
1227
1228 if (!pt[0] || !pt[1] || !ptuv[0] || !ptuv[1])
1229 goto on_error;
1230
1231 INF("YUV [%i, %i] => Y[%i, %i], UV[%i, %i]",
1232 yw, yh,
1233 pt[0]->w, pt[0]->h,
1234 ptuv[0]->w, ptuv[0]->h);
1235 tex = calloc(1, sizeof(Evas_GL_Texture));
1236 if (!tex)
1237 goto on_error;
1238
1239 tex->gc = gc;
1240 tex->references = 1;
1241 tex->pt = pt[0];
1242 tex->ptuv = ptuv[0];
1243 tex->dyn = dynamic;
1244
1245 pt_link(gc, tex, pt[0]);
1246 pt_link(gc, tex, pt[1]);
1247 pt_link(gc, tex, ptuv[0]);
1248 pt_link(gc, tex, ptuv[1]);
1249
1250 tex->x = 0;
1251 tex->y = 0;
1252 tex->w = yw;
1253 tex->h = yh;
1254 tex->double_buffer.source = 0;
1255 memcpy(tex->double_buffer.pt, pt, sizeof (Evas_GL_Texture_Pool *) * 2);
1256 memcpy(tex->double_buffer.ptuv, ptuv, sizeof (Evas_GL_Texture_Pool *) * 2);
1257
1258 return tex;
1259
1260 on_error:
1261 pt_unref(pt[0]);
1262 pt_unref(pt[1]);
1263 pt_unref(ptuv[0]);
1264 pt_unref(ptuv[1]);
1265 return NULL;
1266}
1267
1268Evas_GL_Texture *
1269evas_gl_common_texture_yuy2_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
1270{
1271 Evas_GL_Texture *tex;
1272
1273 tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_FALSE, lum_alpha_ifmt, lum_alpha_fmt, rgba8_ifmt, rgba8_fmt, 0);
1274 evas_gl_common_texture_yuy2_update(tex, rows, w, h);
1275 return tex;
1276}
1277
1278Evas_GL_Texture *
1279evas_gl_common_texture_nv12_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
1280{
1281 Evas_GL_Texture *tex;
1282
1283#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
1284 tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_TRUE, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 1);
1285 if (!tex)
1286#endif
1287 tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_TRUE, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 0);
1288
1289 evas_gl_common_texture_nv12_update(tex, rows, w, h);
1290 return tex;
1291}
1292
1293Evas_GL_Texture *
1294evas_gl_common_texture_nv12tiled_new(Evas_Engine_GL_Context *gc, DATA8 **rows, unsigned int w, unsigned int h)
1295{
1296 Evas_GL_Texture *tex = NULL;
1297
1298#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
1299 tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_TRUE, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 1);
1300 if (!tex)
1301#endif
1302 tex = _evas_gl_common_texture_y2uv_new(gc, w, h, EINA_TRUE, EINA_TRUE, lum_ifmt, lum_fmt, lum_alpha_ifmt, lum_alpha_fmt, 0);
1303
1304 evas_gl_common_texture_nv12tiled_update(tex, rows, w, h);
1305 return tex;
1306}
1307
1308void
1309evas_gl_common_texture_yuy2_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
1310{
1311 if (!tex->pt) return;
1312 // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
1313 unsigned int y;
1314
1315 tex->double_buffer.source = 1 - tex->double_buffer.source;
1316 tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
1317 tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
1318
1319 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1320 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1321 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1322 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1323 _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
1324 if ((rows[1] - rows[0]) == (int)w * 4)
1325 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1326 else
1327 {
1328 for (y = 0; y < h; y++)
1329 _tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
1330 }
1331
1332 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1333 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1334 _tex_2d(tex->ptuv->intformat, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat);
1335#if 0
1336 /*
1337 FIXME: this piece of code doesn't work anymore since texture width
1338 is not anymore exactly w / 2. I don't understand why.
1339 */
1340 if ((rows[1] - rows[0]) == (int)(w * 2))
1341 _tex_sub_2d(0, 0, w / 2, h, tex->ptuv->format, tex->ptuv->dataformat, rows[0]);
1342 else
1343#endif
1344 {
1345 for (y = 0; y < h; y++)
1346 _tex_sub_2d(0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[y]);
1347 }
1348
1349 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1350 {
1351 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1352 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1353 }
1354}
1355
1356void
1357evas_gl_common_texture_nv12_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
1358{
1359 if (!tex->pt) return;
1360
1361 tex->double_buffer.source = 1 - tex->double_buffer.source;
1362 tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
1363 tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
1364
1365 // FIXME: works on lowest size 4 pixel high buffers. must also be multiple of 2
1366#ifdef GL_UNPACK_ROW_LENGTH
1367 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[1] - rows[0]);
1368 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1369 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1370 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1371 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1372 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1373 _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
1374 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1375 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1376 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1377 glPixelStorei(GL_UNPACK_ROW_LENGTH, rows[h + 1] - rows[h]);
1378 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1379 _tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
1380 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
1381#else
1382 unsigned int y;
1383
1384 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1385 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1386 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1387 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1388 _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
1389 if ((rows[1] - rows[0]) == (int)w)
1390 _tex_sub_2d(0, 0, w, h, tex->pt->format, tex->pt->dataformat, rows[0]);
1391 else
1392 {
1393 for (y = 0; y < h; y++)
1394 _tex_sub_2d(0, y, w, 1, tex->pt->format, tex->pt->dataformat, rows[y]);
1395 }
1396
1397 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1398 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1399 _tex_2d(tex->ptuv->intformat, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat);
1400 if ((rows[h + 1] - rows[h]) == (int)(w / 2))
1401 _tex_sub_2d(0, 0, w / 2, h / 2, tex->ptuv->format, tex->ptuv->dataformat, rows[h]);
1402 else
1403 {
1404 for (y = 0; y < (h / 2); y++)
1405 _tex_sub_2d(0, y, w / 2, 1, tex->ptuv->format, tex->ptuv->dataformat, rows[h + y]);
1406 }
1407#endif
1408 if (tex->pt->texture != tex->gc->pipe[0].shader.cur_tex)
1409 {
1410 glBindTexture(GL_TEXTURE_2D, tex->gc->pipe[0].shader.cur_tex);
1411 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1412 }
1413}
1414
1415void
1416evas_gl_common_texture_nv12tiled_update(Evas_GL_Texture *tex, DATA8 **rows, unsigned int w, unsigned int h)
1417{
1418 unsigned int mb_x, mb_y, mb_w, mb_h;
1419 unsigned int base_h;
1420
1421 if (!tex->pt) return;
1422
1423 tex->double_buffer.source = 1 - tex->double_buffer.source;
1424 tex->pt = tex->double_buffer.pt[tex->double_buffer.source];
1425 tex->ptuv = tex->double_buffer.ptuv[tex->double_buffer.source];
1426
1427 mb_w = w / 64 + (w % 64 ? 1 : 0);
1428 mb_h = h / 32 + (h % 32 ? 1 : 0);
1429
1430#if ( defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) )
1431 if (tex->dyn)
1432 {
1433 char *texture_addr;
1434 char *tmp;
1435
1436 texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
1437
1438 /* Iterate each Y macroblock like we do in evas_convert_yuv.c */
1439 for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
1440 {
1441 int step = 2;
1442 int offset = 0;
1443 int x = 0;
1444 int rmb_x = 0;
1445 int ry[2];
1446
1447 ry[0] = mb_y * 2 * 32 * tex->pt->dyn.stride;
1448 ry[1] = ry[0] + 32 * tex->pt->dyn.stride;
1449
1450 for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
1451 {
1452 unsigned int i;
1453
1454 tmp = texture_addr + x + ry[offset];
1455
1456 for (i = 0; i < 32 * 64; i += 64, tmp += tex->pt->dyn.stride)
1457 memcpy(tmp, rows[mb_y] + rmb_x + i, 64);
1458
1459 step++;
1460 if ((step & 0x3) == 0)
1461 {
1462 offset = 1 - offset;
1463 x -= 64;
1464 }
1465 else
1466 {
1467 x += 64;
1468 }
1469 }
1470 }
1471
1472 if (mb_h & 0x1)
1473 {
1474 int rmb_x = 0;
1475 int x = 0;
1476 int ry;
1477
1478 ry = mb_y * 2 * 32 * tex->pt->dyn.stride;
1479
1480 for (mb_x = 0; mb_x < mb_w; mb_x++, x += 64, rmb_x += 64 * 32)
1481 {
1482 unsigned int i;
1483
1484 tmp = texture_addr + x + ry;
1485
1486 for (i = 0; i < 32 * 64; i += 64, tmp += tex->pt->dyn.stride)
1487 memcpy(tmp, rows[mb_y] + rmb_x + i, 64);
1488 }
1489 }
1490
1491 secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->pt->dyn.img);
1492
1493 texture_addr = secsym_eglMapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
1494
1495 /* Iterate each UV macroblock like we do in evas_convert_yuv.c */
1496 base_h = (mb_h >> 1) + (mb_h & 0x1);
1497
1498 /* h is always a multiple of 32 */
1499 mb_h = h / 2;
1500 mb_h = (mb_h / 32 + (mb_h % 32 ? 1 : 0));
1501
1502 mb_w = w / 2;
1503 mb_w = (mb_w / 32 + (mb_w % 32 ? 1 : 0));
1504
1505 for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
1506 {
1507 int step = 2;
1508 int offset = 0;
1509 int x = 0;
1510 int rmb_x = 0;
1511 int ry[2];
1512
1513 ry[0] = mb_y * 2 * 32 * tex->ptuv->dyn.stride;
1514 ry[1] = ry[0] + 32 * tex->ptuv->dyn.stride;
1515
1516 for (mb_x = 0; mb_x < mb_w * 4; mb_x++, rmb_x += 64 * 32)
1517 {
1518 unsigned int i = 0;
1519
1520 tmp = texture_addr + x + ry[offset];
1521
1522 for (i = 0; i < 32 * 64; i += 64, tmp += tex->ptuv->dyn.stride)
1523 memcpy(tmp, rows[mb_y + base_h] + rmb_x + i, 64);
1524
1525 step++;
1526 if ((step & 0x3) == 0)
1527 {
1528 offset = 1 - offset;
1529 x -= 64;
1530 }
1531 else
1532 {
1533 x += 64;
1534 }
1535 }
1536 }
1537
1538 if (mb_h & 0x1)
1539 {
1540 int rmb_x = 0;
1541 int x = 0;
1542 int ry;
1543
1544 ry = mb_y * 2 * 32 * tex->ptuv->dyn.stride;
1545
1546 for (mb_x = 0; mb_x < mb_w * 2; mb_x++, x += 64, rmb_x += 64 * 32)
1547 {
1548 unsigned int i;
1549
1550 tmp = texture_addr + x + ry;
1551
1552 /* It has horizontaly half the pixels, but they are double the size*/
1553 for (i = 0; i < 32 * 64; i += 64, tmp += tex->ptuv->dyn.stride)
1554 memcpy(tmp, rows[mb_y + base_h] + rmb_x + i, 64);
1555 }
1556 }
1557
1558 secsym_eglUnmapImageSEC(tex->gc->egldisp, tex->ptuv->dyn.img);
1559 return ;
1560 }
1561#endif
1562
1563 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
1564 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1565
1566 glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
1567 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1568
1569 // We are telling the driver to not swizzle back the buffer as we are going to replace all pixel
1570 _tex_2d(tex->pt->intformat, w, h, tex->pt->format, tex->pt->dataformat);
1571
1572 /* Iterate each Y macroblock like we do in evas_convert_yuv.c */
1573 for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
1574 {
1575 int step = 2;
1576 int offset = 0;
1577 int x = 0;
1578 int rmb_x = 0;
1579 int ry[2];
1580
1581 ry[0] = mb_y * 2 * 32;
1582 ry[1] = ry[0] + 32;
1583
1584 for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
1585 {
1586 _tex_sub_2d(x, ry[offset], 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
1587
1588 step++;
1589 if ((step & 0x3) == 0)
1590 {
1591 offset = 1 - offset;
1592 x -= 64;
1593 }
1594 else
1595 {
1596 x += 64;
1597 }
1598 }
1599 }
1600
1601 if (mb_h & 0x1)
1602 {
1603 int rmb_x = 0;
1604 int x = 0;
1605 int ry;
1606
1607 ry = mb_y * 2 * 32;
1608
1609 for (mb_x = 0; mb_x < mb_w; mb_x++, x += 64, rmb_x += 64 * 32)
1610 _tex_sub_2d(x, ry, 64, 32, tex->pt->format, tex->pt->dataformat, rows[mb_y] + rmb_x);
1611 }
1612
1613 glBindTexture(GL_TEXTURE_2D, tex->ptuv->texture);
1614 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
1615
1616 _tex_2d(tex->ptuv->intformat, w, h, tex->ptuv->format, tex->ptuv->dataformat);
1617
1618 /* Iterate each UV macroblock like we do in evas_convert_yuv.c */
1619 base_h = (mb_h >> 1) + (mb_h & 0x1);
1620
1621 /* h is always a multiple of 32 */
1622 mb_h = h / 2;
1623 mb_h = (mb_h / 32 + (mb_h % 32 ? 1 : 0));
1624
1625 mb_w = w / 2;
1626 mb_w = (mb_w / 32 + (mb_w % 32 ? 1 : 0));
1627
1628 for (mb_y = 0; mb_y < (mb_h >> 1); mb_y++)
1629 {
1630 int step = 2;
1631 int offset = 0;
1632 int x = 0;
1633 int rmb_x = 0;
1634 int ry[2];
1635
1636 ry[0] = mb_y * 2 * 32;
1637 ry[1] = ry[0] + 32;
1638
1639 for (mb_x = 0; mb_x < mb_w * 2; mb_x++, rmb_x += 64 * 32)
1640 {
1641 _tex_sub_2d(x, ry[offset], 32, 32,
1642 tex->ptuv->format, tex->ptuv->dataformat,
1643 rows[mb_y + base_h] + rmb_x);
1644 step++;
1645 if ((step & 0x3) == 0)
1646 {
1647 offset = 1 - offset;
1648 x -= 32;
1649 }
1650 else
1651 {
1652 x += 32;
1653 }
1654 }
1655 }
1656
1657 if (mb_h & 0x1)
1658 {
1659 int rmb_x = 0;
1660 int x = 0;
1661 int ry;
1662
1663 ry = mb_y * 2 * 32;
1664
1665 for (mb_x = 0; mb_x < mb_w; mb_x++, x += 32, rmb_x += 64 * 32)
1666 _tex_sub_2d(x, ry, 64, 32, tex->ptuv->format, tex->ptuv->dataformat, rows[mb_y + base_h] + rmb_x);
1667 }
1668}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/compile-s3c6410.sh b/libraries/evas/src/modules/engines/gl_common/shader/compile-s3c6410.sh
new file mode 100755
index 0000000..450e5de
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/compile-s3c6410.sh
@@ -0,0 +1,47 @@
1#!/bin/sh
2ORIONEXE=/home/raster/Data/orion/orion.exe
3OPTS="-O --nolodcalc -lp"
4
5function compile()
6{
7 F=$1
8
9 make-c-str.sh $F"_frag.shd" > $F"_frag.h"
10 if test -f $F"_frag_s3c6410.asm"; then
11 wine $ORIONEXE -a $OPTS -f $F"_frag_s3c6410.asm"
12 make-c-bin.sh $F"_frag_s3c6410.bin" > $F"_frag_bin_s3c6410.h"
13 rm -f $F"_frag_s3c6410.bin" $F"_frag_s3c6410.h"
14 else
15 wine $ORIONEXE $OPTS -f $F"_frag.shd"
16 make-c-bin.sh $F"_frag.shd.bin" > $F"_frag_bin_s3c6410.h"
17 rm -f $F"_frag.shd.bin" $F"_frag.shd.asm" $F"_frag.shd.h"
18 fi
19
20 make-c-str.sh $F"_vert.shd" > $F"_vert.h"
21 if test -f $F"_vert_s3c6410.asm"; then
22 wine $ORIONEXE -a $OPTS -v $F"_vert_s3c6410.asm"
23 make-c-bin.sh $F"_vert_s3c6410.bin" > $F"_vert_bin_s3c6410.h"
24 rm -f $F"_vert_s3c6410.bin" $F"_vert_s3c6410.h"
25 else
26 wine $ORIONEXE $OPTS -v $F"_vert.shd"
27 make-c-bin.sh $F"_vert.shd.bin" > $F"_vert_bin_s3c6410.h"
28 rm -f $F"_vert.shd.bin" $F"_vert.shd.asm" $F"_vert.shd.h"
29 fi
30}
31
32compile rect
33compile font
34compile img
35compile img_nomul
36compile img_bgra
37compile img_bgra_nomul
38compile img_mask
39compile yuv
40compile yuv_nomul
41compile tex
42compile tex_nomul
43compile nv12
44compile nv12_nomul
45compile yuy2
46compile yuy2_nomul
47## FIXME: compile filter_*
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/compile-sgx.sh b/libraries/evas/src/modules/engines/gl_common/shader/compile-sgx.sh
new file mode 100755
index 0000000..a96b58c
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/compile-sgx.sh
@@ -0,0 +1,48 @@
1#!/bin/bash
2function compile()
3{
4 F=$1
5
6 if [ -f $F".shd" ]; then
7 make-c-str.sh $F".shd" > $F".h"
8 fi
9 if [ -f $F"_frag.shd" ]; then
10 make-c-str.sh $F"_frag.shd" > $F"_frag.h"
11 fi
12 if [ -f $F"_vert.shd" ]; then
13 make-c-str.sh $F"_vert.shd" > $F"_vert.h"
14 fi
15}
16
17compile rect
18compile font
19compile img
20compile img_nomul
21compile img_bgra
22compile img_bgra_nomul
23compile img_mask
24compile yuv
25compile yuv_nomul
26compile tex
27compile tex_nomul
28compile filter_blur_bgra
29compile filter_blur_bgra_nomul
30compile filter_blur
31compile filter_blur_nomul
32compile filter_greyscale_bgra
33compile filter_greyscale_bgra_nomul
34compile filter_greyscale
35compile filter_greyscale_nomul
36compile filter_invert_bgra
37compile filter_invert_bgra_nomul
38compile filter_invert
39compile filter_invert_nomul
40compile filter_sepia_bgra
41compile filter_sepia_bgra_nomul
42compile filter_sepia
43compile filter_sepia_nomul
44compile nv12
45compile nv12_nomul
46compile yuy2
47compile yuy2_nomul
48
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur.h
new file mode 100644
index 0000000..7c3a369
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur.h
@@ -0,0 +1,24 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4 * col;\n"
24"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur.shd
new file mode 100644
index 0000000..5f13a47
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur.shd
@@ -0,0 +1,24 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4 * col;
24}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.h
new file mode 100644
index 0000000..0862e4f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.h
@@ -0,0 +1,24 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4;\n"
24"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.shd
new file mode 100644
index 0000000..a9134df
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra.shd
@@ -0,0 +1,24 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4;
24}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.h
new file mode 100644
index 0000000..0862e4f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.h
@@ -0,0 +1,24 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4;\n"
24"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.shd
new file mode 100644
index 0000000..a9134df
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_bgra_nomul.shd
@@ -0,0 +1,24 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4;
24}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.h
new file mode 100644
index 0000000..0862e4f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.h
@@ -0,0 +1,24 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"uniform sampler1D gaussian;\n"
10"varying vec4 col;\n"
11"varying vec2 tex_c;\n"
12"varying weight;\n"
13"uniform radius;\n"
14"void main()\n"
15"{\n"
16" int i;\n"
17" vec4 fc = vec4(0,0,0,0);\n"
18" \n"
19" for (i = 0 ; i < radius ; i ++){\n"
20" fc += texture2D(tex, tex_c.xy).rgba *\n"
21" texture1D(gaussian,i/radius).aaaa;\n"
22" }\n"
23" gl_FragColor = fc / 4;\n"
24"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.shd
new file mode 100644
index 0000000..a9134df
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_blur_nomul.shd
@@ -0,0 +1,24 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9uniform sampler1D gaussian;
10varying vec4 col;
11varying vec2 tex_c;
12varying weight;
13uniform radius;
14void main()
15{
16 int i;
17 vec4 fc = vec4(0,0,0,0);
18
19 for (i = 0 ; i < radius ; i ++){
20 fc += texture2D(tex, tex_c.xy).rgba *
21 texture1D(gaussian,i/radius).aaaa;
22 }
23 gl_FragColor = fc / 4;
24}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.h
new file mode 100644
index 0000000..850538a
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" float inten = dot(texture2D(tex,tex_c.xy).agb,vec3(.3, .59, .11));\n"
14" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r) * col;\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.shd
new file mode 100644
index 0000000..78ecf08
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 float inten = dot(texture2D(tex,tex_c.xy).agb,vec3(.3, .59, .11));
14 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r) * col;
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.h
new file mode 100644
index 0000000..3caef35
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));\n"
14" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a) * col;\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.shd
new file mode 100644
index 0000000..5dca381
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));
14 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a) * col;
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.h
new file mode 100644
index 0000000..4cb36a8
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));\n"
13" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a);\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd
new file mode 100644
index 0000000..a077eea
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_bgra_nomul.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 float inten = dot(texture2D(tex,tex_c.xy).rgb,vec3(.3, .59, .11));
13 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).a);
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.h
new file mode 100644
index 0000000..f501a02
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" float inten = dot(texture2D(tex,tex_c.xy).abg,vec3(.3, .59, .11));\n"
13" gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r);\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.shd
new file mode 100644
index 0000000..b5b8ec6
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_greyscale_nomul.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 float inten = dot(texture2D(tex,tex_c.xy).abg,vec3(.3, .59, .11));
13 gl_FragColor = vec4(inten, inten, inten, texture2D(tex,tex_c.xy).r);
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert.h
new file mode 100644
index 0000000..46373e0
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert.shd
new file mode 100644
index 0000000..a75b058
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.h
new file mode 100644
index 0000000..3e3011d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = (vec4(1.0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy))*col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.shd
new file mode 100644
index 0000000..8d7df2d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = (vec4(1.0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy))*col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.h
new file mode 100644
index 0000000..b9f1e25
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inv = vec3(1.0, 1.0, 1.0) - texture2D(tex,tex_c.xy).rgb;\n"
14" gl_FragColor = vec4(inv.r, inv.g, inv.b, 1.0);\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.shd
new file mode 100644
index 0000000..682acb2
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_bgra_nomul.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inv = vec3(1.0, 1.0, 1.0) - texture2D(tex,tex_c.xy).rgb;
14 gl_FragColor = vec4(inv.r, inv.g, inv.b, 1.0);
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.h
new file mode 100644
index 0000000..46373e0
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.shd
new file mode 100644
index 0000000..a75b058
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_invert_nomul.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = (vec4(0, 1.0, 1.0, 1.0) - texture2D(tex, tex_c.xy).bgra)*col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.h
new file mode 100644
index 0000000..50fbf12
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.h
@@ -0,0 +1,20 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).abg;\n"
14" vec4 sep;\n"
15" sep.r = dot(inp, vec3(.393, .769, .189));\n"
16" sep.g = dot(inp, vec3(.349, .686, .168));\n"
17" sep.b = dot(inp, vec3(.272, .534, .131));\n"
18" sep.a = texture2D(tex,tex_c.xy).r;\n"
19" gl_FragColor = sep * col;\n"
20"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.shd
new file mode 100644
index 0000000..027ecfb
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia.shd
@@ -0,0 +1,20 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).abg;
14 vec4 sep;
15 sep.r = dot(inp, vec3(.393, .769, .189));
16 sep.g = dot(inp, vec3(.349, .686, .168));
17 sep.b = dot(inp, vec3(.272, .534, .131));
18 sep.a = texture2D(tex,tex_c.xy).r;
19 gl_FragColor = sep * col;
20}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.h
new file mode 100644
index 0000000..41e4283
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.h
@@ -0,0 +1,20 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).rgb;\n"
14" vec4 sep;\n"
15" sep.r = dot(inp, vec3(.393, .769, .189));\n"
16" sep.g = dot(inp, vec3(.349, .686, .168));\n"
17" sep.b = dot(inp, vec3(.272, .534, .131));\n"
18" sep.a = texture2D(tex,tex_c.xy).a;\n"
19" gl_FragColor = sep * col;\n"
20"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.shd
new file mode 100644
index 0000000..caed378
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra.shd
@@ -0,0 +1,20 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).rgb;
14 vec4 sep;
15 sep.r = dot(inp, vec3(.393, .769, .189));
16 sep.g = dot(inp, vec3(.349, .686, .168));
17 sep.b = dot(inp, vec3(.272, .534, .131));
18 sep.a = texture2D(tex,tex_c.xy).a;
19 gl_FragColor = sep * col;
20}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.h
new file mode 100644
index 0000000..0c4fe1b
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.h
@@ -0,0 +1,18 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).rgb;\n"
14" gl_FragColor.r = dot(inp, vec3(.393, .769, .189));\n"
15" gl_FragColor.g = dot(inp, vec3(.349, .686, .168));\n"
16" gl_FragColor.b = dot(inp, vec3(.272, .534, .131));\n"
17" gl_FragColor.a = texture2D(tex,tex_c.xy).a;\n"
18"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.shd
new file mode 100644
index 0000000..9c6c1d4
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_bgra_nomul.shd
@@ -0,0 +1,18 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).rgb;
14 gl_FragColor.r = dot(inp, vec3(.393, .769, .189));
15 gl_FragColor.g = dot(inp, vec3(.349, .686, .168));
16 gl_FragColor.b = dot(inp, vec3(.272, .534, .131));
17 gl_FragColor.a = texture2D(tex,tex_c.xy).a;
18}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.h b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.h
new file mode 100644
index 0000000..23af9ec
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.h
@@ -0,0 +1,18 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" vec3 inp = texture2D(tex,tex_c.xy).abg;\n"
14" gl_FragColor.r = dot(inp, vec3(.393, .769, .189));\n"
15" gl_FragColor.g = dot(inp, vec3(.349, .686, .168));\n"
16" gl_FragColor.b = dot(inp, vec3(.272, .534, .131));\n"
17" gl_FragColor.a = texture2D(tex,tex_c.xy).r;\n"
18"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.shd b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.shd
new file mode 100644
index 0000000..f9871bd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/filter_sepia_nomul.shd
@@ -0,0 +1,18 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 vec3 inp = texture2D(tex,tex_c.xy).abg;
14 gl_FragColor.r = dot(inp, vec3(.393, .769, .189));
15 gl_FragColor.g = dot(inp, vec3(.349, .686, .168));
16 gl_FragColor.b = dot(inp, vec3(.272, .534, .131));
17 gl_FragColor.a = texture2D(tex,tex_c.xy).r;
18}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/font_frag.h
new file mode 100644
index 0000000..f27dcdc
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_frag.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = texture2D(tex, tex_c.xy).aaaa * col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/font_frag.shd
new file mode 100644
index 0000000..a8eb9b7
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_frag.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = texture2D(tex, tex_c.xy).aaaa * col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/font_frag_bin_s3c6410.h
new file mode 100644
index 0000000..daca692
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_frag_bin_s3c6410.h
@@ -0,0 +1,9 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000000,
20x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000000,
40x00000000, 0x0000e407, 0x307820e4, 0x00000000, 0x01000000, 0x0100e400,
50x237a10ff, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
60x00000004, 0x00000003, 0x00000009, 0x00000000, 0x00000004, 0x00000008,
70x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
80x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x006c6f63, 0x5f786574,
90x00000063, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_frag_s3c6410.asm b/libraries/evas/src/modules/engines/gl_common/shader/font_frag_s3c6410.asm
new file mode 100644
index 0000000..4ed116f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_frag_s3c6410.asm
@@ -0,0 +1,26 @@
1#-------------------------------------------------
2# ORION - OpenGL ES 2.0 Shading Language Compiler
3# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
4# Compiler Version : v04.00.09
5# Release Date : 19.01.2009
6# FIMG VERSION : FIMGv1.5
7# Optimizer Options : -O --nolodcalc
8#-------------------------------------------------
9
10# hand optimised - removed useless ops
11
12ps_3_0
13
14fimg_version 0x01020000
15
16dcl_s2_tex s0
17dcl_f4_col v1.x
18dcl_f2_tex_c v0.x
19
20label start
21label main_
22texld r0.xyzw, v0.xyzw, s0 # tex=s0
23mul_sat oColor.xyzw, r0.wwww, v1.xyzw # gl_FragColor=oColor.xyzw, col=v1.xyzw
24label main_end
25ret
26# 4 instructions, 4 C regs, 1 R regs
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/font_vert.h
new file mode 100644
index 0000000..8921d9d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_vert.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/font_vert.shd
new file mode 100644
index 0000000..606c297
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_vert.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/font_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/font_vert_bin_s3c6410.h
new file mode 100644
index 0000000..1402448
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/font_vert_bin_s3c6410.h
@@ -0,0 +1,20 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000007, 0x00000006,
20x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000031, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20f801e4, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
80x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
90x00000000, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x00000006,
130x00000009, 0x00000000, 0x00000000, 0x00000013, 0x00000005, 0x00000009,
140x00000000, 0x00000004, 0x00000019, 0x00000009, 0x00000003, 0x00000000,
150x00000008, 0x00000000, 0x0000000b, 0x00000009, 0x00010004, 0x00000000,
160x00000027, 0x00000003, 0x00000009, 0x00010004, 0x00000004, 0x0000002b,
170x00000005, 0x00000003, 0x00010004, 0x00000008, 0x00000023, 0x00000003,
180x0000000e, 0x00020001, 0x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69,
190x74726576, 0x63007865, 0x726f6c6f, 0x78657400, 0x6f6f635f, 0x6d006472,
200x63007076, 0x74006c6f, 0x635f7865, 0x00000000, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.h
new file mode 100644
index 0000000..1ced5e0
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = texture2D(tex, tex_c.xy) * col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.shd
new file mode 100644
index 0000000..2bc8d79
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = texture2D(tex, tex_c.xy) * col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag_bin_s3c6410.h
new file mode 100644
index 0000000..feb5bf5
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_frag_bin_s3c6410.h
@@ -0,0 +1,11 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000004, 0x00000003,
20x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000000,
40x00000000, 0x02025400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307820e4, 0x00000000, 0x01000000, 0x0100e400, 0x237a10e4, 0x00000000,
60x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
70x00000000, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
80x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000003,
90x00000009, 0x00000000, 0x00000004, 0x00000008, 0x00000005, 0x00000003,
100x00000000, 0x00000000, 0x00000000, 0x00000003, 0x0000000f, 0x00030005,
110x00000000, 0x00786574, 0x006c6f63, 0x5f786574, 0x00000063,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.h
new file mode 100644
index 0000000..459611f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.h
@@ -0,0 +1,13 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_FragColor = texture2D(tex, tex_c.xy);\n"
13"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.shd
new file mode 100644
index 0000000..877df62
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag.shd
@@ -0,0 +1,13 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 gl_FragColor = texture2D(tex, tex_c.xy);
13}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag_bin_s3c6410.h
new file mode 100644
index 0000000..b89eeb1
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_frag_bin_s3c6410.h
@@ -0,0 +1,10 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000003,
20x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000a, 0x00000000,
40x00000000, 0x02025400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307a10e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
60x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
70x3f800000, 0x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000,
80x00000004, 0x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
90x00000003, 0x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x5f786574,
100x00000063, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.h
new file mode 100644
index 0000000..13d5edd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.h
@@ -0,0 +1,12 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec2 tex_coord;\n"
6"uniform mat4 mvp;\n"
7"varying vec2 tex_c;\n"
8"void main()\n"
9"{\n"
10" gl_Position = mvp * vertex;\n"
11" tex_c = tex_coord;\n"
12"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.shd
new file mode 100644
index 0000000..74f3207
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert.shd
@@ -0,0 +1,12 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec2 tex_coord;
6uniform mat4 mvp;
7varying vec2 tex_c;
8void main()
9{
10 gl_Position = mvp * vertex;
11 tex_c = tex_coord;
12}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert_bin_s3c6410.h
new file mode 100644
index 0000000..314b5f3
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_nomul_vert_bin_s3c6410.h
@@ -0,0 +1,17 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000006, 0x00000006,
20x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000027, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20980154, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
80x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
90x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x0000000c, 0x00000006, 0x00000009, 0x00000000, 0x00000000, 0x00000013,
130x00000009, 0x00000003, 0x00000000, 0x00000004, 0x00000000, 0x0000000b,
140x00000009, 0x00010004, 0x00000000, 0x00000021, 0x00000005, 0x00000003,
150x00010004, 0x00000004, 0x0000001d, 0x00000003, 0x0000000e, 0x00020001,
160x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69, 0x74726576, 0x74007865,
170x635f7865, 0x64726f6f, 0x70766d00, 0x78657400, 0x0000635f,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.h
new file mode 100644
index 0000000..8921d9d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.shd
new file mode 100644
index 0000000..606c297
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert_bin_s3c6410.h
new file mode 100644
index 0000000..1402448
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_bgra_vert_bin_s3c6410.h
@@ -0,0 +1,20 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000007, 0x00000006,
20x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000031, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20f801e4, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
80x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
90x00000000, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x00000006,
130x00000009, 0x00000000, 0x00000000, 0x00000013, 0x00000005, 0x00000009,
140x00000000, 0x00000004, 0x00000019, 0x00000009, 0x00000003, 0x00000000,
150x00000008, 0x00000000, 0x0000000b, 0x00000009, 0x00010004, 0x00000000,
160x00000027, 0x00000003, 0x00000009, 0x00010004, 0x00000004, 0x0000002b,
170x00000005, 0x00000003, 0x00010004, 0x00000008, 0x00000023, 0x00000003,
180x0000000e, 0x00020001, 0x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69,
190x74726576, 0x63007865, 0x726f6c6f, 0x78657400, 0x6f6f635f, 0x6d006472,
200x63007076, 0x74006c6f, 0x635f7865, 0x00000000, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/img_frag.h
new file mode 100644
index 0000000..0a95502
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_frag.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = texture2D(tex, tex_c.xy).bgra * col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_frag.shd
new file mode 100644
index 0000000..9faa414
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_frag.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = texture2D(tex, tex_c.xy).bgra * col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_frag_bin_s3c6410.h
new file mode 100644
index 0000000..3518e8d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_frag_bin_s3c6410.h
@@ -0,0 +1,9 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000000,
20x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000000,
40x00000000, 0x0000e407, 0x307820e4, 0x00000000, 0x01000000, 0x0100e400,
50x237a10c6, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
60x00000004, 0x00000003, 0x00000009, 0x00000000, 0x00000004, 0x00000008,
70x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
80x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x006c6f63, 0x5f786574,
90x00000063, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_frag_s3c6410.asm b/libraries/evas/src/modules/engines/gl_common/shader/img_frag_s3c6410.asm
new file mode 100644
index 0000000..3716bce
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_frag_s3c6410.asm
@@ -0,0 +1,26 @@
1
2#-------------------------------------------------
3# ORION - OpenGL ES 2.0 Shading Language Compiler
4# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
5# Compiler Version : v04.00.09
6# Release Date : 19.01.2009
7# FIMG VERSION : FIMGv1.5
8# Optimizer Options : -O --nolodcalc
9#-------------------------------------------------
10
11# hand optimised - removed useless ops
12
13ps_3_0
14
15fimg_version 0x01020000
16
17dcl_s2_tex s0
18dcl_f4_col v1.x
19dcl_f2_tex_c v0.x
20
21label start
22label main_
23texld r0.xyzw, v0.xyzw, s0 # tex=s0
24mul_sat oColor.xyzw, r0.zyxw, v1.xyzw # gl_FragColor=oColor.xyzw, col=v1.xyzw
25label main_end
26ret
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_mask_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/img_mask_frag.h
new file mode 100644
index 0000000..1b28128
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_mask_frag.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texm;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c, tex_cm;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = texture2D(texm, tex_cm.xy).aaaa * texture2D(tex, tex_c.xy).rgba * col;\n"
14"}\n"
15"\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_mask_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/img_mask_vert.h
new file mode 100644
index 0000000..7508c98
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_mask_vert.h
@@ -0,0 +1,16 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord, tex_coordm;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c, tex_cm;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15" tex_cm = tex_coordm;\n"
16"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.h
new file mode 100644
index 0000000..0343b34
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.h
@@ -0,0 +1,13 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_FragColor = texture2D(tex, tex_c.xy).bgra;\n"
13"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.shd
new file mode 100644
index 0000000..222d635
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag.shd
@@ -0,0 +1,13 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 gl_FragColor = texture2D(tex, tex_c.xy).bgra;
13}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag_bin_s3c6410.h
new file mode 100644
index 0000000..61662c8
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_frag_bin_s3c6410.h
@@ -0,0 +1,10 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000003,
20x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000a, 0x00000000,
40x00000000, 0x02025400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307a10c6, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
60x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
70x3f800000, 0x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000,
80x00000004, 0x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
90x00000003, 0x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x5f786574,
100x00000063, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.h
new file mode 100644
index 0000000..13d5edd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.h
@@ -0,0 +1,12 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec2 tex_coord;\n"
6"uniform mat4 mvp;\n"
7"varying vec2 tex_c;\n"
8"void main()\n"
9"{\n"
10" gl_Position = mvp * vertex;\n"
11" tex_c = tex_coord;\n"
12"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.shd
new file mode 100644
index 0000000..74f3207
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert.shd
@@ -0,0 +1,12 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec2 tex_coord;
6uniform mat4 mvp;
7varying vec2 tex_c;
8void main()
9{
10 gl_Position = mvp * vertex;
11 tex_c = tex_coord;
12}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert_bin_s3c6410.h
new file mode 100644
index 0000000..314b5f3
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_nomul_vert_bin_s3c6410.h
@@ -0,0 +1,17 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000006, 0x00000006,
20x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000027, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20980154, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
80x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
90x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x0000000c, 0x00000006, 0x00000009, 0x00000000, 0x00000000, 0x00000013,
130x00000009, 0x00000003, 0x00000000, 0x00000004, 0x00000000, 0x0000000b,
140x00000009, 0x00010004, 0x00000000, 0x00000021, 0x00000005, 0x00000003,
150x00010004, 0x00000004, 0x0000001d, 0x00000003, 0x0000000e, 0x00020001,
160x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69, 0x74726576, 0x74007865,
170x635f7865, 0x64726f6f, 0x70766d00, 0x78657400, 0x0000635f,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/img_vert.h
new file mode 100644
index 0000000..8921d9d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_vert.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/img_vert.shd
new file mode 100644
index 0000000..606c297
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_vert.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/img_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/img_vert_bin_s3c6410.h
new file mode 100644
index 0000000..1402448
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/img_vert_bin_s3c6410.h
@@ -0,0 +1,20 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000007, 0x00000006,
20x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000031, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20f801e4, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
80x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
90x00000000, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x00000006,
130x00000009, 0x00000000, 0x00000000, 0x00000013, 0x00000005, 0x00000009,
140x00000000, 0x00000004, 0x00000019, 0x00000009, 0x00000003, 0x00000000,
150x00000008, 0x00000000, 0x0000000b, 0x00000009, 0x00010004, 0x00000000,
160x00000027, 0x00000003, 0x00000009, 0x00010004, 0x00000004, 0x0000002b,
170x00000005, 0x00000003, 0x00010004, 0x00000008, 0x00000023, 0x00000003,
180x0000000e, 0x00020001, 0x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69,
190x74726576, 0x63007865, 0x726f6c6f, 0x78657400, 0x6f6f635f, 0x6d006472,
200x63007076, 0x74006c6f, 0x635f7865, 0x00000000, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/make-c-bin.sh b/libraries/evas/src/modules/engines/gl_common/shader/make-c-bin.sh
new file mode 100755
index 0000000..2902df6
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/make-c-bin.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2od --width=4 -t x4 -v $1 | \
3awk '{ if (NF > 1) printf("0x%s, ", $2); L = L + 1; if (L > 5) { L = 0; printf("\n");}}'
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/make-c-str.sh b/libraries/evas/src/modules/engines/gl_common/shader/make-c-str.sh
new file mode 100755
index 0000000..fe7e80a
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/make-c-str.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3awk '{printf("\"%s\\n\"\n", $0);}' $1
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.h
new file mode 100644
index 0000000..fec4b23
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.h
@@ -0,0 +1,31 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texuv;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c, tex_cuv;\n"
11"void main()\n"
12"{\n"
13" float y,u,v,vmu,r,g,b;\n"
14" y=texture2D(tex,tex_c).g;\n"
15" u=texture2D(texuv,tex_cuv).g;\n"
16" v=texture2D(texuv,tex_cuv).a;\n"
17"\n"
18" u=u-0.5;\n"
19" v=v-0.5;\n"
20" vmu=v*0.813+u*0.391;\n"
21" u=u*2.018;\n"
22" v=v*1.596;\n"
23" y=(y-0.062)*1.164;\n"
24"\n"
25" r=y+v;\n"
26" g=y-vmu;\n"
27" b=y+u;\n"
28"\n"
29" gl_FragColor=vec4(r,g,b,1.0) * col;\n"
30"}\n"
31"\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.shd
new file mode 100644
index 0000000..34748fc
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_frag.shd
@@ -0,0 +1,31 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex, texuv;
9varying vec4 col;
10varying vec2 tex_c, tex_cuv;
11void main()
12{
13 float y,u,v,vmu,r,g,b;
14 y=texture2D(tex,tex_c).g;
15 u=texture2D(texuv,tex_cuv).g;
16 v=texture2D(texuv,tex_cuv).a;
17
18 u=u-0.5;
19 v=v-0.5;
20 vmu=v*0.813+u*0.391;
21 u=u*2.018;
22 v=v*1.596;
23 y=(y-0.062)*1.164;
24
25 r=y+v;
26 g=y-vmu;
27 b=y+u;
28
29 gl_FragColor=vec4(r,g,b,1.0) * col;
30}
31
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.h
new file mode 100644
index 0000000..df52d19
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.h
@@ -0,0 +1,31 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texuv;\n"
9"varying vec2 tex_c, tex_cuv;\n"
10"void main()\n"
11"{\n"
12" float y,u,v,vmu,r,g,b;\n"
13" y=texture2D(tex,tex_c).g;\n"
14" u=texture2D(texuv,tex_cuv).g;\n"
15" v=texture2D(texuv,tex_cuv).a;\n"
16"\n"
17" u=u-0.5;\n"
18" v=v-0.5;\n"
19" vmu=v*0.813+u*0.391;\n"
20" u=u*2.018;\n"
21" v=v*1.596;\n"
22" y=(y-0.062)*1.164;\n"
23"\n"
24" r=y+v;\n"
25" g=y-vmu;\n"
26" b=y+u;\n"
27"\n"
28" gl_FragColor=vec4(r,g,b,1.0);\n"
29"}\n"
30"\n"
31"\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.shd
new file mode 100644
index 0000000..6910933
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_frag.shd
@@ -0,0 +1,31 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex, texuv;
9varying vec2 tex_c, tex_cuv;
10void main()
11{
12 float y,u,v,vmu,r,g,b;
13 y=texture2D(tex,tex_c).g;
14 u=texture2D(texuv,tex_cuv).g;
15 v=texture2D(texuv,tex_cuv).a;
16
17 u=u-0.5;
18 v=v-0.5;
19 vmu=v*0.813+u*0.391;
20 u=u*2.018;
21 v=v*1.596;
22 y=(y-0.062)*1.164;
23
24 r=y+v;
25 g=y-vmu;
26 b=y+u;
27
28 gl_FragColor=vec4(r,g,b,1.0);
29}
30
31
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.h
new file mode 100644
index 0000000..6ff1040
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord, tex_coord2;\n"
7"uniform mat4 mvp;\n"
8"varying vec2 tex_c, tex_cuv;\n"
9"void main()\n"
10"{\n"
11" gl_Position = mvp * vertex;\n"
12" tex_c = tex_coord;\n"
13" tex_cuv = tex_coord2 * 0.25;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.shd
new file mode 100644
index 0000000..994f5e6
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_nomul_vert.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord, tex_coord2;
7uniform mat4 mvp;
8varying vec2 tex_c, tex_cuv;
9void main()
10{
11 gl_Position = mvp * vertex;
12 tex_c = tex_coord;
13 tex_cuv = tex_coord2 * 0.25;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.h
new file mode 100644
index 0000000..38d6d9e
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.h
@@ -0,0 +1,16 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord, tex_coord2;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c, tex_cuv;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15" tex_cuv = tex_coord2 * 0.25;\n"
16"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.shd
new file mode 100644
index 0000000..eb7cc36
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/nv12_vert.shd
@@ -0,0 +1,16 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord, tex_coord2;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c, tex_cuv;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15 tex_cuv = tex_coord2 * 0.25;
16}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag.h
new file mode 100644
index 0000000..4a102a4
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag.h
@@ -0,0 +1,13 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"void main()\n"
11"{\n"
12" gl_FragColor = col;\n"
13"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag.shd
new file mode 100644
index 0000000..02251ee
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag.shd
@@ -0,0 +1,13 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10void main()
11{
12 gl_FragColor = col;
13}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag_bin_s3c6410.h
new file mode 100644
index 0000000..ee94467
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag_bin_s3c6410.h
@@ -0,0 +1,6 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000002, 0x00000000,
20x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
40x00000000, 0x00000000, 0x20fa10e4, 0x00000000, 0x00000000, 0x00000000,
50x1e000000, 0x00000000, 0x00000000, 0x00000003, 0x00000009, 0x00000000,
60x00000000, 0x006c6f63, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_frag_s3c6410.asm b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag_s3c6410.asm
new file mode 100644
index 0000000..24c47ac
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_frag_s3c6410.asm
@@ -0,0 +1,24 @@
1
2#-------------------------------------------------
3# ORION - OpenGL ES 2.0 Shading Language Compiler
4# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
5# Compiler Version : v04.00.09
6# Release Date : 19.01.2009
7# FIMG VERSION : FIMGv1.5
8# Optimizer Options : -O --nolodcalc
9#-------------------------------------------------
10
11# hand optimised - removed useless ops
12
13ps_3_0
14
15fimg_version 0x01020000
16
17dcl_f4_col v0.x
18
19label start
20label main_
21label main_end
22mov_sat oColor.xyzw, v0.xyzw
23ret
24
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/rect_vert.h
new file mode 100644
index 0000000..51d41aa
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_vert.h
@@ -0,0 +1,12 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"uniform mat4 mvp;\n"
7"varying vec4 col;\n"
8"void main()\n"
9"{\n"
10" gl_Position = mvp * vertex;\n"
11" col = color;\n"
12"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/rect_vert.shd
new file mode 100644
index 0000000..63fea5d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_vert.shd
@@ -0,0 +1,12 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6uniform mat4 mvp;
7varying vec4 col;
8void main()
9{
10 gl_Position = mvp * vertex;
11 col = color;
12}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/rect_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/rect_vert_bin_s3c6410.h
new file mode 100644
index 0000000..3130684
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/rect_vert_bin_s3c6410.h
@@ -0,0 +1,17 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000006, 0x00000006,
20x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000021, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20f801e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
80x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
90x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x0000000c, 0x00000006, 0x00000009, 0x00000000, 0x00000000, 0x00000013,
130x00000005, 0x00000009, 0x00000000, 0x00000004, 0x00000000, 0x0000000b,
140x00000009, 0x00010004, 0x00000000, 0x0000001d, 0x00000003, 0x00000009,
150x00010004, 0x00000004, 0x00000019, 0x00000003, 0x0000000e, 0x00020001,
160x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69, 0x74726576, 0x63007865,
170x726f6c6f, 0x70766d00, 0x6c6f6300, 0x00000000, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag.h
new file mode 100644
index 0000000..1ced5e0
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c;\n"
11"void main()\n"
12"{\n"
13" gl_FragColor = texture2D(tex, tex_c.xy) * col;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag.shd
new file mode 100644
index 0000000..2bc8d79
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec4 col;
10varying vec2 tex_c;
11void main()
12{
13 gl_FragColor = texture2D(tex, tex_c.xy) * col;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag_bin_s3c6410.h
new file mode 100644
index 0000000..24af537
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag_bin_s3c6410.h
@@ -0,0 +1,9 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000000,
20x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000000,
40x00000000, 0x0000e407, 0x307820e4, 0x00000000, 0x01000000, 0x0100e400,
50x237a10e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
60x00000004, 0x00000003, 0x00000009, 0x00000000, 0x00000004, 0x00000008,
70x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000003,
80x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x006c6f63, 0x5f786574,
90x00000063, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_frag_s3c6410.asm b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag_s3c6410.asm
new file mode 100644
index 0000000..14bbfa1
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_frag_s3c6410.asm
@@ -0,0 +1,26 @@
1
2#-------------------------------------------------
3# ORION - OpenGL ES 2.0 Shading Language Compiler
4# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
5# Compiler Version : v04.00.09
6# Release Date : 19.01.2009
7# FIMG VERSION : FIMGv1.5
8# Optimizer Options : -O --nolodcalc
9#-------------------------------------------------
10
11# hand optimised - removed useless ops
12
13ps_3_0
14
15fimg_version 0x01020000
16
17dcl_s2_tex s0
18dcl_f4_col v1.x
19dcl_f2_tex_c v0.x
20
21label start
22label main_
23texld r0.xyzw, v0.xyzw, s0 # tex=s0
24mul_sat oColor.xyzw, r0.xyzw, v1.xyzw # gl_FragColor=oColor.xyzw, col=v1.xyzw
25label main_end
26ret
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.h
new file mode 100644
index 0000000..459611f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.h
@@ -0,0 +1,13 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_FragColor = texture2D(tex, tex_c.xy);\n"
13"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.shd
new file mode 100644
index 0000000..877df62
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag.shd
@@ -0,0 +1,13 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex;
9varying vec2 tex_c;
10void main()
11{
12 gl_FragColor = texture2D(tex, tex_c.xy);
13}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag_bin_s3c6410.h
new file mode 100644
index 0000000..b89eeb1
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_frag_bin_s3c6410.h
@@ -0,0 +1,10 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x00000003, 0x00000003,
20x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000001,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000a, 0x00000000,
40x00000000, 0x02025400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307a10e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
60x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
70x3f800000, 0x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000,
80x00000004, 0x00000005, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
90x00000003, 0x0000000f, 0x00030005, 0x00000000, 0x00786574, 0x5f786574,
100x00000063, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.h
new file mode 100644
index 0000000..13d5edd
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.h
@@ -0,0 +1,12 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec2 tex_coord;\n"
6"uniform mat4 mvp;\n"
7"varying vec2 tex_c;\n"
8"void main()\n"
9"{\n"
10" gl_Position = mvp * vertex;\n"
11" tex_c = tex_coord;\n"
12"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.shd
new file mode 100644
index 0000000..74f3207
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert.shd
@@ -0,0 +1,12 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec2 tex_coord;
6uniform mat4 mvp;
7varying vec2 tex_c;
8void main()
9{
10 gl_Position = mvp * vertex;
11 tex_c = tex_coord;
12}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert_bin_s3c6410.h
new file mode 100644
index 0000000..314b5f3
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_nomul_vert_bin_s3c6410.h
@@ -0,0 +1,17 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000006, 0x00000006,
20x00000000, 0x00000000, 0x00000002, 0x00000002, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000027, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20980154, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
80x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
90x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x0000000c, 0x00000006, 0x00000009, 0x00000000, 0x00000000, 0x00000013,
130x00000009, 0x00000003, 0x00000000, 0x00000004, 0x00000000, 0x0000000b,
140x00000009, 0x00010004, 0x00000000, 0x00000021, 0x00000005, 0x00000003,
150x00010004, 0x00000004, 0x0000001d, 0x00000003, 0x0000000e, 0x00020001,
160x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69, 0x74726576, 0x74007865,
170x635f7865, 0x64726f6f, 0x70766d00, 0x78657400, 0x0000635f,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_vert.h
new file mode 100644
index 0000000..8921d9d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_vert.h
@@ -0,0 +1,15 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/tex_vert.shd
new file mode 100644
index 0000000..606c297
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_vert.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/tex_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/tex_vert_bin_s3c6410.h
new file mode 100644
index 0000000..1402448
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/tex_vert_bin_s3c6410.h
@@ -0,0 +1,20 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000007, 0x00000006,
20x00000000, 0x00000000, 0x00000003, 0x00000003, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000031, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20f801e4, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
80x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
90x00000000, 0x00000000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000000c, 0x00000006,
130x00000009, 0x00000000, 0x00000000, 0x00000013, 0x00000005, 0x00000009,
140x00000000, 0x00000004, 0x00000019, 0x00000009, 0x00000003, 0x00000000,
150x00000008, 0x00000000, 0x0000000b, 0x00000009, 0x00010004, 0x00000000,
160x00000027, 0x00000003, 0x00000009, 0x00010004, 0x00000004, 0x0000002b,
170x00000005, 0x00000003, 0x00010004, 0x00000008, 0x00000023, 0x00000003,
180x0000000e, 0x00020001, 0x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69,
190x74726576, 0x63007865, 0x726f6c6f, 0x78657400, 0x6f6f635f, 0x6d006472,
200x63007076, 0x74006c6f, 0x635f7865, 0x00000000, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h
new file mode 100644
index 0000000..de9acf8
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.h
@@ -0,0 +1,20 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texu, texv;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c, tex_c2, tex_c3;\n"
11"void main()\n"
12"{\n"
13" const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,\n"
14" 0.00000, -0.34410, 1.77200, 0.00000,\n"
15" 1.40200, -0.71410, 0.00000, 0.00000,\n"
16" -0.77380, 0.45630, -0.95880, 1.00000);\n"
17" gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,\n"
18" texture2D(texu, tex_c2.xy).r,\n"
19" texture2D(texv, tex_c3.xy).r, 1.0)) * col;\n"
20"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd
new file mode 100644
index 0000000..8e55d14
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd
@@ -0,0 +1,20 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex, texu, texv;
9varying vec4 col;
10varying vec2 tex_c, tex_c2, tex_c3;
11void main()
12{
13 const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,
14 0.00000, -0.34410, 1.77200, 0.00000,
15 1.40200, -0.71410, 0.00000, 0.00000,
16 -0.77380, 0.45630, -0.95880, 1.00000);
17 gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,
18 texture2D(texu, tex_c2.xy).r,
19 texture2D(texv, tex_c3.xy).r, 1.0)) * col;
20}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h
new file mode 100644
index 0000000..cd301dc
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_bin_s3c6410.h
@@ -0,0 +1,24 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x0000000d, 0x00000007,
20x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000000, 0x00000003,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000026, 0x00000000,
40x00000000, 0x02065400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307820e4, 0x00000000, 0x01000000, 0x02065400, 0x23782150, 0x00000000,
60x01000000, 0x0101e407, 0x307821e4, 0x00000000, 0x02000000, 0x02065400,
70x23782250, 0x00000000, 0x02000000, 0x0102e407, 0x307822e4, 0x00000000,
80x00000000, 0x02020001, 0x237823e4, 0x00000000, 0x01e40103, 0x02030001,
90x2ef823e4, 0x00000000, 0x02e40103, 0x02040001, 0x2ef823e4, 0x00000000,
100x00000000, 0x02050000, 0x20f824e4, 0x00000000, 0x06e40103, 0x01040002,
110x2ef823e4, 0x00000000, 0x03000000, 0x0103e400, 0x237a10e4, 0x00000000,
120x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x00000000,
130x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
140x3f94fdf4, 0x3f94fdf4, 0x3f94fdf4, 0x00000000, 0x00000000, 0xbeb02de0,
150x3fe2d0e5, 0x00000000, 0x3fb374bc, 0xbf36cf42, 0x00000000, 0x00000000,
160xbf4617c2, 0x3ee9a027, 0xbf7573eb, 0x3f800000, 0x3f800000, 0x00000000,
170x00000000, 0x00000000, 0x0000000e, 0x00000003, 0x00000009, 0x00000000,
180x0000000c, 0x00000012, 0x00000005, 0x00000003, 0x00000000, 0x00000000,
190x00000018, 0x00000006, 0x00000003, 0x00000000, 0x00000004, 0x0000001f,
200x00000006, 0x00000003, 0x00000000, 0x00000008, 0x00000000, 0x00000003,
210x0000000f, 0x00030005, 0x00000000, 0x00000004, 0x00000004, 0x0000000f,
220x00030005, 0x00000004, 0x00000009, 0x00000004, 0x0000000f, 0x00030005,
230x00000008, 0x00786574, 0x75786574, 0x78657400, 0x6f630076, 0x6574006c,
240x00635f78, 0x5f786574, 0x74003263, 0x635f7865, 0x00000033,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm
new file mode 100644
index 0000000..9a10bf0
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag_s3c6410.asm
@@ -0,0 +1,46 @@
1
2#-------------------------------------------------
3# ORION - OpenGL ES 2.0 Shading Language Compiler
4# SAMSUNG INDIA SOFTWARE OPERATIONS PVT. LTD.
5# Compiler Version : v04.00.09
6# Release Date : 19.01.2009
7# FIMG VERSION : FIMGv1.5
8# Optimizer Options : -O --nolodcalc
9#-------------------------------------------------
10
11# hand optimised - removed useless ops
12
13ps_3_0
14
15fimg_version 0x01020000
16
17dcl_s2_tex s0
18dcl_s2_texu s1
19dcl_s2_texv s2
20dcl_f4_col v3.x
21dcl_f2_tex_c v0.x
22dcl_f2_tex_c2 v1.x
23dcl_f2_tex_c3 v2.x
24
25def c2, 1.164000, 1.164000, 1.164000, 0.000000
26def c3, 0.000000, -0.344100, 1.772000, 0.000000
27def c4, 1.402000, -0.714100, 0.000000, 0.000000
28def c5, -0.773800, 0.456300, -0.958800, 1.000000
29def c6, 1.000000, 0.000000, 0.000000, 0.000000
30
31label start
32label main_
33mul r0.xyzw, c6.xxyy, v0.xyyy # tex_c=v0.xyyy
34texld r0.xyzw, r0.xyzw, s0 # tex=s0
35mul r1.xyzw, c6.xxyy, v1.xyyy # tex_c2=v1.xyyy
36texld r1.xyzw, r1.xyzw, s1 # texu=s1
37mul r2.xyzw, c6.xxyy, v2.xyyy # tex_c3=v2.xyyy
38texld r2.xyzw, r2.xyzw, s2 # texv=s2
39mul r3.xyzw, c2.xyzw, r0.xxxx # yuv=r0.xxxx
40mad r3.xyzw, c3.xyzw, r1.xxxx, r3.xyzw # yuv=r1.xxxx
41mad r3.xyzw, c4.xyzw, r2.xxxx, r3.xyzw # yuv=r2.xxxx
42mov r4.xyzw, c5.xyzw
43mad r3.xyzw, r4.xyzw, c6.xxxx, r3.xyzw # yuv=c6.xxxx
44mul_sat oColor.xyzw, r3.xyzw, v3.xyzw # gl_FragColor=oColor.xyzw, col=v3.xyzw
45label main_end
46ret
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h
new file mode 100644
index 0000000..ee5855c
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.h
@@ -0,0 +1,19 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texu, texv;\n"
9"varying vec2 tex_c, tex_c2, tex_c3;\n"
10"void main()\n"
11"{\n"
12" const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,\n"
13" 0.00000, -0.34410, 1.77200, 0.00000,\n"
14" 1.40200, -0.71410, 0.00000, 0.00000,\n"
15" -0.77380, 0.45630, -0.95880, 1.00000);\n"
16" gl_FragColor = yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,\n"
17" texture2D(texu, tex_c2.xy).r,\n"
18" texture2D(texv, tex_c3.xy).r, 1.0);\n"
19"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd
new file mode 100644
index 0000000..3ec4311
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag.shd
@@ -0,0 +1,19 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex, texu, texv;
9varying vec2 tex_c, tex_c2, tex_c3;
10void main()
11{
12 const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000,
13 0.00000, -0.34410, 1.77200, 0.00000,
14 1.40200, -0.71410, 0.00000, 0.00000,
15 -0.77380, 0.45630, -0.95880, 1.00000);
16 gl_FragColor = yuv2rgb * vec4(texture2D(tex, tex_c.xy).r,
17 texture2D(texu, tex_c2.xy).r,
18 texture2D(texv, tex_c3.xy).r, 1.0);
19}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag_bin_s3c6410.h
new file mode 100644
index 0000000..45aa66d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_frag_bin_s3c6410.h
@@ -0,0 +1,23 @@
10x20205350, 0xffff0008, 0x00000048, 0x01020000, 0x0000000c, 0x00000007,
20x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000000, 0x00000003,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000022, 0x00000000,
40x00000000, 0x02065400, 0x23782050, 0x00000000, 0x00000000, 0x0100e407,
50x307820e4, 0x00000000, 0x01000000, 0x02065400, 0x23782150, 0x00000000,
60x01000000, 0x0101e407, 0x307821e4, 0x00000000, 0x02000000, 0x02065400,
70x23782250, 0x00000000, 0x02000000, 0x0102e407, 0x307822e4, 0x00000000,
80x00000000, 0x02020001, 0x237823e4, 0x00000000, 0x01e40103, 0x02030001,
90x2ef823e4, 0x00000000, 0x02e40103, 0x02040001, 0x2ef823e4, 0x00000000,
100x00000000, 0x02050000, 0x20f824e4, 0x00000000, 0x06e40103, 0x01040002,
110x2efa10e4, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
130x3f800000, 0x3f800000, 0x3f94fdf4, 0x3f94fdf4, 0x3f94fdf4, 0x00000000,
140x00000000, 0xbeb02de0, 0x3fe2d0e5, 0x00000000, 0x3fb374bc, 0xbf36cf42,
150x00000000, 0x00000000, 0xbf4617c2, 0x3ee9a027, 0xbf7573eb, 0x3f800000,
160x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000005,
170x00000003, 0x00000000, 0x00000000, 0x00000014, 0x00000006, 0x00000003,
180x00000000, 0x00000004, 0x0000001b, 0x00000006, 0x00000003, 0x00000000,
190x00000008, 0x00000000, 0x00000003, 0x0000000f, 0x00030005, 0x00000000,
200x00000004, 0x00000004, 0x0000000f, 0x00030005, 0x00000004, 0x00000009,
210x00000004, 0x0000000f, 0x00030005, 0x00000008, 0x00786574, 0x75786574,
220x78657400, 0x65740076, 0x00635f78, 0x5f786574, 0x74003263, 0x635f7865,
230x00000033, \ No newline at end of file
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.h
new file mode 100644
index 0000000..c3f585f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.h
@@ -0,0 +1,14 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec2 tex_coord, tex_coord2, tex_coord3;\n"
6"uniform mat4 mvp;\n"
7"varying vec2 tex_c, tex_c2, tex_c3;\n"
8"void main()\n"
9"{\n"
10" gl_Position = mvp * vertex;\n"
11" tex_c = tex_coord;\n"
12" tex_c2 = tex_coord2;\n"
13" tex_c3 = tex_coord3;\n"
14"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.shd
new file mode 100644
index 0000000..a83d505
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec2 tex_coord, tex_coord2, tex_coord3;
6uniform mat4 mvp;
7varying vec2 tex_c, tex_c2, tex_c3;
8void main()
9{
10 gl_Position = mvp * vertex;
11 tex_c = tex_coord;
12 tex_c2 = tex_coord2;
13 tex_c3 = tex_coord3;
14}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert_bin_s3c6410.h
new file mode 100644
index 0000000..5942b4b
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_nomul_vert_bin_s3c6410.h
@@ -0,0 +1,23 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000008, 0x00000006,
20x00000000, 0x00000000, 0x00000004, 0x00000004, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000004b, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20980154, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
80x00000000, 0x00030000, 0x20980354, 0x00000000, 0x00000000, 0x00000000,
90x1e000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
100x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, 0x00000000, 0x00000000,
110x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
130x00000000, 0x00000000, 0x0000000c, 0x00000006, 0x00000009, 0x00000000,
140x00000000, 0x00000013, 0x00000009, 0x00000003, 0x00000000, 0x00000004,
150x0000001d, 0x0000000a, 0x00000003, 0x00000000, 0x00000008, 0x00000028,
160x0000000a, 0x00000003, 0x00000000, 0x0000000c, 0x00000000, 0x0000000b,
170x00000009, 0x00010004, 0x00000000, 0x00000037, 0x00000005, 0x00000003,
180x00010004, 0x00000004, 0x0000003d, 0x00000006, 0x00000003, 0x00010004,
190x00000008, 0x00000044, 0x00000006, 0x00000003, 0x00010004, 0x0000000c,
200x00000033, 0x00000003, 0x0000000e, 0x00020001, 0x00000008, 0x505f6c67,
210x7469736f, 0x006e6f69, 0x74726576, 0x74007865, 0x635f7865, 0x64726f6f,
220x78657400, 0x6f6f635f, 0x00326472, 0x5f786574, 0x726f6f63, 0x6d003364,
230x74007076, 0x635f7865, 0x78657400, 0x0032635f, 0x5f786574, 0x00003363,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.h
new file mode 100644
index 0000000..6ccf06d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.h
@@ -0,0 +1,17 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord, tex_coord2, tex_coord3;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c, tex_c2, tex_c3;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15" tex_c2 = tex_coord2;\n"
16" tex_c3 = tex_coord3;\n"
17"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.shd
new file mode 100644
index 0000000..0ea0b2f
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert.shd
@@ -0,0 +1,17 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord, tex_coord2, tex_coord3;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c, tex_c2, tex_c3;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15 tex_c2 = tex_coord2;
16 tex_c3 = tex_coord3;
17}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert_bin_s3c6410.h b/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert_bin_s3c6410.h
new file mode 100644
index 0000000..e757b6d
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_vert_bin_s3c6410.h
@@ -0,0 +1,26 @@
10x20205356, 0xffff0008, 0x00000048, 0x01020000, 0x00000009, 0x00000006,
20x00000000, 0x00000000, 0x00000005, 0x00000005, 0x00000001, 0x00000000,
30x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000055, 0x00000000,
40x00000000, 0x02020000, 0x237820e4, 0x00000000, 0x00e40100, 0x02035500,
50x2ef820e4, 0x00000000, 0x00e40100, 0x0204aa00, 0x2ef820e4, 0x00000000,
60x00e40100, 0x0205ff00, 0x2ef800e4, 0x00000000, 0x00000000, 0x00010000,
70x20f801e4, 0x00000000, 0x00000000, 0x00020000, 0x20980254, 0x00000000,
80x00000000, 0x00030000, 0x20980354, 0x00000000, 0x00000000, 0x00040000,
90x20980454, 0x00000000, 0x00000000, 0x00000000, 0x1e000000, 0x00000000,
100x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x3f800000,
110x3f800000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
120x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
130x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
140x0000000c, 0x00000006, 0x00000009, 0x00000000, 0x00000000, 0x00000013,
150x00000005, 0x00000009, 0x00000000, 0x00000004, 0x00000019, 0x00000009,
160x00000003, 0x00000000, 0x00000008, 0x00000023, 0x0000000a, 0x00000003,
170x00000000, 0x0000000c, 0x0000002e, 0x0000000a, 0x00000003, 0x00000000,
180x00000010, 0x00000000, 0x0000000b, 0x00000009, 0x00010004, 0x00000000,
190x0000003d, 0x00000003, 0x00000009, 0x00010004, 0x00000004, 0x00000041,
200x00000005, 0x00000003, 0x00010004, 0x00000008, 0x00000047, 0x00000006,
210x00000003, 0x00010004, 0x0000000c, 0x0000004e, 0x00000006, 0x00000003,
220x00010004, 0x00000010, 0x00000039, 0x00000003, 0x0000000e, 0x00020001,
230x00000008, 0x505f6c67, 0x7469736f, 0x006e6f69, 0x74726576, 0x63007865,
240x726f6c6f, 0x78657400, 0x6f6f635f, 0x74006472, 0x635f7865, 0x64726f6f,
250x65740032, 0x6f635f78, 0x3364726f, 0x70766d00, 0x6c6f6300, 0x78657400,
260x7400635f, 0x635f7865, 0x65740032, 0x33635f78, 0x00000000,
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.h
new file mode 100644
index 0000000..abe4b03
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.h
@@ -0,0 +1,30 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texuv;\n"
9"varying vec4 col;\n"
10"varying vec2 tex_c, tex_cuv;\n"
11"void main()\n"
12"{\n"
13" float y,u,v,vmu,r,g,b;\n"
14" y=texture2D(tex,tex_c).r;\n"
15" u=texture2D(texuv,tex_cuv).g;\n"
16" v=texture2D(texuv,tex_cuv).a;\n"
17"\n"
18" u=u-0.5;\n"
19" v=v-0.5;\n"
20" vmu=v*0.813+u*0.391;\n"
21" u=u*2.018;\n"
22" v=v*1.596;\n"
23"\n"
24" r=y+v;\n"
25" g=y-vmu;\n"
26" b=y+u;\n"
27"\n"
28" gl_FragColor=vec4(r,g,b,1.0) * col;\n"
29"}\n"
30"\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.shd
new file mode 100644
index 0000000..98dd91b
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_frag.shd
@@ -0,0 +1,30 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex, texuv;
9varying vec4 col;
10varying vec2 tex_c, tex_cuv;
11void main()
12{
13 float y,u,v,vmu,r,g,b;
14 y=texture2D(tex,tex_c).r;
15 u=texture2D(texuv,tex_cuv).g;
16 v=texture2D(texuv,tex_cuv).a;
17
18 u=u-0.5;
19 v=v-0.5;
20 vmu=v*0.813+u*0.391;
21 u=u*2.018;
22 v=v*1.596;
23
24 r=y+v;
25 g=y-vmu;
26 b=y+u;
27
28 gl_FragColor=vec4(r,g,b,1.0) * col;
29}
30
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.h b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.h
new file mode 100644
index 0000000..618fa50
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.h
@@ -0,0 +1,30 @@
1"#ifdef GL_ES\n"
2"#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
3"precision highp float;\n"
4"#else\n"
5"precision mediump float;\n"
6"#endif\n"
7"#endif\n"
8"uniform sampler2D tex, texuv;\n"
9"varying vec2 tex_c, tex_cuv;\n"
10"void main()\n"
11"{\n"
12" float y,u,v,vmu,r,g,b;\n"
13" y=texture2D(tex,tex_c).r;\n"
14" u=texture2D(texuv,tex_cuv).g;\n"
15" v=texture2D(texuv,tex_cuv).a;\n"
16"\n"
17" u=u-0.5;\n"
18" v=v-0.5;\n"
19" vmu=v*0.813+u*0.391;\n"
20" u=u*2.018;\n"
21" v=v*1.596;\n"
22" y=(y-0.062)*1.164;\n"
23"\n"
24" r=y+v;\n"
25" g=y-vmu;\n"
26" b=y+u;\n"
27"\n"
28" gl_FragColor=vec4(r,g,b,1.0);\n"
29"}\n"
30"\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.shd
new file mode 100644
index 0000000..fd82e2a
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_frag.shd
@@ -0,0 +1,30 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D tex, texuv;
9varying vec2 tex_c, tex_cuv;
10void main()
11{
12 float y,u,v,vmu,r,g,b;
13 y=texture2D(tex,tex_c).r;
14 u=texture2D(texuv,tex_cuv).g;
15 v=texture2D(texuv,tex_cuv).a;
16
17 u=u-0.5;
18 v=v-0.5;
19 vmu=v*0.813+u*0.391;
20 u=u*2.018;
21 v=v*1.596;
22 y=(y-0.062)*1.164;
23
24 r=y+v;
25 g=y-vmu;
26 b=y+u;
27
28 gl_FragColor=vec4(r,g,b,1.0);
29}
30
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.h
new file mode 100644
index 0000000..4620b66
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.h
@@ -0,0 +1,13 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec2 tex_coord, tex_coord2;\n"
6"uniform mat4 mvp;\n"
7"varying vec2 tex_c, tex_cuv;\n"
8"void main()\n"
9"{\n"
10" gl_Position = mvp * vertex;\n"
11" tex_c = tex_coord;\n"
12" tex_cuv = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n"
13"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.shd
new file mode 100644
index 0000000..05acc9c
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_nomul_vert.shd
@@ -0,0 +1,13 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec2 tex_coord, tex_coord2;
6uniform mat4 mvp;
7varying vec2 tex_c, tex_cuv;
8void main()
9{
10 gl_Position = mvp * vertex;
11 tex_c = tex_coord;
12 tex_cuv = vec2(tex_coord2.x * 0.5, tex_coord2.y);
13}
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.h b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.h
new file mode 100644
index 0000000..1e49018
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.h
@@ -0,0 +1,16 @@
1"#ifdef GL_ES\n"
2"precision highp float;\n"
3"#endif\n"
4"attribute vec4 vertex;\n"
5"attribute vec4 color;\n"
6"attribute vec2 tex_coord, tex_coord2;\n"
7"uniform mat4 mvp;\n"
8"varying vec4 col;\n"
9"varying vec2 tex_c, tex_cuv;\n"
10"void main()\n"
11"{\n"
12" gl_Position = mvp * vertex;\n"
13" col = color;\n"
14" tex_c = tex_coord;\n"
15" tex_cuv = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n"
16"}\n"
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.shd
new file mode 100644
index 0000000..54efb1e
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/shader/yuy2_vert.shd
@@ -0,0 +1,16 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec2 tex_coord, tex_coord2;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec2 tex_c, tex_cuv;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 tex_c = tex_coord;
15 tex_cuv = vec2(tex_coord2.x * 0.5, tex_coord2.y);
16}