From b8827ea095aed8c741303172c4cfea815b470747 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 28 Apr 2008 09:33:38 +0000 Subject: [PATCH] 2008-04-28 Emmanuele Bassi * clutter/eglnative/clutter-backend-egl.c: (clutter_backend_egl_redraw): Whitespace fixes. * clutter/eglnative/clutter-stage-egl.c: (clutter_stage_egl_hide): Indentation fixes. (clutter_stage_egl_realize): Use g_critical() to report failure, unset the flags and bail out instead of continuing the realization of the stage. --- ChangeLog | 12 +++++++++ clutter/eglnative/clutter-backend-egl.c | 1 + clutter/eglnative/clutter-stage-egl.c | 33 ++++++++++++++++--------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6be3a4e75..39f39329a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-04-28 Emmanuele Bassi + + * clutter/eglnative/clutter-backend-egl.c: + (clutter_backend_egl_redraw): Whitespace fixes. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_hide): Indentation fixes. + + (clutter_stage_egl_realize): Use g_critical() to report failure, + unset the flags and bail out instead of continuing the realization + of the stage. + 2008-04-25 Neil Roberts Merged in the clutter-ivan branch which contained the new public diff --git a/clutter/eglnative/clutter-backend-egl.c b/clutter/eglnative/clutter-backend-egl.c index 889bc1d8c..f79a1da04 100644 --- a/clutter/eglnative/clutter-backend-egl.c +++ b/clutter/eglnative/clutter-backend-egl.c @@ -72,6 +72,7 @@ clutter_backend_egl_redraw (ClutterBackend *backend, eglWaitNative (EGL_CORE_NATIVE_ENGINE); clutter_actor_paint (CLUTTER_ACTOR (stage)); + eglWaitGL(); eglSwapBuffers (backend_egl->edpy, stage_egl->egl_surface); } diff --git a/clutter/eglnative/clutter-stage-egl.c b/clutter/eglnative/clutter-stage-egl.c index db9ce75df..0e7d77d36 100644 --- a/clutter/eglnative/clutter-stage-egl.c +++ b/clutter/eglnative/clutter-stage-egl.c @@ -29,7 +29,7 @@ G_DEFINE_TYPE_WITH_CODE (ClutterStageEGL, static void clutter_stage_egl_show (ClutterActor *actor) { - ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (actor); + ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (actor); CLUTTER_ACTOR_SET_FLAGS (stage_egl, CLUTTER_ACTOR_MAPPED); CLUTTER_ACTOR_SET_FLAGS (stage_egl->wrapper, CLUTTER_ACTOR_MAPPED); @@ -40,10 +40,11 @@ clutter_stage_egl_show (ClutterActor *actor) static void clutter_stage_egl_hide (ClutterActor *actor) { - ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (actor); + ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (actor); CLUTTER_ACTOR_UNSET_FLAGS (stage_egl, CLUTTER_ACTOR_MAPPED); CLUTTER_ACTOR_UNSET_FLAGS (stage_egl->wrapper, CLUTTER_ACTOR_MAPPED); + CLUTTER_ACTOR_CLASS (clutter_stage_egl_parent_class)->hide (actor); } @@ -99,7 +100,11 @@ clutter_stage_egl_realize (ClutterActor *actor) &config_count); if (status != EGL_TRUE) - g_warning ("eglGetConfigs failed"); + { + g_critical ("eglGetConfigs failed"); + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); + return; + } status = eglChooseConfig (backend_egl->edpy, cfg_attribs, @@ -108,7 +113,11 @@ clutter_stage_egl_realize (ClutterActor *actor) &config_count); if (status != EGL_TRUE) - g_warning ("eglChooseConfig failed"); + { + g_critical ("eglChooseConfig failed"); + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); + return; + } if (stage_egl->egl_surface != EGL_NO_SURFACE) { @@ -128,8 +137,6 @@ clutter_stage_egl_realize (ClutterActor *actor) NULL, NULL); - - if (stage_egl->egl_surface == EGL_NO_SURFACE) { g_critical ("Unable to create an EGL surface"); @@ -175,25 +182,27 @@ clutter_stage_egl_realize (ClutterActor *actor) CLUTTER_ACTOR_SET_FLAGS (stage_egl->wrapper, CLUTTER_ACTOR_REALIZED); CLUTTER_ACTOR_SET_FLAGS (stage_egl, CLUTTER_ACTOR_REALIZED); - - /* eglnative can have only one context */ + /* eglnative can have only one stage */ status = eglMakeCurrent (backend_egl->edpy, stage_egl->egl_surface, stage_egl->egl_surface, backend_egl->egl_context); if (status != EGL_TRUE) - g_warning ("eglMakeCurrent"); - + { + g_critical ("eglMakeCurrent failed"); + + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); + return; + } } else { - g_warning("EGL Backend does not yet support offscreen rendering\n"); + g_warning ("EGL Backend does not yet support offscreen rendering\n"); CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); return; } - CLUTTER_SET_PRIVATE_FLAGS (stage_egl->wrapper, CLUTTER_ACTOR_SYNC_MATRICES); }