Commit 73ba0653 authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod

Bug 574616 – "real" transparency not working from python bindings

2009-03-09  Behdad Esfahbod  <behdad@gnome.org>

        Bug 574616 – "real" transparency not working from python bindings

        * src/vtepangocairo.c (_vte_pangocairo_destroy),
        (_vte_pangocairo_set_background_image): Better handle failure of 
        creating pixmap.

        * src/vtebg.c (vte_bg_get_pixmap): Get rid of unused mask parameter.


svn path=/trunk/; revision=2379
parent 43a9b809
2009-03-09 Behdad Esfahbod <behdad@gnome.org>
Bug 574616 "real" transparency not working from python bindings
* src/vtepangocairo.c (_vte_pangocairo_destroy),
(_vte_pangocairo_set_background_image): Better handle failure of
creating pixmap.
* src/vtebg.c (vte_bg_get_pixmap): Get rid of unused mask parameter.
2009-03-07 Behdad Esfahbod <behdad@gnome.org>
Bug 574025 Crash in _vte_terminal_insert_char
......
......@@ -555,7 +555,6 @@ vte_bg_get_pixmap(VteBg *bg,
gpointer cached;
GdkColormap *rcolormap;
GdkPixmap *pixmap;
GdkBitmap *mask;
GdkPixbuf *pixbuf;
char *file;
......@@ -652,7 +651,6 @@ vte_bg_get_pixmap(VteBg *bg,
}
pixmap = NULL;
mask = NULL;
if (GDK_IS_PIXBUF(pixbuf)) {
/* If the image is smaller than 256x256 then tile it into a
* pixbuf that is at least this large. This is done because
......@@ -661,11 +659,8 @@ vte_bg_get_pixmap(VteBg *bg,
pixbuf = _vte_bg_resize_pixbuf(pixbuf, 256, 256);
gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf,
colormap,
&pixmap, &mask,
&pixmap, NULL,
0);
if (mask != NULL) {
g_object_unref(mask);
}
g_object_unref(pixbuf);
}
......
......@@ -817,6 +817,7 @@ _vte_pangocairo_destroy (struct _vte_draw *draw)
}
g_slice_free (struct _vte_pangocairo_data, draw->impl_data);
draw->impl_data = NULL;
}
static void
......@@ -864,43 +865,38 @@ _vte_pangocairo_set_background_image (struct _vte_draw *draw,
{
struct _vte_pangocairo_data *data = draw->impl_data;
GdkPixmap *pixmap;
if (type == VTE_BG_SOURCE_NONE)
return;
if (data->bg_pattern) {
cairo_pattern_destroy (data->bg_pattern);
data->bg_pattern = NULL;
}
cairo_pattern_t *old_pattern;
cairo_surface_t *surface;
cairo_t *cr;
pixmap = vte_bg_get_pixmap (vte_bg_get_for_screen (gtk_widget_get_screen (draw->widget)),
type, pixbuf, file,
color, saturation,
_vte_draw_get_colormap(draw, TRUE));
if (pixmap) {
if (!pixmap)
return;
/* Ugh... We need to create a dummy cairo_t */
cairo_surface_t *surface;
cairo_t *cr;
if (data->bg_pattern)
cairo_pattern_destroy (data->bg_pattern);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0);
cr = cairo_create (surface);
/* Ugh... We need to create a dummy cairo_t */
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0);
cr = cairo_create (surface);
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
data->bg_pattern = cairo_pattern_reference (cairo_get_source (cr));
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
data->bg_pattern = cairo_pattern_reference (cairo_get_source (cr));
cairo_destroy (cr);
cairo_surface_destroy (surface);
cairo_destroy (cr);
cairo_surface_destroy (surface);
/* Transfer the pixmap ownership to the pattern */
cairo_pattern_set_user_data (data->bg_pattern,
(cairo_user_data_key_t *) data,
pixmap,
(cairo_destroy_func_t) g_object_unref);
/* Transfer the pixmap ownership to the pattern */
cairo_pattern_set_user_data (data->bg_pattern,
(cairo_user_data_key_t *) data,
pixmap,
(cairo_destroy_func_t) g_object_unref);
cairo_pattern_set_extend (data->bg_pattern, CAIRO_EXTEND_REPEAT);
}
cairo_pattern_set_extend (data->bg_pattern, CAIRO_EXTEND_REPEAT);
}
static void
......
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