2008-04-28 Emmanuele Bassi <ebassi@openedhand.com>

* 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.
This commit is contained in:
Emmanuele Bassi 2008-04-28 09:33:38 +00:00
parent b1592629ca
commit b8827ea095
3 changed files with 34 additions and 12 deletions

View File

@ -1,3 +1,15 @@
2008-04-28 Emmanuele Bassi <ebassi@openedhand.com>
* 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 <neil@o-hand.com>
Merged in the clutter-ivan branch which contained the new public

View File

@ -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);
}

View File

@ -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);
}