summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2009-10-11 06:59:47 +0000
committerCarsten Haitzler <raster@rasterman.com>2009-10-11 06:59:47 +0000
commita60f577446d01bc1e8db7142721d252f2d6a2dbd (patch)
tree9b08fac071e1bb8c6210718ab2d1d7045b8189c4 /legacy
parent0a036d1ec24584dc73b1f05a6c8c198772158dd6 (diff)
some infra for starting to handle dest-alpha (rgba) windows in gl engine.
not sure shaped windows will ever be sanely possible. SVN revision: 43015
Diffstat (limited to '')
-rw-r--r--legacy/evas/m4/evas_check_engine.m46
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_context.c1
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/evas_engine.h3
-rw-r--r--legacy/evas/src/modules/engines/gl_x11/evas_x_main.c55
4 files changed, 57 insertions, 8 deletions
diff --git a/legacy/evas/m4/evas_check_engine.m4 b/legacy/evas/m4/evas_check_engine.m4
index fbc9dd98aa..52b482ce7c 100644
--- a/legacy/evas/m4/evas_check_engine.m4
+++ b/legacy/evas/m4/evas_check_engine.m4
@@ -154,13 +154,13 @@ if test "x${have_dep}" = "xyes" ; then
154 evas_engine_gl_common_libs="-lGL -lpthread" 154 evas_engine_gl_common_libs="-lGL -lpthread"
155else 155else
156 if test "x$2" = "xyes" ; then 156 if test "x$2" = "xyes" ; then
157 x_libs="${x_libs} -lX11 -lXext" 157 x_libs="${x_libs} -lX11 -lXext -lXrender"
158 else 158 else
159 x_dir=${x_dir:-/usr/X11R6} 159 x_dir=${x_dir:-/usr/X11R6}
160 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} 160 x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
161 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11" 161 x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
162 fi 162 fi
163 AC_CHECK_HEADERS([EGL/egl.h X11/X.h X11/Xlib.h], [have_egl="yes"]) 163 AC_CHECK_HEADERS([EGL/egl.h X11/X.h X11/Xlib.h X11/extensions/Xrender.h], [have_egl="yes"])
164 if test "x${have_egl}" = "xyes" ; then 164 if test "x${have_egl}" = "xyes" ; then
165 have_gles20="no" 165 have_gles20="no"
166 AC_CHECK_LIB(gles20, glTexImage2D, [have_gles20="yes"], , -lEGL) 166 AC_CHECK_LIB(gles20, glTexImage2D, [have_gles20="yes"], , -lEGL)
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
index 330a10dafa..0074bb016c 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
@@ -86,7 +86,6 @@ evas_gl_common_context_new(void)
86 glEnable(GL_DITHER); 86 glEnable(GL_DITHER);
87 glDisable(GL_BLEND); 87 glDisable(GL_BLEND);
88 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 88 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
89// for dest alpha
90// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 89// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
91 glDepthMask(GL_FALSE); 90 glDepthMask(GL_FALSE);
92 91
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_engine.h b/legacy/evas/src/modules/engines/gl_x11/evas_engine.h
index f81980813e..99aca22c47 100644
--- a/legacy/evas/src/modules/engines/gl_x11/evas_engine.h
+++ b/legacy/evas/src/modules/engines/gl_x11/evas_engine.h
@@ -12,6 +12,7 @@
12# include <X11/Xlib.h> 12# include <X11/Xlib.h>
13# include <X11/Xatom.h> 13# include <X11/Xatom.h>
14# include <X11/Xutil.h> 14# include <X11/Xutil.h>
15# include <X11/extensions/Xrender.h>
15# elif defined(GLES_VARIETY_SGX) 16# elif defined(GLES_VARIETY_SGX)
16# define SUPPORT_X11 1 17# define SUPPORT_X11 1
17# include <EGL/egl.h> 18# include <EGL/egl.h>
@@ -19,12 +20,14 @@
19# include <X11/Xlib.h> 20# include <X11/Xlib.h>
20# include <X11/Xatom.h> 21# include <X11/Xatom.h>
21# include <X11/Xutil.h> 22# include <X11/Xutil.h>
23# include <X11/extensions/Xrender.h>
22# endif 24# endif
23# else 25# else
24# include <GL/glx.h> 26# include <GL/glx.h>
25# include <X11/Xlib.h> 27# include <X11/Xlib.h>
26# include <X11/Xatom.h> 28# include <X11/Xatom.h>
27# include <X11/Xutil.h> 29# include <X11/Xutil.h>
30# include <X11/extensions/Xrender.h>
28# include <GL/gl.h> 31# include <GL/gl.h>
29# include <GL/glx.h> 32# include <GL/glx.h>
30# endif 33# endif
diff --git a/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c b/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
index 5571468d5b..0535aa749b 100644
--- a/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
+++ b/legacy/evas/src/modules/engines/gl_x11/evas_x_main.c
@@ -198,18 +198,65 @@ eng_best_visual_get(Display *disp, int screen)
198 XMatchVisualInfo(disp, screen, depth, TrueColor, _evas_gl_x11_vi); 198 XMatchVisualInfo(disp, screen, depth, TrueColor, _evas_gl_x11_vi);
199// GLX 199// GLX
200#else 200#else
201 int _evas_gl_x11_configuration[9] = 201
202#if 0 // use this if we want alpha
203 int config_attrs[20];
204 GLXFBConfig *configs = NULL, config = 0;
205 int i, num;
206
207 config_attrs[0] = GLX_DRAWABLE_TYPE;
208 config_attrs[1] = GLX_WINDOW_BIT;
209 config_attrs[2] = GLX_DOUBLEBUFFER;
210 config_attrs[3] = 1;
211 config_attrs[4] = GLX_RED_SIZE;
212 config_attrs[5] = 1;
213 config_attrs[6] = GLX_GREEN_SIZE;
214 config_attrs[7] = 1;
215 config_attrs[8] = GLX_BLUE_SIZE;
216 config_attrs[9] = 1;
217 config_attrs[10] = None;
218
219 // if rgba
220 config_attrs[10] = GLX_ALPHA_SIZE;
221 config_attrs[11] = 1;
222 config_attrs[12] = GLX_RENDER_TYPE;
223 config_attrs[13] = GLX_RGBA_BIT;
224 config_attrs[14] = None;
225
226 configs = glXChooseFBConfig(disp, 0, config_attrs, &num);
227 for (i = 0; i < num; i++)
228 {
229 XVisualInfo *visinfo;
230 XRenderPictFormat *format;
231
232 visinfo = glXGetVisualFromFBConfig(disp, configs[i]);
233 if (!visinfo) continue;
234 format = XRenderFindVisualFormat(disp, visinfo->visual);
235 if (!format) continue;
236
237 if (format->direct.alphaMask > 0)
238 {
239 config = configs[i];
240 _evas_gl_x11_vi = visinfo;
241 break;
242 }
243 XFree(visinfo);
244 }
245#else
246 int _evas_gl_x11_configuration[] =
202 { 247 {
203 GLX_DOUBLEBUFFER, 248 GLX_DOUBLEBUFFER,
204 GLX_RGBA, 249 GLX_RGBA,
205 GLX_RED_SIZE, 1, 250 GLX_RED_SIZE, 1,
206 GLX_GREEN_SIZE, 1, 251 GLX_GREEN_SIZE,1,
207 GLX_BLUE_SIZE, 1, 252 GLX_BLUE_SIZE, 1,
208 None 253 None
209 }; 254 };
210 _evas_gl_x11_vi = glXChooseVisual(disp, screen, 255 _evas_gl_x11_vi = glXChooseVisual(disp, screen,
211 _evas_gl_x11_configuration); 256 _evas_gl_x11_configuration);
212#endif 257#endif
258
259#endif
213 } 260 }
214 if (!_evas_gl_x11_vi) return NULL; 261 if (!_evas_gl_x11_vi) return NULL;
215 return _evas_gl_x11_vi->visual; 262 return _evas_gl_x11_vi->visual;