summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c
new file mode 100644
index 000000000..fb50612ad
--- /dev/null
+++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c
@@ -0,0 +1,62 @@
+/* **********************************************************
+ * Copyright (C) 1998-2001 VMware, Inc.
+ * All Rights Reserved
+ * **********************************************************/
+#ifdef VMX86_DEVEL
+char rcsId_vmwarezerarc[] =
+
+ "Id: vmwarezerarc.c,v 1.2 2001/01/26 23:32:16 yoel Exp $";
+#endif
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarezerarc.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */
+
+#include "vmware.h"
+
+static void
+computeBBarc(DrawablePtr pDrawable,
+ GCPtr pGC, int narcs, xArc * parcs, BoxPtr pBB)
+{
+ if (narcs <= 0)
+ return;
+ pBB->x1 = parcs->x;
+ pBB->y1 = parcs->y;
+ pBB->x2 = parcs->x + parcs->width + 1;
+ pBB->y2 = parcs->y + parcs->height + 1;
+ while (--narcs) {
+ parcs++;
+ if (parcs->x < pBB->x1)
+ pBB->x1 = parcs->x;
+ if (parcs->y < pBB->y1)
+ pBB->y1 = parcs->y;
+ if ((parcs->x + parcs->width + 1) > pBB->x2)
+ pBB->x2 = parcs->x + parcs->width + 1;
+ if ((parcs->y + parcs->height + 1) > pBB->y2)
+ pBB->y2 = parcs->y + parcs->height + 1;
+ }
+ pBB->x1 =
+ MAX(pDrawable->x + pBB->x1 - pGC->lineWidth,
+ (REGION_EXTENTS(pGC->pScreen,
+&((WindowPtr) pDrawable)->winSize))->x1);
+ pBB->y1 =
+ MAX(pDrawable->y + pBB->y1 - pGC->lineWidth,
+ (REGION_EXTENTS(pGC->pScreen,
+&((WindowPtr) pDrawable)->winSize))->y1);
+ pBB->x2 =
+ MIN(pDrawable->x + pBB->x2 + pGC->lineWidth,
+ (REGION_EXTENTS(pGC->pScreen,
+&((WindowPtr) pDrawable)->winSize))->x2);
+ pBB->y2 =
+ MIN(pDrawable->y + pBB->y2 + pGC->lineWidth,
+ (REGION_EXTENTS(pGC->pScreen,
+&((WindowPtr) pDrawable)->winSize))->y2);
+}
+
+void
+vmwarePolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs)
+{
+ TRACEPOINT
+
+ GC_FUNC_WRAPPER(pDrawable->type == DRAWABLE_WINDOW,
+ pGC->pScreen,
+ computeBBarc(pDrawable, pGC, narcs, parcs, &BB),
+ GC_OPS(pGC)->PolyArc(pDrawable, pGC, narcs, parcs));
+}