Commit b8c691e6 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Handle drawing transparency without a mask correctly.

Mon Mar  6 11:02:07 2000  Owen Taylor  <otaylor@redhat.com>

	* pixmap_theme_pixbuf.c: Handle drawing transparency without a
	mask correctly.

	* pixmap_theme_main.c pixmap_theme_draw.c: Remove duplicate
	includes.
parent ac671570
Mon Mar 6 11:02:07 2000 Owen Taylor <otaylor@redhat.com>
* pixmap_theme_pixbuf.c: Handle drawing transparency without a
mask correctly.
* pixmap_theme_main.c pixmap_theme_draw.c: Remove duplicate
includes.
Sun Feb 6 21:34:30 2000 Owen Taylor <otaylor@redhat.com>
* Started ChangeLog for pixbuf engine, check sources
......
/* GTK+ Pixbuf Engine
* Copyright (C) 1998-2000 Red Hat Software
* Copyright (C) 1998-2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -22,7 +22,6 @@
#include "pixmap_theme.h"
#include <math.h>
#include "pixmap_theme.h"
static ThemeImage *
match_theme_image(GtkStyle *style,
......@@ -78,10 +77,10 @@ match_theme_image(GtkStyle *style,
}
static void
draw_simple_image(GtkStyle *style,
GdkWindow *window,
GdkRectangle *area,
GtkWidget *widget,
draw_simple_image(GtkStyle *style,
GdkWindow *window,
GdkRectangle *area,
GtkWidget *widget,
ThemeMatchData *match_data,
gboolean draw_center,
gboolean allow_setbg,
......
/* GTK+ Pixbuf Engine
* Copyright (C) 1998-2000 Red Hat Software
* Copyright (C) 1998-2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -20,7 +20,6 @@
* Carsten Haitzler <raster@rasterman.com>
*/
#include "pixmap_theme.h"
#include "pixmap_theme.h"
#include <gmodule.h>
......
/* GTK+ Pixbuf Engine
* Copyright (C) 1998-2000 Red Hat Software
* Copyright (C) 1998-2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -42,7 +42,6 @@ pixbuf_render (GdkPixbuf *src,
GdkPixbuf *tmp_pixbuf;
GdkRectangle rect;
int x_offset, y_offset;
art_u32 bg_color = 0xffffff;
if (dest_width <= 0 || dest_height <= 0)
return;
......@@ -84,20 +83,10 @@ pixbuf_render (GdkPixbuf *src,
partial_src_gdk = gdk_pixbuf_new_from_art_pixbuf (partial_src_art);
tmp_pixbuf = gdk_pixbuf_new (ART_PIX_RGB, src->art_pixbuf->has_alpha, 8, rect.width, rect.height);
if (mask)
{
gdk_pixbuf_scale (partial_src_gdk, tmp_pixbuf, 0, 0, rect.width, rect.height,
dest_x - rect.x, dest_y - rect.y,
(double)dest_width / src_width, (double)dest_height / src_height,
ART_FILTER_BILINEAR);
}
else
{
gdk_pixbuf_composite_color (partial_src_gdk, tmp_pixbuf, 0, 0, rect.width, rect.height,
dest_x - rect.x, dest_y - rect.y,
(double)dest_width / src_width, (double)dest_height / src_height,
ART_FILTER_BILINEAR, 255, 0, 0, 16, bg_color, bg_color);
}
gdk_pixbuf_scale (partial_src_gdk, tmp_pixbuf, 0, 0, rect.width, rect.height,
dest_x - rect.x, dest_y - rect.y,
(double)dest_width / src_width, (double)dest_height / src_height,
ART_FILTER_BILINEAR);
gdk_pixbuf_unref (partial_src_gdk);
......
/* GTK+ Pixbuf Engine
* Copyright (C) 1998-2000 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Written by Owen Taylor <otaylor@redhat.com>, based on code by
* Carsten Haitzler <raster@rasterman.com>
*/
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment