|
|
05d2ce0 |
diff --git a/exa/exa.c b/exa/exa.c
|
|
|
05d2ce0 |
index e9f42df..8e22b89 100644
|
|
|
05d2ce0 |
--- a/exa/exa.c
|
|
|
05d2ce0 |
+++ b/exa/exa.c
|
|
|
05d2ce0 |
@@ -126,7 +126,7 @@ exaGetDrawablePixmap(DrawablePtr pDrawable)
|
|
|
05d2ce0 |
* the backing drawable. These coordinates are nonzero only for redirected
|
|
|
05d2ce0 |
* windows.
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
-static void
|
|
|
05d2ce0 |
+void
|
|
|
05d2ce0 |
exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
|
|
|
05d2ce0 |
int *xp, int *yp)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -172,29 +172,6 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
|
|
|
05d2ce0 |
REGION_UNINIT(pScreen, ®ion);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
-/**
|
|
|
05d2ce0 |
- * exaDrawableDirty() marks a pixmap backing a drawable as dirty, allowing for
|
|
|
05d2ce0 |
- * optimizations in pixmap migration when no changes have occurred.
|
|
|
05d2ce0 |
- */
|
|
|
05d2ce0 |
-void
|
|
|
05d2ce0 |
-exaDrawableDirty (DrawablePtr pDrawable, int x1, int y1, int x2, int y2)
|
|
|
05d2ce0 |
-{
|
|
|
05d2ce0 |
- PixmapPtr pPix = exaGetDrawablePixmap(pDrawable);
|
|
|
05d2ce0 |
- int xoff, yoff;
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- x1 = max(x1, pDrawable->x);
|
|
|
05d2ce0 |
- y1 = max(y1, pDrawable->y);
|
|
|
05d2ce0 |
- x2 = min(x2, pDrawable->x + pDrawable->width);
|
|
|
05d2ce0 |
- y2 = min(y2, pDrawable->y + pDrawable->height);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- if (x1 >= x2 || y1 >= y2)
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
|
|
05d2ce0 |
-}
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
static Bool
|
|
|
05d2ce0 |
exaDestroyPixmap (PixmapPtr pPixmap)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -322,6 +299,9 @@ exaPixmapIsOffscreen(PixmapPtr p)
|
|
|
05d2ce0 |
if (p->devPrivate.ptr == NULL)
|
|
|
05d2ce0 |
return TRUE;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ if (pExaScr->info->PixmapIsOffscreen)
|
|
|
05d2ce0 |
+ return pExaScr->info->PixmapIsOffscreen(p);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
return ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
|
|
|
05d2ce0 |
(CARD8 *) pExaScr->info->memoryBase) <
|
|
|
05d2ce0 |
pExaScr->info->memorySize);
|
|
|
05d2ce0 |
@@ -589,6 +569,45 @@ exaDriverInit (ScreenPtr pScreen,
|
|
|
05d2ce0 |
PictureScreenPtr ps;
|
|
|
05d2ce0 |
#endif
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ if (!pScreenInfo)
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!pScreenInfo->memoryBase) {
|
|
|
05d2ce0 |
+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memoryBase must be "
|
|
|
05d2ce0 |
+ "non-zero\n", pScreen->myNum);
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!pScreenInfo->memorySize) {
|
|
|
05d2ce0 |
+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::memorySize must be "
|
|
|
05d2ce0 |
+ "non-zero\n", pScreen->myNum);
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (pScreenInfo->offScreenBase > pScreenInfo->memorySize) {
|
|
|
05d2ce0 |
+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::offScreenBase must be <= "
|
|
|
05d2ce0 |
+ "ExaDriverRec::memorySize\n", pScreen->myNum);
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!pScreenInfo->PrepareSolid) {
|
|
|
05d2ce0 |
+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::PrepareSolid must be "
|
|
|
05d2ce0 |
+ "non-NULL\n", pScreen->myNum);
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!pScreenInfo->PrepareCopy) {
|
|
|
05d2ce0 |
+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::PrepareCopy must be "
|
|
|
05d2ce0 |
+ "non-NULL\n", pScreen->myNum);
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!pScreenInfo->WaitMarker) {
|
|
|
05d2ce0 |
+ LogMessage(X_ERROR, "EXA(%d): ExaDriverRec::WaitMarker must be "
|
|
|
05d2ce0 |
+ "non-NULL\n", pScreen->myNum);
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
if (pScreenInfo->exa_major != EXA_VERSION_MAJOR ||
|
|
|
05d2ce0 |
pScreenInfo->exa_minor > EXA_VERSION_MINOR)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -668,10 +687,6 @@ exaDriverInit (ScreenPtr pScreen,
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
#endif
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
-#ifdef COMPOSITE
|
|
|
05d2ce0 |
- miDisableCompositeWrapper(pScreen);
|
|
|
05d2ce0 |
-#endif
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
#ifdef MITSHM
|
|
|
05d2ce0 |
/* Re-register with the MI funcs, which don't allow shared pixmaps.
|
|
|
05d2ce0 |
* Shared pixmaps are almost always a performance loss for us, but this
|
|
|
05d2ce0 |
diff --git a/exa/exa.h b/exa/exa.h
|
|
|
05d2ce0 |
index bf723f7..9ea5933 100644
|
|
|
05d2ce0 |
--- a/exa/exa.h
|
|
|
05d2ce0 |
+++ b/exa/exa.h
|
|
|
05d2ce0 |
@@ -39,7 +39,7 @@
|
|
|
05d2ce0 |
#include "fb.h"
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
#define EXA_VERSION_MAJOR 2
|
|
|
05d2ce0 |
-#define EXA_VERSION_MINOR 1
|
|
|
05d2ce0 |
+#define EXA_VERSION_MINOR 2
|
|
|
05d2ce0 |
#define EXA_VERSION_RELEASE 0
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
|
|
05d2ce0 |
@@ -229,7 +229,7 @@ typedef struct _ExaDriver {
|
|
|
05d2ce0 |
* @{
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
/**
|
|
|
05d2ce0 |
- * PrepareCopy() sets up the driver for doing a copy within offscreen
|
|
|
05d2ce0 |
+ * PrepareCopy() sets up the driver for doing a copy within video
|
|
|
05d2ce0 |
* memory.
|
|
|
05d2ce0 |
*
|
|
|
05d2ce0 |
* @param pSrcPixmap source pixmap
|
|
|
05d2ce0 |
@@ -636,6 +636,23 @@ typedef struct _ExaDriver {
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
void (*FinishAccess)(PixmapPtr pPix, int index);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ /**
|
|
|
05d2ce0 |
+ * PixmapIsOffscreen() is an optional driver replacement to
|
|
|
05d2ce0 |
+ * exaPixmapIsOffscreen(). Set to NULL if you want the standard behaviour
|
|
|
05d2ce0 |
+ * of exaPixmapIsOffscreen().
|
|
|
05d2ce0 |
+ *
|
|
|
05d2ce0 |
+ * @param pPix the pixmap
|
|
|
05d2ce0 |
+ * @return TRUE if the given drawable is in framebuffer memory.
|
|
|
05d2ce0 |
+ *
|
|
|
05d2ce0 |
+ * exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen
|
|
|
05d2ce0 |
+ * memory, meaning that acceleration could probably be done to it, and that it
|
|
|
05d2ce0 |
+ * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it
|
|
|
05d2ce0 |
+ * with the CPU.
|
|
|
05d2ce0 |
+ *
|
|
|
05d2ce0 |
+ *
|
|
|
05d2ce0 |
+ */
|
|
|
05d2ce0 |
+ Bool (*PixmapIsOffscreen)(PixmapPtr pPix);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
/** @name PrepareAccess() and FinishAccess() indices
|
|
|
05d2ce0 |
* @{
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
@@ -704,6 +721,9 @@ exaOffscreenAlloc(ScreenPtr pScreen, int size, int align,
|
|
|
05d2ce0 |
ExaOffscreenArea *
|
|
|
05d2ce0 |
exaOffscreenFree(ScreenPtr pScreen, ExaOffscreenArea *area);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+void
|
|
|
05d2ce0 |
+ExaOffscreenMarkUsed (PixmapPtr pPixmap);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
unsigned long
|
|
|
05d2ce0 |
exaGetPixmapOffset(PixmapPtr pPix);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
|
|
|
05d2ce0 |
index e633d80..cc383cc 100644
|
|
|
05d2ce0 |
--- a/exa/exa_accel.c
|
|
|
05d2ce0 |
+++ b/exa/exa_accel.c
|
|
|
05d2ce0 |
@@ -74,6 +74,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|
|
05d2ce0 |
pGC->planemask,
|
|
|
05d2ce0 |
pGC->fgPixel))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted);
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
@@ -109,8 +110,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pPixmap,
|
|
|
05d2ce0 |
fullX1 + off_x, fullY1 + off_y,
|
|
|
05d2ce0 |
fullX2 + off_x, fullY1 + 1 + off_y);
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, fullX1 + off_x, fullY1 + off_y,
|
|
|
05d2ce0 |
- fullX2 + off_x, fullY1 + 1 + off_y);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
else
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -129,8 +128,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pPixmap,
|
|
|
05d2ce0 |
partX1 + off_x, fullY1 + off_y,
|
|
|
05d2ce0 |
partX2 + off_x, fullY1 + 1 + off_y);
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, partX1 + off_x, fullY1 + off_y,
|
|
|
05d2ce0 |
- partX2 + off_x, fullY1 + 1 + off_y);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
pbox++;
|
|
|
05d2ce0 |
@@ -154,8 +151,9 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
|
|
05d2ce0 |
int xoff, yoff;
|
|
|
05d2ce0 |
int src_stride, bpp = pDrawable->bitsPerPixel;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (pExaScr->swappedOut || pExaScr->info->UploadToScreen == NULL)
|
|
|
05d2ce0 |
- goto migrate_and_fallback;
|
|
|
05d2ce0 |
+ pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[0].as_src = FALSE;
|
|
|
05d2ce0 |
+ pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* Don't bother with under 8bpp, XYPixmaps. */
|
|
|
05d2ce0 |
if (format != ZPixmap || bpp < 8)
|
|
|
05d2ce0 |
@@ -165,10 +163,14 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
|
|
05d2ce0 |
if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy)
|
|
|
05d2ce0 |
goto migrate_and_fallback;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
- pixmaps[0].as_src = FALSE;
|
|
|
05d2ce0 |
- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
|
05d2ce0 |
+ if (pExaScr->swappedOut)
|
|
|
05d2ce0 |
+ goto fallback;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (pExaScr->info->UploadToScreen == NULL)
|
|
|
05d2ce0 |
+ goto fallback;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
if (pPix == NULL)
|
|
|
05d2ce0 |
@@ -221,25 +223,23 @@ exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
fbBltStip((FbStip *)bits + (y1 - y) * (src_stride / sizeof(FbStip)),
|
|
|
05d2ce0 |
src_stride / sizeof(FbStip),
|
|
|
05d2ce0 |
- (x1 - x) * bpp,
|
|
|
05d2ce0 |
- dst + (y1 + yoff) * dst_stride,
|
|
|
05d2ce0 |
+ (x1 - x) * dstBpp,
|
|
|
05d2ce0 |
+ dst + (y1 + dstYoff) * dst_stride,
|
|
|
05d2ce0 |
dst_stride,
|
|
|
05d2ce0 |
- (x1 + xoff) * bpp,
|
|
|
05d2ce0 |
- (x2 - x1) * bpp,
|
|
|
05d2ce0 |
+ (x1 + dstXoff) * dstBpp,
|
|
|
05d2ce0 |
+ (x2 - x1) * dstBpp,
|
|
|
05d2ce0 |
y2 - y1,
|
|
|
05d2ce0 |
- GXcopy, FB_ALLONES, bpp);
|
|
|
05d2ce0 |
+ GXcopy, FB_ALLONES, dstBpp);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
exaFinishAccess(pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
exaPixmapDirty(pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
migrate_and_fallback:
|
|
|
05d2ce0 |
- pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
- pixmaps[0].as_src = FALSE;
|
|
|
05d2ce0 |
- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
fallback:
|
|
|
05d2ce0 |
@@ -387,6 +387,7 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|
|
05d2ce0 |
int src_off_x, src_off_y;
|
|
|
05d2ce0 |
int dst_off_x, dst_off_y;
|
|
|
05d2ce0 |
ExaMigrationRec pixmaps[2];
|
|
|
05d2ce0 |
+ Bool fallback = FALSE;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = FALSE;
|
|
|
05d2ce0 |
@@ -404,62 +405,64 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
|
|
|
05d2ce0 |
pDstPixmap->drawable.width > pExaScr->info->maxX ||
|
|
|
05d2ce0 |
pDstPixmap->drawable.height > pExaScr->info->maxY)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 2, FALSE);
|
|
|
05d2ce0 |
- goto fallback;
|
|
|
05d2ce0 |
+ fallback = TRUE;
|
|
|
05d2ce0 |
} else {
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 2, TRUE);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* Mixed directions must be handled specially if the card is lame */
|
|
|
05d2ce0 |
- if (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS &&
|
|
|
05d2ce0 |
+ if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) &&
|
|
|
05d2ce0 |
reverse != upsidedown) {
|
|
|
05d2ce0 |
- if (!exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox,
|
|
|
05d2ce0 |
+ if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox,
|
|
|
05d2ce0 |
dx, dy))
|
|
|
05d2ce0 |
- goto fallback;
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ return;
|
|
|
05d2ce0 |
+ fallback = TRUE;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable);
|
|
|
05d2ce0 |
+ pDstPixmap = exaGetDrawablePixmap (pDstDrawable);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (fallback || !exaPixmapIsOffscreen(pSrcPixmap) ||
|
|
|
05d2ce0 |
+ !exaPixmapIsOffscreen(pDstPixmap) ||
|
|
|
05d2ce0 |
+ !(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1,
|
|
|
05d2ce0 |
+ upsidedown ? -1 : 1,
|
|
|
05d2ce0 |
+ pGC ? pGC->alu : GXcopy,
|
|
|
05d2ce0 |
+ pGC ? pGC->planemask : FB_ALLONES)) {
|
|
|
05d2ce0 |
+ fallback = TRUE;
|
|
|
05d2ce0 |
+ EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable,
|
|
|
05d2ce0 |
+ exaDrawableLocation(pSrcDrawable),
|
|
|
05d2ce0 |
+ exaDrawableLocation(pDstDrawable)));
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 2, FALSE);
|
|
|
05d2ce0 |
+ exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
+ exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
+ fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
|
05d2ce0 |
+ pbox, nbox, dx, dy, reverse, upsidedown,
|
|
|
05d2ce0 |
+ bitplane, closure);
|
|
|
05d2ce0 |
+ exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
+ exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if ((pSrcPixmap = exaGetOffscreenPixmap (pSrcDrawable, &src_off_x, &src_off_y)) &&
|
|
|
05d2ce0 |
- (pDstPixmap = exaGetOffscreenPixmap (pDstDrawable, &dst_off_x, &dst_off_y)) &&
|
|
|
05d2ce0 |
- (*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap,
|
|
|
05d2ce0 |
- reverse ? -1 : 1, upsidedown ? -1 : 1,
|
|
|
05d2ce0 |
- pGC ? pGC->alu : GXcopy,
|
|
|
05d2ce0 |
- pGC ? pGC->planemask : FB_ALLONES))
|
|
|
05d2ce0 |
+ while (nbox--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- while (nbox--)
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
+ if (!fallback)
|
|
|
05d2ce0 |
(*pExaScr->info->Copy) (pDstPixmap,
|
|
|
05d2ce0 |
pbox->x1 + dx + src_off_x,
|
|
|
05d2ce0 |
pbox->y1 + dy + src_off_y,
|
|
|
05d2ce0 |
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
- pbox->x2 - pbox->x1,
|
|
|
05d2ce0 |
- pbox->y2 - pbox->y1);
|
|
|
05d2ce0 |
- exaPixmapDirty (pDstPixmap,
|
|
|
05d2ce0 |
- pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
- pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
|
05d2ce0 |
- pbox++;
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
- (*pExaScr->info->DoneCopy) (pDstPixmap);
|
|
|
05d2ce0 |
- exaMarkSync(pDstDrawable->pScreen);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
-fallback:
|
|
|
05d2ce0 |
- EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable,
|
|
|
05d2ce0 |
- exaDrawableLocation(pSrcDrawable),
|
|
|
05d2ce0 |
- exaDrawableLocation(pDstDrawable)));
|
|
|
05d2ce0 |
- exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
- exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
- fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC,
|
|
|
05d2ce0 |
- pbox, nbox, dx, dy, reverse, upsidedown,
|
|
|
05d2ce0 |
- bitplane, closure);
|
|
|
05d2ce0 |
- exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
- exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
- while (nbox--)
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- exaDrawableDirty (pDstDrawable, pbox->x1, pbox->y1, pbox->x2, pbox->y2);
|
|
|
05d2ce0 |
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
|
|
|
05d2ce0 |
+ exaPixmapDirty (pDstPixmap, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
+ pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
|
05d2ce0 |
pbox++;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (fallback)
|
|
|
05d2ce0 |
+ return;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ (*pExaScr->info->DoneCopy) (pDstPixmap);
|
|
|
05d2ce0 |
+ exaMarkSync (pDstDrawable->pScreen);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
RegionPtr
|
|
|
05d2ce0 |
@@ -618,6 +621,9 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
|
|
|
05d2ce0 |
DEALLOCATE_LOCAL(prect);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion,
|
|
|
05d2ce0 |
+ Pixel pixel, CARD32 planemask, CARD32 alu);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
static void
|
|
|
05d2ce0 |
exaPolyFillRect(DrawablePtr pDrawable,
|
|
|
05d2ce0 |
GCPtr pGC,
|
|
|
05d2ce0 |
@@ -626,7 +632,7 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
ExaScreenPriv (pDrawable->pScreen);
|
|
|
05d2ce0 |
RegionPtr pClip = fbGetCompositeClip(pGC);
|
|
|
05d2ce0 |
- PixmapPtr pPixmap;
|
|
|
05d2ce0 |
+ PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
|
|
05d2ce0 |
register BoxPtr pbox;
|
|
|
05d2ce0 |
BoxPtr pextent;
|
|
|
05d2ce0 |
int extentX1, extentX2, extentY1, extentY2;
|
|
|
05d2ce0 |
@@ -635,40 +641,73 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|
|
05d2ce0 |
int xoff, yoff;
|
|
|
05d2ce0 |
int xorg, yorg;
|
|
|
05d2ce0 |
int n;
|
|
|
05d2ce0 |
- ExaMigrationRec pixmaps[1];
|
|
|
05d2ce0 |
+ ExaMigrationRec pixmaps[2];
|
|
|
05d2ce0 |
+ RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ /* Compute intersection of rects and clip region */
|
|
|
05d2ce0 |
+ REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
|
|
|
05d2ce0 |
+ REGION_INTERSECT(pScreen, pReg, pClip, pReg);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!REGION_NUM_RECTS(pReg)) {
|
|
|
05d2ce0 |
+ goto out;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = FALSE;
|
|
|
05d2ce0 |
- pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
|
|
|
05d2ce0 |
+ pixmaps[0].pPix = pPixmap;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
if (pExaScr->swappedOut ||
|
|
|
05d2ce0 |
- pGC->fillStyle != FillSolid ||
|
|
|
05d2ce0 |
pPixmap->drawable.width > pExaScr->info->maxX ||
|
|
|
05d2ce0 |
pPixmap->drawable.height > pExaScr->info->maxY)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
- ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect);
|
|
|
05d2ce0 |
- while (nrect-- >= 0) {
|
|
|
05d2ce0 |
- exaDrawableDirty(pDrawable,
|
|
|
05d2ce0 |
- pDrawable->x + prect->x,
|
|
|
05d2ce0 |
- pDrawable->y + prect->y,
|
|
|
05d2ce0 |
- pDrawable->x + prect->x + prect->width,
|
|
|
05d2ce0 |
- pDrawable->y + prect->y + prect->height);
|
|
|
05d2ce0 |
- prect++;
|
|
|
05d2ce0 |
+ goto fallback;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ /* For ROPs where overlaps don't matter, convert rectangles to region and
|
|
|
05d2ce0 |
+ * call exaFillRegion{Solid,Tiled}.
|
|
|
05d2ce0 |
+ */
|
|
|
05d2ce0 |
+ if ((pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) &&
|
|
|
05d2ce0 |
+ (pGC->alu == GXcopy || pGC->alu == GXclear || pGC->alu == GXnoop ||
|
|
|
05d2ce0 |
+ pGC->alu == GXcopyInverted || pGC->alu == GXset)) {
|
|
|
05d2ce0 |
+ if (((pGC->fillStyle == FillSolid || pGC->tileIsPixel) &&
|
|
|
05d2ce0 |
+ exaFillRegionSolid(pDrawable, pReg, pGC->fillStyle == FillSolid ?
|
|
|
05d2ce0 |
+ pGC->fgPixel : pGC->tile.pixel, pGC->planemask,
|
|
|
05d2ce0 |
+ pGC->alu)) ||
|
|
|
05d2ce0 |
+ (pGC->fillStyle == FillTiled && !pGC->tileIsPixel &&
|
|
|
05d2ce0 |
+ exaFillRegionTiled(pDrawable, pReg, pGC->tile.pixmap, &pGC->patOrg,
|
|
|
05d2ce0 |
+ pGC->planemask, pGC->alu))) {
|
|
|
05d2ce0 |
+ goto out;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
- } else {
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (!(pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) ||
|
|
|
05d2ce0 |
+ if (pGC->fillStyle != FillSolid &&
|
|
|
05d2ce0 |
+ !(pGC->tileIsPixel && pGC->fillStyle == FillTiled))
|
|
|
05d2ce0 |
+ {
|
|
|
05d2ce0 |
+ goto fallback;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!exaPixmapIsOffscreen (pPixmap) ||
|
|
|
05d2ce0 |
!(*pExaScr->info->PrepareSolid) (pPixmap,
|
|
|
05d2ce0 |
pGC->alu,
|
|
|
05d2ce0 |
pGC->planemask,
|
|
|
05d2ce0 |
pGC->fgPixel))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
+fallback:
|
|
|
05d2ce0 |
+ if (pGC->fillStyle == FillTiled && !pGC->tileIsPixel) {
|
|
|
05d2ce0 |
+ pixmaps[1].as_dst = FALSE;
|
|
|
05d2ce0 |
+ pixmaps[1].as_src = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[1].pPix = pGC->tile.pixmap;
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 2, FALSE);
|
|
|
05d2ce0 |
+ } else {
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ goto out;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
xorg = pDrawable->x;
|
|
|
05d2ce0 |
@@ -707,15 +746,14 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pPixmap,
|
|
|
05d2ce0 |
fullX1 + xoff, fullY1 + yoff,
|
|
|
05d2ce0 |
fullX2 + xoff, fullY2 + yoff);
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, fullX1 + xoff, fullY1 + yoff,
|
|
|
05d2ce0 |
- fullX2 + xoff, fullY2 + yoff);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
else
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
pbox = REGION_RECTS(pClip);
|
|
|
05d2ce0 |
/*
|
|
|
05d2ce0 |
* clip the rectangle to each box in the clip region
|
|
|
05d2ce0 |
- * this is logically equivalent to calling Intersect()
|
|
|
05d2ce0 |
+ * this is logically equivalent to calling Intersect(),
|
|
|
05d2ce0 |
+ * but rectangles may overlap each other here.
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
while(n--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -738,14 +776,15 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pPixmap,
|
|
|
05d2ce0 |
partX1 + xoff, partY1 + yoff,
|
|
|
05d2ce0 |
partX2 + xoff, partY2 + yoff);
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff,
|
|
|
05d2ce0 |
- partX2 + xoff, partY2 + yoff);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
(*pExaScr->info->DoneSolid) (pPixmap);
|
|
|
05d2ce0 |
exaMarkSync(pDrawable->pScreen);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+out:
|
|
|
05d2ce0 |
+ REGION_DESTROY(pScreen, pReg);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
static void
|
|
|
05d2ce0 |
@@ -775,20 +814,19 @@ exaSolidBoxClipped (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
pPixmap->drawable.width > pExaScr->info->maxX ||
|
|
|
05d2ce0 |
pPixmap->drawable.height > pExaScr->info->maxY)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
- goto fallback;
|
|
|
05d2ce0 |
+ fallback = TRUE;
|
|
|
05d2ce0 |
} else {
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas (pDrawable, pPixmap, &xoff, &yoff);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (!pPixmap ||
|
|
|
05d2ce0 |
+ if (fallback || !exaPixmapIsOffscreen(pPixmap) ||
|
|
|
05d2ce0 |
!(*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
-fallback:
|
|
|
05d2ce0 |
EXA_FALLBACK(("to %p (%c)\n", pDrawable,
|
|
|
05d2ce0 |
exaDrawableLocation(pDrawable)));
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
fallback = TRUE;
|
|
|
05d2ce0 |
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel);
|
|
|
05d2ce0 |
@@ -827,10 +865,10 @@ fallback:
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pPixmap,
|
|
|
05d2ce0 |
partX1 + xoff, partY1 + yoff,
|
|
|
05d2ce0 |
partX2 + xoff, partY2 + yoff);
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff,
|
|
|
05d2ce0 |
- partX2 + xoff, partY2 + yoff);
|
|
|
05d2ce0 |
- } else
|
|
|
05d2ce0 |
- exaDrawableDirty (pDrawable, partX1, partY1, partX2, partY2);
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, partX2 + xoff,
|
|
|
05d2ce0 |
+ partY2 + yoff);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
if (fallback)
|
|
|
05d2ce0 |
@@ -870,12 +908,36 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
int dstBpp;
|
|
|
05d2ce0 |
int dstXoff, dstYoff;
|
|
|
05d2ce0 |
FbBits depthMask;
|
|
|
05d2ce0 |
+ PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
|
|
05d2ce0 |
+ ExaMigrationRec pixmaps[1];
|
|
|
05d2ce0 |
+ int xBack, widthBack, yBack, heightBack;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ for (ppci = ppciInit, n = nglyph, widthBack = 0; n; n--)
|
|
|
05d2ce0 |
+ widthBack += (*ppci++)->metrics.characterWidth;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ xBack = x;
|
|
|
05d2ce0 |
+ if (widthBack < 0)
|
|
|
05d2ce0 |
+ {
|
|
|
05d2ce0 |
+ xBack += widthBack;
|
|
|
05d2ce0 |
+ widthBack = -widthBack;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+ yBack = y - FONTASCENT(pGC->font);
|
|
|
05d2ce0 |
+ heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (xBack >= pDrawable->width || yBack >= pDrawable->height ||
|
|
|
05d2ce0 |
+ (xBack + widthBack) <= 0 || (yBack + heightBack) <= 0)
|
|
|
05d2ce0 |
+ return;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[0].pPix = pPixmap;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
depthMask = FbFullMask(pDrawable->depth);
|
|
|
05d2ce0 |
if ((pGC->planemask & depthMask) != depthMask)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
+ exaDoMigration(pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ goto damage;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
glyph = NULL;
|
|
|
05d2ce0 |
switch (pDrawable->bitsPerPixel) {
|
|
|
05d2ce0 |
@@ -887,6 +949,8 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
x += pDrawable->x;
|
|
|
05d2ce0 |
y += pDrawable->y;
|
|
|
05d2ce0 |
+ xBack += pDrawable->x;
|
|
|
05d2ce0 |
+ yBack += pDrawable->y;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
if (TERMINALFONT (pGC->font) && !glyph)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -894,23 +958,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
else
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- int xBack, widthBack;
|
|
|
05d2ce0 |
- int yBack, heightBack;
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- ppci = ppciInit;
|
|
|
05d2ce0 |
- n = nglyph;
|
|
|
05d2ce0 |
- widthBack = 0;
|
|
|
05d2ce0 |
- while (n--)
|
|
|
05d2ce0 |
- widthBack += (*ppci++)->metrics.characterWidth;
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- xBack = x;
|
|
|
05d2ce0 |
- if (widthBack < 0)
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- xBack += widthBack;
|
|
|
05d2ce0 |
- widthBack = -widthBack;
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
- yBack = y - FONTASCENT(pGC->font);
|
|
|
05d2ce0 |
- heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
|
|
|
05d2ce0 |
exaSolidBoxClipped (pDrawable,
|
|
|
05d2ce0 |
fbGetCompositeClip(pGC),
|
|
|
05d2ce0 |
pGC->planemask,
|
|
|
05d2ce0 |
@@ -923,74 +970,50 @@ exaImageGlyphBlt (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
|
|
05d2ce0 |
+ exaDoMigration(pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
exaPrepareAccessGC (pGC);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- ppci = ppciInit;
|
|
|
05d2ce0 |
- while (nglyph--)
|
|
|
05d2ce0 |
+ for (ppci = ppciInit; nglyph; nglyph--, x += pci->metrics.characterWidth)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
pci = *ppci++;
|
|
|
05d2ce0 |
- pglyph = FONTGLYPHBITS(pglyphBase, pci);
|
|
|
05d2ce0 |
gWidth = GLYPHWIDTHPIXELS(pci);
|
|
|
05d2ce0 |
gHeight = GLYPHHEIGHTPIXELS(pci);
|
|
|
05d2ce0 |
- if (gWidth && gHeight)
|
|
|
05d2ce0 |
+ gx = x + pci->metrics.leftSideBearing;
|
|
|
05d2ce0 |
+ gy = y - pci->metrics.ascent;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!gWidth || !gHeight || (gx + gWidth) <= xBack ||
|
|
|
05d2ce0 |
+ (gy + gHeight) <= yBack || gx >= (xBack + widthBack) ||
|
|
|
05d2ce0 |
+ gy >= (yBack + heightBack))
|
|
|
05d2ce0 |
+ continue;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ pglyph = FONTGLYPHBITS(pglyphBase, pci);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (glyph && gWidth <= sizeof (FbStip) * 8 &&
|
|
|
05d2ce0 |
+ fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- gx = x + pci->metrics.leftSideBearing;
|
|
|
05d2ce0 |
- gy = y - pci->metrics.ascent;
|
|
|
05d2ce0 |
- if (glyph && gWidth <= sizeof (FbStip) * 8 &&
|
|
|
05d2ce0 |
- fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- (*glyph) (dst + (gy + dstYoff) * dstStride,
|
|
|
05d2ce0 |
- dstStride,
|
|
|
05d2ce0 |
- dstBpp,
|
|
|
05d2ce0 |
- (FbStip *) pglyph,
|
|
|
05d2ce0 |
- pPriv->fg,
|
|
|
05d2ce0 |
- gx + dstXoff,
|
|
|
05d2ce0 |
- gHeight);
|
|
|
05d2ce0 |
- exaDrawableDirty (pDrawable, gx, gy, gx + gWidth, gy + gHeight);
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
- else
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- RegionPtr pClip = fbGetCompositeClip(pGC);
|
|
|
05d2ce0 |
- int nbox;
|
|
|
05d2ce0 |
- BoxPtr pbox;
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
|
|
|
05d2ce0 |
- fbPutXYImage (pDrawable,
|
|
|
05d2ce0 |
- pClip,
|
|
|
05d2ce0 |
- pPriv->fg,
|
|
|
05d2ce0 |
- pPriv->bg,
|
|
|
05d2ce0 |
- pPriv->pm,
|
|
|
05d2ce0 |
- GXcopy,
|
|
|
05d2ce0 |
- opaque,
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- gx,
|
|
|
05d2ce0 |
- gy,
|
|
|
05d2ce0 |
- gWidth, gHeight,
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- (FbStip *) pglyph,
|
|
|
05d2ce0 |
- gStride,
|
|
|
05d2ce0 |
- 0);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip);
|
|
|
05d2ce0 |
- nbox--; pbox++) {
|
|
|
05d2ce0 |
- int x1 = max(gx, pbox->x1), x2 = min(gx + gWidth, pbox->x2);
|
|
|
05d2ce0 |
- int y1 = max(gy, pbox->y1), y2 = min(gy + gHeight, pbox->y2);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- if (x1 >= x2 || y1 >= y2)
|
|
|
05d2ce0 |
- continue;
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- exaDrawableDirty (pDrawable, gx, gy, gx + gWidth,
|
|
|
05d2ce0 |
- gy + gHeight);
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
+ (*glyph) (dst + (gy + dstYoff) * dstStride, dstStride, dstBpp,
|
|
|
05d2ce0 |
+ (FbStip *) pglyph, pPriv->fg, gx + dstXoff, gHeight);
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+ else
|
|
|
05d2ce0 |
+ {
|
|
|
05d2ce0 |
+ RegionPtr pClip = fbGetCompositeClip(pGC);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
|
|
|
05d2ce0 |
+ fbPutXYImage (pDrawable, pClip, pPriv->fg, pPriv->bg, pPriv->pm,
|
|
|
05d2ce0 |
+ GXcopy, opaque, gx, gy, gWidth, gHeight,
|
|
|
05d2ce0 |
+ (FbStip *) pglyph, gStride, 0);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- x += pci->metrics.characterWidth;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
exaFinishAccessGC (pGC);
|
|
|
05d2ce0 |
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+damage:
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDrawable, pPixmap, &dstXoff, &dstYoff);
|
|
|
05d2ce0 |
+ exaPixmapDirty(pPixmap, xBack + dstXoff, yBack + dstYoff,
|
|
|
05d2ce0 |
+ xBack + dstXoff + widthBack, yBack + dstYoff + heightBack);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
const GCOps exaOps = {
|
|
|
05d2ce0 |
@@ -1043,10 +1066,12 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
|
|
05d2ce0 |
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
-static void
|
|
|
05d2ce0 |
+static Bool
|
|
|
05d2ce0 |
exaFillRegionSolid (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
RegionPtr pRegion,
|
|
|
05d2ce0 |
- Pixel pixel)
|
|
|
05d2ce0 |
+ Pixel pixel,
|
|
|
05d2ce0 |
+ CARD32 planemask,
|
|
|
05d2ce0 |
+ CARD32 alu)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
ExaScreenPriv(pDrawable->pScreen);
|
|
|
05d2ce0 |
PixmapPtr pPixmap;
|
|
|
05d2ce0 |
@@ -1062,22 +1087,19 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
if (pPixmap->drawable.width > pExaScr->info->maxX ||
|
|
|
05d2ce0 |
pPixmap->drawable.height > pExaScr->info->maxY)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
goto fallback;
|
|
|
05d2ce0 |
} else {
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) &&
|
|
|
05d2ce0 |
- (*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, FB_ALLONES, pixel))
|
|
|
05d2ce0 |
+ (*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
while (nbox--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pPixmap,
|
|
|
05d2ce0 |
pBox->x1 + xoff, pBox->y1 + yoff,
|
|
|
05d2ce0 |
pBox->x2 + xoff, pBox->y2 + yoff);
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
|
|
05d2ce0 |
- pBox->x2 + xoff, pBox->y2 + yoff);
|
|
|
05d2ce0 |
pBox++;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
(*pExaScr->info->DoneSolid) (pPixmap);
|
|
|
05d2ce0 |
@@ -1086,27 +1108,30 @@ exaFillRegionSolid (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
else
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
fallback:
|
|
|
05d2ce0 |
+ if (alu != GXcopy || planemask != FB_ALLONES)
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
EXA_FALLBACK(("to %p (%c)\n", pDrawable,
|
|
|
05d2ce0 |
exaDrawableLocation(pDrawable)));
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
fbFillRegionSolid (pDrawable, pRegion, 0,
|
|
|
05d2ce0 |
fbReplicatePixel (pixel, pDrawable->bitsPerPixel));
|
|
|
05d2ce0 |
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
- while (nbox--)
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
|
|
05d2ce0 |
- pBox++;
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ return TRUE;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* Try to do an accelerated tile of the pTile into pRegion of pDrawable.
|
|
|
05d2ce0 |
* Based on fbFillRegionTiled(), fbTile().
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
-static void
|
|
|
05d2ce0 |
+Bool
|
|
|
05d2ce0 |
exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
RegionPtr pRegion,
|
|
|
05d2ce0 |
- PixmapPtr pTile)
|
|
|
05d2ce0 |
+ PixmapPtr pTile,
|
|
|
05d2ce0 |
+ DDXPointPtr pPatOrg,
|
|
|
05d2ce0 |
+ CARD32 planemask,
|
|
|
05d2ce0 |
+ CARD32 alu)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
ExaScreenPriv(pDrawable->pScreen);
|
|
|
05d2ce0 |
PixmapPtr pPixmap;
|
|
|
05d2ce0 |
@@ -1122,10 +1147,10 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
/* If we're filling with a solid color, grab it out and go to
|
|
|
05d2ce0 |
* FillRegionSolid, saving numerous copies.
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
- if (tileWidth == 1 && tileHeight == 1) {
|
|
|
05d2ce0 |
- exaFillRegionSolid(pDrawable, pRegion, exaGetPixmapFirstPixel (pTile));
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
+ if (tileWidth == 1 && tileHeight == 1)
|
|
|
05d2ce0 |
+ return exaFillRegionSolid(pDrawable, pRegion,
|
|
|
05d2ce0 |
+ exaGetPixmapFirstPixel (pTile), planemask,
|
|
|
05d2ce0 |
+ alu);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = FALSE;
|
|
|
05d2ce0 |
@@ -1139,7 +1164,6 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
tileWidth > pExaScr->info->maxX ||
|
|
|
05d2ce0 |
tileHeight > pExaScr->info->maxY)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 2, FALSE);
|
|
|
05d2ce0 |
goto fallback;
|
|
|
05d2ce0 |
} else {
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 2, TRUE);
|
|
|
05d2ce0 |
@@ -1153,8 +1177,9 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
if (!exaPixmapIsOffscreen(pTile))
|
|
|
05d2ce0 |
goto fallback;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile, &tileXoff, &tileYoff), pPixmap, 0, 0, GXcopy,
|
|
|
05d2ce0 |
- FB_ALLONES))
|
|
|
05d2ce0 |
+ if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile,
|
|
|
05d2ce0 |
+ &tileXoff, &tileYoff),
|
|
|
05d2ce0 |
+ pPixmap, 0, 0, alu, planemask))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
while (nbox--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
@@ -1162,7 +1187,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
int dstY = pBox->y1;
|
|
|
05d2ce0 |
int tileY;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- tileY = (dstY - pDrawable->y) % tileHeight;
|
|
|
05d2ce0 |
+ tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight;
|
|
|
05d2ce0 |
while (height > 0) {
|
|
|
05d2ce0 |
int width = pBox->x2 - pBox->x1;
|
|
|
05d2ce0 |
int dstX = pBox->x1;
|
|
|
05d2ce0 |
@@ -1173,7 +1198,7 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
h = height;
|
|
|
05d2ce0 |
height -= h;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- tileX = (dstX - pDrawable->x) % tileWidth;
|
|
|
05d2ce0 |
+ tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth;
|
|
|
05d2ce0 |
while (width > 0) {
|
|
|
05d2ce0 |
int w = tileWidth - tileX;
|
|
|
05d2ce0 |
if (w > width)
|
|
|
05d2ce0 |
@@ -1190,38 +1215,44 @@ exaFillRegionTiled (DrawablePtr pDrawable,
|
|
|
05d2ce0 |
dstY += h;
|
|
|
05d2ce0 |
tileY = 0;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
|
|
05d2ce0 |
- pBox->x2 + xoff, pBox->y2 + yoff);
|
|
|
05d2ce0 |
pBox++;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
(*pExaScr->info->DoneCopy) (pPixmap);
|
|
|
05d2ce0 |
exaMarkSync(pDrawable->pScreen);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ return TRUE;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
fallback:
|
|
|
05d2ce0 |
+ if (alu != GXcopy || planemask != FB_ALLONES)
|
|
|
05d2ce0 |
+ return FALSE;
|
|
|
05d2ce0 |
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable,
|
|
|
05d2ce0 |
exaDrawableLocation(&pTile->drawable),
|
|
|
05d2ce0 |
exaDrawableLocation(pDrawable)));
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 2, FALSE);
|
|
|
05d2ce0 |
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
fbFillRegionTiled (pDrawable, pRegion, pTile);
|
|
|
05d2ce0 |
exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
- while (nbox--)
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- exaDrawableDirty (pDrawable, pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
|
|
05d2ce0 |
- pBox++;
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ return TRUE;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
ExaScreenPriv (pWin->drawable.pScreen);
|
|
|
05d2ce0 |
- if (!REGION_NUM_RECTS(pRegion))
|
|
|
05d2ce0 |
+ PixmapPtr pPixmap = exaGetDrawablePixmap((DrawablePtr)pWin);
|
|
|
05d2ce0 |
+ int xoff, yoff;
|
|
|
05d2ce0 |
+ BoxPtr pBox;
|
|
|
05d2ce0 |
+ int nbox = REGION_NUM_RECTS(pRegion);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!nbox)
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
if (!pExaScr->swappedOut) {
|
|
|
05d2ce0 |
+ DDXPointRec zeros = { 0, 0 };
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
switch (what) {
|
|
|
05d2ce0 |
case PW_BACKGROUND:
|
|
|
05d2ce0 |
switch (pWin->backgroundState) {
|
|
|
05d2ce0 |
@@ -1235,25 +1266,41 @@ exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
|
|
|
05d2ce0 |
what);
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
case BackgroundPixel:
|
|
|
05d2ce0 |
- exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel,
|
|
|
05d2ce0 |
+ FB_ALLONES, GXcopy);
|
|
|
05d2ce0 |
+ goto damage;
|
|
|
05d2ce0 |
case BackgroundPixmap:
|
|
|
05d2ce0 |
- exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap,
|
|
|
05d2ce0 |
+ &zeros, FB_ALLONES, GXcopy);
|
|
|
05d2ce0 |
+ goto damage;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
break;
|
|
|
05d2ce0 |
case PW_BORDER:
|
|
|
05d2ce0 |
if (pWin->borderIsPixel) {
|
|
|
05d2ce0 |
- exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel,
|
|
|
05d2ce0 |
+ FB_ALLONES, GXcopy);
|
|
|
05d2ce0 |
+ goto damage;
|
|
|
05d2ce0 |
} else {
|
|
|
05d2ce0 |
- exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap);
|
|
|
05d2ce0 |
- return;
|
|
|
05d2ce0 |
+ exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap,
|
|
|
05d2ce0 |
+ &zeros, FB_ALLONES, GXcopy);
|
|
|
05d2ce0 |
+ goto damage;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
break;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
ExaCheckPaintWindow (pWin, pRegion, what);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+damage:
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas((DrawablePtr)pWin, pPixmap, &xoff, &yoff);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ pBox = REGION_RECTS(pRegion);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ while (nbox--)
|
|
|
05d2ce0 |
+ {
|
|
|
05d2ce0 |
+ exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff,
|
|
|
05d2ce0 |
+ pBox->x2 + xoff, pBox->y2 + yoff);
|
|
|
05d2ce0 |
+ pBox++;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/**
|
|
|
05d2ce0 |
@@ -1273,27 +1320,22 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
|
|
|
05d2ce0 |
int xoff, yoff;
|
|
|
05d2ce0 |
Bool ok;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (pExaScr->swappedOut || pExaScr->info->DownloadFromScreen == NULL)
|
|
|
05d2ce0 |
+ if (pExaScr->swappedOut || (w == 1 && h == 1))
|
|
|
05d2ce0 |
goto fallback;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ if (pExaScr->info->DownloadFromScreen == NULL)
|
|
|
05d2ce0 |
+ goto migrate_and_fallback;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
/* Only cover the ZPixmap, solid copy case. */
|
|
|
05d2ce0 |
if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask))
|
|
|
05d2ce0 |
- goto fallback;
|
|
|
05d2ce0 |
+ goto migrate_and_fallback;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* Only try to handle the 8bpp and up cases, since we don't want to think
|
|
|
05d2ce0 |
* about <8bpp.
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
if (pDrawable->bitsPerPixel < 8)
|
|
|
05d2ce0 |
- goto fallback;
|
|
|
05d2ce0 |
+ goto migrate_and_fallback;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- /* Migrate, but assume that we could accelerate the download. It is up to
|
|
|
05d2ce0 |
- * the migration scheme to ensure that this case doesn't result in bad
|
|
|
05d2ce0 |
- * moving of pixmaps.
|
|
|
05d2ce0 |
- */
|
|
|
05d2ce0 |
- pixmaps[0].as_dst = FALSE;
|
|
|
05d2ce0 |
- pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
|
|
|
05d2ce0 |
if (pPix == NULL)
|
|
|
05d2ce0 |
goto fallback;
|
|
|
05d2ce0 |
@@ -1308,12 +1350,12 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
-fallback:
|
|
|
05d2ce0 |
+migrate_and_fallback:
|
|
|
05d2ce0 |
pixmaps[0].as_dst = FALSE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
|
|
|
05d2ce0 |
exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
+fallback:
|
|
|
05d2ce0 |
ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
|
|
|
05d2ce0 |
index eedc5fd..70d8e12 100644
|
|
|
05d2ce0 |
--- a/exa/exa_migration.c
|
|
|
05d2ce0 |
+++ b/exa/exa_migration.c
|
|
|
05d2ce0 |
@@ -464,12 +464,10 @@ exaAssertNotDirty (PixmapPtr pPixmap)
|
|
|
05d2ce0 |
BoxPtr pBox = REGION_RECTS(pValidReg);
|
|
|
05d2ce0 |
Bool ret = TRUE;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (pExaPixmap == NULL || pExaPixmap->fb_ptr == NULL)
|
|
|
05d2ce0 |
+ if (!nbox || exaPixmapIsPinned(pPixmap) || pExaPixmap->fb_ptr == NULL)
|
|
|
05d2ce0 |
return ret;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- dst = pExaPixmap->sys_ptr;
|
|
|
05d2ce0 |
dst_pitch = pExaPixmap->sys_pitch;
|
|
|
05d2ce0 |
- src = pExaPixmap->fb_ptr;
|
|
|
05d2ce0 |
src_pitch = pExaPixmap->fb_pitch;
|
|
|
05d2ce0 |
cpp = pPixmap->drawable.bitsPerPixel / 8;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -486,21 +484,18 @@ exaAssertNotDirty (PixmapPtr pPixmap)
|
|
|
05d2ce0 |
continue;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
rowbytes = (pBox->x2 - pBox->x1) * cpp;
|
|
|
05d2ce0 |
- src += pBox->y1 * src_pitch + pBox->x1 * cpp;
|
|
|
05d2ce0 |
- dst += pBox->y1 * dst_pitch + pBox->x1 * cpp;
|
|
|
05d2ce0 |
+ src = pExaPixmap->fb_ptr + pBox->y1 * src_pitch + pBox->x1 * cpp;
|
|
|
05d2ce0 |
+ dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- for (y = pBox->y2 - pBox->y1; y; y--) {
|
|
|
05d2ce0 |
- if (memcmp(dst + pBox->y1 * dst_pitch + pBox->x1 * cpp,
|
|
|
05d2ce0 |
- src + pBox->y1 * src_pitch + pBox->x1 * cpp,
|
|
|
05d2ce0 |
- (pBox->x2 - pBox->x1) * cpp) != 0) {
|
|
|
05d2ce0 |
+ for (y = pBox->y1; y < pBox->y2;
|
|
|
05d2ce0 |
+ y++, src += src_pitch, dst += dst_pitch) {
|
|
|
05d2ce0 |
+ if (memcmp(dst, src, rowbytes) != 0) {
|
|
|
05d2ce0 |
ret = FALSE;
|
|
|
05d2ce0 |
+ exaPixmapDirty(pPixmap, pBox->x1, pBox->y1, pBox->x2,
|
|
|
05d2ce0 |
+ pBox->y2);
|
|
|
05d2ce0 |
break;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- src += src_pitch;
|
|
|
05d2ce0 |
- dst += dst_pitch;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- src -= pBox->y1 * src_pitch + pBox->x1 * cpp;
|
|
|
05d2ce0 |
- dst -= pBox->y1 * dst_pitch + pBox->x1 * cpp;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
|
|
|
05d2ce0 |
index 7708dd7..c666b00 100644
|
|
|
05d2ce0 |
--- a/exa/exa_offscreen.c
|
|
|
05d2ce0 |
+++ b/exa/exa_offscreen.c
|
|
|
05d2ce0 |
@@ -54,7 +54,7 @@ ExaOffscreenValidate (ScreenPtr pScreen)
|
|
|
05d2ce0 |
assert (area->offset >= area->base_offset &&
|
|
|
05d2ce0 |
area->offset < (area->base_offset + area->size));
|
|
|
05d2ce0 |
if (prev)
|
|
|
05d2ce0 |
- assert (prev->base_offset + prev->area.size == area->base_offset);
|
|
|
05d2ce0 |
+ assert (prev->base_offset + prev->size == area->base_offset);
|
|
|
05d2ce0 |
prev = area;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
assert (prev->base_offset + prev->size == pExaScr->info->memorySize);
|
|
|
05d2ce0 |
@@ -341,13 +341,15 @@ exaEnableDisableFBAccess (int index, Bool enable)
|
|
|
05d2ce0 |
ScreenPtr pScreen = screenInfo.screens[index];
|
|
|
05d2ce0 |
ExaScreenPriv (pScreen);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (!enable) {
|
|
|
05d2ce0 |
+ if (!enable && pExaScr->disableFbCount++ == 0) {
|
|
|
05d2ce0 |
if (pExaScr->info->exa_minor < 1)
|
|
|
05d2ce0 |
ExaOffscreenSwapOut (pScreen);
|
|
|
05d2ce0 |
else
|
|
|
05d2ce0 |
ExaOffscreenEjectPixmaps (pScreen);
|
|
|
05d2ce0 |
pExaScr->swappedOut = TRUE;
|
|
|
05d2ce0 |
- } else {
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (enable && --pExaScr->disableFbCount == 0) {
|
|
|
05d2ce0 |
if (pExaScr->info->exa_minor < 1)
|
|
|
05d2ce0 |
ExaOffscreenSwapIn (pScreen);
|
|
|
05d2ce0 |
pExaScr->swappedOut = FALSE;
|
|
|
05d2ce0 |
@@ -427,7 +429,7 @@ ExaOffscreenMarkUsed (PixmapPtr pPixmap)
|
|
|
05d2ce0 |
ExaScreenPriv (pPixmap->drawable.pScreen);
|
|
|
05d2ce0 |
static int iter = 0;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (!pExaPixmap->area)
|
|
|
05d2ce0 |
+ if (!pExaPixmap || !pExaPixmap->area)
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* The numbers here are arbitrary. We may want to tune these. */
|
|
|
05d2ce0 |
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
|
|
|
05d2ce0 |
index 984cb66..a6d98cd 100644
|
|
|
05d2ce0 |
--- a/exa/exa_priv.h
|
|
|
05d2ce0 |
+++ b/exa/exa_priv.h
|
|
|
05d2ce0 |
@@ -113,6 +113,7 @@ typedef struct {
|
|
|
05d2ce0 |
enum ExaMigrationHeuristic migration;
|
|
|
05d2ce0 |
Bool hideOffscreenPixmapData;
|
|
|
05d2ce0 |
Bool checkDirtyCorrectness;
|
|
|
05d2ce0 |
+ unsigned disableFbCount;
|
|
|
05d2ce0 |
} ExaScreenPrivRec, *ExaScreenPrivPtr;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/*
|
|
|
05d2ce0 |
@@ -287,6 +288,10 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap);
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+Bool
|
|
|
05d2ce0 |
+exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
|
|
|
05d2ce0 |
+ DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -318,9 +323,6 @@ ExaCheckComposite (CARD8 op,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* exa_offscreen.c */
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
-ExaOffscreenMarkUsed (PixmapPtr pPixmap);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
-void
|
|
|
05d2ce0 |
ExaOffscreenSwapOut (ScreenPtr pScreen);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
@@ -343,7 +345,8 @@ void
|
|
|
05d2ce0 |
exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
-exaDrawableDirty(DrawablePtr pDrawable, int x1, int y1, int x2, int y2);
|
|
|
05d2ce0 |
+exaGetDrawableDeltas (DrawablePtr pDrawable, PixmapPtr pPixmap,
|
|
|
05d2ce0 |
+ int *xp, int *yp);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
Bool
|
|
|
05d2ce0 |
exaDrawableIsOffscreen (DrawablePtr pDrawable);
|
|
|
05d2ce0 |
diff --git a/exa/exa_render.c b/exa/exa_render.c
|
|
|
05d2ce0 |
index b78d728..5e7c67f 100644
|
|
|
05d2ce0 |
--- a/exa/exa_render.c
|
|
|
05d2ce0 |
+++ b/exa/exa_render.c
|
|
|
05d2ce0 |
@@ -297,15 +297,15 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
nbox = REGION_NUM_RECTS(®ion);
|
|
|
05d2ce0 |
pbox = REGION_RECTS(®ion);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
while (nbox--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
(*pExaScr->info->Solid) (pDstPix,
|
|
|
05d2ce0 |
pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
|
05d2ce0 |
- exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
- pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
|
05d2ce0 |
pbox++;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
(*pExaScr->info->DoneSolid) (pDstPix);
|
|
|
05d2ce0 |
exaMarkSync(pDst->pDrawable->pScreen);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -446,8 +446,6 @@ exaTryDriverComposite(CARD8 op,
|
|
|
05d2ce0 |
pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
pbox->x2 - pbox->x1,
|
|
|
05d2ce0 |
pbox->y2 - pbox->y1);
|
|
|
05d2ce0 |
- exaPixmapDirty (pDstPix, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y,
|
|
|
05d2ce0 |
- pbox->x2 + dst_off_x, pbox->y2 + dst_off_y);
|
|
|
05d2ce0 |
pbox++;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
(*pExaScr->info->DoneComposite) (pDstPix);
|
|
|
05d2ce0 |
@@ -521,6 +519,9 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op,
|
|
|
05d2ce0 |
CARD16 height)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
ExaScreenPriv (pDst->pDrawable->pScreen);
|
|
|
05d2ce0 |
+ DrawablePtr pDstDraw = pDst->pDrawable;
|
|
|
05d2ce0 |
+ PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDstDraw);
|
|
|
05d2ce0 |
+ int xoff, yoff;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
assert(op == PictOpOver);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -539,6 +540,12 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op,
|
|
|
05d2ce0 |
exaComposite(PictOpOutReverse, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask,
|
|
|
05d2ce0 |
xDst, yDst, width, height);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDstDraw, pDstPixmap, &xoff, &yoff);
|
|
|
05d2ce0 |
+ xoff += pDstDraw->x;
|
|
|
05d2ce0 |
+ yoff += pDstDraw->y;
|
|
|
05d2ce0 |
+ exaPixmapDirty(pDstPixmap, xDst + xoff, yDst + yoff, xDst + xoff + width,
|
|
|
05d2ce0 |
+ yDst + yoff + height);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
/* Then, add in the source value times the destination alpha factors (1.0).
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
exaComposite(PictOpAdd, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask,
|
|
|
05d2ce0 |
@@ -565,6 +572,28 @@ exaComposite(CARD8 op,
|
|
|
05d2ce0 |
int ret = -1;
|
|
|
05d2ce0 |
Bool saveSrcRepeat = pSrc->repeat;
|
|
|
05d2ce0 |
Bool saveMaskRepeat = pMask ? pMask->repeat : 0;
|
|
|
05d2ce0 |
+ ExaMigrationRec pixmaps[3];
|
|
|
05d2ce0 |
+ int npixmaps = 1;
|
|
|
05d2ce0 |
+ PixmapPtr pSrcPixmap = NULL;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[0].as_src = exaOpReadsDestination(op);
|
|
|
05d2ce0 |
+ pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (pSrc->pDrawable) {
|
|
|
05d2ce0 |
+ pSrcPixmap = exaGetDrawablePixmap (pSrc->pDrawable);
|
|
|
05d2ce0 |
+ pixmaps[npixmaps].as_dst = FALSE;
|
|
|
05d2ce0 |
+ pixmaps[npixmaps].as_src = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[npixmaps].pPix = pSrcPixmap;
|
|
|
05d2ce0 |
+ npixmaps++;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (pMask && pMask->pDrawable) {
|
|
|
05d2ce0 |
+ pixmaps[npixmaps].as_dst = FALSE;
|
|
|
05d2ce0 |
+ pixmaps[npixmaps].as_src = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[npixmaps].pPix = exaGetDrawablePixmap (pMask->pDrawable);
|
|
|
05d2ce0 |
+ npixmaps++;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
/* We currently don't support acceleration of gradients, or other pictures
|
|
|
05d2ce0 |
* with a NULL pDrawable.
|
|
|
05d2ce0 |
@@ -583,19 +612,24 @@ exaComposite(CARD8 op,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
if (!pMask)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
- if (op == PictOpSrc)
|
|
|
05d2ce0 |
+ if ((op == PictOpSrc &&
|
|
|
05d2ce0 |
+ ((pSrc->format == pDst->format) ||
|
|
|
05d2ce0 |
+ (pSrc->format==PICT_a8r8g8b8 && pDst->format==PICT_x8r8g8b8) ||
|
|
|
05d2ce0 |
+ (pSrc->format==PICT_a8b8g8r8 && pDst->format==PICT_x8b8g8r8))) ||
|
|
|
05d2ce0 |
+ (op == PictOpOver && !pSrc->alphaMap && !pDst->alphaMap &&
|
|
|
05d2ce0 |
+ pSrc->format == pDst->format &&
|
|
|
05d2ce0 |
+ (pSrc->format==PICT_x8r8g8b8 || pSrc->format==PICT_x8b8g8r8)))
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
if (pSrc->pDrawable->width == 1 &&
|
|
|
05d2ce0 |
- pSrc->pDrawable->height == 1 && pSrc->repeat &&
|
|
|
05d2ce0 |
- pSrc->repeatType == RepeatNormal)
|
|
|
05d2ce0 |
+ pSrc->pDrawable->height == 1 &&
|
|
|
05d2ce0 |
+ pSrc->repeat)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
ret = exaTryDriverSolidFill(pSrc, pDst, xSrc, ySrc, xDst, yDst,
|
|
|
05d2ce0 |
width, height);
|
|
|
05d2ce0 |
if (ret == 1)
|
|
|
05d2ce0 |
goto done;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- else if (!pSrc->repeat && !pSrc->transform &&
|
|
|
05d2ce0 |
- pSrc->format == pDst->format)
|
|
|
05d2ce0 |
+ else if (pSrcPixmap && !pSrc->repeat && !pSrc->transform)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
RegionRec region;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -617,6 +651,45 @@ exaComposite(CARD8 op,
|
|
|
05d2ce0 |
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
|
|
05d2ce0 |
goto done;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
+ else if (pSrcPixmap && !pSrc->transform &&
|
|
|
05d2ce0 |
+ pSrc->repeatType == RepeatNormal)
|
|
|
05d2ce0 |
+ {
|
|
|
05d2ce0 |
+ RegionRec region;
|
|
|
05d2ce0 |
+ DDXPointRec srcOrg;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ /* Let's see if the driver can do the repeat in one go */
|
|
|
05d2ce0 |
+ if (pExaScr->info->PrepareComposite && !pSrc->alphaMap &&
|
|
|
05d2ce0 |
+ !pDst->alphaMap)
|
|
|
05d2ce0 |
+ {
|
|
|
05d2ce0 |
+ ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc,
|
|
|
05d2ce0 |
+ ySrc, xMask, yMask, xDst, yDst,
|
|
|
05d2ce0 |
+ width, height);
|
|
|
05d2ce0 |
+ if (ret == 1)
|
|
|
05d2ce0 |
+ goto done;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ /* Now see if we can use exaFillRegionTiled() */
|
|
|
05d2ce0 |
+ xDst += pDst->pDrawable->x;
|
|
|
05d2ce0 |
+ yDst += pDst->pDrawable->y;
|
|
|
05d2ce0 |
+ xSrc += pSrc->pDrawable->x;
|
|
|
05d2ce0 |
+ ySrc += pSrc->pDrawable->y;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc,
|
|
|
05d2ce0 |
+ ySrc, xMask, yMask, xDst, yDst,
|
|
|
05d2ce0 |
+ width, height))
|
|
|
05d2ce0 |
+ goto done;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ srcOrg.x = (xSrc - xDst) % pSrcPixmap->drawable.width;
|
|
|
05d2ce0 |
+ srcOrg.y = (ySrc - yDst) % pSrcPixmap->drawable.height;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ ret = exaFillRegionTiled(pDst->pDrawable, ®ion, pSrcPixmap,
|
|
|
05d2ce0 |
+ &srcOrg, FB_ALLONES, GXcopy);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (ret)
|
|
|
05d2ce0 |
+ goto done;
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -627,8 +700,8 @@ exaComposite(CARD8 op,
|
|
|
05d2ce0 |
pMask->repeat = 0;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
if (pExaScr->info->PrepareComposite &&
|
|
|
05d2ce0 |
- (!pSrc->repeat || pSrc->repeat == RepeatNormal) &&
|
|
|
05d2ce0 |
- (!pMask || !pMask->repeat || pMask->repeat == RepeatNormal) &&
|
|
|
05d2ce0 |
+ (!pSrc->repeat || pSrc->repeatType == RepeatNormal) &&
|
|
|
05d2ce0 |
+ (!pMask || !pMask->repeat || pMask->repeatType == RepeatNormal) &&
|
|
|
05d2ce0 |
!pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
Bool isSrcSolid;
|
|
|
05d2ce0 |
@@ -660,39 +733,14 @@ exaComposite(CARD8 op,
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (ret != 0) {
|
|
|
05d2ce0 |
- ExaMigrationRec pixmaps[3];
|
|
|
05d2ce0 |
- /* failure to accelerate was not due to pixmaps being in the wrong
|
|
|
05d2ce0 |
- * locations.
|
|
|
05d2ce0 |
- */
|
|
|
05d2ce0 |
- pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
- pixmaps[0].as_src = exaOpReadsDestination(op);
|
|
|
05d2ce0 |
- pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable);
|
|
|
05d2ce0 |
- pixmaps[1].as_dst = FALSE;
|
|
|
05d2ce0 |
- pixmaps[1].as_src = TRUE;
|
|
|
05d2ce0 |
- pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
|
|
05d2ce0 |
- if (pMask) {
|
|
|
05d2ce0 |
- pixmaps[2].as_dst = FALSE;
|
|
|
05d2ce0 |
- pixmaps[2].as_src = TRUE;
|
|
|
05d2ce0 |
- pixmaps[2].pPix = exaGetDrawablePixmap (pMask->pDrawable);
|
|
|
05d2ce0 |
- exaDoMigration(pixmaps, 3, FALSE);
|
|
|
05d2ce0 |
- } else {
|
|
|
05d2ce0 |
- exaDoMigration(pixmaps, 2, FALSE);
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
fallback:
|
|
|
05d2ce0 |
#if DEBUG_TRACE_FALL
|
|
|
05d2ce0 |
exaPrintCompositeFallback (op, pSrc, pMask, pDst);
|
|
|
05d2ce0 |
#endif
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ exaDoMigration(pixmaps, npixmaps, FALSE);
|
|
|
05d2ce0 |
ExaCheckComposite (op, pSrc, pMask, pDst, xSrc, ySrc,
|
|
|
05d2ce0 |
xMask, yMask, xDst, yDst, width, height);
|
|
|
05d2ce0 |
- exaDrawableDirty(pDst->pDrawable,
|
|
|
05d2ce0 |
- pDst->pDrawable->x + xDst,
|
|
|
05d2ce0 |
- pDst->pDrawable->y + yDst,
|
|
|
05d2ce0 |
- pDst->pDrawable->x + xDst + width,
|
|
|
05d2ce0 |
- pDst->pDrawable->y + yDst + height);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
done:
|
|
|
05d2ce0 |
pSrc->repeat = saveSrcRepeat;
|
|
|
05d2ce0 |
@@ -716,6 +764,7 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
DrawablePtr pDraw = pPicture->pDrawable;
|
|
|
05d2ce0 |
ExaMigrationRec pixmaps[1];
|
|
|
05d2ce0 |
+ int xoff, yoff;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
@@ -724,8 +773,10 @@ exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
fbRasterizeTrapezoid(pPicture, trap, x_off, y_off);
|
|
|
05d2ce0 |
- exaDrawableDirty(pDraw, pDraw->x, pDraw->y,
|
|
|
05d2ce0 |
- pDraw->x + pDraw->width, pDraw->y + pDraw->height);
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff);
|
|
|
05d2ce0 |
+ exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff,
|
|
|
05d2ce0 |
+ pDraw->x + xoff + pDraw->width,
|
|
|
05d2ce0 |
+ pDraw->y + yoff + pDraw->height);
|
|
|
05d2ce0 |
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -739,6 +790,7 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
DrawablePtr pDraw = pPicture->pDrawable;
|
|
|
05d2ce0 |
ExaMigrationRec pixmaps[1];
|
|
|
05d2ce0 |
+ int xoff, yoff;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
@@ -747,8 +799,10 @@ exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri,
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
exaPrepareAccess(pDraw, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
fbAddTriangles(pPicture, x_off, y_off, ntri, tris);
|
|
|
05d2ce0 |
- exaDrawableDirty(pDraw, pDraw->x, pDraw->y,
|
|
|
05d2ce0 |
- pDraw->x + pDraw->width, pDraw->y + pDraw->height);
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff);
|
|
|
05d2ce0 |
+ exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff,
|
|
|
05d2ce0 |
+ pDraw->x + xoff + pDraw->width,
|
|
|
05d2ce0 |
+ pDraw->y + yoff + pDraw->height);
|
|
|
05d2ce0 |
exaFinishAccess(pDraw, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
@@ -845,10 +899,11 @@ exaGlyphs (CARD8 op,
|
|
|
05d2ce0 |
PixmapPtr pPixmap = NULL;
|
|
|
05d2ce0 |
PicturePtr pPicture;
|
|
|
05d2ce0 |
PixmapPtr pMaskPixmap = NULL;
|
|
|
05d2ce0 |
+ PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDst->pDrawable);
|
|
|
05d2ce0 |
PicturePtr pMask;
|
|
|
05d2ce0 |
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
|
|
05d2ce0 |
int width = 0, height = 0;
|
|
|
05d2ce0 |
- int x, y;
|
|
|
05d2ce0 |
+ int x, y, x1, y1, xoff, yoff;
|
|
|
05d2ce0 |
int xDst = list->xOff, yDst = list->yOff;
|
|
|
05d2ce0 |
int n;
|
|
|
05d2ce0 |
int error;
|
|
|
05d2ce0 |
@@ -892,7 +947,12 @@ exaGlyphs (CARD8 op,
|
|
|
05d2ce0 |
xRectangle rect;
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
miGlyphExtents (nlist, list, glyphs, &extents);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ extents.x1 = max(extents.x1, 0);
|
|
|
05d2ce0 |
+ extents.y1 = max(extents.y1, 0);
|
|
|
05d2ce0 |
+ extents.x2 = min(extents.x2, pDst->pDrawable->width);
|
|
|
05d2ce0 |
+ extents.y2 = min(extents.y2, pDst->pDrawable->height);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1)
|
|
|
05d2ce0 |
return;
|
|
|
05d2ce0 |
width = extents.x2 - extents.x1;
|
|
|
05d2ce0 |
@@ -918,6 +978,7 @@ exaGlyphs (CARD8 op,
|
|
|
05d2ce0 |
rect.width = width;
|
|
|
05d2ce0 |
rect.height = height;
|
|
|
05d2ce0 |
(*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect);
|
|
|
05d2ce0 |
+ exaPixmapDirty(pMaskPixmap, 0, 0, width, height);
|
|
|
05d2ce0 |
FreeScratchGC (pGC);
|
|
|
05d2ce0 |
x = -extents.x1;
|
|
|
05d2ce0 |
y = -extents.y1;
|
|
|
05d2ce0 |
@@ -929,6 +990,8 @@ exaGlyphs (CARD8 op,
|
|
|
05d2ce0 |
y = 0;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDst->pDrawable, pDstPixmap, &xoff, &yoff);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
while (nlist--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
GCPtr pGC = NULL;
|
|
|
05d2ce0 |
@@ -983,13 +1046,21 @@ exaGlyphs (CARD8 op,
|
|
|
05d2ce0 |
pixmaps[0].as_dst = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
pixmaps[0].pPix = pPixmap;
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, TRUE);
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, pExaScr->info->PrepareComposite != NULL);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
while (n--)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
GlyphPtr glyph = *glyphs++;
|
|
|
05d2ce0 |
pointer glyphdata = (pointer) (glyph + 1);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
+ DrawablePtr pCmpDrw = (maskFormat ? pMask : pDst)->pDrawable;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ x1 = x - glyph->info.x;
|
|
|
05d2ce0 |
+ y1 = y - glyph->info.y;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (x1 >= pCmpDrw->width || y1 >= pCmpDrw->height ||
|
|
|
05d2ce0 |
+ (x1 + glyph->info.width) <= 0 || (y1 + glyph->info.height) <= 0)
|
|
|
05d2ce0 |
+ goto nextglyph;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
(*pScreen->ModifyPixmapHeader) (pScratchPixmap,
|
|
|
05d2ce0 |
glyph->info.width,
|
|
|
05d2ce0 |
glyph->info.height,
|
|
|
05d2ce0 |
@@ -1048,17 +1119,22 @@ exaGlyphs (CARD8 op,
|
|
|
05d2ce0 |
if (maskFormat)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
exaComposite (PictOpAdd, pPicture, NULL, pMask, 0, 0, 0, 0,
|
|
|
05d2ce0 |
- x - glyph->info.x, y - glyph->info.y,
|
|
|
05d2ce0 |
- glyph->info.width, glyph->info.height);
|
|
|
05d2ce0 |
+ x1, y1, glyph->info.width, glyph->info.height);
|
|
|
05d2ce0 |
+ exaPixmapDirty(pMaskPixmap, x1, y1, x1 + glyph->info.width,
|
|
|
05d2ce0 |
+ y1 + glyph->info.height);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
else
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
exaComposite (op, pSrc, pPicture, pDst,
|
|
|
05d2ce0 |
- xSrc + (x - glyph->info.x) - xDst,
|
|
|
05d2ce0 |
- ySrc + (y - glyph->info.y) - yDst,
|
|
|
05d2ce0 |
- 0, 0, x - glyph->info.x, y - glyph->info.y,
|
|
|
05d2ce0 |
- glyph->info.width, glyph->info.height);
|
|
|
05d2ce0 |
+ xSrc + x1 - xDst, ySrc + y1 - yDst,
|
|
|
05d2ce0 |
+ 0, 0, x1, y1, glyph->info.width,
|
|
|
05d2ce0 |
+ glyph->info.height);
|
|
|
05d2ce0 |
+ x1 += pDst->pDrawable->x + xoff;
|
|
|
05d2ce0 |
+ y1 += pDst->pDrawable->y + yoff;
|
|
|
05d2ce0 |
+ exaPixmapDirty(pDstPixmap, x1, y1, x1 + glyph->info.width,
|
|
|
05d2ce0 |
+ y1 + glyph->info.height);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
+nextglyph:
|
|
|
05d2ce0 |
x += glyph->info.xOff;
|
|
|
05d2ce0 |
y += glyph->info.yOff;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
|
|
|
05d2ce0 |
index 7713a08..b67ea63 100644
|
|
|
05d2ce0 |
--- a/exa/exa_unaccel.c
|
|
|
05d2ce0 |
+++ b/exa/exa_unaccel.c
|
|
|
05d2ce0 |
@@ -88,10 +88,15 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
|
|
|
05d2ce0 |
int x, int y, int w, int h, int leftPad, int format,
|
|
|
05d2ce0 |
char *bits)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
+ PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
|
|
|
05d2ce0 |
+ int xoff, yoff;
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
|
|
05d2ce0 |
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
|
|
|
05d2ce0 |
exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
+ exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
|
|
05d2ce0 |
+ exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
RegionPtr
|
|
|
05d2ce0 |
@@ -201,32 +206,11 @@ ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- if (nrect) {
|
|
|
05d2ce0 |
- int x1 = max(prect->x, 0), y1 = max(prect->y, 0);
|
|
|
05d2ce0 |
- int x2 = min(prect->x + prect->width, pDrawable->width);
|
|
|
05d2ce0 |
- int y2 = min(prect->y + prect->height, pDrawable->height);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
- exaPrepareAccessGC (pGC);
|
|
|
05d2ce0 |
- fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
|
|
05d2ce0 |
- exaFinishAccessGC (pGC);
|
|
|
05d2ce0 |
- exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- /* Only track bounding box of damage, as this path can degenerate to
|
|
|
05d2ce0 |
- * zillions of damage boxes
|
|
|
05d2ce0 |
- */
|
|
|
05d2ce0 |
- while (--nrect)
|
|
|
05d2ce0 |
- {
|
|
|
05d2ce0 |
- prect++;
|
|
|
05d2ce0 |
- x1 = min(x1, prect->x);
|
|
|
05d2ce0 |
- x2 = max(x2, prect->x + prect->width);
|
|
|
05d2ce0 |
- y1 = min(y1, prect->y);
|
|
|
05d2ce0 |
- y2 = max(y2, prect->y + prect->height);
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- exaDrawableDirty (pDrawable, pDrawable->x + x1, pDrawable->y + y1,
|
|
|
05d2ce0 |
- pDrawable->x + x2, pDrawable->y + y2);
|
|
|
05d2ce0 |
- }
|
|
|
05d2ce0 |
+ exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
+ exaPrepareAccessGC (pGC);
|
|
|
05d2ce0 |
+ fbPolyFillRect (pDrawable, pGC, nrect, prect);
|
|
|
05d2ce0 |
+ exaFinishAccessGC (pGC);
|
|
|
05d2ce0 |
+ exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
void
|
|
|
05d2ce0 |
@@ -385,31 +369,48 @@ ExaCheckComposite (CARD8 op,
|
|
|
05d2ce0 |
/**
|
|
|
05d2ce0 |
* Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps
|
|
|
05d2ce0 |
* that happen to be 1x1. Pixmap must be at least 8bpp.
|
|
|
05d2ce0 |
+ *
|
|
|
05d2ce0 |
+ * XXX This really belongs in fb, so it can be aware of tiling and etc.
|
|
|
05d2ce0 |
*/
|
|
|
05d2ce0 |
CARD32
|
|
|
05d2ce0 |
exaGetPixmapFirstPixel (PixmapPtr pPixmap)
|
|
|
05d2ce0 |
{
|
|
|
05d2ce0 |
CARD32 pixel;
|
|
|
05d2ce0 |
+ void *fb;
|
|
|
05d2ce0 |
+ Bool need_finish = FALSE;
|
|
|
05d2ce0 |
+ BoxRec box;
|
|
|
05d2ce0 |
ExaMigrationRec pixmaps[1];
|
|
|
05d2ce0 |
+ ExaPixmapPriv (pPixmap);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ /* Try to avoid framebuffer readbacks */
|
|
|
05d2ce0 |
+ if (exaPixmapIsOffscreen(pPixmap)) {
|
|
|
05d2ce0 |
+ if (!miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box)) {
|
|
|
05d2ce0 |
+ fb = pExaPixmap->sys_ptr;
|
|
|
05d2ce0 |
+ } else {
|
|
|
05d2ce0 |
+ need_finish = TRUE;
|
|
|
05d2ce0 |
+ fb = pPixmap->devPrivate.ptr;
|
|
|
05d2ce0 |
+ pixmaps[0].as_dst = FALSE;
|
|
|
05d2ce0 |
+ pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
+ pixmaps[0].pPix = pPixmap;
|
|
|
05d2ce0 |
+ exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
+ exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
+ }
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
- pixmaps[0].as_dst = FALSE;
|
|
|
05d2ce0 |
- pixmaps[0].as_src = TRUE;
|
|
|
05d2ce0 |
- pixmaps[0].pPix = pPixmap;
|
|
|
05d2ce0 |
- exaDoMigration (pixmaps, 1, FALSE);
|
|
|
05d2ce0 |
-
|
|
|
05d2ce0 |
- exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
switch (pPixmap->drawable.bitsPerPixel) {
|
|
|
05d2ce0 |
case 32:
|
|
|
05d2ce0 |
- pixel = *(CARD32 *)(pPixmap->devPrivate.ptr);
|
|
|
05d2ce0 |
+ pixel = *(CARD32 *)fb;
|
|
|
05d2ce0 |
break;
|
|
|
05d2ce0 |
case 16:
|
|
|
05d2ce0 |
- pixel = *(CARD16 *)(pPixmap->devPrivate.ptr);
|
|
|
05d2ce0 |
+ pixel = *(CARD16 *)fb;
|
|
|
05d2ce0 |
break;
|
|
|
05d2ce0 |
default:
|
|
|
05d2ce0 |
- pixel = *(CARD8 *)(pPixmap->devPrivate.ptr);
|
|
|
05d2ce0 |
+ pixel = *(CARD8 *)fb;
|
|
|
05d2ce0 |
break;
|
|
|
05d2ce0 |
}
|
|
|
05d2ce0 |
- exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
+
|
|
|
05d2ce0 |
+ if (need_finish)
|
|
|
05d2ce0 |
+ exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
|
|
|
05d2ce0 |
|
|
|
05d2ce0 |
return pixel;
|
|
|
05d2ce0 |
}
|