[gtk+/rendering-cleanup: 24/113] testgtk: Remove alpha drawing test



commit 480c932c7a6b8e7b00f04ea651318fcd13254a5b
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jul 13 15:54:04 2010 +0200

    testgtk: Remove alpha drawing test
    
    We use Cairo for that these days.

 tests/testgtk.c |   68 -------------------------------------------------------
 1 files changed, 0 insertions(+), 68 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 7dfa9c1..5ae4d81 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -247,73 +247,6 @@ build_alpha_widgets (void)
   return table;
 }
 
-static gboolean
-on_alpha_drawing_expose (GtkWidget      *widget,
-			 GdkEventExpose *expose)
-{
-  int x = widget->allocation.x;
-  int y = widget->allocation.y;
-  int width = widget->allocation.width;
-  int height = widget->allocation.height;
-  GdkPixbuf *pixbuf;
-  cairo_t *cr;
-  guchar *buffer;
-  guchar *p;
-  int i, j;
-
-  buffer = g_malloc (64 * 64 * 4);
-  
-  gdk_draw_rectangle (widget->window, widget->style->black_gc, FALSE,
-		      x,         y,
-		      width - 1, height - 1);
-
-  p = buffer;
-  for (i = 0; i < 64; i++) {
-    for (j = 0; j < 64; j++) {
-      *(p++) = i * 4 + 3;
-      *(p++) = 0;
-      *(p++) = j + 4 + 3;
-      *(p++) = MIN (255, ((32 - i) * (32 - i) + (32 - j) * (32 - j)) / 8);
-    }
-  }
-  p++;
-
-  gdk_draw_rgb_32_image (widget->window, widget->style->black_gc,
-			 x + 18, y + (height - 64) /2,
-			 64, 64, GDK_RGB_DITHER_NORMAL, buffer, 64 * 4);
-
-  pixbuf = gdk_pixbuf_new_from_data (buffer, GDK_COLORSPACE_RGB, TRUE,
-				     8, 64, 64, 4 * 64, NULL, NULL);
-  cr = gdk_cairo_create (widget->window);
-
-  gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
-  cairo_rectangle (cr,
-                   x + width - 18 - 64, y + (height - 64) /2,
-                   64, 64);
-  cairo_fill (cr);
-
-  cairo_destroy (cr);
-  g_object_unref (pixbuf);
-
-  g_free (buffer);
-  
-  return FALSE;
-}
-
-static GtkWidget *
-build_alpha_drawing ()
-{
-  GtkWidget *hbox;
-
-  hbox = gtk_hbox_new (FALSE, 0);
-  gtk_widget_set_size_request (hbox, 100, 100);
-
-  g_signal_connect (hbox, "expose-event",
-		    G_CALLBACK (on_alpha_drawing_expose), NULL);
-
-  return hbox;
-}
-
 static void
 on_alpha_screen_changed (GtkWidget *widget,
 			 GdkScreen *old_screen,
@@ -383,7 +316,6 @@ create_alpha_window (GtkWidget *widget)
       g_signal_connect (window, "composited_changed", G_CALLBACK (on_composited_changed), label);
       
       gtk_box_pack_start (GTK_BOX (vbox), build_alpha_widgets (), TRUE, TRUE, 0);
-      gtk_box_pack_start (GTK_BOX (vbox), build_alpha_drawing (), TRUE, TRUE, 0);
 
       g_signal_connect (window, "destroy",
 			G_CALLBACK (gtk_widget_destroyed),



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