From b84c5311ee7f84e60aad8c976dc9028144cc4cd2 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Wed, 25 Jun 2008 11:17:43 +0000 Subject: [PATCH] 2008-06-25 Matthew Allum * clutter/eglnative/clutter-stage-egl.c: * clutter/eglx/clutter-stage-egl.c: Disable passing of attribs to eglCreateContext() on GLES 1.1 h/w --- ChangeLog | 6 ++++++ clutter/eglnative/clutter-stage-egl.c | 19 +++++++++++-------- clutter/eglx/clutter-stage-egl.c | 23 ++++++++++++----------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index e76ae7282..771a9a042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-25 Matthew Allum + + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglx/clutter-stage-egl.c: + Disable passing of attribs to eglCreateContext() on GLES 1.1 h/w + 2008-06-25 Neil Roberts * clutter/clutter-actor.c (clutter_actor_paint): Guard against the diff --git a/clutter/eglnative/clutter-stage-egl.c b/clutter/eglnative/clutter-stage-egl.c index 0e5235a8b..75a15f560 100644 --- a/clutter/eglnative/clutter-stage-egl.c +++ b/clutter/eglnative/clutter-stage-egl.c @@ -156,20 +156,21 @@ clutter_stage_egl_realize (ClutterActor *actor) if (G_UNLIKELY (backend_egl->egl_context == NULL)) { - static const EGLint attribs[3] - = { EGL_CONTEXT_CLIENT_VERSION, #ifdef HAVE_COGL_GLES2 - 2, -#else /* HAVE_COGL_GLES2 */ - 1, -#endif - EGL_NONE }; - CLUTTER_NOTE (GL, "Creating EGL Context"); + static const EGLint attribs[3] + = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; backend_egl->egl_context = eglCreateContext (backend_egl->edpy, configs[0], EGL_NO_CONTEXT, attribs); +#else + /* Seems some GLES implementations 1.x do not like attribs... */ + backend_egl->egl_context = eglCreateContext (backend_egl->edpy, + configs[0], + EGL_NO_CONTEXT, + NULL); +#endif if (backend_egl->egl_context == EGL_NO_CONTEXT) { @@ -178,6 +179,8 @@ clutter_stage_egl_realize (ClutterActor *actor) CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); return; } + + CLUTTER_NOTE (GL, "Created EGL Context"); } CLUTTER_NOTE (BACKEND, "Marking stage as realized and setting context"); diff --git a/clutter/eglx/clutter-stage-egl.c b/clutter/eglx/clutter-stage-egl.c index 75ebc7e68..5eb32130b 100644 --- a/clutter/eglx/clutter-stage-egl.c +++ b/clutter/eglx/clutter-stage-egl.c @@ -223,27 +223,28 @@ clutter_stage_egl_realize (ClutterActor *actor) if (G_UNLIKELY (backend_egl->egl_context == None)) { - static const EGLint attribs[3] - = { EGL_CONTEXT_CLIENT_VERSION, #ifdef HAVE_COGL_GLES2 - 2, -#else /* HAVE_COGL_GLES2 */ - 1, -#endif - EGL_NONE }; - - CLUTTER_NOTE (GL, "Creating EGL Context"); + static const EGLint attribs[3] + = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; backend_egl->egl_context = eglCreateContext (backend_egl->edpy, - configs[0], + configs[0], EGL_NO_CONTEXT, attribs); - +#else + /* Seems some GLES implementations 1.x do not like attribs... */ + backend_egl->egl_context = eglCreateContext (backend_egl->edpy, + configs[0], + EGL_NO_CONTEXT, + NULL); +#endif if (backend_egl->egl_context == EGL_NO_CONTEXT) { g_critical ("Unable to create a suitable EGL context"); goto fail; } + + CLUTTER_NOTE (GL, "Created EGL Context"); } CLUTTER_ACTOR_SET_FLAGS (actor, CLUTTER_ACTOR_REALIZED);