summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-13 17:15:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-13 17:17:54 +0100
commit8de09a0707ee1be1b919b979843711728618ef27 (patch)
treedbf40be1d7517bbc3d1ff83638b216b43cd4042b
parent92e9cf8af784b13c28030e38b15c8decf29e6a32 (diff)
uxa: Convert 1x1R back to solid_fill
In the change to prevent blitting between incompatible sources, we also prevented 1x1R pixmaps from being used for solid fills. Reorder the sequence of conditions to enable this fast path again.
-rw-r--r--uxa/uxa-render.c151
1 files changed, 75 insertions, 76 deletions
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 93930585..39793ba7 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -1374,90 +1374,89 @@ uxa_composite(CARD8 op,
}
}
}
- } else if (compatible_formats (op, pDst, pSrc)) {
- if (pSrc->pDrawable->width == 1 &&
- pSrc->pDrawable->height == 1 &&
- pSrc->repeat) {
- ret = uxa_try_driver_solid_fill(pSrc, pDst,
- xSrc, ySrc,
- xDst, yDst,
- width, height);
+ } else if (pSrc->pDrawable->width == 1 &&
+ pSrc->pDrawable->height == 1 &&
+ pSrc->repeat) {
+ ret = uxa_try_driver_solid_fill(pSrc, pDst,
+ xSrc, ySrc,
+ xDst, yDst,
+ width, height);
+ if (ret == 1)
+ goto done;
+ } else if (compatible_formats (op, pDst, pSrc) &&
+ !pSrc->repeat &&
+ transform_is_integer_translation(pSrc->transform, &tx, &ty) &&
+ drawable_contains(pSrc->pDrawable,
+ xSrc + tx, ySrc + ty,
+ width, height)) {
+ xDst += pDst->pDrawable->x;
+ yDst += pDst->pDrawable->y;
+ xSrc += pSrc->pDrawable->x + tx;
+ ySrc += pSrc->pDrawable->y + ty;
+
+ if (!miComputeCompositeRegion
+ (&region, pSrc, pMask, pDst, xSrc, ySrc,
+ xMask, yMask, xDst, yDst, width, height))
+ goto done;
+
+ uxa_copy_n_to_n(pSrc->pDrawable,
+ pDst->pDrawable, NULL,
+ REGION_RECTS(&region),
+ REGION_NUM_RECTS(&region),
+ xSrc - xDst, ySrc - yDst, FALSE,
+ FALSE, 0, NULL);
+ REGION_UNINIT(pDst->pDrawable->pScreen,
+ &region);
+ goto done;
+ } else if (pSrc->pDrawable->type == DRAWABLE_PIXMAP &&
+ pSrc->repeatType == RepeatNormal &&
+ transform_is_integer_translation(pSrc->transform, &tx, &ty)) {
+ DDXPointRec patOrg;
+
+ /* Let's see if the driver can do the repeat
+ * in one go
+ */
+ if (uxa_screen->info->prepare_composite) {
+ ret = uxa_try_driver_composite(op, pSrc,
+ pMask, pDst,
+ xSrc, ySrc,
+ xMask, yMask,
+ xDst, yDst,
+ width, height);
if (ret == 1)
goto done;
- } else if (!pSrc->repeat &&
- transform_is_integer_translation(pSrc->transform, &tx, &ty) &&
- drawable_contains(pSrc->pDrawable,
- xSrc + tx, ySrc + ty,
- width, height)) {
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- xSrc += pSrc->pDrawable->x + tx;
- ySrc += pSrc->pDrawable->y + ty;
-
- if (!miComputeCompositeRegion
- (&region, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height))
- goto done;
+ }
- uxa_copy_n_to_n(pSrc->pDrawable,
- pDst->pDrawable, NULL,
- REGION_RECTS(&region),
- REGION_NUM_RECTS(&region),
- xSrc - xDst, ySrc - yDst, FALSE,
- FALSE, 0, NULL);
- REGION_UNINIT(pDst->pDrawable->pScreen,
- &region);
+ /* Now see if we can use
+ * uxa_fill_region_tiled()
+ */
+ xDst += pDst->pDrawable->x;
+ yDst += pDst->pDrawable->y;
+ xSrc += pSrc->pDrawable->x + tx;
+ ySrc += pSrc->pDrawable->y + ty;
+
+ if (!miComputeCompositeRegion
+ (&region, pSrc, pMask, pDst, xSrc, ySrc,
+ xMask, yMask, xDst, yDst, width, height))
goto done;
- } else if (pSrc->pDrawable->type == DRAWABLE_PIXMAP &&
- !pSrc->transform &&
- pSrc->repeatType == RepeatNormal) {
- DDXPointRec patOrg;
-
- /* Let's see if the driver can do the repeat
- * in one go
- */
- if (uxa_screen->info->prepare_composite) {
- ret = uxa_try_driver_composite(op, pSrc,
- pMask, pDst,
- xSrc, ySrc,
- xMask, yMask,
- xDst, yDst,
- width, height);
- if (ret == 1)
- goto done;
- }
-
- /* Now see if we can use
- * uxa_fill_region_tiled()
- */
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
-
- if (!miComputeCompositeRegion
- (&region, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height))
- goto done;
- /* pattern origin is the point in the
- * destination drawable
- * corresponding to (0,0) in the source */
- patOrg.x = xDst - xSrc;
- patOrg.y = yDst - ySrc;
+ /* pattern origin is the point in the
+ * destination drawable
+ * corresponding to (0,0) in the source */
+ patOrg.x = xDst - xSrc;
+ patOrg.y = yDst - ySrc;
- ret = uxa_fill_region_tiled(pDst->pDrawable,
- &region,
- (PixmapPtr) pSrc->
- pDrawable, &patOrg,
- FB_ALLONES, GXcopy);
+ ret = uxa_fill_region_tiled(pDst->pDrawable,
+ &region,
+ (PixmapPtr) pSrc->
+ pDrawable, &patOrg,
+ FB_ALLONES, GXcopy);
- REGION_UNINIT(pDst->pDrawable->pScreen,
- &region);
+ REGION_UNINIT(pDst->pDrawable->pScreen,
+ &region);
- if (ret)
- goto done;
- }
+ if (ret)
+ goto done;
}
}