diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-09-19 07:25:55 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-09-19 07:25:55 -0400 |
commit | 97c150b61bbe436453b05d3c07cd2173870aac40 (patch) | |
tree | 5335d0df93703e7ca8617cfae57315709d032a29 /mfb | |
parent | 57907e0943da0c3fd3bf6c128d210b544629ce72 (diff) | |
parent | 547ad2125ece93bbe01f6d09a3baf176ebd16bb3 (diff) |
Merge branch 'master' into XACE-SELINUX
Conflicts:
afb/afbpntwin.c
afb/afbscrinit.c
afb/afbwindow.c
cfb/cfb.h
cfb/cfballpriv.c
cfb/cfbscrinit.c
cfb/cfbwindow.c
configure.ac
fb/wfbrename.h
hw/xfree86/xf4bpp/ppcIO.c
hw/xfree86/xf4bpp/ppcPntWin.c
hw/xfree86/xf4bpp/ppcWindow.c
hw/xfree86/xf8_32bpp/cfbscrinit.c
mfb/mfb.h
mfb/mfbpntwin.c
mfb/mfbscrinit.c
mfb/mfbwindow.c
mi/miexpose.c
Note: conflicts caused by devPrivates rework vs. paintwindow changes.
Diffstat (limited to 'mfb')
-rw-r--r-- | mfb/Makefile.am | 2 | ||||
-rw-r--r-- | mfb/mfb.h | 21 | ||||
-rw-r--r-- | mfb/mfbpntwin.c | 127 | ||||
-rw-r--r-- | mfb/mfbscrinit.c | 20 | ||||
-rw-r--r-- | mfb/mfbwindow.c | 179 |
5 files changed, 8 insertions, 341 deletions
diff --git a/mfb/Makefile.am b/mfb/Makefile.am index 8ff0260e7..274a32d7d 100644 --- a/mfb/Makefile.am +++ b/mfb/Makefile.am @@ -12,7 +12,7 @@ libmfb_gen_sources = mfbseg.c mfbpgbwht.c mfbpgbblak.c mfbpgbinv.c mfbigbwht.c \ DISTCLEANFILES = $(libmfb_gen_sources) libmfb_la_SOURCES = mfbgc.c mfbwindow.c mfbfont.c \ - mfbfillrct.c mfbpntwin.c maskbits.c mfbpixmap.c \ + mfbfillrct.c maskbits.c mfbpixmap.c \ mfbimage.c mfbline.c mfbbres.c mfbhrzvert.c mfbbresd.c \ mfbpushpxl.c mfbzerarc.c mfbfillarc.c \ mfbfillsp.c mfbsetsp.c mfbscrinit.c mfbscrclse.c mfbclip.c \ @@ -650,13 +650,6 @@ extern void mfbFillPolyWhite( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* mfbpntwin.c */ - -extern void mfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); /* mfbpolypnt.c */ extern void mfbPolyPoint( @@ -705,8 +698,7 @@ extern Bool mfbCloseScreen( extern Bool mfbAllocatePrivates( ScreenPtr /*pScreen*/, - DevPrivateKey *pWinKey, - DevPrivateKey *pGCIndex + DevPrivateKey * /*pGCKey*/ ); extern Bool mfbScreenInit( @@ -892,22 +884,11 @@ typedef mfbPrivGC *mfbPrivGCPtr; #endif extern DevPrivateKey mfbGetGCPrivateKey(void); -extern DevPrivateKey mfbGetWindowPrivateKey(void); #ifdef PIXMAP_PER_WINDOW extern DevPrivateKey frameGetWindowPrivateKey(void); #endif #ifndef MFB_PROTOTYPES_ONLY -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } mfbPrivWin; - /* Common macros for extracting drawing information */ #define mfbGetTypedWidth(pDrawable,wtype) (\ diff --git a/mfb/mfbpntwin.c b/mfb/mfbpntwin.c deleted file mode 100644 index 725d6beb8..000000000 --- a/mfb/mfbpntwin.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/X.h> - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "privates.h" - -#include "mfb.h" -#include "maskbits.h" -#include "mi.h" - -void -mfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground); - return; - } - break; - case BackgroundPixel: - if (pWin->background.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - if (pWin->border.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - else if (pPrivWin->fastBorder) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c index 515e9e3ce..8873a1ba1 100644 --- a/mfb/mfbscrinit.c +++ b/mfb/mfbscrinit.c @@ -71,8 +71,6 @@ SOFTWARE. static DevPrivateKey frameWindowPrivateKey = &frameWindowPrivateKey; DevPrivateKey frameGetWindowPrivateKey(void) { return frameWindowPrivateKey; } #endif -static DevPrivateKey mfbWindowPrivateKey = &mfbWindowPrivateKey; -DevPrivateKey mfbGetWindowPrivateKey(void) { return mfbWindowPrivateKey; } static DevPrivateKey mfbGCPrivateKey = &mfbGCPrivateKey; DevPrivateKey mfbGetGCPrivateKey(void) { return mfbGCPrivateKey; } static unsigned long mfbGeneration = 0; @@ -90,8 +88,7 @@ static DepthRec depth = { }; Bool -mfbAllocatePrivates(ScreenPtr pScreen, - DevPrivateKey *pWinIndex, DevPrivateKey *pGCIndex) +mfbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey) { if (mfbGeneration != serverGeneration) { @@ -99,14 +96,11 @@ mfbAllocatePrivates(ScreenPtr pScreen, VID = visual.vid; mfbGeneration = serverGeneration; } - if (pWinIndex) - *pWinIndex = mfbWindowPrivateKey; - if (pGCIndex) - *pGCIndex = mfbGCPrivateKey; + if (pGCKey) + *pGCKey = mfbGCPrivateKey; pScreen->GetWindowPixmap = mfbGetWindowPixmap; pScreen->SetWindowPixmap = mfbSetWindowPixmap; - return (dixRequestPrivate(mfbWindowPrivateKey, sizeof(mfbPrivWin)) && - dixRequestPrivate(mfbGCPrivateKey, sizeof(mfbPrivGC))); + return dixRequestPrivate(mfbGCPrivateKey, sizeof(mfbPrivGC)); } @@ -119,7 +113,7 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!mfbAllocatePrivates(pScreen, NULL, NULL)) + if (!mfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = (Colormap) FakeClientID(0); /* whitePixel, blackPixel */ @@ -128,13 +122,9 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->GetImage = mfbGetImage; pScreen->GetSpans = mfbGetSpans; pScreen->CreateWindow = mfbCreateWindow; - pScreen->DestroyWindow = mfbDestroyWindow; pScreen->PositionWindow = mfbPositionWindow; - pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes; pScreen->RealizeWindow = mfbMapWindow; pScreen->UnrealizeWindow = mfbUnmapWindow; - pScreen->PaintWindowBackground = mfbPaintWindow; - pScreen->PaintWindowBorder = mfbPaintWindow; pScreen->CopyWindow = mfbCopyWindow; pScreen->CreatePixmap = mfbCreatePixmap; pScreen->DestroyPixmap = mfbDestroyPixmap; diff --git a/mfb/mfbwindow.c b/mfb/mfbwindow.c index c522b07a3..e0bff8bea 100644 --- a/mfb/mfbwindow.c +++ b/mfb/mfbwindow.c @@ -65,32 +65,14 @@ Bool mfbCreateWindow(pWin) register WindowPtr pWin; { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - return (TRUE); } /* This always returns true, because Xfree can't fail. It might be possible * on some devices for Destroy to fail */ Bool -mfbDestroyWindow(pWin) - WindowPtr pWin; +mfbDestroyWindow(WindowPtr pWin) { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return (TRUE); } @@ -115,36 +97,6 @@ mfbPositionWindow(pWin, x, y) register WindowPtr pWin; int x, y; { - register mfbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - mfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - /* This is the "wrong" fix to the right problem, but it doesn't really * cost very much. When the window is moved, we need to invalidate any * RotatedPixmap that exists in any GC currently validated against this @@ -214,132 +166,3 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) DEALLOCATE_LOCAL(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } - - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ -Bool -mfbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; -{ - register unsigned long index; - register mfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) - { - mfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ - return (TRUE); -} |