summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-04-04 12:11:14 -0700
committerAdam Jackson <ajax@redhat.com>2008-06-30 13:50:57 -0400
commit795d293d769aa93dddd457e8e200d62044a3921a (patch)
tree657d23da7e42c6c90c08c220c2d8d6d77af934a2
parent32cd2c510939498e94ae2aaec40fe48b2850a321 (diff)
Wrap AddTraps in exa and damage.
This fine (and unused) function wasn't ever wrapped which made it not work under exa. (cherry picked from commit 06e7e1d0486e8c516a9b3219a2c86026f88825fc)
-rw-r--r--exa/exa.c4
-rw-r--r--exa/exa_priv.h8
-rw-r--r--exa/exa_unaccel.c14
-rwxr-xr-xmiext/damage/damage.c53
-rwxr-xr-xmiext/damage/damagestr.h1
5 files changed, 80 insertions, 0 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 3a6ad988e..a35b17446 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -753,6 +753,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
if (ps) {
ps->Composite = pExaScr->SavedComposite;
ps->Trapezoids = pExaScr->SavedTrapezoids;
+ ps->AddTraps = pExaScr->SavedAddTraps;
}
#endif
@@ -919,6 +920,9 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->SavedTrapezoids = ps->Trapezoids;
ps->Trapezoids = exaTrapezoids;
+
+ pExaScr->SavedAddTraps = ps->AddTraps;
+ ps->AddTraps = ExaCheckAddTraps;
}
#endif
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 0138e4a7d..21e6f0b55 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -114,6 +114,7 @@ typedef struct {
TrianglesProcPtr SavedTriangles;
GlyphsProcPtr SavedGlyphs;
TrapezoidsProcPtr SavedTrapezoids;
+ AddTrapsProcPtr SavedAddTraps;
#endif
Bool swappedOut;
@@ -293,6 +294,13 @@ ExaCheckGetSpans (DrawablePtr pDrawable,
int nspans,
char *pdstStart);
+void
+ExaCheckAddTraps (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntrap,
+ xTrap *traps);
+
/* exa_accel.c */
static _X_INLINE Bool
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 8e19886a9..d7bd06cb2 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -350,6 +350,20 @@ ExaCheckComposite (CARD8 op,
REGION_UNINIT(pScreen, &region);
}
+void
+ExaCheckAddTraps (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntrap,
+ xTrap *traps)
+{
+ EXA_FALLBACK(("to pict %p (%c)\n",
+ exaDrawableLocation(pPicture->pDrawable)));
+ exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
+ fbAddTraps (pPicture, x_off, y_off, ntrap, traps);
+ exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
+}
+
/**
* Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps
* that happen to be 1x1. Pixmap must be at least 8bpp.
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 56864c56d..b9a15ee20 100755
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -655,6 +655,58 @@ damageGlyphs (CARD8 op,
damageReportPostOp (pDst->pDrawable);
wrap (pScrPriv, ps, Glyphs, damageGlyphs);
}
+
+static void
+damageAddTraps (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntrap,
+ xTrap *traps)
+{
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ damageScrPriv(pScreen);
+
+ if (checkPictureDamage (pPicture))
+ {
+ BoxRec box;
+ int i;
+ int x, y;
+ xTrap *t = traps;
+
+ box.x1 = 32767;
+ box.y1 = 32767;
+ box.x2 = -32767;
+ box.y2 = -32767;
+ x = pPicture->pDrawable->x + x_off;
+ y = pPicture->pDrawable->y + y_off;
+ for (i = 0; i < ntrap; i++)
+ {
+ pixman_fixed_t l = min (t->top.l, t->bot.l);
+ pixman_fixed_t r = max (t->top.r, t->bot.r);
+ int x1 = x + pixman_fixed_to_int (l);
+ int x2 = x + pixman_fixed_to_int (pixman_fixed_ceil (r));
+ int y1 = y + pixman_fixed_to_int (t->top.y);
+ int y2 = y + pixman_fixed_to_int (pixman_fixed_ceil (t->bot.y));
+
+ if (x1 < box.x1)
+ box.x1 = x1;
+ if (x2 > box.x2)
+ box.x2 = x2;
+ if (y1 < box.y1)
+ box.y1 = y1;
+ if (y2 > box.y2)
+ box.y2 = y2;
+ }
+ TRIM_PICTURE_BOX (box, pPicture);
+ if (BOX_NOT_EMPTY(box))
+ damageDamageBox (pPicture->pDrawable, &box, pPicture->subWindowMode);
+ }
+ unwrap (pScrPriv, ps, AddTraps);
+ (*ps->AddTraps) (pPicture, x_off, y_off, ntrap, traps);
+ damageReportPostOp (pPicture->pDrawable);
+ wrap (pScrPriv, ps, AddTraps, damageAddTraps);
+}
#endif
/**********************************************************/
@@ -1767,6 +1819,7 @@ DamageSetup (ScreenPtr pScreen)
if (ps) {
wrap (pScrPriv, ps, Glyphs, damageGlyphs);
wrap (pScrPriv, ps, Composite, damageComposite);
+ wrap (pScrPriv, ps, AddTraps, damageAddTraps);
}
#endif
diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h
index 2f6d53844..7ee40ce23 100755
--- a/miext/damage/damagestr.h
+++ b/miext/damage/damagestr.h
@@ -70,6 +70,7 @@ typedef struct _damageScrPriv {
#ifdef RENDER
CompositeProcPtr Composite;
GlyphsProcPtr Glyphs;
+ AddTrapsProcPtr AddTraps;
#endif
} DamageScrPrivRec, *DamageScrPrivPtr;