summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-06-21 19:48:47 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-06-21 19:48:47 +0000
commitf534125777af40642d3587eb1e0cb2de6946f4f2 (patch)
tree9f39aee4ba08a27b69a442b9d83c31735b54c346
parentee0895169d57f2d67f7d1b85f941a6fa31b439f0 (diff)
downloadgdk-pixbuf-f534125777af40642d3587eb1e0cb2de6946f4f2.tar.gz
Revert accidental changes from Federico's last commit.
2000-06-21 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/testpixbuf-scale.c: Revert accidental changes from Federico's last commit.
-rw-r--r--demos/testpixbuf-scale.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c
index f0059d4ab..a99977fbd 100644
--- a/demos/testpixbuf-scale.c
+++ b/demos/testpixbuf-scale.c
@@ -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,