summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exa/exa.c27
-rw-r--r--exa/exa_accel.c27
-rw-r--r--exa/exa_migration.c27
-rw-r--r--hw/xfree86/exa/exa.c27
-rw-r--r--hw/xfree86/exa/exa_accel.c27
-rw-r--r--hw/xfree86/exa/exa_migration.c27
6 files changed, 162 insertions, 0 deletions
diff --git a/exa/exa.c b/exa/exa.c
index e1b48427d..2b9dc63dd 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
+ /* If we're filling with a solid color, grab it out and go to
+ * FillRegionSolid, saving numerous copies.
+ */
+ if (pDrawable->width == 1 && pDrawable->height == 1) {
+ CARD32 pixel;
+
+ exaDrawableUseMemory(&pTile->drawable);
+ exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ switch (pTile->drawable.bitsPerPixel) {
+ case 8:
+ pixel = *(CARD8 *)(pTile->devPrivate.ptr);
+ break;
+ case 16:
+ pixel = *(CARD16 *)(pTile->devPrivate.ptr);
+ break;
+ case 32:
+ pixel = *(CARD32 *)(pTile->devPrivate.ptr);
+ break;
+ default:
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ goto fallback;
+ }
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ exaFillRegionSolid(pDrawable, pRegion, pixel);
+ return;
+ }
+
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index e1b48427d..2b9dc63dd 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
+ /* If we're filling with a solid color, grab it out and go to
+ * FillRegionSolid, saving numerous copies.
+ */
+ if (pDrawable->width == 1 && pDrawable->height == 1) {
+ CARD32 pixel;
+
+ exaDrawableUseMemory(&pTile->drawable);
+ exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ switch (pTile->drawable.bitsPerPixel) {
+ case 8:
+ pixel = *(CARD8 *)(pTile->devPrivate.ptr);
+ break;
+ case 16:
+ pixel = *(CARD16 *)(pTile->devPrivate.ptr);
+ break;
+ case 32:
+ pixel = *(CARD32 *)(pTile->devPrivate.ptr);
+ break;
+ default:
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ goto fallback;
+ }
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ exaFillRegionSolid(pDrawable, pRegion, pixel);
+ return;
+ }
+
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index e1b48427d..2b9dc63dd 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
+ /* If we're filling with a solid color, grab it out and go to
+ * FillRegionSolid, saving numerous copies.
+ */
+ if (pDrawable->width == 1 && pDrawable->height == 1) {
+ CARD32 pixel;
+
+ exaDrawableUseMemory(&pTile->drawable);
+ exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ switch (pTile->drawable.bitsPerPixel) {
+ case 8:
+ pixel = *(CARD8 *)(pTile->devPrivate.ptr);
+ break;
+ case 16:
+ pixel = *(CARD16 *)(pTile->devPrivate.ptr);
+ break;
+ case 32:
+ pixel = *(CARD32 *)(pTile->devPrivate.ptr);
+ break;
+ default:
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ goto fallback;
+ }
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ exaFillRegionSolid(pDrawable, pRegion, pixel);
+ return;
+ }
+
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;
diff --git a/hw/xfree86/exa/exa.c b/hw/xfree86/exa/exa.c
index e1b48427d..2b9dc63dd 100644
--- a/hw/xfree86/exa/exa.c
+++ b/hw/xfree86/exa/exa.c
@@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
+ /* If we're filling with a solid color, grab it out and go to
+ * FillRegionSolid, saving numerous copies.
+ */
+ if (pDrawable->width == 1 && pDrawable->height == 1) {
+ CARD32 pixel;
+
+ exaDrawableUseMemory(&pTile->drawable);
+ exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ switch (pTile->drawable.bitsPerPixel) {
+ case 8:
+ pixel = *(CARD8 *)(pTile->devPrivate.ptr);
+ break;
+ case 16:
+ pixel = *(CARD16 *)(pTile->devPrivate.ptr);
+ break;
+ case 32:
+ pixel = *(CARD32 *)(pTile->devPrivate.ptr);
+ break;
+ default:
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ goto fallback;
+ }
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ exaFillRegionSolid(pDrawable, pRegion, pixel);
+ return;
+ }
+
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;
diff --git a/hw/xfree86/exa/exa_accel.c b/hw/xfree86/exa/exa_accel.c
index e1b48427d..2b9dc63dd 100644
--- a/hw/xfree86/exa/exa_accel.c
+++ b/hw/xfree86/exa/exa_accel.c
@@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
+ /* If we're filling with a solid color, grab it out and go to
+ * FillRegionSolid, saving numerous copies.
+ */
+ if (pDrawable->width == 1 && pDrawable->height == 1) {
+ CARD32 pixel;
+
+ exaDrawableUseMemory(&pTile->drawable);
+ exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ switch (pTile->drawable.bitsPerPixel) {
+ case 8:
+ pixel = *(CARD8 *)(pTile->devPrivate.ptr);
+ break;
+ case 16:
+ pixel = *(CARD16 *)(pTile->devPrivate.ptr);
+ break;
+ case 32:
+ pixel = *(CARD32 *)(pTile->devPrivate.ptr);
+ break;
+ default:
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ goto fallback;
+ }
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ exaFillRegionSolid(pDrawable, pRegion, pixel);
+ return;
+ }
+
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;
diff --git a/hw/xfree86/exa/exa_migration.c b/hw/xfree86/exa/exa_migration.c
index e1b48427d..2b9dc63dd 100644
--- a/hw/xfree86/exa/exa_migration.c
+++ b/hw/xfree86/exa/exa_migration.c
@@ -1220,6 +1220,33 @@ exaFillRegionTiled (DrawablePtr pDrawable,
goto fallback;
}
+ /* If we're filling with a solid color, grab it out and go to
+ * FillRegionSolid, saving numerous copies.
+ */
+ if (pDrawable->width == 1 && pDrawable->height == 1) {
+ CARD32 pixel;
+
+ exaDrawableUseMemory(&pTile->drawable);
+ exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ switch (pTile->drawable.bitsPerPixel) {
+ case 8:
+ pixel = *(CARD8 *)(pTile->devPrivate.ptr);
+ break;
+ case 16:
+ pixel = *(CARD16 *)(pTile->devPrivate.ptr);
+ break;
+ case 32:
+ pixel = *(CARD32 *)(pTile->devPrivate.ptr);
+ break;
+ default:
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ goto fallback;
+ }
+ exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
+ exaFillRegionSolid(pDrawable, pRegion, pixel);
+ return;
+ }
+
pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (!pPixmap)
goto fallback;