summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/group
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-12 15:20:56 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-12 15:20:56 +0000
commit8c54687bd3eacae78cda588df3e8a84e72f1d1de (patch)
tree035d109022792b4cf5e7c6210bf0bfa100e2544c /beryl-plugins/src/group
parent8327279f43bf91df48952d4d53e27bdc9a341e0d (diff)
downloadmarex-dev-8c54687bd3eacae78cda588df3e8a84e72f1d1de.tar.gz
marex-dev-8c54687bd3eacae78cda588df3e8a84e72f1d1de.tar.bz2
beryl-core & -plugins:
added fragment attribute interface (FAI) written by David Reveman (providing a means for plugins to add per-fragment operations to drawing operations) git-svn-id: file:///beryl/trunk@3994 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/group')
-rw-r--r--beryl-plugins/src/group/group.h2
-rw-r--r--beryl-plugins/src/group/paint.c28
2 files changed, 23 insertions, 7 deletions
diff --git a/beryl-plugins/src/group/group.h b/beryl-plugins/src/group/group.h
index 185b388..2a9723a 100644
--- a/beryl-plugins/src/group/group.h
+++ b/beryl-plugins/src/group/group.h
@@ -595,7 +595,7 @@ void groupRenderTopTabHighlight(GroupSelection *group);
void groupRenderTabBarBackground(GroupSelection *group);
void groupRenderWindowTitle(GroupSelection *group);
void groupPaintThumb(GroupSelection *group, GroupTabBarSlot *slot, int targetOpacity);
-void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib, Region clipRegion);
+void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib, unsigned int mask, Region clipRegion);
void groupPreparePaintScreen(CompScreen * s, int msSinceLastPaint);
Bool groupPaintScreen(CompScreen * s, const ScreenPaintAttrib * sAttrib, Region region, int output, unsigned int mask);
void groupPaintTransformedScreen(CompScreen * s, const ScreenPaintAttrib * sa, Region region, int output, unsigned int mask);
diff --git a/beryl-plugins/src/group/paint.c b/beryl-plugins/src/group/paint.c
index dc5e706..9332915 100644
--- a/beryl-plugins/src/group/paint.c
+++ b/beryl-plugins/src/group/paint.c
@@ -285,7 +285,7 @@ void groupRenderWindowTitle(GroupSelection *group)
* groupPaintTabBar
*
*/
-void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib, Region clipRegion)
+void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib, unsigned int mask, Region clipRegion)
{
if (!group || !HAS_TOP_WIN(group) || !group->tabBar || (group->tabBar->state == PaintOff))
return;
@@ -397,6 +397,7 @@ void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib,
if (layer) {
CompMatrix matrix = layer->texture.matrix;
+ FragmentAttrib fAttrib = { 0 };
// remove the old x1 and y1 so we have a relative value
box.extents.x2 -= box.extents.x1;
@@ -430,11 +431,18 @@ void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib,
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor4us(alpha, alpha, alpha, alpha);
+ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
+ pushWindowTransform(topTab, &attrib);
+
(*group->screen->drawWindowTexture) (topTab,
- &layer->texture, &attrib,
+ &layer->texture, &attrib, &fAttrib,
PAINT_WINDOW_TRANSLUCENT_MASK | PAINT_WINDOW_TRANSFORMED_MASK);
- screenTexEnvMode (s, GL_REPLACE);
+ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
+ glPopMatrix();
+
+ screenTexEnvMode(s, GL_REPLACE);
+
glColor4usv(defaultColor);
}
}
@@ -879,6 +887,7 @@ groupDrawWindow(CompWindow * w,
if (w->vCount) {
WindowPaintAttrib wAttrib = *attrib;
+ FragmentAttrib fAttrib = { 0 };
wAttrib.opacity = OPAQUE;
wAttrib.saturation = COLOR;
@@ -890,12 +899,19 @@ groupDrawWindow(CompWindow * w,
glColor4us(gw->group->color[0], gw->group->color[1],
gw->group->color[2], attrib->opacity);
+ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
+ pushWindowTransform(w, &wAttrib);
+
/* we use PAINT_WINDOW_TRANSFORMED_MASK here to force
the usage of a good texture filter */
- (*w->screen->drawWindowTexture) (w, &gs->glowTexture, &wAttrib,
+ (*w->screen->drawWindowTexture) (w, &gs->glowTexture,
+ &wAttrib, &fAttrib,
mask | PAINT_WINDOW_TRANSLUCENT_MASK |
PAINT_WINDOW_TRANSFORMED_MASK | PAINT_WINDOW_DECORATION_MASK);
+ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
+ glPopMatrix();
+
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
screenTexEnvMode (w->screen, GL_REPLACE);
glColor4usv(defaultColor);
@@ -1004,10 +1020,10 @@ groupPaintWindow(CompWindow * w,
if (gw->group && gw->group->tabBar) {
if (HAS_TOP_WIN(gw->group) && IS_TOP_TAB(w, gw->group)) {
if ((gw->group->changeState == PaintOff) || (gw->group->changeState == PaintFadeOut))
- groupPaintTabBar(gw->group, attrib, region);
+ groupPaintTabBar(gw->group, attrib, mask, region);
} else if (IS_PREV_TOP_TAB(w, gw->group)) {
if (gw->group->changeState == PaintFadeIn)
- groupPaintTabBar(gw->group, attrib, region);
+ groupPaintTabBar(gw->group, attrib, mask, region);
}
}