/**
 * clutter_glx_texture_pixmap_using_extension:
 * @texture: A #ClutterGLXTexturePixmap
 *
 * Checks whether @texture is using the GLX_EXT_texture_from_pixmap
 * extension; this extension can be optionally (though it is strongly
 * encouraged) implemented as a zero-copy between a GLX pixmap and
 * a GL texture.
 *
 * Return value: %TRUE if the texture is using the
 *   GLX_EXT_texture_from_pixmap OpenGL extension or falling back to the
 *   slower software mechanism.
 *
 * Deprecated: 1.6: Use cogl_texture_pixmap_x11_is_using_tfp_extension()
 *   on the texture handle instead.
 *
 * Since: 0.8
 */
gboolean
clutter_glx_texture_pixmap_using_extension (ClutterGLXTexturePixmap *texture)
{
  CoglHandle cogl_texture;

  g_return_val_if_fail (CLUTTER_GLX_IS_TEXTURE_PIXMAP (texture), FALSE);

  cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (texture));

  return (cogl_is_texture_pixmap_x11 (cogl_texture) &&
          cogl_texture_pixmap_x11_is_using_tfp_extension (cogl_texture));
}
static void
set_pixmap (MetaSurfaceActorX11 *self,
            Pixmap               pixmap)
{
  MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);

  CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
  MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
  CoglTexture *texture;

  g_assert (priv->pixmap == None);
  priv->pixmap = pixmap;

  texture = COGL_TEXTURE (cogl_texture_pixmap_x11_new (ctx, priv->pixmap, FALSE, NULL));

  if (G_UNLIKELY (!cogl_texture_pixmap_x11_is_using_tfp_extension (COGL_TEXTURE_PIXMAP_X11 (texture))))
    g_warning ("NOTE: Not using GLX TFP!\n");

  priv->texture = texture;
  meta_shaped_texture_set_texture (stex, texture);
}