123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- #ifdef HAVE_DIX_CONFIG_H
- #include <dix-config.h>
- #endif
- #include <X11/X.h>
- #include <X11/Xprotostr.h>
- #include "pixmapstr.h"
- #include "gcstruct.h"
- #include "windowstr.h"
- #include "mi.h"
- _X_EXPORT void
- miPolyPoint(pDrawable, pGC, mode, npt, pptInit)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int mode;
- int npt;
- xPoint *pptInit;
- {
- int xorg;
- int yorg;
- int nptTmp;
- XID fsOld, fsNew;
- int *pwidthInit, *pwidth;
- int i;
- xPoint *ppt;
-
- if (mode == CoordModePrevious)
- {
- ppt = pptInit;
- nptTmp = npt;
- nptTmp--;
- while(nptTmp--)
- {
- ppt++;
- ppt->x += (ppt-1)->x;
- ppt->y += (ppt-1)->y;
- }
- }
- if(pGC->miTranslate)
- {
- ppt = pptInit;
- nptTmp = npt;
- xorg = pDrawable->x;
- yorg = pDrawable->y;
- while(nptTmp--)
- {
- ppt->x += xorg;
- ppt++->y += yorg;
- }
- }
- fsOld = pGC->fillStyle;
- fsNew = FillSolid;
- if(pGC->fillStyle != FillSolid)
- {
- DoChangeGC(pGC, GCFillStyle, &fsNew, 0);
- ValidateGC(pDrawable, pGC);
- }
- if(!(pwidthInit = (int *)ALLOCATE_LOCAL(npt * sizeof(int))))
- return;
- pwidth = pwidthInit;
- for(i = 0; i < npt; i++)
- *pwidth++ = 1;
- (*pGC->ops->FillSpans)(pDrawable, pGC, npt, pptInit, pwidthInit, FALSE);
- if(fsOld != FillSolid)
- {
- DoChangeGC(pGC, GCFillStyle, &fsOld, 0);
- ValidateGC(pDrawable, pGC);
- }
- DEALLOCATE_LOCAL(pwidthInit);
- }
|