summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@beryl-project.org>2007-04-26 19:38:25 +0200
committerDennis Kasprzyk <onestone@beryl-project.org>2007-04-26 19:38:25 +0200
commitba746a6e3a28f2d55d25bdf4a1801c5612273ae2 (patch)
treec902fd9f8af078ad47f49de47dfce6a5ae94083e
parentf83e0e7a5be493ec010bfabe599dcb9e0fabcd1e (diff)
downloadberyl-premerge-ba746a6e3a28f2d55d25bdf4a1801c5612273ae2.tar.gz
beryl-premerge-ba746a6e3a28f2d55d25bdf4a1801c5612273ae2.tar.bz2
fixed some wall multiscreen issues and improved moving performance
-rw-r--r--src/wall.c77
1 files changed, 48 insertions, 29 deletions
diff --git a/src/wall.c b/src/wall.c
index e1689e0..d14ee24 100644
--- a/src/wall.c
+++ b/src/wall.c
@@ -1646,7 +1646,7 @@ static Bool wallPaintScreen(CompScreen * s,
ws->mSAttribs.brightness = 0.4f * BRIGHT;
ws->mSAttribs.saturation = COLOR;
- if (i == origVX - ws->destx && j == origVY - ws->desty &&
+ if (i == origVX && j == origVY &&
ws->moving)
{
ws->mSAttribs.brightness = BRIGHT;
@@ -1683,12 +1683,12 @@ static void wallGetDistanceForAnimation(CompScreen *s, double left, int output,
float dx = (tx - 1.4422495) * (tx - 1.4422495) / 2;
dx = 1 - dx;
- dx *= s->width / (float)s->outputDev[output].width;
+ //dx *= s->width / (float)s->outputDev[output].width;
dx *= ws->destx;
float dy = (tx - 1.4422495) * (tx - 1.4422495) / 2;
dy = 1 - dy;
- dy *= (s->height) / (float)s->outputDev[output].height;
+ //dy *= (s->height) / (float)s->outputDev[output].height;
dy *= ws->desty;
if (rdx)
@@ -1822,7 +1822,8 @@ static void wallPaintTransformedScreen(CompScreen * s,
if (ws->expoCam > 0)
mask |= PAINT_SCREEN_CLEAR_MASK;
- (*s->paintTransformedScreen) (s, sAttrib, &sTransform, region, output, mask);
+ if (!ws->moving)
+ (*s->paintTransformedScreen) (s, sAttrib, &sTransform, region, output, mask);
mask &= ~PAINT_SCREEN_CLEAR_MASK;
@@ -2024,40 +2025,58 @@ static void wallPaintTransformedScreen(CompScreen * s,
clearTargetOutput(s->display, GL_COLOR_BUFFER_BIT);
- int i, j;
- float dx, dy;
-
- wallGetDistanceForAnimation(s, left, output, &dx, &dy);
- matrixTranslate(&sTransform, -ws->destx, ws->desty,0);
- matrixTranslate(&sTransform, dx, -dy, 0);
+ float dx, dy, px, py;
+ int tx, ty;
- for (i = -abs(ws->destx); i < s->hsize; i++) // TODO: Add a slight bit of intelligence to not be so ineffecient
- {
- for (j = -abs(ws->desty); j < s->vsize; j++)
- {
+ float mx = (s->width / (float)s->outputDev[output].width);
+ float my = (s->height / (float)s->outputDev[output].height);
- matrixTranslate(&sTransform, i *
- (s->width / (float)s->outputDev[output].width),
- j * (s->height /
- (float)s->outputDev[output].height), 0);
- moveScreenViewport(s, -i, j, FALSE);
- (*s->paintTransformedScreen) (s,
- sAttrib, &sTransform,
- &s->region, output, mask);
+ wallGetDistanceForAnimation(s, left, output, &dx, &dy);
+ ScreenPaintAttrib sA = *sAttrib;
- matrixTranslate(&sTransform, -i *
- (s->width / (float)s->outputDev[output].width),
- -j * (s->height /
- (float)s->outputDev[output].height), 0);
- moveScreenViewport(s, i, -j, FALSE);
- }
+ px = origx + ws->destx - dx;
+ py = origy + ws->desty - dy;
+
+ if (floor(py) != ceil(py))
+ {
+ ty = ceil(py) - s->y;
+ sA.yTranslate = (fmod(py,1) - 1) * my;
+ if (floor(px) != ceil(px))
+ {
+ tx = ceil(px) - s->x;
+ moveScreenViewport(s, -tx, -ty, FALSE);
+ sA.xTranslate = (1-fmod(px,1)) * mx;
+ (*s->paintTransformedScreen) (s, &sA, &sTransform,
+ &s->region, output, mask);
+ }
+ tx = floor(px) - s->x;
+ moveScreenViewport(s, - tx, -ty, FALSE);
+ sA.xTranslate = (-fmod(px,1)) * mx;
+ (*s->paintTransformedScreen) (s, &sA, &sTransform,
+ &s->region, output, mask);
}
+
+ ty = floor(py) - s->y;
+ sA.yTranslate = (fmod(py,1)) * my;
+ if (floor(px) != ceil(px))
+ {
+ tx = ceil(px) - s->x;
+ moveScreenViewport(s, -tx, -ty, FALSE);
+ sA.xTranslate = (1-fmod(px,1)) * mx;
+ (*s->paintTransformedScreen) (s, &sA, &sTransform,
+ &s->region, output, mask);
+ }
+ tx = floor(px) - s->x;
+ moveScreenViewport(s, - tx, -ty, FALSE);
+ sA.xTranslate = (-fmod(px,1)) * mx;
+ (*s->paintTransformedScreen) (s, &sA, &sTransform,
+ &s->region, output, mask);
-
+
while (s->x != origx)
moveScreenViewport(s, -1, 0, FALSE);
while (s->y != origy)