+2008-06-03 Matthew Allum <mallum@openedhand.com>
+
+ * clutter/glx/clutter-glx-texture-pixmap.c:
+ Dont always fallback to x11 (slow) updates for a single
+ failed pixmap.
+ Minor cleanups.
+ * clutter/x11/clutter-x11-texture-pixmap.c:
+ Move shm allocation to only area updates.
+
2008-06-03 Øyvind Kolås <pippin@o-hand.com>
* clutter/clutter-container.c: (container_get_child_property):
guint depth;
Pixmap pixmap;
guint pixmap_width, pixmap_height;
- ClutterBackendGLX *backend_glx;
+ ClutterBackendGLX *backend_glx;
CLUTTER_NOTE (TEXTURE, "Creating GLXPixmap");
dpy = clutter_x11_get_default_display ();
+ priv->use_fallback = FALSE;
+
g_object_get (texture,
"pixmap-width", &pixmap_width,
"pixmap-height", &pixmap_height,
"pixmap-depth", &depth,
"pixmap", &pixmap,
NULL);
+
if (!pixmap)
{
goto cleanup;
if (priv->use_fallback)
{
+ CLUTTER_NOTE (TEXTURE, "Falling back to X11..");
parent_class->update_area (texture,
x, y,
width, height);
if (texture_bind (CLUTTER_GLX_TEXTURE_PIXMAP(texture)))
{
+ CLUTTER_NOTE (TEXTURE, "Really updating via GLX");
+
clutter_x11_trap_x_errors ();
(_gl_bind_tex_image) (dpy,
if (!priv->pixmap)
return;
+ if (priv->shminfo.shmid == -1)
+ try_alloc_shm (texture);
+
clutter_x11_trap_x_errors ();
if (priv->have_shm)
g_object_unref (texture);
free_shm_resources (texture);
- if (pixmap != None)
- try_alloc_shm (texture);
if (priv->depth != 0 &&
priv->pixmap != None &&
priv->pixmap_width != 0 &&
priv->pixmap_height != 0)
{
+ gboolean sync_size = TRUE;
+
if (CLUTTER_ACTOR_IS_REALIZED (texture))
clutter_x11_texture_pixmap_update_area (texture,
0, 0,
priv->pixmap_width,
priv->pixmap_height);
+
+#if 0
+ /* Borked - externally resizing resets this prop.. */
+ g_object_get (texture, "sync-size", &sync_size, NULL);
+
+ /*if (sync_size)*/
+ clutter_actor_set_size (CLUTTER_ACTOR(texture),
+ priv->pixmap_width, priv->pixmap_height);
+#endif
}
}
g_signal_emit (texture, signals[UPDATE_AREA], 0, x, y, width, height);
}
-/* FIXME: to implement */
-void
-clutter_x11_texture_pixmap_set_from_window (ClutterX11TexturePixmap *texture,
- Window win,
- gboolean reflect)
-{
- ClutterX11TexturePixmapPrivate *priv;
-
- g_return_if_fail (CLUTTER_X11_IS_TEXTURE_PIXMAP (texture));
-
- /* This would mainly be used for compositing type situations
- * with named pixmap (cannot be regular pixmap) and setting up
- * actual window redirection.
- *
- * It also seems to can pass a window to texture_pixmap and it
- * it works like redirectwindow automatic.
- *
- * Note windows do however change size, whilst pixmaps do not.
- */
-
- priv = texture->priv;
-
- /*
- priv->window_pixmap = XCompositeNameWindowPixmap (dpy, win);
-
- XCompositeRedirectWindow(clutter_x11_get_default_display(),
- win_remote,
- CompositeRedirectAutomatic);
- */
-}
-
-
-
/* FIXME: Below will change, just proof of concept atm - it will not work
* 100% for named pixmaps.
*/