]> Pileus Git - ~andy/gtk/commitdiff
Revert accidental changes from Federico's last commit.
authorOwen Taylor <otaylor@redhat.com>
Wed, 21 Jun 2000 19:48:47 +0000 (19:48 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 21 Jun 2000 19:48:47 +0000 (19:48 +0000)
2000-06-21  Owen Taylor  <otaylor@redhat.com>

* gdk-pixbuf/testpixbuf-scale.c: Revert accidental changes
from Federico's last commit.

demos/testpixbuf-scale.c

index f0059d4ab03677b4de779947bcca6ea55a59518f..a99977fbda35d4d98774be4a167716fb55ba60f5 100644 (file)
@@ -29,41 +29,19 @@ gboolean
 expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 {
   GdkPixbuf *dest;
-  GdkGC *gc;
-  GdkColormap *colormap;
-  GdkColor color;
-
-  color.red = 0xffff;
-  color.green = 0xffff;
-  color.blue = 0xffff;
-  
-  gc = gdk_gc_new (widget->window);
-  colormap = gdk_window_get_colormap (widget->window);
-  gdk_colormap_alloc_color (colormap, &color, TRUE, TRUE);
-  gdk_gc_set_foreground (gc, &color);
-  gdk_draw_rectangle (widget->window, gc,      
-                     TRUE,
-                     event->area.x, 
-                     event->area.y, 
-                     event->area.width, event->area.height);
 
   gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
+  
+  dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
 
+  gdk_pixbuf_composite_color (pixbuf, dest,
+                             0, 0, event->area.width, event->area.height,
+                             -event->area.x, -event->area.y,
+                             (double) widget->allocation.width / gdk_pixbuf_get_width (pixbuf),
+                             (double) widget->allocation.height / gdk_pixbuf_get_height (pixbuf),
+                             interp_type, overall_alpha,
+                             event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
 
-  dest = gdk_pixbuf_get_from_drawable(NULL,
-                                     widget->window,
-                                     gdk_window_get_colormap (widget->window),
-                                     event->area.x, 
-                                     event->area.y, 
-                                     0, 0, event->area.width, event->area.height);
-
-  gdk_pixbuf_composite (pixbuf, dest,
-                       0, 0, event->area.width, event->area.height,
-                       -event->area.x, -event->area.y,
-                       (double) widget->allocation.width / gdk_pixbuf_get_width (pixbuf),
-                       (double) widget->allocation.height / gdk_pixbuf_get_height (pixbuf),
-                       interp_type, overall_alpha);
-  
   gdk_pixbuf_render_to_drawable (dest, widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
                                 0, 0, event->area.x, event->area.y,
                                 event->area.width, event->area.height,