summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/neg.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 00:43:33 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 00:43:33 +0000
commit0ab00e046951ad9b6263c8fb0ede3effa86d222d (patch)
treeaf3675da1e41d63d136e72824326d2a0c358bb7b /beryl-plugins/src/neg.c
parent104ed8ebe6ebeed3e48c8b1269a23e36928aacc8 (diff)
downloadmarex-dev-0ab00e046951ad9b6263c8fb0ede3effa86d222d.tar.gz
marex-dev-0ab00e046951ad9b6263c8fb0ede3effa86d222d.tar.bz2
beryl-(core|plugins): moved matrix transformations out of gl (David Reveman)
- group not ported yet - blurfx has bugs but this will be fixed in a rewrite all other plugins should work git-svn-id: file:///beryl/trunk@4005 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/neg.c')
-rw-r--r--beryl-plugins/src/neg.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/beryl-plugins/src/neg.c b/beryl-plugins/src/neg.c
index f0f4a50..2b06b1f 100644
--- a/beryl-plugins/src/neg.c
+++ b/beryl-plugins/src/neg.c
@@ -254,8 +254,7 @@ getNegFragmentFunction (CompScreen *s, CompTexture *texture, Bool alpha)
static void
NEGDrawWindowTexture(CompWindow * w,
CompTexture * texture,
- const WindowPaintAttrib * attrib,
- const FragmentAttrib *fAttrib,
+ const FragmentAttrib *attrib,
unsigned int mask)
{
int filter;
@@ -270,7 +269,7 @@ NEGDrawWindowTexture(CompWindow * w,
{
if (w->screen->fragmentProgram)
{
- FragmentAttrib fa = *fAttrib;
+ FragmentAttrib fa = *attrib;
int function;
function = getNegFragmentFunction (w->screen, texture, w->alpha);
if (function)
@@ -278,37 +277,27 @@ NEGDrawWindowTexture(CompWindow * w,
addFragmentFunction (&fa, function);
}
UNWRAP(ns, w->screen, drawWindowTexture);
- (*w->screen->drawWindowTexture) (w, texture, attrib, &fa, mask);
+ (*w->screen->drawWindowTexture) (w, texture, &fa, mask);
WRAP(ns, w->screen, drawWindowTexture, NEGDrawWindowTexture);
}
else
{
/* this is for the most part taken from paint.c */
- /* push the current matrix */
- glPushMatrix();
-
- /* we need this to handle windows that are not regular, like during scale */
if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
{
- glTranslatef(w->attrib.x, w->attrib.y, 0.0f);
- glScalef(attrib->xScale, attrib->yScale, 0.0f);
- glTranslatef(attrib->xTranslate / attrib->xScale -
- w->attrib.x,
- attrib->yTranslate / attrib->yScale -
- w->attrib.y, 0.0f);
-
- filter = w->screen->filter[WINDOW_TRANS_FILTER];
+ filter = w->screen->filter[WINDOW_TRANS_FILTER];
}
else if (mask & PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK)
{
- filter = w->screen->filter[SCREEN_TRANS_FILTER];
+ filter = w->screen->filter[SCREEN_TRANS_FILTER];
}
else
{
- filter = w->screen->filter[NOTHING_TRANS_FILTER];
+ filter = w->screen->filter[NOTHING_TRANS_FILTER];
}
+
/* if we can addjust saturation, even if it's just on and off */
if (w->screen->canDoSaturated && attrib->saturation != COLOR)
{
@@ -570,15 +559,13 @@ NEGDrawWindowTexture(CompWindow * w,
/* set the screens texture mode back to replace */
screenTexEnvMode(w->screen, GL_REPLACE);
}
- /* pop previous matrix */
- glPopMatrix();
}
}
else
{
/* not negative */
UNWRAP(ns, w->screen, drawWindowTexture);
- (*w->screen->drawWindowTexture) (w, texture, attrib, fAttrib, mask);
+ (*w->screen->drawWindowTexture) (w, texture, attrib, mask);
WRAP(ns, w->screen, drawWindowTexture, NEGDrawWindowTexture);
}
}