]> Dogcows Code - chaz/openbox/commitdiff
put an alpha channel in the rgba texture
authorDana Jansens <danakj@orodu.net>
Tue, 29 May 2007 03:22:55 +0000 (03:22 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 29 May 2007 03:22:55 +0000 (03:22 +0000)
openbox/focus_cycle_popup.c
openbox/framerender.c
openbox/menuframe.c
openbox/popup.c
render/render.h

index 89c3c82c0925f20e917e384060ac1951cfc263e4..ee03370004d8aa04d2e5a2bcc7a38e9816761eb9 100644 (file)
@@ -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;
index b86f469227a6fe332d6621c2bc7cfd1ec3a04aec..2fec1a55d6c5e640b880f5754431114f89a8842d 100644 (file)
@@ -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;
index b908ad4ff0a6be146562d62a0265c0c6ef24d26f..813354cdb03b29b385f024c70411315f7f7fafec 100644 (file)
@@ -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;
index 2768ee2b44fe7663d460dd7398216d40ac62e4a1..f46a3a7fd89a13bf666f8d1d4810f56d51bd6898 100644 (file)
@@ -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;
index ac1deb4b0bf3ab8e32ce8e21b4a02c27ba2424dd..c13894aab9573f666b1185051cf9ecadcc2cc79e 100644 (file)
@@ -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;
This page took 0.028778 seconds and 4 git commands to generate.