aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/xaa/xaaOverlay.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-15 16:28:11 +0000
committermarha <marha@users.sourceforge.net>2010-05-15 16:28:11 +0000
commitc38dead3ea7e177728d90cd815cf4eead0c9f534 (patch)
treeb809dba1dc9013bb1e67a5ee388f2dd217dc0f88 /xorg-server/hw/xfree86/xaa/xaaOverlay.c
parent6083a94d68878c9ad5f59b28bd07e4738e9fb7b4 (diff)
downloadvcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.tar.gz
vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.tar.bz2
vcxsrv-c38dead3ea7e177728d90cd815cf4eead0c9f534.zip
xserver git update 15/5/2010
Diffstat (limited to 'xorg-server/hw/xfree86/xaa/xaaOverlay.c')
-rw-r--r--xorg-server/hw/xfree86/xaa/xaaOverlay.c258
1 files changed, 129 insertions, 129 deletions
diff --git a/xorg-server/hw/xfree86/xaa/xaaOverlay.c b/xorg-server/hw/xfree86/xaa/xaaOverlay.c
index 2956a3dbf..b7122a58f 100644
--- a/xorg-server/hw/xfree86/xaa/xaaOverlay.c
+++ b/xorg-server/hw/xfree86/xaa/xaaOverlay.c
@@ -1,129 +1,129 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "xaa.h"
-#include "xaalocal.h"
-#include "xaawrap.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "mioverlay.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-static void
-XAACopyWindow8_32(
- WindowPtr pWin,
- DDXPointRec ptOldOrg,
- RegionPtr prgnSrc
-){
- DDXPointPtr pptSrc, ppt;
- RegionRec rgnDst;
- BoxPtr pbox;
- int dx, dy, nbox;
- WindowPtr pwinRoot;
- ScreenPtr pScreen = pWin->drawable.pScreen;
- XAAInfoRecPtr infoRec =
- GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
- Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
- RegionPtr borderClip = &pWin->borderClip;
- Bool freeReg = FALSE;
-
- if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt ||
- (infoRec->ScreenToScreenBitBltFlags & NO_PLANEMASK))
- {
- XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
- if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
- (*infoRec->Sync)(infoRec->pScrn);
- infoRec->NeedToSync = FALSE;
- }
- (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
- XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow8_32);
- return;
- }
-
- pwinRoot = WindowTable[pScreen->myNum];
-
- if(doUnderlay)
- freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
-
- REGION_NULL(pScreen, &rgnDst);
-
- dx = ptOldOrg.x - pWin->drawable.x;
- dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
- REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
-
- pbox = REGION_RECTS(&rgnDst);
- nbox = REGION_NUM_RECTS(&rgnDst);
- if(!nbox ||
- !(pptSrc = (DDXPointPtr )xalloc(nbox * sizeof(DDXPointRec)))) {
- REGION_UNINIT(pScreen, &rgnDst);
- return;
- }
- ppt = pptSrc;
-
- while(nbox--) {
- ppt->x = pbox->x1 + dx;
- ppt->y = pbox->y1 + dy;
- ppt++; pbox++;
- }
-
- infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000;
- infoRec->ScratchGC.alu = GXcopy;
-
- XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
- &(infoRec->ScratchGC), &rgnDst, pptSrc);
-
- xfree(pptSrc);
- REGION_UNINIT(pScreen, &rgnDst);
- if(freeReg)
- REGION_DESTROY(pScreen, borderClip);
-}
-
-static void
-XAASetColorKey8_32(
- ScreenPtr pScreen,
- int nbox,
- BoxPtr pbox
-){
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- ScrnInfoPtr pScrn = infoRec->pScrn;
-
- /* I'm counting on writes being clipped away while switched away.
- If this isn't going to be true then I need to be wrapping instead. */
- if(!infoRec->pScrn->vtSema) return;
-
- (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey << 24, GXcopy,
- 0xff000000, nbox, pbox);
-
- SET_SYNC_FLAG(infoRec);
-}
-
-void
-XAASetupOverlay8_32Planar(ScreenPtr pScreen)
-{
- XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
- int i;
-
- pScreen->CopyWindow = XAACopyWindow8_32;
-
- if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK))
- miOverlaySetTransFunction(pScreen, XAASetColorKey8_32);
-
- infoRec->FullPlanemask = ~0;
- for(i = 0; i < 32; i++) /* haven't thought about this much */
- infoRec->FullPlanemasks[i] = ~0;
-}
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include <X11/X.h>
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "mioverlay.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+static void
+XAACopyWindow8_32(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+){
+ DDXPointPtr pptSrc, ppt;
+ RegionRec rgnDst;
+ BoxPtr pbox;
+ int dx, dy, nbox;
+ WindowPtr pwinRoot;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec =
+ GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
+ Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
+ RegionPtr borderClip = &pWin->borderClip;
+ Bool freeReg = FALSE;
+
+ if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt ||
+ (infoRec->ScreenToScreenBitBltFlags & NO_PLANEMASK))
+ {
+ XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
+ if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
+ XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow8_32);
+ return;
+ }
+
+ pwinRoot = WindowTable[pScreen->myNum];
+
+ if(doUnderlay)
+ freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
+
+ REGION_NULL(pScreen, &rgnDst);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
+
+ pbox = REGION_RECTS(&rgnDst);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(!nbox ||
+ !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
+ REGION_UNINIT(pScreen, &rgnDst);
+ return;
+ }
+ ppt = pptSrc;
+
+ while(nbox--) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ ppt++; pbox++;
+ }
+
+ infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000;
+ infoRec->ScratchGC.alu = GXcopy;
+
+ XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ &(infoRec->ScratchGC), &rgnDst, pptSrc);
+
+ free(pptSrc);
+ REGION_UNINIT(pScreen, &rgnDst);
+ if(freeReg)
+ REGION_DESTROY(pScreen, borderClip);
+}
+
+static void
+XAASetColorKey8_32(
+ ScreenPtr pScreen,
+ int nbox,
+ BoxPtr pbox
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = infoRec->pScrn;
+
+ /* I'm counting on writes being clipped away while switched away.
+ If this isn't going to be true then I need to be wrapping instead. */
+ if(!infoRec->pScrn->vtSema) return;
+
+ (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey << 24, GXcopy,
+ 0xff000000, nbox, pbox);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+void
+XAASetupOverlay8_32Planar(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ int i;
+
+ pScreen->CopyWindow = XAACopyWindow8_32;
+
+ if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK))
+ miOverlaySetTransFunction(pScreen, XAASetColorKey8_32);
+
+ infoRec->FullPlanemask = ~0;
+ for(i = 0; i < 32; i++) /* haven't thought about this much */
+ infoRec->FullPlanemasks[i] = ~0;
+}