From ea435b99a804b755312bcbb9371faa4c0111d43e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 14 Feb 2008 10:47:49 +0100 Subject: Introducing the icon cache. If an icon is the same as one in the cache, then it uses that one. icons of different sizes (from the same client) are linked together into one, and resizes of icons are cached and linked to all the various sizes. so you only need one icon in memory for all your terminals now. ya! --- openbox/framerender.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'openbox/framerender.c') diff --git a/openbox/framerender.c b/openbox/framerender.c index 87706b2b..bf71d2c3 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -354,21 +354,21 @@ static void framerender_label(ObFrame *self, RrAppearance *a) static void framerender_icon(ObFrame *self, RrAppearance *a) { - const ObClientIcon *icon; + RrImage *icon; if (!self->icon_on) return; - icon = client_icon(self->client, - ob_rr_theme->button_size + 2, - ob_rr_theme->button_size + 2); + icon = client_icon(self->client); + if (icon) { - a->texture[0].type = RR_TEXTURE_RGBA; - a->texture[0].data.rgba.width = icon->width; - a->texture[0].data.rgba.height = icon->height; - a->texture[0].data.rgba.alpha = 0xff; - a->texture[0].data.rgba.data = icon->data; - } else + RrAppearanceClearTextures(a); + a->texture[0].type = RR_TEXTURE_IMAGE; + a->texture[0].data.image.alpha = 0xff; + a->texture[0].data.image.image = icon; + } else { + RrAppearanceClearTextures(a); a->texture[0].type = RR_TEXTURE_NONE; + } RrPaint(a, self->icon, ob_rr_theme->button_size + 2, ob_rr_theme->button_size + 2); -- cgit v1.2.3