diff -Nru clutter-1.0-1.2.12/debian/changelog clutter-1.0-1.2.12/debian/changelog --- clutter-1.0-1.2.12/debian/changelog 2010-10-06 12:09:23.000000000 +0000 +++ clutter-1.0-1.2.12/debian/changelog 2010-11-11 10:59:37.000000000 +0000 @@ -1,3 +1,16 @@ +clutter-1.0 (1.2.12-0ubuntu13alf4) maverick; urgency=low + + * debian/patches/no_gles2_auto_generate_mipmap.patch: + - Don't query the GL_GENERATE_MIPMAP parameter for GLES2. + * debian/patches/eglx_texture_pixmap.patch: + - Update patch to use a proper texture-from-pixmap implementation + using the EGL_KHR_image_pixmap extension. + * debian/control: + - Add an explicit libegl1-mesa-dev dependency to the build-deps. + - Add non-mesa specific alternatives to egl, gles, gles2 build-deps. + + -- Alexandros Frantzis Thu, 11 Nov 2010 10:47:27 +0200 + clutter-1.0 (1.2.12-0ubuntu13alf3) maverick; urgency=low * debian/control: diff -Nru clutter-1.0-1.2.12/debian/control clutter-1.0-1.2.12/debian/control --- clutter-1.0-1.2.12/debian/control 2010-10-06 12:03:22.000000000 +0000 +++ clutter-1.0-1.2.12/debian/control 2010-11-11 10:58:17.000000000 +0000 @@ -8,8 +8,9 @@ gnome-pkg-tools, dh-autoreconf, libgl1-mesa-dev | libgl-dev, - libgles1-mesa-dev, - libgles2-mesa-dev, + libgles1-mesa-dev | libgles1-dev, + libgles2-mesa-dev | libgles2-dev, + libegl1-mesa-dev | libegl1-dev, libgdk-pixbuf2.0-dev, libcairo2-dev (>= 1.6), libpango1.0-dev (>= 1.20), @@ -18,7 +19,6 @@ libxcomposite-dev, libxfixes-dev, libgegl-0.0-dev, - libgl1-mesa-dev, libxdamage-dev, libx11-dev, gtk-doc-tools (>= 1.11), diff -Nru clutter-1.0-1.2.12/debian/patches/eglx_texture_pixmap.patch clutter-1.0-1.2.12/debian/patches/eglx_texture_pixmap.patch --- clutter-1.0-1.2.12/debian/patches/eglx_texture_pixmap.patch 2010-09-20 07:44:19.000000000 +0000 +++ clutter-1.0-1.2.12/debian/patches/eglx_texture_pixmap.patch 2010-11-11 14:50:34.000000000 +0000 @@ -21,7 +21,7 @@ clutter-egl-headers.h --- /dev/null +++ b/clutter/eglx/clutter-glx-texture-pixmap.c -@@ -0,0 +1,136 @@ +@@ -0,0 +1,543 @@ +/* + * Clutter. + * @@ -61,6 +61,12 @@ + * + */ + ++/* ++ * EGL TFP implementation based on the KHR_image_pixmap extension. ++ * ++ * Authors: Graeme Gregory ++ * Alexandros Frantzis ++ */ + + +#ifdef HAVE_CONFIG_H @@ -69,20 +75,423 @@ + +#include "../x11/clutter-x11-texture-pixmap.h" +#include "clutter-glx-texture-pixmap.h" ++#include "clutter-backend-egl.h" ++#include "../clutter-debug.h" ++ ++PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; ++PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR; ++PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; ++ ++struct _ClutterGLXTexturePixmapPrivate ++{ ++ EGLImageKHR egl_image; ++ GLuint gl_tex; ++ gboolean bind_tex_image_queued; ++}; ++ ++static gboolean _ext_check_done = FALSE; ++static gboolean _have_tex_from_pixmap_ext = FALSE; + +G_DEFINE_TYPE (ClutterGLXTexturePixmap, \ + clutter_glx_texture_pixmap, \ + CLUTTER_X11_TYPE_TEXTURE_PIXMAP); + ++static ClutterX11TexturePixmapClass *parent_class = NULL; ++ ++const EGLint img_attribs[] = { ++ EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, ++ EGL_NONE ++}; ++ ++static void ++clutter_glx_texture_pixmap_update_area (ClutterX11TexturePixmap *texture, ++ gint x, ++ gint y, ++ gint width, ++ gint height); ++ ++static void ++bind_texture (ClutterGLXTexturePixmap *tex) ++{ ++ GLuint handle = 0; ++ GLenum target = 0; ++ CoglHandle cogl_tex = ++ clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (tex)); ++ ++ if (!cogl_texture_get_gl_texture (cogl_tex, &handle, &target)) ++ g_warning ("Failed to pluck out GL handle from cogl texture to bind"); ++ ++ glBindTexture (target, handle); ++} ++ ++static void ++clutter_glx_texture_pixmap_dispose_resources (ClutterGLXTexturePixmap *self) ++{ ++ ClutterGLXTexturePixmapPrivate *priv = self->priv; ++ CoglHandle cogl_tex; ++ EGLDisplay dpy; ++ ++ if (priv->egl_image) ++ { ++ dpy = clutter_eglx_display (); ++ ++ if (!eglDestroyImageKHR (dpy, priv->egl_image)) ++ { ++ g_warning ("Could not destroy EGLImageKHR"); ++ } ++ ++ priv->egl_image = EGL_NO_IMAGE_KHR; ++ } ++ ++ if (priv->gl_tex) ++ { ++ cogl_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (self)); ++ ++ if (cogl_tex != COGL_INVALID_HANDLE) ++ { ++ GLuint gl_handle; ++ GLenum gl_target; ++ ++ cogl_texture_get_gl_texture (cogl_tex, &gl_handle, &gl_target); ++ ++ glDeleteTextures (1, &gl_handle); ++ } ++ ++ priv->gl_tex = 0; ++ } ++} ++ ++static void ++on_glx_texture_pixmap_pre_paint (ClutterGLXTexturePixmap *texture, ++ gpointer user_data) ++{ ++ ClutterGLXTexturePixmapPrivate *priv = texture->priv; ++ ++ if (priv->bind_tex_image_queued) ++ { ++ eglWaitNative(EGL_CORE_NATIVE_ENGINE); ++ ++ bind_texture (CLUTTER_GLX_TEXTURE_PIXMAP (texture)); ++ ++ CLUTTER_NOTE (TEXTURE, "Updating texture data via glEGLImageTargetTexture2D"); ++ if (priv->egl_image != EGL_NO_IMAGE_KHR) ++ glEGLImageTargetTexture2DOES (GL_TEXTURE_2D, (GLeglImageOES) priv->egl_image); ++ ++ priv->bind_tex_image_queued = FALSE; ++ } ++ ++ /* Disable mipmaps */ ++ if (clutter_texture_get_filter_quality (CLUTTER_TEXTURE (texture)) ++ == CLUTTER_TEXTURE_QUALITY_HIGH) ++ { ++ CoglHandle material ++ = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (texture)); ++ ++ cogl_material_set_layer_filters (material, 0, ++ COGL_MATERIAL_FILTER_LINEAR, ++ COGL_MATERIAL_FILTER_LINEAR); ++ } ++} ++ ++static void ++clutter_glx_texture_pixmap_create_resources (ClutterGLXTexturePixmap *texture) ++{ ++ ClutterGLXTexturePixmapPrivate *priv; ++ ++ EGLDisplay dpy; ++ ++ CoglHandle cogl_tex; ++ GLuint gl_tex; ++ ++ guint depth; ++ Pixmap pixmap = None; ++ guint pixmap_width = 0, pixmap_height = 0; ++ CoglPixelFormat cogl_format = 0; ++ ++ priv = texture->priv; ++ ++ /* Dispose old resources */ ++ clutter_glx_texture_pixmap_dispose_resources (texture); ++ ++ g_object_get (texture, ++ "pixmap-width", &pixmap_width, ++ "pixmap-height", &pixmap_height, ++ "pixmap-depth", &depth, ++ "pixmap", &pixmap, ++ NULL); ++ ++ if (!pixmap) ++ return; ++ ++ dpy = clutter_eglx_display (); ++ ++ CLUTTER_NOTE (TEXTURE, "Creating EGLImageKHR from pixmap %ux%ux%u...", ++ pixmap_width, pixmap_height, depth); ++ ++ /* Create an EGLImage holding the pixmap */ ++ priv->egl_image = eglCreateImageKHR (dpy, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, ++ (EGLClientBuffer) pixmap, img_attribs); ++ ++ if(priv->egl_image) ++ { ++ CLUTTER_NOTE (TEXTURE, "Created EGLImageKHR"); ++ } ++ else ++ { ++ CLUTTER_NOTE (TEXTURE, "Failed to create EGLImageKHR"); ++ } ++ ++ ++ if (priv->egl_image != EGL_NO_IMAGE_KHR) ++ clutter_glx_texture_pixmap_update_area (CLUTTER_X11_TEXTURE_PIXMAP (texture), ++ 0, 0, ++ pixmap_width, pixmap_height); ++ if (depth == 32) ++ { ++ cogl_format = COGL_PIXEL_FORMAT_RGBA_8888; ++ } ++ else if (depth == 24) ++ { ++ cogl_format = COGL_PIXEL_FORMAT_RGB_888; ++ } ++ else ++ { ++ g_critical ("Can't create a TFP cogl texture for pixmap with depth %d (< 24)", depth); ++ return; ++ } ++ ++ /* Create a GL texture */ ++#if HAVE_COGL_GLES ++ glEnable(GL_TEXTURE_2D); ++#endif ++ /* Create a new texture */ ++ glGenTextures(1, &priv->gl_tex); ++ glBindTexture(GL_TEXTURE_2D, priv->gl_tex); ++ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); ++ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); ++ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ++ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ++ ++ ++ /* Convert our new gl texture to cogl type */ ++ cogl_tex = cogl_texture_new_from_foreign (priv->gl_tex, GL_TEXTURE_2D, ++ pixmap_width, ++ pixmap_height, ++ 0, ++ 0, ++ cogl_format | COGL_BGR_BIT | ++ COGL_PREMULT_BIT); ++ ++ if (cogl_tex) ++ { ++ clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (texture), cogl_tex); ++ cogl_handle_unref(cogl_tex); ++ } ++ ++} + +static void +clutter_glx_texture_pixmap_init (ClutterGLXTexturePixmap *self) +{ ++ ClutterGLXTexturePixmapPrivate *priv; ++ const char *egl_image_pixmap_env = NULL; ++ ++ priv = self->priv = ++ G_TYPE_INSTANCE_GET_PRIVATE (self, ++ CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, ++ ClutterGLXTexturePixmapPrivate); ++ ++ /* Initialize private members */ ++ priv->egl_image = 0; ++ priv->gl_tex = 0; ++ priv->bind_tex_image_queued = FALSE; ++ ++ if (_ext_check_done == FALSE) ++ { ++ const char *gles_extensions = NULL; ++ const char *egl_extensions = NULL; ++ gboolean ext_found = TRUE; ++ ++ egl_extensions = eglQueryString (clutter_eglx_display(), EGL_EXTENSIONS); ++ ++ gles_extensions = (const char *) glGetString(GL_EXTENSIONS); ++ ++ CLUTTER_NOTE (TEXTURE, "EGL Info: %s %s", ++ eglQueryString(clutter_eglx_display(), EGL_VENDOR), ++ eglQueryString(clutter_eglx_display(), EGL_VERSION)); ++ ++ CLUTTER_NOTE (TEXTURE, "EGL extensions: %s", egl_extensions); ++ ++ CLUTTER_NOTE (TEXTURE, "GLES Info: %s %s %s", ++ glGetString(GL_VENDOR), ++ glGetString(GL_RENDERER), ++ glGetString(GL_VERSION)); ++ ++ CLUTTER_NOTE (TEXTURE, "GLES extensions: %s", gles_extensions); ++ ++ /* Check for the texture from pixmap extension */ ++ if (!_cogl_check_extension ("EGL_KHR_image_pixmap", egl_extensions)) ++ { ++ CLUTTER_NOTE (TEXTURE, "EGL does not support EGL_KHR_image_pixmap"); ++ ext_found = FALSE; ++ } ++ if(!_cogl_check_extension ("GL_OES_EGL_image", gles_extensions)) ++ { ++ CLUTTER_NOTE (TEXTURE, "GLES does not support GL_OES_EGL_image"); ++ ext_found = FALSE; ++ } ++ ++ _ext_check_done = TRUE; ++ ++ eglCreateImageKHR = ++ (PFNEGLCREATEIMAGEKHRPROC)cogl_get_proc_address ("eglCreateImageKHR"); ++ eglDestroyImageKHR = ++ (PFNEGLDESTROYIMAGEKHRPROC)cogl_get_proc_address ("eglDestroyImageKHR"); ++ glEGLImageTargetTexture2DOES = ++ (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) ++ cogl_get_proc_address ("glEGLImageTargetTexture2DOES"); ++ ++ _have_tex_from_pixmap_ext = eglCreateImageKHR && ++ eglDestroyImageKHR && ++ glEGLImageTargetTexture2DOES && ++ ext_found; ++ ++ CLUTTER_NOTE (TEXTURE, "_have_tex_from_pixmap_ext = %s", ++ _have_tex_from_pixmap_ext == TRUE ? "TRUE" : "FALSE"); ++ ++ /* Let the user override the extension check */ ++ if ((egl_image_pixmap_env = g_getenv ("CLUTTER_EGL_IMAGE_PIXMAP"))) ++ { ++ CLUTTER_NOTE (TEXTURE, "Overriding extension check: CLUTTER_EGL_IMAGE_PIXMAP=%s", ++ egl_image_pixmap_env); ++ if (g_ascii_strcasecmp (egl_image_pixmap_env, "force") == 0) ++ _have_tex_from_pixmap_ext = TRUE; ++ else if (g_ascii_strcasecmp (egl_image_pixmap_env, "disable") == 0) ++ _have_tex_from_pixmap_ext = FALSE; ++ else ++ g_warning ("Unknown value for CLUTTER_EGL_IMAGE_PIXMAP " ++ "should be 'force' or 'disable'"); ++ } ++ } ++ ++ if (_have_tex_from_pixmap_ext) ++ g_signal_connect (CLUTTER_ACTOR(self), ++ "paint", G_CALLBACK (on_glx_texture_pixmap_pre_paint), ++ NULL); ++} ++ ++static void ++clutter_glx_texture_pixmap_dispose (GObject *object) ++{ ++ ClutterGLXTexturePixmap *texture = CLUTTER_GLX_TEXTURE_PIXMAP (object); ++ ++ clutter_glx_texture_pixmap_dispose_resources (texture); ++ ++ G_OBJECT_CLASS (clutter_glx_texture_pixmap_parent_class)->dispose (object); ++} ++ ++static void ++clutter_glx_texture_pixmap_realize (ClutterActor *actor) ++{ ++ ClutterGLXTexturePixmap *texture = CLUTTER_GLX_TEXTURE_PIXMAP (actor); ++ ++ if (!_have_tex_from_pixmap_ext) ++ { ++ CLUTTER_ACTOR_CLASS (clutter_glx_texture_pixmap_parent_class)-> ++ realize (actor); ++ return; ++ } ++ ++ clutter_glx_texture_pixmap_create_resources (texture); ++} ++ ++static void ++clutter_glx_texture_pixmap_unrealize (ClutterActor *actor) ++{ ++ ClutterGLXTexturePixmap *texture = CLUTTER_GLX_TEXTURE_PIXMAP (actor); ++ ++ if (!_have_tex_from_pixmap_ext) ++ { ++ CLUTTER_ACTOR_CLASS (clutter_glx_texture_pixmap_parent_class)-> ++ unrealize (actor); ++ return; ++ } ++ ++ if (!CLUTTER_ACTOR_IS_REALIZED (actor)) ++ return; ++ ++ clutter_glx_texture_pixmap_dispose_resources (texture); ++ ++ CLUTTER_ACTOR_UNSET_FLAGS (actor, CLUTTER_ACTOR_REALIZED); ++} ++ ++static void ++clutter_glx_texture_pixmap_update_area (ClutterX11TexturePixmap *texture, ++ gint x, ++ gint y, ++ gint width, ++ gint height) ++{ ++ ClutterGLXTexturePixmap *texture_glx = CLUTTER_GLX_TEXTURE_PIXMAP (texture); ++ ClutterGLXTexturePixmapPrivate *priv = texture_glx->priv; ++ ++ if (!_have_tex_from_pixmap_ext) ++ { ++ CLUTTER_X11_TEXTURE_PIXMAP_CLASS (clutter_glx_texture_pixmap_parent_class)-> ++ update_area (texture, x, y, width, height); ++ return; ++ } ++ ++ if (!CLUTTER_ACTOR_IS_REALIZED (texture)) ++ return; ++ ++ CLUTTER_NOTE (TEXTURE, "Queuing texture pixmap update"); ++ ++ priv->bind_tex_image_queued = TRUE; ++} ++ ++static void ++clutter_glx_texture_pixmap_notify (GObject *object, GParamSpec *pspec) ++{ ++ if (!_have_tex_from_pixmap_ext) ++ { ++ if (G_OBJECT_CLASS (clutter_glx_texture_pixmap_parent_class)-> ++ notify) ++ { ++ G_OBJECT_CLASS (clutter_glx_texture_pixmap_parent_class)-> ++ notify(object, pspec); ++ } ++ return; ++ } ++ ++ if (g_str_equal (pspec->name, "pixmap")) ++ { ++ ClutterGLXTexturePixmap *texture = CLUTTER_GLX_TEXTURE_PIXMAP (object); ++ if (CLUTTER_ACTOR_IS_REALIZED (texture)) ++ clutter_glx_texture_pixmap_create_resources (texture); ++ } +} + +static void +clutter_glx_texture_pixmap_class_init (ClutterGLXTexturePixmapClass *klass) +{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass); ++ ClutterX11TexturePixmapClass *x11_texture_class = ++ CLUTTER_X11_TEXTURE_PIXMAP_CLASS (klass); ++ ++ g_type_class_add_private (klass, sizeof (ClutterGLXTexturePixmapPrivate)); ++ ++ parent_class = g_type_class_peek_parent(klass); ++ ++ object_class->dispose = clutter_glx_texture_pixmap_dispose; ++ ++ object_class->notify = clutter_glx_texture_pixmap_notify; ++ ++ actor_class->realize = clutter_glx_texture_pixmap_realize; ++ actor_class->unrealize = clutter_glx_texture_pixmap_unrealize; ++ ++ x11_texture_class->update_area = clutter_glx_texture_pixmap_update_area; +} + +/** @@ -103,9 +512,7 @@ +gboolean +clutter_glx_texture_pixmap_using_extension (ClutterGLXTexturePixmap *texture) +{ -+ g_return_val_if_fail (CLUTTER_GLX_IS_TEXTURE_PIXMAP (texture), FALSE); -+ -+ return FALSE; ++ return (_have_tex_from_pixmap_ext); +} + +/** @@ -258,3 +665,20 @@ G_BEGIN_DECLS #define CLUTTER_GLX_TYPE_TEXTURE_PIXMAP (clutter_glx_texture_pixmap_get_type ()) +--- a/clutter/eglx/clutter-egl-headers.h ++++ b/clutter/eglx/clutter-egl-headers.h +@@ -24,10 +24,14 @@ + + #ifdef HAVE_COGL_GLES2 + #include ++#include + #include ++#include + #else /* HAVE_COGL_GLES2 */ + #include ++#include + #include ++#include + #endif /* HAVE_COGL_GLES2 */ + + #ifdef HAVE_COGL_GLES2 diff -Nru clutter-1.0-1.2.12/debian/patches/no_gles2_auto_generate_mipmap.patch clutter-1.0-1.2.12/debian/patches/no_gles2_auto_generate_mipmap.patch --- clutter-1.0-1.2.12/debian/patches/no_gles2_auto_generate_mipmap.patch 1970-01-01 00:00:00.000000000 +0000 +++ clutter-1.0-1.2.12/debian/patches/no_gles2_auto_generate_mipmap.patch 2010-11-11 10:19:22.000000000 +0000 @@ -0,0 +1,26 @@ +Description: Don't query the GL_GENERATE_MIPMAP parameter for GLES2. +Author: Alexandros Frantzis +Last-Updated: 2010-11-11 +--- a/clutter/cogl/cogl/cogl-texture-2d-sliced.c ++++ b/clutter/cogl/cogl/cogl-texture-2d-sliced.c +@@ -1088,7 +1088,7 @@ + GLint gl_int_format = 0; + GLint gl_width = 0; + GLint gl_height = 0; +- GLint gl_gen_mipmap; ++ GLint gl_gen_mipmap = GL_FALSE; + CoglTexture2DSliced *tex_2ds; + CoglTexture *tex; + CoglSpan x_span; +@@ -1143,9 +1143,11 @@ + gl_width = width + x_pot_waste; + gl_height = height + y_pot_waste; + ++#if HAVE_COGL_GL || HAVE_COGL_GLES + GE( glGetTexParameteriv (gl_target, + GL_GENERATE_MIPMAP, + &gl_gen_mipmap) ); ++#endif + + /* Validate width and height */ + if (gl_width <= 0 || gl_height <= 0) diff -Nru clutter-1.0-1.2.12/debian/patches/series clutter-1.0-1.2.12/debian/patches/series --- clutter-1.0-1.2.12/debian/patches/series 2010-10-06 11:55:13.000000000 +0000 +++ clutter-1.0-1.2.12/debian/patches/series 2010-11-11 10:11:52.000000000 +0000 @@ -18,3 +18,4 @@ depth_stencil_only_supported_in_gl.patch check_disable_clip_planes.patch check_correct_texture_unit.patch +no_gles2_auto_generate_mipmap.patch