summaryrefslogtreecommitdiff
path: root/src/smi_xaa.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-25 19:57:05 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-25 19:57:05 -0200
commit06c78cee718a86b1521c1fc1075d08bb9ad257f1 (patch)
tree2d5a97ef42bdbf10a93373279fc88bbe3d41f722 /src/smi_xaa.c
parent9570cfdc132b0acb1d2b70edc6a3a5a812ef9691 (diff)
Remove smi_dga.c and polylines code from smi_xaa.c.
DGA was also not being properly test to not enable the pSmi fields, but since the dga implementation is very basic, it is better to just remove it (if compiling the sources on pre 1.4 X Server, DGA will be disabled). The polylines code in xmi_xaa.c was already if 0'ed for some time, but it may be reinstantiated to accelerate (back) xaa rotated modes. Currently only randr+exa accelerates rotated modes.
Diffstat (limited to 'src/smi_xaa.c')
-rw-r--r--src/smi_xaa.c160
1 files changed, 0 insertions, 160 deletions
diff --git a/src/smi_xaa.c b/src/smi_xaa.c
index 5b9e32d..29b7c4d 100644
--- a/src/smi_xaa.c
+++ b/src/smi_xaa.c
@@ -60,11 +60,6 @@ static void SMI_SetupForImageWrite(ScrnInfoPtr, int, unsigned int, int, int,
int);
static void SMI_SubsequentImageWriteRect(ScrnInfoPtr, int, int, int, int, int);
#endif
-#if 0
-/* #671 */
-static void SMI_ValidatePolylines(GCPtr, unsigned long, DrawablePtr);
-static void SMI_Polylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
-#endif
Bool
SMI_XAAInit(ScreenPtr pScreen)
@@ -724,158 +719,3 @@ SMI_SubsequentImageWriteRect(ScrnInfoPtr pScrn, int x, int y, int w, int h,
LEAVE();
}
#endif
-
-#if 0
-/******************************************************************************/
-/* Polylines #671 */
-/******************************************************************************/
-
-/*
-
-In order to speed up the "logout" screen in rotated modes, we need to intercept
-the Polylines function. Normally, the polylines are drawn and the shadowFB is
-then sending a request of the bounding rectangle of those poylines. This should
-be okay, if it weren't for the fact that the Gnome logout screen is drawing
-polylines in rectangles and this asks for a rotation of the entire rectangle.
-This is very slow.
-
-To circumvent this slowness, we intercept the ValidatePolylines function and
-override the default "Fallback" Polylines with our own Polylines function. Our
-Polylines function first draws the polylines through the original Fallback
-function and then rotates the lines, line by line. We then set a flag and
-return control to the shadowFB which will try to rotate the bounding rectangle.
-However, the flag has been set and the RefreshArea function does nothing but
-clear the flag so the next Refresh that comes in shoiuld be handled correctly.
-
-All this code improves the speed quite a bit.
-
-*/
-
-#define IS_VISIBLE(pWin) \
-( \
- pScrn->vtSema \
- && (((WindowPtr) pWin)->visibility != VisibilityFullyObscured) \
-)
-
-#define TRIM_BOX(box, pGC) \
-{ \
- BoxPtr extents = &pGC->pCompositeClip->extents; \
- if (box.x1 < extents->x1) box.x1 = extents->x1; \
- if (box.y1 < extents->y1) box.y1 = extents->y1; \
- if (box.x2 > extents->x2) box.x2 = extents->x2; \
- if (box.y2 > extents->y2) box.y2 = extents->y2; \
-}
-
-#define TRANSLATE_BOX(box, pDraw) \
-{ \
- box.x1 += pDraw->x; \
- box.y1 += pDraw->y; \
- box.x2 += pDraw->x; \
- box.y2 += pDraw->y; \
-}
-
-#define BOX_NOT_EMPTY(box) \
- ((box.x2 > box.x1) && (box.y2 > box.y1))
-
-static void
-SMI_ValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- SMIPtr pSmi = SMIPTR(infoRec->pScrn);
-
- ENTER();
-
- pSmi->ValidatePolylines(pGC, changes, pDraw);
- if (pGC->ops->Polylines == XAAGetFallbackOps()->Polylines) {
- /* Override the Polylines function with our own Polylines function. */
- pGC->ops->Polylines = SMI_Polylines;
- }
-
- LEAVE();
-}
-
-static void
-SMI_Polylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt,
- DDXPointPtr pptInit)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
- ScrnInfoPtr pScrn = infoRec->pScrn;
- SMIPtr pSmi = SMIPTR(pScrn);
-
- ENTER();
-
- /* Call the original Polylines function. */
- pGC->ops->Polylines = XAAGetFallbackOps()->Polylines;
- (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- pGC->ops->Polylines = SMI_Polylines;
-
- if (IS_VISIBLE(pDraw) && npt) {
- /* Allocate a temporary buffer for all segments of the polyline. */
- BoxPtr pBox = xnfcalloc(sizeof(BoxRec), npt);
- int extra = pGC->lineWidth >> 1, box;
-
- if (npt > 1) {
- /* Adjust the extra space required per polyline segment. */
- if (pGC->joinStyle == JoinMiter) {
- extra = 6 * pGC->lineWidth;
- } else if (pGC->capStyle == CapProjecting) {
- extra = pGC->lineWidth;
- }
- }
-
- for (box = 0; --npt;) {
- /* Setup the bounding box for one polyline segment. */
- pBox[box].x1 = pptInit->x;
- pBox[box].y1 = pptInit->y;
- pptInit++;
- pBox[box].x2 = pptInit->x;
- pBox[box].y2 = pptInit->y;
- if (mode == CoordModePrevious) {
- pBox[box].x2 += pBox[box].x1;
- pBox[box].y2 += pBox[box].y1;
- }
-
- /* Sort coordinates. */
- if (pBox[box].x1 > pBox[box].x2) {
- int tmp = pBox[box].x1;
- pBox[box].x1 = pBox[box].x2;
- pBox[box].x2 = tmp;
- }
- if (pBox[box].y1 > pBox[box].y2) {
- int tmp = pBox[box].y1;
- pBox[box].y1 = pBox[box].y2;
- pBox[box].y2 = tmp;
- }
-
- /* Add extra space required for each polyline segment. */
- pBox[box].x1 -= extra;
- pBox[box].y1 -= extra;
- pBox[box].x2 += extra + 1;
- pBox[box].y2 += extra + 1;
-
- /* See if we need to draw this polyline segment. */
- TRANSLATE_BOX(pBox[box], pDraw);
- TRIM_BOX(pBox[box], pGC);
- if (BOX_NOT_EMPTY(pBox[box])) {
- box++;
- }
- }
-
- if (box) {
- /* Refresh all polyline segments now. */
- if (pSmi->Chipset == SMI_COUGAR3DR) {
- SMI_RefreshArea730(pScrn, box, pBox);
- } else {
- SMI_RefreshArea(pScrn, box, pBox);
- }
- }
-
- /* Free the temporary buffer. */
- xfree(pBox);
- }
-
- pSmi->polyLines = TRUE;
- LEAVE();
-}
-
-#endif