[gtk+/rendering-cleanup: 80/95] x11: Remove display_x11->have_render



commit 13851de0dfa0f2752e6964da06e8ba467c787a72
Author: Benjamin Otte <otte redhat com>
Date:   Fri Aug 6 04:36:17 2010 +0200

    x11: Remove display_x11->have_render
    
    Also remove setters and getters for the variable and the GdkTristate
    enum, as it's the only place where it was used.

 gdk/x11/gdkdisplay-x11.c  |    2 -
 gdk/x11/gdkdisplay-x11.h  |    8 ----
 gdk/x11/gdkdrawable-x11.c |   88 ---------------------------------------------
 gdk/x11/gdkprivate-x11.h  |    2 -
 4 files changed, 0 insertions(+), 100 deletions(-)
---
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 9b61238..5aeb017 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -1257,8 +1257,6 @@ gdk_display_open (const gchar *display_name)
 
   display_x11->leader_window_title_set = FALSE;
 
-  display_x11->have_render = GDK_UNKNOWN;
-
 #ifdef HAVE_XFIXES
   if (XFixesQueryExtension (display_x11->xdisplay, 
 			    &display_x11->xfixes_event_base, 
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 86beda5..87496d4 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -45,13 +45,6 @@ typedef struct _GdkDisplayX11Class GdkDisplayX11Class;
 #define GDK_IS_DISPLAY_X11_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_X11))
 #define GDK_DISPLAY_X11_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_X11, GdkDisplayX11Class))
 
-typedef enum 
-{
-  GDK_UNKNOWN,
-  GDK_NO,
-  GDK_YES
-} GdkTristate;
-
 struct _GdkDisplayX11
 {
   GdkDisplay parent_instance;
@@ -76,7 +69,6 @@ struct _GdkDisplayX11
   GdkKeymap *keymap;
   guint	    keymap_serial;
 
-  GdkTristate have_render;
   gboolean have_xfixes;
   gint xfixes_event_base;
 
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 9204745..02efc0d 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -136,94 +136,6 @@ _gdk_x11_drawable_update_size (GdkDrawable *drawable)
     }
 }
 
-static void
-try_pixmap (Display *xdisplay,
-	    int      screen,
-	    int      depth)
-{
-  Pixmap pixmap = XCreatePixmap (xdisplay,
-				 RootWindow (xdisplay, screen),
-				 1, 1, depth);
-  XFreePixmap (xdisplay, pixmap);
-}
-
-gboolean
-_gdk_x11_have_render (GdkDisplay *display)
-{
-  Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
-  GdkDisplayX11 *x11display = GDK_DISPLAY_X11 (display);
-
-  if (x11display->have_render == GDK_UNKNOWN)
-    {
-      int event_base, error_base;
-      x11display->have_render =
-	XRenderQueryExtension (xdisplay, &event_base, &error_base)
-	? GDK_YES : GDK_NO;
-
-      if (x11display->have_render == GDK_YES)
-	{
-	  /*
-	   * Sun advertises RENDER, but fails to support 32-bit pixmaps.
-	   * That is just no good.  Therefore, we check all screens
-	   * for proper support.
-	   */
-
-	  int screen;
-	  for (screen = 0; screen < ScreenCount (xdisplay); screen++)
-	    {
-	      int count;
-	      int *depths = XListDepths (xdisplay, screen, &count);
-	      gboolean has_8 = FALSE, has_32 = FALSE;
-
-	      if (depths)
-		{
-		  int i;
-
-		  for (i = 0; i < count; i++)
-		    {
-		      if (depths[i] == 8)
-			has_8 = TRUE;
-		      else if (depths[i] == 32)
-			has_32 = TRUE;
-		    }
-		  XFree (depths);
-		}
-
-	      /* At this point, we might have a false positive;
-	       * buggy versions of Xinerama only report depths for
-	       * which there is an associated visual; so we actually
-	       * go ahead and try create pixmaps.
-	       */
-	      if (!(has_8 && has_32))
-		{
-		  gdk_error_trap_push ();
-		  if (!has_8)
-		    try_pixmap (xdisplay, screen, 8);
-		  if (!has_32)
-		    try_pixmap (xdisplay, screen, 32);
-		  XSync (xdisplay, False);
-		  if (gdk_error_trap_pop () == 0)
-		    {
-		      has_8 = TRUE;
-		      has_32 = TRUE;
-		    }
-		}
-	      
-	      if (!(has_8 && has_32))
-		{
-		  g_warning ("The X server advertises that RENDER support is present,\n"
-			     "but fails to supply the necessary pixmap support.  In\n"
-			     "other words, it is buggy.");
-		  x11display->have_render = GDK_NO;
-		  break;
-		}
-	    }
-	}
-    }
-
-  return x11display->have_render == GDK_YES;
-}
-
 /*****************************************************
  * X11 specific implementations of generic functions *
  *****************************************************/
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 3ea4b4d..70693b4 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -72,8 +72,6 @@ gint _gdk_send_xevent      (GdkDisplay *display,
 			    glong       event_mask,
 			    XEvent     *event_send);
 
-gboolean _gdk_x11_have_render           (GdkDisplay *display);
-
 /* Routines from gdkgeometry-x11.c */
 void _gdk_window_move_resize_child (GdkWindow     *window,
                                     gint           x,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]