From c4eaa943852c770d09034258ba40ccc07516d2f6 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 29 May 2007 03:22:55 +0000 Subject: [PATCH] put an alpha channel in the rgba texture --- openbox/focus_cycle_popup.c | 23 ++++------------------- openbox/framerender.c | 1 + openbox/menuframe.c | 2 ++ openbox/popup.c | 1 + render/render.h | 1 + 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index 89c3c82c..ee033700 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -321,6 +321,7 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) /* set up the hilite texture for the background */ p->a_bg->texture[0].data.rgba.width = rgbaw; p->a_bg->texture[0].data.rgba.height = rgbah; + p->a_bg->texture[0].data.rgba.alpha = 0xff; p->hilite_rgba = g_new(RrPixel32, rgbaw * rgbah); p->a_bg->texture[0].data.rgba.data = p->hilite_rgba; @@ -421,25 +422,9 @@ static void popup_render(ObFocusCyclePopup *p, const ObClient *c) icon = client_icon(target->client, innerw, innerh); p->a_icon->texture[0].data.rgba.width = icon->width; p->a_icon->texture[0].data.rgba.height = icon->height; - if (target->client->iconic) { - /* fade iconic windows */ - gint i; - RrPixel32 *d, *s; - - icon_data = g_new(RrPixel32, icon->width * icon->height); - - s = icon->data; - d = icon_data; - for (i = 0; i < icon->width * icon->height; ++i, ++d, ++s) { - /* 7/16 opacity */ - gint a = ((*s >> RrDefaultAlphaOffset) & 0xff); - *d = *s - (a << RrDefaultAlphaOffset) + - (((a>>1) - (a>>4)) << RrDefaultAlphaOffset); - } - - } else - icon_data = icon->data; - p->a_icon->texture[0].data.rgba.data = icon_data; + /* 7/16 alpha */ + p->a_icon->texture[0].data.rgba.alpha = (0xff>>1 - 0xff>>4); + p->a_icon->texture[0].data.rgba.data = icon->data; /* draw the icon */ p->a_icon->surface.parentx = innerx; diff --git a/openbox/framerender.c b/openbox/framerender.c index b86f4692..2fec1a55 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -344,6 +344,7 @@ static void framerender_icon(ObFrame *self, RrAppearance *a) 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 a->texture[0].type = RR_TEXTURE_NONE; diff --git a/openbox/menuframe.c b/openbox/menuframe.c index b908ad4f..813354cd 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -499,6 +499,8 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) self->entry->data.normal.icon_width; self->a_icon->texture[0].data.rgba.height = self->entry->data.normal.icon_height; + /* XXX determine this from iconic window */ + self->a_icon->texture[0].data.rgba.width = 0xff; self->a_icon->texture[0].data.rgba.data = self->entry->data.normal.icon_data; self->a_icon->surface.parent = item_a; diff --git a/openbox/popup.c b/openbox/popup.c index 2768ee2b..f46a3a7f 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -324,6 +324,7 @@ void icon_popup_delay_show(ObIconPopup *self, gulong usec, self->a_icon->texture[0].type = RR_TEXTURE_RGBA; self->a_icon->texture[0].data.rgba.width = icon->width; self->a_icon->texture[0].data.rgba.height = icon->height; + self->a_icon->texture[0].data.rgba.alpha = 0xff; self->a_icon->texture[0].data.rgba.data = icon->data; } else self->a_icon->texture[0].type = RR_TEXTURE_NONE; diff --git a/render/render.h b/render/render.h index ac1deb4b..c13894aa 100644 --- a/render/render.h +++ b/render/render.h @@ -146,6 +146,7 @@ struct _RrTextureMask { struct _RrTextureRGBA { gint width; gint height; + gint alpha; RrPixel32 *data; /* cached scaled so we don't have to scale often */ gint cwidth; -- 2.44.0