summaryrefslogtreecommitdiff
path: root/legacy/evas/m4
diff options
context:
space:
mode:
authorSung W. Park <sungwoo@gmail.com>2011-04-25 08:41:36 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-04-25 08:41:36 +0000
commitd12e4f28d4e1d883978be7896f476c4eb875ac7e (patch)
treea28954098e869e8dc34fbb04dc180074a3de38f3 /legacy/evas/m4
parentf60fb4f1a9d9bfda2308fa13826f130d6735a02a (diff)
From: "Sung W. Park" <sungwoo@gmail.com>
Subject: [E-devel] [Review] [Patch] Evas - OpenGL on Evas: surface texture creation patch I'm attaching a patch that addresses the awkward usage case. It's something that didn't bother me initially but the more I look at it, i think it's a little off. :-) The initial version of the evas_gl that I've submitted had the following use case. evasgl = evas_gl_new(e); sfc = evas_gl_surface_create(...); ctx = evas_gl_context_create(...); // Make current triggers surface texture and FBO to be created evas_gl_make_current(evasgl, sfc, ctx); // Then you can do a surface_get to retrieve the proper texture and set it evas_gl_native_surface_get(evasgl, sfc, &ns); evas_object_image_native_surface_set(img_obj, &ns); The unnatural thing about this use case is that you have to call the make_current one time in order for evas_gl to generate a surface texture. This is because you need a context to create a texture. Unfortunately, this makes the usage case really awkward. So, instead, I've decided to get rid of the need for calling the make_current by generating a surface texture when evas_gl_surface_create() is called by using the evas' gl context. This works because the newly created context shares resources with evas. in fact, this is what i'm currently doing with surface deletion anyway so I thought this solution was reasonable. Here's how it looks after you get rid of the make_current: evasgl = evas_gl_new(e); sfc = evas_gl_surface_create(...); ctx = evas_gl_context_create(...); evas_gl_native_surface_get(evasgl, sfc, &ns); evas_object_image_native_surface_set(img_obj, &ns); The patch is pretty small and straightforward. SVN revision: 58892
Diffstat (limited to 'legacy/evas/m4')
-rw-r--r--legacy/evas/m4/evas_check_engine.m440
1 files changed, 23 insertions, 17 deletions
diff --git a/legacy/evas/m4/evas_check_engine.m4 b/legacy/evas/m4/evas_check_engine.m4
index b1f60c7..f5dbe24 100644
--- a/legacy/evas/m4/evas_check_engine.m4
+++ b/legacy/evas/m4/evas_check_engine.m4
@@ -113,16 +113,19 @@ if test "x$gl_flavor_gles" = "xyes" ; then
113fi 113fi
114 114
115if test "x${have_dep}" = "xyes" ; then 115if test "x${have_dep}" = "xyes" ; then
116 if test "x$2" = "xyes" ; then 116 PKG_CHECK_MODULES([GL_EET], [eet >= 1.4.0], [have_dep="yes"], [have_dep="no"])
117 x_libs="${x_libs} -lX11 -lXext -lXrender" 117 if test "x${have_dep}" = "xyes" ; then
118 else 118 if test "x$2" = "xyes" ; then
119 x_dir=${x_dir:-/usr/X11R6} 119 x_libs="${x_libs} -lX11 -lXext -lXrender"
120 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} 120 else
121 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" 121 x_dir=${x_dir:-/usr/X11R6}
122 fi 122 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
123 evas_engine_[]$1[]_cflags="-I/usr/include ${x_cflags}" 123 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
124 evas_engine_[]$1[]_libs="${x_libs} -lGL $gl_pt_lib" 124 fi
125 evas_engine_gl_common_libs="-lGL $gl_pt_lib" 125 evas_engine_[]$1[]_cflags="-I/usr/include ${x_cflags}"
126 evas_engine_[]$1[]_libs="${x_libs} -lGL $gl_pt_lib"
127 evas_engine_gl_common_libs="-lGL $gl_pt_lib"
128 fi
126else 129else
127 if test "x$2" = "xyes" ; then 130 if test "x$2" = "xyes" ; then
128 x_libs="${x_libs} -lX11 -lXext -lXrender" 131 x_libs="${x_libs} -lX11 -lXext -lXrender"
@@ -147,13 +150,16 @@ else
147 if test "x${have_egl}" = "xyes" ; then 150 if test "x${have_egl}" = "xyes" ; then
148 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib) 151 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib)
149 if test "x${have_glesv2}" = "xyes" ; then 152 if test "x${have_glesv2}" = "xyes" ; then
150 evas_engine_[]$1[]_cflags="${x_cflags}" 153 PKG_CHECK_MODULES([GL_EET], [eet >= 1.4.0], [have_dep="yes"], [have_dep="no"])
151 evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib" 154 if test "x${have_dep}" = "xyes" ; then
152 evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" 155 evas_engine_[]$1[]_cflags="${x_cflags}"
153 have_dep="yes" 156 evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib"
154 gl_flavor_gles="no" 157 evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib"
155 AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support]) 158 have_dep="yes"
156 gles_variety_sgx="yes" 159 gl_flavor_gles="no"
160 AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
161 gles_variety_sgx="yes"
162 fi
157 fi 163 fi
158 fi 164 fi
159fi 165fi