summaryrefslogtreecommitdiff
path: root/openbox/framerender.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-02-14 10:47:49 +0100
committerDana Jansens <danakj@orodu.net>2008-02-14 15:09:24 -0500
commit4c7cc1cfa64bf5722f059eae0528d510c2ae636f (patch)
treebf9657e364a76cdcd11ae86c81335b74d4d56fa0 /openbox/framerender.c
parent512d93afcc3e7dd5caa42cdb69508964c6338f3d (diff)
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!
Diffstat (limited to 'openbox/framerender.c')
-rw-r--r--openbox/framerender.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/openbox/framerender.c b/openbox/framerender.c
index e4db2a06..4720d763 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);