diff --git a/ChangeLog b/ChangeLog index 976ecae40..18e99c785 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-02-07 Matthew Allum + + * clutter/clutter-stage.c: + * clutter/clutter-stage.h: + * clutter/eglnative/clutter-stage-egl.c: + * clutter/eglx/clutter-stage-egl.c: + * clutter/osx/clutter-stage-osx.c: + * clutter/sdl/clutter-stage-sdl.c: + * clutter/x11/clutter-stage-x11.c: + Add at least somne basic offscreen handling into all backends. + Remove unused clutter_stage_set_offscreen vfunc. (#549) + + * clutter/clutter-texture.c: + Minor API doc tweak, noting rowstride source in set_area + 2008-02-07 Emmanuele Bassi * clutter/clutter-score.c (traverse_children): Actually implement diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 83cf2fbd0..2d28a2da5 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -149,6 +149,10 @@ clutter_stage_set_property (GObject *object, if (CLUTTER_ACTOR_IS_REALIZED (actor)) { + /* Backend needs to check this prop and handle accordingly + * in realise. + * FIXME: More 'obvious' implementation needed? + */ clutter_actor_unrealize (actor); priv->is_offscreen = g_value_get_boolean (value); clutter_actor_realize (actor); diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index 69ba9a1bb..731e7f138 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -103,8 +103,6 @@ struct _ClutterStageClass gboolean fullscreen); void (* set_cursor_visible) (ClutterStage *stage, gboolean visible); - void (* set_offscreen) (ClutterStage *stage, - gboolean offscreen); GdkPixbuf* (* draw_to_pixbuf) (ClutterStage *stage, gint x, gint y, diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index c0dd7714f..3423a7216 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -2088,7 +2088,7 @@ texture_update_data (ClutterTexture *texture, * @y: Y coordinate of upper left corner of region to update. * @width: Width in pixels of region to update. * @height: Height in pixels of region to update. - * @rowstride: Distance in bytes between row starts. + * @rowstride: Distance in bytes between row starts on source buffer. * @bpp: bytes per pixel ( Currently only 4 supported ) * @flags: #ClutterTextureFlags * @error: return location for a #GError, or %NULL diff --git a/clutter/eglnative/clutter-stage-egl.c b/clutter/eglnative/clutter-stage-egl.c index dcad992eb..5854a1ac5 100644 --- a/clutter/eglnative/clutter-stage-egl.c +++ b/clutter/eglnative/clutter-stage-egl.c @@ -148,7 +148,9 @@ clutter_stage_egl_realize (ClutterActor *actor) } else { - /* FIXME */ + g_warning("EGL Backend does not yet support offscreen rendering\n"); + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); + return; } clutter_stage_get_perspectivex (CLUTTER_STAGE (actor), &perspective); @@ -192,15 +194,6 @@ clutter_stage_egl_set_fullscreen (ClutterStage *stage, G_OBJECT_TYPE_NAME (stage)); } - -static void -clutter_stage_egl_set_offscreen (ClutterStage *stage, - gboolean offscreen) -{ - g_warning ("Stage of type `%s' do not support ClutterStage::set_offscreen", - G_OBJECT_TYPE_NAME (stage)); -} - static GdkPixbuf* clutter_stage_egl_draw_to_pixbuf (ClutterStage *stage, gint x, @@ -238,9 +231,7 @@ clutter_stage_egl_class_init (ClutterStageEGLClass *klass) actor_class->unrealize = clutter_stage_egl_unrealize; actor_class->request_coords = clutter_stage_egl_request_coords; actor_class->query_coords = clutter_stage_egl_query_coords; - - stage_class->set_fullscreen = clutter_stage_egl_set_fullscreen; - stage_class->set_offscreen = clutter_stage_egl_set_offscreen; + stage_class->set_fullscreen = clutter_stage_egl_set_fullscreen; stage_class->draw_to_pixbuf = clutter_stage_egl_draw_to_pixbuf; } diff --git a/clutter/eglx/clutter-stage-egl.c b/clutter/eglx/clutter-stage-egl.c index 5640c1307..7559761d0 100644 --- a/clutter/eglx/clutter-stage-egl.c +++ b/clutter/eglx/clutter-stage-egl.c @@ -28,9 +28,11 @@ clutter_stage_egl_unrealize (ClutterActor *actor) g_object_get (actor, "offscreen", &was_offscreen, NULL); + if (G_UNLIKELY (was_offscreen)) { /* No support as yet for this */ + } else { @@ -154,7 +156,9 @@ clutter_stage_egl_realize (ClutterActor *actor) } else { - /* FIXME */ + g_warning("EGL Backend does not yet support offscreen rendering\n"); + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); + return; } CLUTTER_SET_PRIVATE_FLAGS(actor, CLUTTER_ACTOR_SYNC_MATRICES); diff --git a/clutter/osx/clutter-stage-osx.c b/clutter/osx/clutter-stage-osx.c index 31074c0d2..28a757b5e 100644 --- a/clutter/osx/clutter-stage-osx.c +++ b/clutter/osx/clutter-stage-osx.c @@ -261,11 +261,21 @@ clutter_stage_osx_realize (ClutterActor *actor) { ClutterStageOSX *self = CLUTTER_STAGE_OSX (actor); ClutterBackendOSX *backend_osx; + gboolean is_offscreen; CLUTTER_NOTE (BACKEND, "realize"); CLUTTER_OSX_POOL_ALLOC(); + g_object_get (actor, "offscreen", &is_offscreen, NULL); + + if (is_offcreen) + { + g_warning("OSX Backend does not yet support offscreen rendering\n"); + CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); + return; + } + if (CLUTTER_ACTOR_CLASS (clutter_stage_osx_parent_class)->realize) CLUTTER_ACTOR_CLASS (clutter_stage_osx_parent_class)->realize (actor); diff --git a/clutter/sdl/clutter-stage-sdl.c b/clutter/sdl/clutter-stage-sdl.c index 893ab92a7..48a94964e 100644 --- a/clutter/sdl/clutter-stage-sdl.c +++ b/clutter/sdl/clutter-stage-sdl.c @@ -151,14 +151,6 @@ clutter_stage_sdl_set_cursor_visible (ClutterStage *stage, SDL_ShowCursor(show_cursor); } -static void -clutter_stage_sdl_set_offscreen (ClutterStage *stage, - gboolean offscreen) -{ - g_warning ("Stage of type `%s' do not support ClutterStage::set_offscreen", - G_OBJECT_TYPE_NAME (stage)); -} - static GdkPixbuf* clutter_stage_sdl_draw_to_pixbuf (ClutterStage *stage, GdkPixbuf *dest, @@ -207,7 +199,6 @@ clutter_stage_sdl_class_init (ClutterStageSDLClass *klass) stage_class->set_fullscreen = clutter_stage_sdl_set_fullscreen; stage_class->set_cursor_visible = clutter_stage_sdl_set_cursor_visible; - stage_class->set_offscreen = clutter_stage_sdl_set_offscreen; stage_class->draw_to_pixbuf = clutter_stage_sdl_draw_to_pixbuf; stage_class->set_title = clutter_stage_sdl_set_title; } diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c index 7e7fcbc00..f8262db4d 100644 --- a/clutter/x11/clutter-stage-x11.c +++ b/clutter/x11/clutter-stage-x11.c @@ -375,13 +375,6 @@ clutter_stage_x11_set_user_resize (ClutterStage *stage, clutter_stage_x11_fix_window_size (stage_x11); } -static void -clutter_stage_x11_set_offscreen (ClutterStage *stage, - gboolean offscreen) -{ - /* Do nothing ? */ -} - static void clutter_stage_x11_dispose (GObject *gobject) { @@ -409,7 +402,6 @@ clutter_stage_x11_class_init (ClutterStageX11Class *klass) stage_class->set_fullscreen = clutter_stage_x11_set_fullscreen; stage_class->set_cursor_visible = clutter_stage_x11_set_cursor_visible; - stage_class->set_offscreen = clutter_stage_x11_set_offscreen; stage_class->set_title = clutter_stage_x11_set_title; stage_class->set_user_resize = clutter_stage_x11_set_user_resize; }