summaryrefslogtreecommitdiff
path: root/exa/exa_migration.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-04-29 23:45:48 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-04-29 23:45:48 +0200
commite869573b52fac69fb88cea120daaeec59c7a3461 (patch)
tree6ac6c0dd0678c9514811c2c8e97aafc63b55606f /exa/exa_migration.c
parentd3f8667341bfe6dc7d0258c4ad69377f37d88d95 (diff)
EXA: exaAssertNotDirty improvements.
* Return early if the valid region is empty or the pixmap is pinned. * Fix loop for several cliprects.
Diffstat (limited to 'exa/exa_migration.c')
-rw-r--r--exa/exa_migration.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index eedc5fd03..70d8e1235 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -464,12 +464,10 @@ exaAssertNotDirty (PixmapPtr pPixmap)
BoxPtr pBox = REGION_RECTS(pValidReg);
Bool ret = TRUE;
- if (pExaPixmap == NULL || pExaPixmap->fb_ptr == NULL)
+ if (!nbox || exaPixmapIsPinned(pPixmap) || pExaPixmap->fb_ptr == NULL)
return ret;
- dst = pExaPixmap->sys_ptr;
dst_pitch = pExaPixmap->sys_pitch;
- src = pExaPixmap->fb_ptr;
src_pitch = pExaPixmap->fb_pitch;
cpp = pPixmap->drawable.bitsPerPixel / 8;
@@ -486,21 +484,18 @@ exaAssertNotDirty (PixmapPtr pPixmap)
continue;
rowbytes = (pBox->x2 - pBox->x1) * cpp;
- src += pBox->y1 * src_pitch + pBox->x1 * cpp;
- dst += pBox->y1 * dst_pitch + pBox->x1 * cpp;
+ src = pExaPixmap->fb_ptr + pBox->y1 * src_pitch + pBox->x1 * cpp;
+ dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp;
- for (y = pBox->y2 - pBox->y1; y; y--) {
- if (memcmp(dst + pBox->y1 * dst_pitch + pBox->x1 * cpp,
- src + pBox->y1 * src_pitch + pBox->x1 * cpp,
- (pBox->x2 - pBox->x1) * cpp) != 0) {
+ for (y = pBox->y1; y < pBox->y2;
+ y++, src += src_pitch, dst += dst_pitch) {
+ if (memcmp(dst, src, rowbytes) != 0) {
ret = FALSE;
+ exaPixmapDirty(pPixmap, pBox->x1, pBox->y1, pBox->x2,
+ pBox->y2);
break;
}
- src += src_pitch;
- dst += dst_pitch;
}
- src -= pBox->y1 * src_pitch + pBox->x1 * cpp;
- dst -= pBox->y1 * dst_pitch + pBox->x1 * cpp;
}
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);