Commit b296e636 authored by Nalin Dahyabhai's avatar Nalin Dahyabhai

when setting up backgrounds, don't deref an existing background before

* src/vteft2.c, src/vtegl.c, src/vtepango.c, src/vtepangox.c, src/vtexft.c:
	when setting up backgrounds, don't deref an existing background before
	fetching a new one, in case they're the same.
* src/vteglyph.c(_vte_glyph_draw): fix computation of the input offset.
* src/vtegl.c: implement drawing of backgrounds.
parent 10bfd9a5
2003-05-06 nalin
* src/vteft2.c, src/vtegl.c, src/vtepango.c, src/vtepangox.c,
src/vtexft.c: when setting up backgrounds, don't deref an existing
background before fetching a new one, in case they're the same.
* src/vteglyph.c(_vte_glyph_draw): fix computation of the input offset.
* src/vtegl.c: implement drawing of backgrounds.
2003-05-06 nalin
* src/iso2022.c(_vte_iso2022_map_J): include the whole JIS0201 map
instead of just the lower half.
......
HEAD: Recognizes 8-bit versions of SS2 and SS3.
Shares pixmap and pixbuf backgrounds between multiple terminal widgets
within the same process, reducing both memory and CPU use.
0.11.5: Support for PC437. Fix Ctrl+/. Use xrdb font settings if GTK+ doesn't
have anything to say.
0.11.4: Speedier transparency update when you move the windows, fixes for
......
......@@ -38,13 +38,6 @@
struct _vte_draw_impl
*_vte_draw_impls[] = {
&_vte_draw_skel,
#if GTK_CHECK_VERSION(2,2,0)
#ifndef X_DISPLAY_MISSING
#ifdef HAVE_GL
/* &_vte_draw_gl, */
#endif
#endif
#endif
#ifndef X_DISPLAY_MISSING
#ifdef HAVE_XFT2
&_vte_draw_xft,
......@@ -57,6 +50,13 @@ struct _vte_draw_impl
&_vte_draw_pango_x,
#endif
#endif
#if GTK_CHECK_VERSION(2,2,0)
#ifndef X_DISPLAY_MISSING
#ifdef HAVE_GL
&_vte_draw_gl,
#endif
#endif
#endif
};
struct _vte_draw *
......
......@@ -165,14 +165,16 @@ _vte_ft2_set_background_image(struct _vte_draw *draw,
double saturation)
{
struct _vte_ft2_data *data;
GdkPixbuf *bgpixbuf;
data = (struct _vte_ft2_data*) draw->impl_data;
bgpixbuf = vte_bg_get_pixbuf(vte_bg_get(), type, pixbuf, file,
color, saturation);
if (GDK_IS_PIXBUF(data->pixbuf)) {
g_object_unref(G_OBJECT(data->pixbuf));
}
data->pixbuf = vte_bg_get_pixbuf(vte_bg_get(), type, pixbuf, file,
color, saturation);
data->pixbuf = bgpixbuf;
}
static void
......
This diff is collapsed.
......@@ -554,9 +554,9 @@ _vte_glyph_get_uncached(struct _vte_glyph_cache *cache, gunichar c)
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
ioffset += (x * 3);
r = face->glyph->bitmap.buffer[ioffset++];
g = face->glyph->bitmap.buffer[ioffset++];
b = face->glyph->bitmap.buffer[ioffset++];
r = face->glyph->bitmap.buffer[ioffset + 0];
g = face->glyph->bitmap.buffer[ioffset + 1];
b = face->glyph->bitmap.buffer[ioffset + 2];
break;
#endif
#if HAVE_DECL_FT_PIXEL_MODE_GRAY
......@@ -684,7 +684,8 @@ _vte_glyph_draw_loop:
}
ooffset = (y + row) * buffer->stride +
((x + ocol) * 3);
ioffset = (((row - glyph->skip) * glyph->width) + icol) * 4;
ioffset = (((row - glyph->skip) * glyph->width) + icol) *
DEFAULT_BYTES_PER_PIXEL;
ecol = MIN(cache->width * columns, glyph->width);
for (col = 0; col < ecol; col++) {
if (col + x >= buffer->width) {
......
......@@ -182,14 +182,14 @@ _vte_pango_set_background_image(struct _vte_draw *draw,
struct _vte_pango_data *data;
data = (struct _vte_pango_data*) draw->impl_data;
if (data->pixmap) {
g_object_unref(G_OBJECT(data->pixmap));
data->pixmap = NULL;
data->pixmapw = data->pixmaph = 0;
}
pixmap = vte_bg_get_pixmap(vte_bg_get(), type, pixbuf, file,
color, saturation,
_vte_draw_get_colormap(draw));
if (GDK_IS_PIXMAP(data->pixmap)) {
g_object_unref(G_OBJECT(data->pixmap));
}
data->pixmap = NULL;
data->pixmapw = data->pixmaph = 0;
if (pixmap) {
data->pixmap = pixmap;
gdk_drawable_get_size(pixmap, &data->pixmapw, &data->pixmaph);
......
......@@ -209,14 +209,14 @@ _vte_pango_x_set_background_image(struct _vte_draw *draw,
struct _vte_pango_x_data *data;
data = (struct _vte_pango_x_data*) draw->impl_data;
if (data->pixmap) {
g_object_unref(G_OBJECT(data->pixmap));
data->pixmap = NULL;
data->pixmapw = data->pixmaph = 0;
}
pixmap = vte_bg_get_pixmap(vte_bg_get(), type, pixbuf, file,
color, saturation,
_vte_draw_get_colormap(draw));
if (data->pixmap) {
g_object_unref(G_OBJECT(data->pixmap));
}
data->pixmap = NULL;
data->pixmapw = data->pixmaph = 0;
if (pixmap) {
data->pixmap = pixmap;
gdk_drawable_get_size(pixmap, &data->pixmapw, &data->pixmaph);
......
......@@ -421,15 +421,15 @@ _vte_xft_set_background_image(struct _vte_draw *draw,
data = (struct _vte_xft_data*) draw->impl_data;
if (GDK_IS_PIXMAP(data->pixmap)) {
g_object_unref(G_OBJECT(data->pixmap));
}
data->pixmap = NULL;
data->xpixmap = -1;
data->pixmapw = data->pixmaph = 0;
pixmap = vte_bg_get_pixmap(vte_bg_get(), type,
pixbuf, file, color, saturation,
_vte_draw_get_colormap(draw));
if (GDK_IS_PIXMAP(data->pixmap)) {
g_object_unref(G_OBJECT(data->pixmap));
}
data->pixmap = NULL;
if (GDK_IS_PIXMAP(pixmap)) {
data->pixmap = pixmap;
data->xpixmap = gdk_x11_drawable_get_xid(pixmap);
......
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