exa: Fix the broken upload fallback for "mixed"
- Replace it with something wfb friendly while i'm at it.
This commit is contained in:
parent
c029678bf7
commit
a73f95aa93
|
@ -32,32 +32,37 @@
|
||||||
#include "exa.h"
|
#include "exa.h"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
exaUploadFallback(PixmapPtr pPixmap, CARD8 *src, int src_pitch,
|
exaUploadFallback(PixmapPtr pPixmap, CARD8 *src, int src_pitch)
|
||||||
CARD8 *dst, int dst_pitch)
|
|
||||||
{
|
{
|
||||||
ExaPixmapPriv(pPixmap);
|
ExaPixmapPriv(pPixmap);
|
||||||
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
|
RegionPtr damage = DamageRegion (pExaPixmap->pDamage);
|
||||||
int i, cpp = pPixmap->drawable.bitsPerPixel / 8;
|
GCPtr pGC = GetScratchGC (pPixmap->drawable.depth,
|
||||||
int bytes, nbox;
|
pPixmap->drawable.pScreen);
|
||||||
|
int nbox, cpp = pPixmap->drawable.bitsPerPixel / 8;
|
||||||
|
DamagePtr backup = pExaPixmap->pDamage;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
|
CARD8 *src2;
|
||||||
|
|
||||||
|
/* We don't want damage optimisations. */
|
||||||
|
pExaPixmap->pDamage = NULL;
|
||||||
|
ValidateGC (&pPixmap->drawable, pGC);
|
||||||
|
|
||||||
pbox = REGION_RECTS(damage);
|
pbox = REGION_RECTS(damage);
|
||||||
nbox = REGION_NUM_RECTS(damage);
|
nbox = REGION_NUM_RECTS(damage);
|
||||||
|
|
||||||
while (nbox--) {
|
while (nbox--) {
|
||||||
bytes = (pbox->x2 - pbox->x1) * cpp;
|
src2 = src + pbox->y1 * src_pitch + pbox->x1 * cpp;
|
||||||
|
|
||||||
src += pbox->y1 * src_pitch + pbox->x1 * cpp;
|
ExaCheckPutImage(&pPixmap->drawable, pGC,
|
||||||
dst += pbox->y1 * dst_pitch + pbox->x1 * cpp;
|
pPixmap->drawable.depth, pbox->x1, pbox->y1,
|
||||||
|
pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, 0,
|
||||||
for (i = pbox->y2 - pbox->y1; i; i--) {
|
ZPixmap, (char*) src2);
|
||||||
memcpy (dst, src, bytes);
|
|
||||||
src += src_pitch;
|
|
||||||
dst += dst_pitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FreeScratchGC (pGC);
|
||||||
|
pExaPixmap->pDamage = backup;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -131,10 +136,7 @@ exaCreateDriverPixmap_mixed(PixmapPtr pPixmap)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
fallback:
|
fallback:
|
||||||
ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST);
|
exaUploadFallback(pPixmap, sys_buffer, sys_pitch);
|
||||||
exaUploadFallback(pPixmap, sys_buffer, sys_pitch, pPixmap->devPrivate.ptr,
|
|
||||||
exaGetPixmapPitch(pPixmap));
|
|
||||||
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_DEST);
|
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
free(sys_buffer);
|
free(sys_buffer);
|
||||||
|
|
Loading…
Reference in New Issue