xserver-multidpi/miext/shadow/shpacked.c

119 lines
3.2 KiB
C
Raw Normal View History

2003-11-14 17:48:57 +01:00
/*
*
* Copyright © 2000 Keith Packard
2003-11-14 17:48:57 +01:00
*
* 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, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD 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 <stdlib.h>
#include <X11/X.h>
2003-11-14 17:48:57 +01:00
#include "scrnintstr.h"
#include "windowstr.h"
#include <X11/fonts/font.h>
2003-11-14 17:48:57 +01:00
#include "dixfontstr.h"
#include <X11/fonts/fontstruct.h>
2003-11-14 17:48:57 +01:00
#include "mi.h"
#include "regionstr.h"
#include "globals.h"
#include "gcstruct.h"
#include "shadow.h"
#include "fb.h"
void
2003-11-14 17:48:57 +01:00
shadowUpdatePacked (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
RegionPtr damage = shadowDamage (pBuf);
2003-11-14 17:48:57 +01:00
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = RegionNumRects (damage);
BoxPtr pbox = RegionRects (damage);
2003-11-14 17:48:57 +01:00
FbBits *shaBase, *shaLine, *sha;
FbStride shaStride;
int scrBase, scrLine, scr;
int shaBpp;
miext: Mark some variables as unused. There's no use for the values set through the various macro calls (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused. The following warnings go away accordingly: | CC shpacked.lo | shpacked.c: In function 'shadowUpdatePacked': | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar8.lo | shplanar8.c: In function 'shadowUpdatePlanar4x8': | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar.lo | shplanar.c: In function 'shadowUpdatePlanar4': | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_180.lo | In file included from shrot16pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270.lo | In file included from shrot16pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270YX.lo | In file included from shrot16pack_270YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90.lo | In file included from shrot16pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90YX.lo | In file included from shrot16pack_90YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack.lo | In file included from shrot16pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate16': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_180.lo | In file included from shrot32pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_270.lo | In file included from shrot32pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_90.lo | In file included from shrot32pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack.lo | In file included from shrot32pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate32': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_180.lo | In file included from shrot8pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_270.lo | In file included from shrot8pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_90.lo | In file included from shrot8pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack.lo | In file included from shrot8pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate8': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrotate.lo | shrotate.c: In function 'shadowUpdateRotatePacked': | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shpacked.lo | shpacked.c: In function 'shadowUpdatePacked': | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar8.lo | shplanar8.c: In function 'shadowUpdatePlanar4x8': | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar.lo | shplanar.c: In function 'shadowUpdatePlanar4': | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_180.lo | In file included from shrot16pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270.lo | In file included from shrot16pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270YX.lo | In file included from shrot16pack_270YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90.lo | In file included from shrot16pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90YX.lo | In file included from shrot16pack_90YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack.lo | In file included from shrot16pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate16': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_180.lo | In file included from shrot32pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_270.lo | In file included from shrot32pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_90.lo | In file included from shrot32pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack.lo | In file included from shrot32pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate32': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_180.lo | In file included from shrot8pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_270.lo | In file included from shrot8pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_90.lo | In file included from shrot8pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack.lo | In file included from shrot8pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate8': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrotate.lo | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Cyril Brulebois <kibi@debian.org>
2011-05-24 18:33:17 +02:00
_X_UNUSED int shaXoff, shaYoff;
2003-11-14 17:48:57 +01:00
int x, y, w, h, width;
int i;
FbBits *winBase = NULL, *win;
CARD32 winSize;
fbGetDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff);
while (nbox--)
{
x = pbox->x1 * shaBpp;
y = pbox->y1;
w = (pbox->x2 - pbox->x1) * shaBpp;
h = pbox->y2 - pbox->y1;
scrLine = (x >> FB_SHIFT);
shaLine = shaBase + y * shaStride + (x >> FB_SHIFT);
x &= FB_MASK;
w = (w + x + FB_MASK) >> FB_SHIFT;
while (h--)
{
winSize = 0;
scrBase = 0;
width = w;
scr = scrLine;
sha = shaLine;
while (width) {
/* how much remains in this window */
i = scrBase + winSize - scr;
if (i <= 0 || scr < scrBase)
{
winBase = (FbBits *) (*pBuf->window) (pScreen,
y,
scr * sizeof (FbBits),
SHADOW_WINDOW_WRITE,
&winSize,
pBuf->closure);
if(!winBase)
return;
scrBase = scr;
winSize /= sizeof (FbBits);
i = winSize;
}
win = winBase + (scr - scrBase);
if (i > width)
i = width;
width -= i;
scr += i;
#define PickBit(a,i) (((a) >> (i)) & 1)
memcpy(win, sha, i * sizeof(FbBits));
sha += i;
2003-11-14 17:48:57 +01:00
}
shaLine += shaStride;
y++;
}
pbox++;
}
}
shadowUpdateProc
Export symbols defined in the sdk. This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-11-30 02:56:06 +01:00
shadowUpdatePackedWeak(void) {
return shadowUpdatePacked;
}