Evas (wayland_egl): Update wayland_egl engine to match recent gl_x11

changes.



SVN revision: 71109
This commit is contained in:
Christopher Michael 2012-05-15 12:03:01 +00:00
parent 0f45670b50
commit 726b718812
3 changed files with 640 additions and 1329 deletions

View File

@ -11,36 +11,38 @@ AM_CPPFLAGS = \
@EINA_CFLAGS@ \ @EINA_CFLAGS@ \
@GL_EET_CFLAGS@ \ @GL_EET_CFLAGS@ \
@FRIBIDI_CFLAGS@ \ @FRIBIDI_CFLAGS@ \
@evas_engine_gl_xlib_cflags@ @evas_engine_wayland_egl_cflags@
if BUILD_ENGINE_GL_X11 if BUILD_ENGINE_WAYLAND_EGL
GL_X11_SOURCES = \ WAYLAND_EGL_SOURCES = \
Evas_Engine_Wayland_Egl.h \
evas_engine.h \
evas_engine.c \ evas_engine.c \
evas_x_main.c evas_wl_main.c
GL_X11_LIBADD = @evas_engine_gl_xlib_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ @dlopen_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la
includes_HEADERS = Evas_Engine_Wayland_Egl.h
includes_HEADERS = Evas_Engine_GL_X11.h
includesdir = $(includedir)/evas-@VMAJ@ includesdir = $(includedir)/evas-@VMAJ@
if !EVAS_STATIC_BUILD_GL_X11 if !EVAS_STATIC_BUILD_WAYLAND_EGL
pkgdir = $(libdir)/evas/modules/engines/gl_x11/$(MODULE_ARCH) pkgdir = $(libdir)/evas/modules/engines/wayland_egl/$(MODULE_ARCH)
pkg_LTLIBRARIES = module.la pkg_LTLIBRARIES = module.la
module_la_SOURCES = $(GL_X11_SOURCES) module_la_SOURCES = $(WAYLAND_EGL_SOURCES)
module_la_LIBADD = @EINA_LIBS@ @GL_EET_LIBS@ $(GL_X11_LIBADD) $(top_builddir)/src/lib/libevas.la @dlopen_libs@ module_la_LIBADD = $(WAYLAND_EGL_LIBADD) $(top_builddir)/src/lib/libevas.la
module_la_LDFLAGS = -module -avoid-version module_la_LDFLAGS = -no-undefined -module -avoid-version
module_la_LIBTOOLFLAGS = --tag=disable-static module_la_LIBTOOLFLAGS = --tag=disable-static
else else
noinst_LTLIBRARIES = libevas_engine_gl_x11.la noinst_LTLIBRARIES = libevas_engine_wayland_egl.la
libevas_engine_gl_x11_la_SOURCES = $(GL_X11_SOURCES) libevas_engine_wayland_egl_la_SOURCES = $(WAYLAND_EGL_SOURCES)
libevas_engine_gl_x11_la_LIBADD = $(GL_X11_LIBADD) libevas_engine_wayland_egl_la_LIBADD = $(WAYLAND_EGL_LIBADD)
endif endif
endif endif

File diff suppressed because it is too large Load Diff

View File

@ -6,121 +6,81 @@
# include "evas_private.h" # include "evas_private.h"
# include "evas_gl_common.h" # include "evas_gl_common.h"
# include "Evas.h" # include "Evas.h"
#include "Evas_Engine_GL_X11.h" # include "Evas_Engine_Wayland_Egl.h"
# define GL_GLEXT_PROTOTYPES # define GL_GLEXT_PROTOTYPES
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
# if defined(GLES_VARIETY_S3C6410)
# include <EGL/egl.h>
# include <GLES2/gl2.h>
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# include <X11/Xresource.h> // xres - dpi
# elif defined(GLES_VARIETY_SGX)
# define SUPPORT_X11 1
# include <EGL/egl.h> # include <EGL/egl.h>
# include <GLES2/gl2.h> # include <GLES2/gl2.h>
# include <GLES2/gl2ext.h> # include <GLES2/gl2ext.h>
# include <X11/Xlib.h> # include <wayland-egl.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h> extern int _evas_engine_wl_egl_log_dom;
# include <X11/extensions/Xrender.h>
# include <X11/Xresource.h> // xres - dpi
# endif
#else
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# include <X11/Xresource.h> // xres - dpi
# include <GL/gl.h>
# include <GL/glext.h>
# include <GL/glx.h>
#endif
extern int _evas_engine_GL_X11_log_dom ;
# ifdef ERR # ifdef ERR
# undef ERR # undef ERR
# endif # endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_GL_X11_log_dom, __VA_ARGS__) # define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_wl_egl_log_dom, __VA_ARGS__)
# ifdef DBG # ifdef DBG
# undef DBG # undef DBG
# endif # endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_GL_X11_log_dom, __VA_ARGS__) # define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_wl_egl_log_dom, __VA_ARGS__)
# ifdef INF # ifdef INF
# undef INF # undef INF
# endif # endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_GL_X11_log_dom, __VA_ARGS__) # define INF(...) EINA_LOG_DOM_INFO(_evas_engine_wl_egl_log_dom, __VA_ARGS__)
# ifdef WRN # ifdef WRN
# undef WRN # undef WRN
# endif # endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_GL_X11_log_dom, __VA_ARGS__) # define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_wl_egl_log_dom, __VA_ARGS__)
# ifdef CRIT # ifdef CRIT
# undef CRIT # undef CRIT
# endif # endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_GL_X11_log_dom, __VA_ARGS__) # define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_wl_egl_log_dom, __VA_ARGS__)
typedef struct _Evas_GL_X11_Window Evas_GL_X11_Window; typedef struct _Evas_GL_Wl_Window Evas_GL_Wl_Window;
struct _Evas_GL_X11_Window struct _Evas_GL_Wl_Window
{ {
Display *disp; struct wl_display *disp;
Window win; struct wl_egl_window *win;
struct wl_surface *surface;
int w, h; int w, h;
int screen; int screen;
XVisualInfo *visualinfo;
Visual *visual;
Colormap colormap;
int depth; int depth;
int alpha; int alpha;
int rot; int rot;
Evas_Engine_GL_Context *gl_context; Evas_Engine_GL_Context *gl_context;
struct {
struct
{
int redraw : 1; int redraw : 1;
int drew : 1; int drew : 1;
int x1, y1, x2, y2; int x1, y1, x2, y2;
} draw; } draw;
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
EGLContext egl_context[1]; EGLContext egl_context[1];
EGLSurface egl_surface[1]; EGLSurface egl_surface[1];
EGLConfig egl_config; EGLConfig egl_config;
EGLDisplay egl_disp; EGLDisplay egl_disp;
#else
GLXContext context;
GLXWindow glxwin;
struct {
GLXFBConfig fbc;
int tex_format;
int tex_target;
int mipmap;
unsigned char yinvert : 1;
} depth_cfg[33]; // config for all 32 possible depths!
struct {
unsigned int loose_binding : 1;
} detected;
#endif
int surf : 1; int surf : 1;
}; };
Evas_GL_X11_Window *eng_window_new(Display *disp, Window win, int screen, Evas_GL_Wl_Window *eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen,
Visual *vis, Colormap cmap,
int depth, int w, int h, int indirect, int depth, int w, int h, int indirect,
int alpha, int rot); int alpha, int rot);
void eng_window_free(Evas_GL_X11_Window *gw); void eng_window_free(Evas_GL_Wl_Window *gw);
void eng_window_use(Evas_GL_X11_Window *gw); void eng_window_use(Evas_GL_Wl_Window *gw);
void eng_window_unsurf(Evas_GL_X11_Window *gw); void eng_window_unsurf(Evas_GL_Wl_Window *gw);
void eng_window_resurf(Evas_GL_X11_Window *gw); void eng_window_resurf(Evas_GL_Wl_Window *gw);
Visual *eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo); int eng_best_depth_get(Evas_Engine_Info_Wayland_Egl *einfo);
Colormap eng_best_colormap_get(Evas_Engine_Info_GL_X11 *einfo);
int eng_best_depth_get(Evas_Engine_Info_GL_X11 *einfo);
#endif #endif