diff options
author | mh0310.choi <mh0310.choi@samsung.com> | 2015-07-28 10:46:57 +0900 |
---|---|---|
committer | mh0310.choi <mh0310.choi@samsung.com> | 2015-07-28 13:08:12 +0900 |
commit | 5e67a6f721eaedda61300baf0799199c7771ebd0 (patch) | |
tree | 6cd50b52498aab50e79b966cdccc2a137db316d9 /boilerplate/cairo-boilerplate-egl.c | |
parent | d3aeffba37161d2b76b29c4ea13369bd67a47a8e (diff) | |
download | cairo-5e67a6f721eaedda61300baf0799199c7771ebd0.tar.gz cairo-5e67a6f721eaedda61300baf0799199c7771ebd0.tar.bz2 cairo-5e67a6f721eaedda61300baf0799199c7771ebd0.zip |
Cairo version Upgrade for Tizen3.0submit/tizen_tv/20150728.091927submit/tizen_mobile/20150728.091912submit/tizen_common/20150728.091859accepted/tizen/tv/20150729.011254accepted/tizen/mobile/20150729.011230
- from 1.12.14 to 1.14.2
Change-Id: I3b62d212041b337bbb926d579f9ce74f42a45c3b
Diffstat (limited to 'boilerplate/cairo-boilerplate-egl.c')
-rw-r--r--[-rwxr-xr-x] | boilerplate/cairo-boilerplate-egl.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c index dd62ea8a0..c5b126065 100755..100644 --- a/boilerplate/cairo-boilerplate-egl.c +++ b/boilerplate/cairo-boilerplate-egl.c @@ -41,6 +41,14 @@ extern void glFinish (void); #include <GL/gl.h> #elif CAIRO_HAS_GLESV2_SURFACE #include <GLES2/gl2.h> +#elif CAIRO_HAS_GLESV3_SURFACE +#include <GLES3/gl3.h> +#endif + +// For Wayland-egl +#ifdef HAVE_WAYLAND +#include <wayland-egl.h> +#include <wayland-client.h> #endif static const cairo_user_data_key_t gl_closure_key; @@ -91,15 +99,16 @@ _cairo_boilerplate_egl_create_surface (const char *name, EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, #if CAIRO_HAS_GL_SURFACE EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, -#elif CAIRO_HAS_GLESV2_SURFACE +#elif CAIRO_HAS_GLESV2_SURFACE || CAIRO_HAS_GLESV3_SURFACE EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, #endif - EGL_SAMPLES, 4, EGL_NONE }; const EGLint ctx_attribs[] = { #if CAIRO_HAS_GLESV2_SURFACE EGL_CONTEXT_CLIENT_VERSION, 2, +#elif CAIRO_HAS_GLESV3_SURFACE + EGL_CONTEXT_CLIENT_VERSION, 3, #endif EGL_NONE }; @@ -107,7 +116,15 @@ _cairo_boilerplate_egl_create_surface (const char *name, gltc = xcalloc (1, sizeof (egl_target_closure_t)); *closure = gltc; +#ifdef HAVE_WAYLAND + static struct wl_display *display; + display = wl_display_connect (NULL); + struct wl_registry *registry = wl_display_get_registry (display); + wl_display_dispatch (display); + gltc->dpy = eglGetDisplay (display); +#else gltc->dpy = eglGetDisplay (EGL_DEFAULT_DISPLAY); +#endif if (! eglInitialize (gltc->dpy, &major, &minor)) { free (gltc); @@ -122,7 +139,7 @@ _cairo_boilerplate_egl_create_surface (const char *name, #if CAIRO_HAS_GL_SURFACE eglBindAPI (EGL_OPENGL_API); -#elif CAIRO_HAS_GLESV2_SURFACE +#elif CAIRO_HAS_GLESV2_SURFACE || CAIRO_HAS_GLESV3_SURFACE eglBindAPI (EGL_OPENGL_ES_API); #endif @@ -135,7 +152,8 @@ _cairo_boilerplate_egl_create_surface (const char *name, } gltc->device = cairo_egl_device_create (gltc->dpy, gltc->ctx); - cairo_gl_device_set_thread_aware (gltc->device, FALSE); + if (mode == CAIRO_BOILERPLATE_MODE_PERF) + cairo_gl_device_set_thread_aware(gltc->device, FALSE); if (width < 1) width = 1; |