From 8b1385ed23c7846705547719e90422e5f7668b7d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 25 Jun 2008 11:49:43 +0000 Subject: [PATCH] 2008-06-25 Emmanuele Bassi * clutter/clutter-stage.c: (clutter_stage_allocate): Check if the stage provided by the backend is static (i.e. a framebuffer that cannot be resized) and interrupt the allocation chain there. * clutter/eglnative/clutter-stage-egl.c: (clutter_stage_egl_class_init): Remove the ::allocate empty stub. --- ChangeLog | 11 +++++++++++ clutter/clutter-stage.c | 19 +++++++++++++------ clutter/eglnative/clutter-stage-egl.c | 12 ------------ clutter/fruity/clutter-stage-fruity.c | 12 ------------ 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 771a9a042..1bed62278 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-06-25 Emmanuele Bassi + + * clutter/clutter-stage.c: + (clutter_stage_allocate): Check if the stage provided by the + backend is static (i.e. a framebuffer that cannot be resized) + and interrupt the allocation chain there. + + * clutter/eglnative/clutter-stage-egl.c: + (clutter_stage_egl_class_init): Remove the ::allocate empty + stub. + 2008-06-25 Matthew Allum * clutter/eglnative/clutter-stage-egl.c: diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index ba233a77f..5978377be 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -160,13 +160,20 @@ clutter_stage_allocate (ClutterActor *self, g_assert (priv->impl != NULL); - CLUTTER_ACTOR_GET_CLASS (priv->impl)->allocate (priv->impl, - box, - origin_changed); + /* if the stage is fixed size (for instance, it's using a frame-buffer) + * then we simply ignore any allocation request and interrupt the + * allocation chain here. + */ + if (clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC)) + { + ClutterActorClass *klass; - CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->allocate (self, - box, - origin_changed); + klass = CLUTTER_ACTOR_CLASS (clutter_stage_parent_class); + klass->allocate (self, box, origin_changed); + + klass = CLUTTER_ACTOR_GET_CLASS (priv->impl); + klass->allocate (priv->impl, box, origin_changed); + } } static void diff --git a/clutter/eglnative/clutter-stage-egl.c b/clutter/eglnative/clutter-stage-egl.c index 75a15f560..a581771ed 100644 --- a/clutter/eglnative/clutter-stage-egl.c +++ b/clutter/eglnative/clutter-stage-egl.c @@ -238,17 +238,6 @@ clutter_stage_egl_get_preferred_height (ClutterActor *self, *natural_height_p = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_height); } -static void -clutter_stage_egl_allocate (ClutterActor *self, - const ClutterActorBox *box, - gboolean origin_changed) -{ - /* we cannot resize the frame buffer, so we just ignore - * any allocation we receive by simply interrupting the - * allocation chain. - */ -} - static void clutter_stage_egl_dispose (GObject *gobject) { @@ -273,7 +262,6 @@ clutter_stage_egl_class_init (ClutterStageEGLClass *klass) actor_class->unrealize = clutter_stage_egl_unrealize; actor_class->get_preferred_width = clutter_stage_egl_get_preferred_width; actor_class->get_preferred_height = clutter_stage_egl_get_preferred_height; - actor_class->allocate = clutter_stage_egl_allocate; } static void diff --git a/clutter/fruity/clutter-stage-fruity.c b/clutter/fruity/clutter-stage-fruity.c index 64ee5497d..ed603a375 100644 --- a/clutter/fruity/clutter-stage-fruity.c +++ b/clutter/fruity/clutter-stage-fruity.c @@ -217,17 +217,6 @@ clutter_stage_egl_get_preferred_height (ClutterActor *self, *natural_height_p = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_height); } -static void -clutter_stage_egl_allocate (ClutterActor *self, - const ClutterActorBox *box, - gboolean origin_changed) -{ - /* we cannot resize the frame buffer, so we just ignore - * any allocation we receive by simply interrupting the - * allocation chain. - */ -} - static void clutter_stage_egl_dispose (GObject *gobject) { @@ -252,7 +241,6 @@ clutter_stage_egl_class_init (ClutterStageEGLClass *klass) actor_class->unrealize = clutter_stage_egl_unrealize; actor_class->get_preferred_width = clutter_stage_egl_get_preferred_width; actor_class->get_preferred_height = clutter_stage_egl_get_preferred_height; - actor_class->allocate = clutter_stage_egl_allocate; } static void