From 064d45266a7de77d82da3b8981b497adcfc41cb8 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 23 Mar 2007 16:37:56 +0000 Subject: [PATCH] 2007-03-23 Emmanuele Bassi * clutter/glx/clutter-stage-glx.c: (clutter_stage_glx_allocate_coords): Make sure the top-left corner of the box is our origin. --- ChangeLog | 6 ++++++ clutter/clutter-group.c | 5 +++++ clutter/clutter-stage.c | 13 +++++++++++++ clutter/glx/clutter-stage-glx.c | 14 +++++--------- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 238db1c89..4e1d4c2fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-23 Emmanuele Bassi + + * clutter/glx/clutter-stage-glx.c: + (clutter_stage_glx_allocate_coords): Make sure the top-left + corner of the box is our origin. + 2007-03-23 Matthew Allum * clutter/glx/clutter-stage-glx.c: diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 8798e2489..fb450b8d3 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -37,6 +37,7 @@ #include "clutter-group.h" #include "clutter-main.h" #include "clutter-private.h" +#include "clutter-debug.h" #include "clutter-marshal.h" #include "clutter-enum-types.h" @@ -68,6 +69,8 @@ clutter_group_paint (ClutterActor *actor) ClutterGroup *self = CLUTTER_GROUP(actor); GList *child_item; + CLUTTER_NOTE (PAINT, "ClutterGroup paint enter"); + glPushMatrix(); for (child_item = self->priv->children; @@ -83,6 +86,8 @@ clutter_group_paint (ClutterActor *actor) } glPopMatrix(); + + CLUTTER_NOTE (PAINT, "ClutterGroup paint leave"); } static void diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index be9296887..7a6e9cefc 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -100,6 +100,16 @@ clutter_stage_delete_event (ClutterStage *stage, return FALSE; } +static void +clutter_stage_paint (ClutterActor *actor) +{ + /* chain up */ + CLUTTER_NOTE (PAINT, "Chaining up to parent class paint"); + + if (CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint) + CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (actor); +} + static void clutter_stage_set_property (GObject *object, guint prop_id, @@ -185,11 +195,14 @@ static void clutter_stage_class_init (ClutterStageClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); ClutterStageClass *stage_class = CLUTTER_STAGE_CLASS (klass); gobject_class->set_property = clutter_stage_set_property; gobject_class->get_property = clutter_stage_get_property; + actor_class->paint = clutter_stage_paint; + stage_class->delete_event = clutter_stage_delete_event; /** diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index e0cfa0e99..ef0ec7299 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -214,7 +214,7 @@ clutter_stage_glx_realize (ClutterActor *actor) if (stage_glx->xwin == None) { - CLUTTER_NOTE (MISC, "XCreateSimpleWindow"); + CLUTTER_NOTE (MISC, "Creating stage X window"); stage_glx->xwin = XCreateSimpleWindow (stage_glx->xdpy, stage_glx->xwin_root, 0, 0, @@ -238,7 +238,7 @@ clutter_stage_glx_realize (ClutterActor *actor) if (stage_glx->gl_context) glXDestroyContext (stage_glx->xdpy, stage_glx->gl_context); - CLUTTER_NOTE (GL, "glXCreateContext"); + CLUTTER_NOTE (GL, "Creating GL Context"); stage_glx->gl_context = glXCreateContext (stage_glx->xdpy, stage_glx->xvisinfo, 0, @@ -360,13 +360,9 @@ clutter_stage_glx_paint (ClutterActor *self) ClutterColor stage_color; static GTimer *timer = NULL; static guint timer_n_frames = 0; - static ClutterActorClass *parent_class = NULL; CLUTTER_NOTE (PAINT, " Redraw enter"); - if (!parent_class) - parent_class = g_type_class_peek_parent (CLUTTER_STAGE_GET_CLASS (stage)); - if (clutter_get_show_fps ()) { if (!timer) @@ -383,7 +379,8 @@ clutter_stage_glx_paint (ClutterActor *self) glDisable (GL_LIGHTING); glDisable (GL_DEPTH_TEST); - parent_class->paint (self); + if (CLUTTER_ACTOR_CLASS (clutter_stage_glx_parent_class)->paint) + CLUTTER_ACTOR_CLASS (clutter_stage_glx_parent_class)->paint (self); if (stage_glx->xwin) { @@ -417,10 +414,9 @@ clutter_stage_glx_allocate_coords (ClutterActor *self, { ClutterStageGlx *stage_glx = CLUTTER_STAGE_GLX (self); + box->x1 = box->y1 = 0; box->x2 = box->x1 + stage_glx->xwin_width; box->y2 = box->y1 + stage_glx->xwin_height; - - return; } static void