r35179 - in /desktop/experimental/gnome-shell/debian: ./ patches/

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Tue May 29 16:23:44 UTC 2012


Author: biebl
Date: Tue May 29 16:23:43 2012
New Revision: 35179

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=35179
Log:
* Pull patches from upstream wip/wayland branch which make it possible to
  build gnome-shell on arm{el,hf} where we use GLES instead of GL.
* debian/patches/30-remove-shell-screen-grabber.patch: The screen grabber
  was a workaround for a slow path in Mesa which has been fixed with 8.0.
* debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch:
  Use Cogl to query for available GLX extensions.
* debian/patches/32-don-t-link-directly-to-libGL.patch: Don't link directly
  to libGL since nothing in gnome-shell uses any symbols from libGL anymore.
* debian/patches/14_make-GLX-optional.patch: The above three patches make
  this one obsolete, so remove it.

Added:
    desktop/experimental/gnome-shell/debian/patches/30-remove-shell-screen-grabber.patch
    desktop/experimental/gnome-shell/debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch
    desktop/experimental/gnome-shell/debian/patches/32-don-t-link-directly-to-libGL.patch
Removed:
    desktop/experimental/gnome-shell/debian/patches/14_make-GLX-optional.patch
Modified:
    desktop/experimental/gnome-shell/debian/changelog
    desktop/experimental/gnome-shell/debian/control
    desktop/experimental/gnome-shell/debian/control.in
    desktop/experimental/gnome-shell/debian/patches/series

Modified: desktop/experimental/gnome-shell/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/changelog?rev=35179&op=diff
==============================================================================
--- desktop/experimental/gnome-shell/debian/changelog [utf-8] (original)
+++ desktop/experimental/gnome-shell/debian/changelog [utf-8] Tue May 29 16:23:43 2012
@@ -3,6 +3,16 @@
   * debian/patches/22-remove-online-accounts-from-user-menu.patch: Remove
     "Online Accounts" from user menu. It can be easily accessed via
     "System Settings" so there is no need to clutter up the user menu.
+  * Pull patches from upstream wip/wayland branch which make it possible to
+    build gnome-shell on arm{el,hf} where we use GLES instead of GL.
+  * debian/patches/30-remove-shell-screen-grabber.patch: The screen grabber
+    was a workaround for a slow path in Mesa which has been fixed with 8.0.
+  * debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch:
+    Use Cogl to query for available GLX extensions.
+  * debian/patches/32-don-t-link-directly-to-libGL.patch: Don't link directly
+    to libGL since nothing in gnome-shell uses any symbols from libGL anymore.
+  * debian/patches/14_make-GLX-optional.patch: The above three patches make
+    this one obsolete, so remove it.
 
  -- Michael Biebl <biebl at debian.org>  Tue, 22 May 2012 08:34:06 +0200
 

Modified: desktop/experimental/gnome-shell/debian/control
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/control?rev=35179&op=diff
==============================================================================
--- desktop/experimental/gnome-shell/debian/control [utf-8] (original)
+++ desktop/experimental/gnome-shell/debian/control [utf-8] Tue May 29 16:23:43 2012
@@ -62,7 +62,7 @@
          gnome-shell-common (= ${source:Version}),
          gir1.2-accountsservice-1.0,
          gir1.2-caribou-1.0,
-         gir1.2-clutter-1.0,
+         gir1.2-clutter-1.0 (>= 1.10.0),
          gir1.2-freedesktop,
          gir1.2-gcr-3,
          gir1.2-gconf-2.0,

Modified: desktop/experimental/gnome-shell/debian/control.in
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/control.in?rev=35179&op=diff
==============================================================================
--- desktop/experimental/gnome-shell/debian/control.in [utf-8] (original)
+++ desktop/experimental/gnome-shell/debian/control.in [utf-8] Tue May 29 16:23:43 2012
@@ -57,7 +57,7 @@
          gnome-shell-common (= ${source:Version}),
          gir1.2-accountsservice-1.0,
          gir1.2-caribou-1.0,
-         gir1.2-clutter-1.0,
+         gir1.2-clutter-1.0 (>= 1.10.0),
          gir1.2-freedesktop,
          gir1.2-gcr-3,
          gir1.2-gconf-2.0,

Added: desktop/experimental/gnome-shell/debian/patches/30-remove-shell-screen-grabber.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/patches/30-remove-shell-screen-grabber.patch?rev=35179&op=file
==============================================================================
--- desktop/experimental/gnome-shell/debian/patches/30-remove-shell-screen-grabber.patch (added)
+++ desktop/experimental/gnome-shell/debian/patches/30-remove-shell-screen-grabber.patch [utf-8] Tue May 29 16:23:43 2012
@@ -1,0 +1,444 @@
+From 5248c8bcbcc114f65a9bbb1f0db6240b27c74c76 Mon Sep 17 00:00:00 2001
+From: Neil Roberts <neil at linux.intel.com>
+Date: Tue, 13 Mar 2012 15:07:43 +0000
+Subject: [PATCH 1/4] Remove shell-screen-grabber
+
+The screen grabber was a workaround for an extremely slow path in Mesa
+when reading back pixel data from the frame buffer. It was using pixel
+buffer objects by directly calling into GL to hit a fast blit path in
+Intel's driver. This should no longer be necessary with the latest
+Mesa because the normal read pixels path now has a fast path to just
+memcpy the data. Using PBOs in that case just adds an extra
+indirection because the data is read into an intermediate buffer and
+then copied back out again.
+
+We want to be able to remove the dependency on linking against libGL
+directly from Gnome Shell because that will not work if Cogl is
+actually using GLES. Also libGL includes GLX which means gnome-shell
+ends up with a hard dependency on Xlib which hinders the goal of
+getting Gnome Shell to be a Wayland compositor.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=46631
+---
+ src/Makefile.am            |    4 -
+ src/shell-recorder.c       |   16 ++--
+ src/shell-screen-grabber.c |  210 --------------------------------------------
+ src/shell-screen-grabber.h |   44 ----------
+ src/shell-screenshot.c     |   37 +++++---
+ 5 files changed, 34 insertions(+), 277 deletions(-)
+ delete mode 100644 src/shell-screen-grabber.c
+ delete mode 100644 src/shell-screen-grabber.h
+
+Index: gnome-shell-3.4.1/src/Makefile.am
+===================================================================
+--- gnome-shell-3.4.1.orig/src/Makefile.am	2012-05-28 20:42:06.847115250 +0200
++++ gnome-shell-3.4.1/src/Makefile.am	2012-05-28 20:42:10.647115131 +0200
+@@ -113,7 +113,6 @@
+ 	shell-mount-operation.h		\
+ 	shell-perf-log.h		\
+ 	shell-screenshot.h		\
+-	shell-screen-grabber.h		\
+ 	shell-slicer.h			\
+ 	shell-stack.h			\
+ 	shell-tp-client.h		\
+@@ -166,7 +165,6 @@
+ 	shell-polkit-authentication-agent.h	\
+ 	shell-polkit-authentication-agent.c	\
+ 	shell-screenshot.c		\
+-	shell-screen-grabber.c		\
+ 	shell-secure-text-buffer.c	\
+ 	shell-secure-text-buffer.h	\
+ 	shell-slicer.c			\
+@@ -238,8 +236,6 @@
+ 
+ test_recorder_SOURCES =     \
+ 	$(shell_recorder_sources) $(shell_recorder_private_sources) \
+-	shell-screen-grabber.c	\
+-	shell-screen-grabber.h	\
+ 	test-recorder.c
+ endif BUILD_RECORDER
+ 
+Index: gnome-shell-3.4.1/src/shell-recorder.c
+===================================================================
+--- gnome-shell-3.4.1.orig/src/shell-recorder.c	2012-05-28 20:41:43.923116063 +0200
++++ gnome-shell-3.4.1/src/shell-recorder.c	2012-05-28 20:42:10.647115131 +0200
+@@ -12,7 +12,6 @@
+ 
+ #include "shell-recorder-src.h"
+ #include "shell-recorder.h"
+-#include "shell-screen-grabber.h"
+ 
+ #include <clutter/x11/clutter-x11.h>
+ #include <X11/extensions/Xfixes.h>
+@@ -48,8 +47,6 @@
+   int stage_width;
+   int stage_height;
+ 
+-  ShellScreenGrabber *grabber;
+-
+   gboolean have_pointer;
+   int pointer_x;
+   int pointer_y;
+@@ -267,8 +264,6 @@
+   recorder->recording_icon = create_recording_icon ();
+   recorder->memory_target = get_memory_target();
+ 
+-  recorder->grabber = shell_screen_grabber_new ();
+-
+   recorder->state = RECORDER_STATE_CLOSED;
+   recorder->framerate = DEFAULT_FRAMES_PER_SECOND;
+ }
+@@ -300,8 +295,6 @@
+   recorder_set_pipeline (recorder, NULL);
+   recorder_set_filename (recorder, NULL);
+ 
+-  g_object_unref (recorder->grabber);
+-
+   cogl_handle_unref (recorder->recording_icon);
+ 
+   G_OBJECT_CLASS (shell_recorder_parent_class)->finalize (object);
+@@ -545,8 +538,13 @@
+ 
+   size = recorder->stage_width * recorder->stage_height * 4;
+ 
+-  data = shell_screen_grabber_grab (recorder->grabber,
+-                                    0, 0, recorder->stage_width, recorder->stage_height);
++  data = g_malloc (recorder->stage_width * 4 * recorder->stage_height);
++  cogl_read_pixels (0, 0, /* x/y */
++                    recorder->stage_width,
++                    recorder->stage_height,
++                    COGL_READ_PIXELS_COLOR_BUFFER,
++                    CLUTTER_CAIRO_FORMAT_ARGB32,
++                    data);
+ 
+   buffer = gst_buffer_new();
+   GST_BUFFER_SIZE(buffer) = size;
+Index: gnome-shell-3.4.1/src/shell-screen-grabber.c
+===================================================================
+--- gnome-shell-3.4.1.orig/src/shell-screen-grabber.c	2012-05-28 20:41:43.923116063 +0200
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,210 +0,0 @@
+-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+-
+-#include <string.h>
+-
+-#include <clutter/clutter.h>
+-#include <cogl/cogl.h>
+-#include <GL/gl.h>
+-#include <GL/glx.h>
+-#include <GL/glext.h>
+-
+-#include "shell-screen-grabber.h"
+-
+-PFNGLBINDBUFFERARBPROC pf_glBindBufferARB;
+-PFNGLBUFFERDATAARBPROC pf_glBufferDataARB;
+-PFNGLDELETEBUFFERSARBPROC pf_glDeleteBuffersARB;
+-PFNGLGENBUFFERSARBPROC pf_glGenBuffersARB;
+-PFNGLMAPBUFFERARBPROC pf_glMapBufferARB;
+-PFNGLUNMAPBUFFERARBPROC pf_glUnmapBufferARB;
+-
+-struct _ShellScreenGrabberClass
+-{
+-  GObjectClass parent_class;
+-};
+-
+-struct _ShellScreenGrabber
+-{
+-  GObject parent_instance;
+-
+-  int have_pixel_buffers;
+-  int have_pack_invert;
+-  int width, height;
+-  GLuint pixel_buffer;
+-};
+-
+-G_DEFINE_TYPE(ShellScreenGrabber, shell_screen_grabber, G_TYPE_OBJECT);
+-
+-static void
+-shell_screen_grabber_finalize (GObject *gobject)
+-{
+-  ShellScreenGrabber *grabber = SHELL_SCREEN_GRABBER (gobject);
+-
+-  if (grabber->pixel_buffer != 0)
+-    pf_glDeleteBuffersARB (1, &grabber->pixel_buffer);
+-}
+-
+-static void
+-shell_screen_grabber_class_init (ShellScreenGrabberClass *grabber_class)
+-{
+-  GObjectClass *gobject_class = G_OBJECT_CLASS (grabber_class);
+-
+-  gobject_class->finalize = shell_screen_grabber_finalize;
+-}
+-
+-static void
+-shell_screen_grabber_init (ShellScreenGrabber *grabber)
+-{
+-  grabber->have_pixel_buffers = -1;
+-  grabber->width = -1;
+-  grabber->height= -1;
+-  grabber->pixel_buffer = 0;
+-}
+-
+-ShellScreenGrabber *
+-shell_screen_grabber_new  (void)
+-{
+-  return g_object_new (SHELL_TYPE_SCREEN_GRABBER, NULL);
+-}
+-
+-/**
+- * shell_screen_grabber_grab:
+- * x: X coordinate of the rectangle to grab
+- * y: Y coordinate of the rectangle to grab
+- * width: width of the rectangle to grab
+- * height: heigth of the rectangle to grab
+- *
+- * Grabs pixel data from a portion of the screen.
+- *
+- * Return value: buffer holding the grabbed data. The data is stored as 32-bit
+- *  words with native-endian xRGB pixels (i.e., the same as CAIRO_FORMAT_RGB24)
+- *  with no padding on the rows. So, the size of the buffer is width * height * 4
+- *  bytes. Free with g_free().
+- **/
+-guchar *
+-shell_screen_grabber_grab (ShellScreenGrabber *grabber,
+-                           int                 x,
+-                           int                 y,
+-                           int                 width,
+-                           int                 height)
+-{
+-  guchar *data;
+-  gsize row_bytes;
+-  gsize data_size;
+-
+-  row_bytes = width * 4;
+-  data_size = row_bytes * height;
+-  data = g_malloc (data_size);
+-
+-  if (grabber->have_pixel_buffers == -1)
+-    {
+-      const GLubyte* extensions = glGetString (GL_EXTENSIONS);
+-      grabber->have_pixel_buffers = strstr ((const char *)extensions, "GL_EXT_pixel_buffer_object") != NULL;
+-      grabber->have_pack_invert = strstr ((const char *)extensions, "GL_MESA_pack_invert") != NULL;
+-    }
+-
+-  if (grabber->have_pixel_buffers)
+-    {
+-      GLubyte *mapped_data;
+-      GLint old_swap_bytes, old_lsb_first, old_row_length, old_skip_pixels, old_skip_rows, old_alignment;
+-      GLint old_pack_invert = GL_FALSE;
+-      GLint vp_size[4];
+-      guchar *src_row, *dest_row;
+-      int i;
+-
+-      cogl_flush ();
+-
+-      if (pf_glBindBufferARB == NULL)
+-        {
+-          pf_glBindBufferARB = (PFNGLBINDBUFFERARBPROC) cogl_get_proc_address ("glBindBufferARB");
+-          pf_glBufferDataARB = (PFNGLBUFFERDATAARBPROC) cogl_get_proc_address ("glBufferDataARB");
+-          pf_glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC) cogl_get_proc_address ("glDeleteBuffersARB");
+-          pf_glGenBuffersARB = (PFNGLGENBUFFERSARBPROC) cogl_get_proc_address ("glGenBuffersARB");
+-          pf_glMapBufferARB = (PFNGLMAPBUFFERARBPROC) cogl_get_proc_address ("glMapBufferARB");
+-          pf_glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC) cogl_get_proc_address ("glUnmapBufferARB");
+-        }
+-
+-      glGetIntegerv (GL_PACK_SWAP_BYTES, &old_swap_bytes);
+-      glGetIntegerv (GL_PACK_LSB_FIRST, &old_lsb_first);
+-      glGetIntegerv (GL_PACK_ROW_LENGTH, &old_row_length);
+-      glGetIntegerv (GL_PACK_SKIP_PIXELS, &old_skip_pixels);
+-      glGetIntegerv (GL_PACK_SKIP_ROWS, &old_skip_rows);
+-      glGetIntegerv (GL_PACK_ALIGNMENT, &old_alignment);
+-
+-      glPixelStorei (GL_PACK_SWAP_BYTES, GL_FALSE);
+-      glPixelStorei (GL_PACK_LSB_FIRST, GL_FALSE);
+-      glPixelStorei (GL_PACK_ROW_LENGTH, 0);
+-      glPixelStorei (GL_PACK_SKIP_PIXELS, 0);
+-      glPixelStorei (GL_PACK_SKIP_ROWS, 0);
+-      glPixelStorei (GL_PACK_ALIGNMENT, 1);
+-
+-      if (grabber->have_pack_invert)
+-        {
+-          glGetIntegerv (GL_PACK_INVERT_MESA, &old_pack_invert);
+-          glPixelStorei (GL_PACK_INVERT_MESA, GL_FALSE);
+-        }
+-
+-      if (grabber->pixel_buffer != 0 &&
+-          (grabber->width != width ||
+-           grabber->height != height))
+-        {
+-          pf_glDeleteBuffersARB (1, &grabber->pixel_buffer);
+-          grabber->pixel_buffer = 0;
+-        }
+-
+-      if (grabber->pixel_buffer == 0)
+-        {
+-          pf_glGenBuffersARB (1, &grabber->pixel_buffer);
+-
+-          pf_glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, grabber->pixel_buffer);
+-          pf_glBufferDataARB (GL_PIXEL_PACK_BUFFER_ARB, data_size, 0, GL_STREAM_READ_ARB);
+-
+-          grabber->width = width;
+-          grabber->height = height;
+-        }
+-      else
+-        {
+-          pf_glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, grabber->pixel_buffer);
+-        }
+-
+-      /* In OpenGL, (x,y) specifies the bottom-left corner rather than the
+-       * top-left */
+-      glGetIntegerv (GL_VIEWPORT, vp_size);
+-      y = vp_size[3] - (y + height);
+-      glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_BYTE, 0);
+-
+-      mapped_data = pf_glMapBufferARB (GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY_ARB);
+-
+-      src_row = mapped_data + (height - 1) * row_bytes;
+-      dest_row = data;
+-
+-      for (i = 0; i < height; i++)
+-        {
+-          memcpy (dest_row, src_row, row_bytes);
+-          src_row -= row_bytes;
+-          dest_row += row_bytes;
+-        }
+-
+-      pf_glUnmapBufferARB (GL_PIXEL_PACK_BUFFER_ARB);
+-      pf_glBindBufferARB (GL_PIXEL_PACK_BUFFER_ARB, 0);
+-
+-      glPixelStorei (GL_PACK_SWAP_BYTES, old_swap_bytes);
+-      glPixelStorei (GL_PACK_LSB_FIRST, old_lsb_first);
+-      glPixelStorei (GL_PACK_ROW_LENGTH, old_row_length);
+-      glPixelStorei (GL_PACK_SKIP_PIXELS, old_skip_pixels);
+-      glPixelStorei (GL_PACK_SKIP_ROWS, old_skip_rows);
+-      glPixelStorei (GL_PACK_ALIGNMENT, old_alignment);
+-
+-      if (grabber->have_pack_invert)
+-        glPixelStorei (GL_PACK_INVERT_MESA, old_pack_invert);
+-    }
+-  else
+-    {
+-      cogl_read_pixels (x, y,
+-                        width, height,
+-                        COGL_READ_PIXELS_COLOR_BUFFER,
+-                        CLUTTER_CAIRO_FORMAT_ARGB32,
+-                        data);
+-    }
+-
+-  return data;
+-}
+Index: gnome-shell-3.4.1/src/shell-screen-grabber.h
+===================================================================
+--- gnome-shell-3.4.1.orig/src/shell-screen-grabber.h	2012-05-28 20:41:43.923116063 +0200
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,44 +0,0 @@
+-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+-#ifndef __SHELL_SCREEN_GRABBER_H__
+-#define __SHELL_SCREEN_GRABBER_H__
+-
+-#include <glib-object.h>
+-
+-G_BEGIN_DECLS
+-
+-/**
+- * SECTION:shell-screen-grabber
+- * @short_description: Grab pixel data from the screen
+- *
+- * The #ShellScreenGrabber object is used to download previous drawn
+- * content to the screen. It internally uses pixel-buffer objects if
+- * available, otherwise falls back to cogl_read_pixels().
+- *
+- * If you are repeatedly grabbing images of the same size from the
+- * screen, it makes sense to create one #ShellScreenGrabber and keep
+- * it around. Otherwise, it's fine to simply create one as needed and
+- * then get rid of it.
+- */
+-
+-typedef struct _ShellScreenGrabber      ShellScreenGrabber;
+-typedef struct _ShellScreenGrabberClass ShellScreenGrabberClass;
+-
+-#define SHELL_TYPE_SCREEN_GRABBER              (shell_screen_grabber_get_type ())
+-#define SHELL_SCREEN_GRABBER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), SHELL_TYPE_SCREEN_GRABBER, ShellScreenGrabber))
+-#define SHELL_SCREEN_GRABBER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_SCREEN_GRABBER, ShellScreenGrabberClass))
+-#define SHELL_IS_SCREEN_GRABBER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), SHELL_TYPE_SCREEN_GRABBER))
+-#define SHELL_IS_SCREEN_GRABBER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_SCREEN_GRABBER))
+-#define SHELL_SCREEN_GRABBER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_SCREEN_GRABBER, ShellScreenGrabberClass))
+-
+-GType shell_screen_grabber_get_type (void) G_GNUC_CONST;
+-
+-ShellScreenGrabber *shell_screen_grabber_new  (void);
+-guchar *            shell_screen_grabber_grab (ShellScreenGrabber *grabber,
+-                                               int                 x,
+-                                               int                 y,
+-                                               int                 width,
+-                                               int                 height);
+-
+-G_END_DECLS
+-
+-#endif /* __SHELL_SCREEN_GRABBER_H__ */
+Index: gnome-shell-3.4.1/src/shell-screenshot.c
+===================================================================
+--- gnome-shell-3.4.1.orig/src/shell-screenshot.c	2012-05-28 20:41:43.923116063 +0200
++++ gnome-shell-3.4.1/src/shell-screenshot.c	2012-05-28 20:42:10.651115127 +0200
+@@ -1,5 +1,8 @@
+ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+ 
++#define COGL_ENABLE_EXPERIMENTAL_API
++#define CLUTTER_ENABLE_EXPERIMENTAL_API
++
+ #include <X11/extensions/Xfixes.h>
+ #include <clutter/x11/clutter-x11.h>
+ #include <clutter/clutter.h>
+@@ -10,7 +13,6 @@
+ #include <meta/meta-shaped-texture.h>
+ 
+ #include "shell-global.h"
+-#include "shell-screen-grabber.h"
+ #include "shell-screenshot.h"
+ 
+ struct _ShellScreenshotClass
+@@ -90,18 +92,33 @@
+                     int               width,
+                     int               height)
+ {
+-  ShellScreenGrabber *grabber;
+-  static const cairo_user_data_key_t key;
++  CoglBitmap *bitmap;
++  ClutterBackend *backend;
++  CoglContext *context;
++  int stride;
+   guchar *data;
+ 
+-  grabber = shell_screen_grabber_new ();
+-  data = shell_screen_grabber_grab (grabber, x, y, width, height);
+-  g_object_unref (grabber);
+-
+-  screenshot_data->image = cairo_image_surface_create_for_data (data, CAIRO_FORMAT_RGB24,
+-                                                               width, height, width * 4);
+-  cairo_surface_set_user_data (screenshot_data->image, &key,
+-                               data, (cairo_destroy_func_t)g_free);
++  backend = clutter_get_default_backend ();
++  context = clutter_backend_get_cogl_context (backend);
++
++  screenshot_data->image = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
++                                                       width, height);
++
++
++  data = cairo_image_surface_get_data (screenshot_data->image);
++  stride = cairo_image_surface_get_stride (screenshot_data->image);
++
++  bitmap = cogl_bitmap_new_for_data (context,
++                                     width,
++                                     height,
++                                     CLUTTER_CAIRO_FORMAT_ARGB32,
++                                     stride,
++                                     data);
++  cogl_framebuffer_read_pixels_into_bitmap (cogl_get_draw_framebuffer (),
++                                            x, y,
++                                            COGL_READ_PIXELS_COLOR_BUFFER,
++                                            bitmap);
++  cogl_object_unref (bitmap);
+ }
+ 
+ static void

Added: desktop/experimental/gnome-shell/debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch?rev=35179&op=file
==============================================================================
--- desktop/experimental/gnome-shell/debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch (added)
+++ desktop/experimental/gnome-shell/debian/patches/31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch [utf-8] Tue May 29 16:23:43 2012
@@ -1,0 +1,155 @@
+From e264be5228587306424a2ab0638ef6a725cb535f Mon Sep 17 00:00:00 2001
+From: Neil Roberts <neil at linux.intel.com>
+Date: Thu, 15 Mar 2012 15:58:36 +0000
+Subject: [PATCH 2/4] Don't try to use GLX if Cogl isn't using that Winsys
+
+Instead of directly using symbols from GLX to check for the swap event
+notification, the plugin now first verifies that the Cogl renderer is
+actually using the GLX winsys and then indirectly fetches the pointers
+for the GLX functions using cogl_get_proc_address. That way it will
+continue to work if Cogl is using an EGL winsys.
+---
+ configure.ac             |   16 +++++++++++++
+ src/Makefile.am          |    1 +
+ src/gnome-shell-plugin.c |   58 ++++++++++++++++++++++++++++++++++++----------
+ 3 files changed, 63 insertions(+), 12 deletions(-)
+
+Index: gnome-shell-3.4.1/configure.ac
+===================================================================
+--- gnome-shell-3.4.1.orig/configure.ac	2012-05-28 20:42:07.587115226 +0200
++++ gnome-shell-3.4.1/configure.ac	2012-05-28 20:42:15.951114944 +0200
+@@ -127,6 +127,22 @@
+ 
+ AM_CONDITIONAL(HAVE_NETWORKMANAGER, test "$have_networkmanager" = "yes")
+ 
++dnl Check whether GL/glx.h is available. This is used to support the
++dnl GLX_INTEL_swap_event event. Only the header is used and no
++dnl libraries are directly linked to.
++have_glx_h=yes
++PKG_CHECK_MODULES(GL, gl, [], [have_glx_h=no])
++AS_IF([test "x$have_glx_h" = "xyes"], [
++saved_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS $GL_CFLAGS"
++AC_CHECK_HEADER([GL/glx.h], [], [have_glx_h=no])
++AC_CHECK_HEADER([GL/glxext.h], [], [have_glx_h=no],
++                [AC_INCLUDES_DEFAULT
++                 #include <GL/glx.h>])
++CFLAGS="$saved_CFLAGS"])
++AS_IF([test "x$have_glx_h" = "xyes"],
++      [AC_DEFINE(HAVE_GLX_H, 1, [Defined if GL/glx.h is available])])
++
+ PKG_CHECK_MODULES(SHELL_PERF_HELPER, gtk+-3.0 gio-2.0)
+ 
+ PKG_CHECK_MODULES(SHELL_HOTPLUG_SNIFFER, gio-2.0 gdk-pixbuf-2.0)
+Index: gnome-shell-3.4.1/src/Makefile.am
+===================================================================
+--- gnome-shell-3.4.1.orig/src/Makefile.am	2012-05-28 20:42:10.647115131 +0200
++++ gnome-shell-3.4.1/src/Makefile.am	2012-05-28 20:42:15.951114944 +0200
+@@ -81,6 +81,7 @@
+ 
+ gnome_shell_cflags =				\
+ 	$(GNOME_SHELL_CFLAGS)			\
++	$(GL_CFLAGS)				\
+ 	$(SYSTEMD_CFLAGS)                       \
+ 	-I$(srcdir)/tray			\
+ 	-DVERSION=\"$(VERSION)\"		\
+Index: gnome-shell-3.4.1/src/gnome-shell-plugin.c
+===================================================================
+--- gnome-shell-3.4.1.orig/src/gnome-shell-plugin.c	2012-05-28 20:41:44.099116052 +0200
++++ gnome-shell-3.4.1/src/gnome-shell-plugin.c	2012-05-28 20:42:15.951114944 +0200
+@@ -28,10 +28,14 @@
+ #include <stdlib.h>
+ #include <string.h>
+ 
++#define CLUTTER_ENABLE_EXPERIMENTAL_API
++#define COGL_ENABLE_EXPERIMENTAL_API
+ #include <clutter/clutter.h>
+ #include <clutter/x11/clutter-x11.h>
++#ifdef HAVE_GLX_H
+ #include <GL/glx.h>
+ #include <GL/glxext.h>
++#endif /* HAVE_GLX_H */
+ #include <gjs/gjs.h>
+ #include <meta/display.h>
+ #include <meta/meta-plugin.h>
+@@ -99,6 +103,7 @@
+   int glx_error_base;
+   int glx_event_base;
+   guint have_swap_event : 1;
++  CoglContext *cogl_context;
+ 
+   ShellGlobal *global;
+ };
+@@ -142,30 +147,59 @@
+ {
+ }
+ 
+-static void
+-gnome_shell_plugin_start (MetaPlugin *plugin)
++static gboolean
++gnome_shell_plugin_has_swap_event (GnomeShellPlugin *shell_plugin)
+ {
+-  GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
++  MetaPlugin *plugin = META_PLUGIN (shell_plugin);
++  CoglDisplay *cogl_display =
++    cogl_context_get_display (shell_plugin->cogl_context);
++  CoglRenderer *renderer = cogl_display_get_renderer (cogl_display);
++  const char * (* query_extensions_string) (Display *dpy, int screen);
++  Bool (* query_extension) (Display *dpy, int *error, int *event);
+   MetaScreen *screen;
+   MetaDisplay *display;
+   Display *xdisplay;
+-  GError *error = NULL;
+-  int status;
+   const char *glx_extensions;
+-  GjsContext *gjs_context;
++
++  /* We will only get swap events if Cogl is using GLX */
++  if (cogl_renderer_get_winsys_id (renderer) != COGL_WINSYS_ID_GLX)
++    return FALSE;
+ 
+   screen = meta_plugin_get_screen (plugin);
+   display = meta_screen_get_display (screen);
+ 
+   xdisplay = meta_display_get_xdisplay (display);
+ 
+-  glXQueryExtension (xdisplay,
+-                     &shell_plugin->glx_error_base,
+-                     &shell_plugin->glx_event_base);
+-
+-  glx_extensions = glXQueryExtensionsString (xdisplay,
+-                                             meta_screen_get_screen_number (screen));
+-  shell_plugin->have_swap_event = strstr (glx_extensions, "GLX_INTEL_swap_event") != NULL;
++  query_extensions_string =
++    (void *) cogl_get_proc_address ("glXQueryExtensionsString");
++  query_extension =
++    (void *) cogl_get_proc_address ("glXQueryExtension");
++
++  query_extension (xdisplay,
++                   &shell_plugin->glx_error_base,
++                   &shell_plugin->glx_event_base);
++
++  glx_extensions =
++    query_extensions_string (xdisplay,
++                             meta_screen_get_screen_number (screen));
++
++  return strstr (glx_extensions, "GLX_INTEL_swap_event") != NULL;
++}
++
++static void
++gnome_shell_plugin_start (MetaPlugin *plugin)
++{
++  GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
++  GError *error = NULL;
++  int status;
++  GjsContext *gjs_context;
++  ClutterBackend *backend;
++
++  backend = clutter_get_default_backend ();
++  shell_plugin->cogl_context = clutter_backend_get_cogl_context (backend);
++
++  shell_plugin->have_swap_event =
++    gnome_shell_plugin_has_swap_event (shell_plugin);
+ 
+   shell_perf_log_define_event (shell_perf_log_get_default (),
+                                "glx.swapComplete",

Added: desktop/experimental/gnome-shell/debian/patches/32-don-t-link-directly-to-libGL.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/patches/32-don-t-link-directly-to-libGL.patch?rev=35179&op=file
==============================================================================
--- desktop/experimental/gnome-shell/debian/patches/32-don-t-link-directly-to-libGL.patch (added)
+++ desktop/experimental/gnome-shell/debian/patches/32-don-t-link-directly-to-libGL.patch [utf-8] Tue May 29 16:23:43 2012
@@ -1,0 +1,33 @@
+From 6355e9a59904072ed995e936738e882e15d7998f Mon Sep 17 00:00:00 2001
+From: Neil Roberts <neil at linux.intel.com>
+Date: Thu, 15 Mar 2012 16:00:14 +0000
+Subject: [PATCH 3/4] Don't link directly to libGL
+
+Nothing in the Gnome Shell plugin now directly uses symbols from libGL
+so we don't need to link to it. This helps to make the plugin support
+other Cogl drivers and winsys's than GL+GLX (such as GLES+EGL).
+---
+ configure.ac |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+Index: gnome-shell-3.4.1/configure.ac
+===================================================================
+--- gnome-shell-3.4.1.orig/configure.ac	2012-05-28 20:42:15.951114944 +0200
++++ gnome-shell-3.4.1/configure.ac	2012-05-28 20:42:18.887114820 +0200
+@@ -50,7 +50,7 @@
+    AC_MSG_RESULT(yes)
+    build_recorder=true
+    recorder_modules="gstreamer-0.10 gstreamer-base-0.10 x11"
+-   PKG_CHECK_MODULES(TEST_SHELL_RECORDER, $recorder_modules clutter-1.0 xfixes gl)
++   PKG_CHECK_MODULES(TEST_SHELL_RECORDER, $recorder_modules clutter-1.0 xfixes)
+ else
+    AC_MSG_RESULT(no)
+ fi
+@@ -82,7 +82,6 @@
+                                gjs-internals-1.0 >= $GJS_MIN_VERSION
+ 			       libgnome-menu-3.0 $recorder_modules
+                                gdk-x11-3.0 libsoup-2.4
+-                               gl
+ 			       clutter-x11-1.0 >= $CLUTTER_MIN_VERSION
+ 			       clutter-glx-1.0 >= $CLUTTER_MIN_VERSION
+                                libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_MIN_VERSION

Modified: desktop/experimental/gnome-shell/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-shell/debian/patches/series?rev=35179&op=diff
==============================================================================
--- desktop/experimental/gnome-shell/debian/patches/series [utf-8] (original)
+++ desktop/experimental/gnome-shell/debian/patches/series [utf-8] Tue May 29 16:23:43 2012
@@ -1,6 +1,8 @@
 09-respect-NoDisplay-semantics-for-app-menu.patch
 10-make-NetworkManager-optional.patch
 11-no-gettext.patch
-14_make-GLX-optional.patch
 21_revert_evolution_gsettings.patch
 22-remove-online-accounts-from-user-menu.patch
+30-remove-shell-screen-grabber.patch
+31-don-t-try-to-use-GLX-if-Cogl-isn-t-using-that-Winsys.patch
+32-don-t-link-directly-to-libGL.patch




More information about the pkg-gnome-commits mailing list