[xserver-commit] xserver/miext/shadow Makefile.am,1.2,1.2.2.1 shadow.c,1.16,1.16.2.1 shadow.h,1.8,1.8.2.1 shpacked.c,1.7,1.7.2.1 shplanar.c,1.6,1.6.2.1 shplanar8.c,1.6,1.6.2.1 shrotate.c,1.7,1.7.2.1 shrotpack.h,1.6,1.6.2.1
Keith Packard
xserver-commit@pdx.freedesktop.org
Tue, 21 Oct 2003 23:00:52 -0700
Committed by: keithp
Update of /cvs/xserver/xserver/miext/shadow
In directory pdx:/tmp/cvs-serv16351/miext/shadow
Modified Files:
Tag: xfixes_2_branch
Makefile.am shadow.c shadow.h shpacked.c shplanar.c
shplanar8.c shrotate.c shrotpack.h
Log Message:
* configure.ac:
Build damage infrastructure. Don't build layer
* fb/fbcopy.c: (fbCopyNtoN), (fbCopyArea):
Move check for 24/32 copy to fbCopyNtoN so that other users will hit
it
* hw/kdrive/fbdev/Makefile.am:
* hw/kdrive/fbdev/fbdev.c: (fbdevScreenInitialize),
(fbdevGetPixmap), (fbdevPixmapSet), (fbdevRandRSetConfig),
(fbdevInitScreen), (fbdevFinishInitScreen):
* hw/kdrive/fbdev/fbdev.h:
Eliminate miext/layer
* hw/kdrive/linux/Makefile.am:
Build damage infrastructure. Don't build layer
* hw/kdrive/mach64/Makefile.am:
Build damage infrastructure. Don't build layer
* hw/kdrive/mach64/mach64.c: (mach64ScreenInit),
(mach64InitScreen), (mach64ScreenFini), (mach64CardFini):
* hw/kdrive/mach64/mach64.h:
* hw/kdrive/mach64/mach64draw.c: (mach64DrawFini):
* hw/kdrive/mach64/mach64video.c: (mach64InitVideo),
(mach64FiniVideo):
Memory leak fix of mach64c on server reset
Memory leak fix for video on server reset.
Eliminate layer
* hw/kdrive/mga/Makefile.am:
* hw/kdrive/mga/mga.c: (mgaScreenInit):
Build damage infrastructure. Don't build layer
* hw/kdrive/nvidia/Makefile.am:
* hw/kdrive/nvidia/nvidia.c: (nvidiaRandRSetConfig),
(nvidiaPreserve), (nvidiaEnable):
Build damage infrastructure. Don't build layer
* hw/kdrive/r128/Makefile.am:
* hw/kdrive/smi/Makefile.am:
Build damage infrastructure. Don't build layer
* hw/kdrive/src/Makefile.am:
Build damage infrastructure. Don't build layer
* hw/kdrive/src/kaa.c: (kaaDestroyPixmap), (kaaCreatePixmap),
(kaaPixmapIsOffscreen), (kaaGetOffscreenPixmap),
(kaaDrawableIsOffscreen), (kaaFillSpans), (kaaCopyNtoN),
(kaaPolyFillRect), (kaaSolidBoxClipped), (kaaValidateGC),
(kaaFillRegionSolid), (kaaDrawInit), (kaaDrawFini):
Don't assume windows are onscreen, use GetWindowPixmap
and test devPrivate.ptr. Make sure depth 24 pixmaps are 24bpp
when hardware format is 24bpp.
* hw/kdrive/src/kasync.c:
Get rid of debug KdAssertSync function
* hw/kdrive/src/kdrive.c: (KdCloseScreen), (KdScreenInit):
* hw/kdrive/src/kdrive.h:
* hw/kdrive/src/koffscreen.c: (KdOffscreenValidate),
(KdOffscreenAlloc), (KdOffscreenInit):
add memory_size to KdScreenInfo, eliminate off_screen_size,
fix tests to suit.
* hw/kdrive/vesa/Makefile.am:
* hw/kdrive/vesa/vesa.c: (vesaScreenInitialize), (vesaUpdateMono),
(vesaGetPixmap), (vesaMapFramebuffer), (vesaPixmapSet),
(vesaRandRSetConfig), (vesaInitScreen), (vesaFinishInitScreen),
(vesaScreenFini):
* hw/kdrive/vesa/vesa.h:
Build damage infrastructure. Don't build layer
* hw/xnest/Makefile.am:
Use damage (for software cursor, I guess)
* mi/Makefile.am:
* mi/misprite.c: (miSpriteReportDamage), (miSpriteCopyWindow):
* mi/mispritest.h:
Damage is used for software cursor
* miext/Makefile.am:
* miext/layer/Makefile.am:
* miext/layer/layerinit.c: (layerCloseScreen):
Build damage infrastructure. Don't build layer
* miext/shadow/Makefile.am:
* miext/shadow/shadow.c: (shadowRedisplay), (shadowGetImage),
(shadowCloseScreen), (shadowSetup), (shadowSet), (shadowUnset),
(shadowInit):
* miext/shadow/shadow.h:
* miext/shadow/shpacked.c: (shadowUpdatePacked):
* miext/shadow/shplanar.c: (shadowUpdatePlanar4):
* miext/shadow/shplanar8.c: (shadowUpdatePlanar4x8):
* miext/shadow/shrotate.c: (shadowUpdateRotatePacked):
* miext/shadow/shrotpack.h:
Use damage to track changes
* xfixes/xfixes.c: (XFixesResetProc):
Fix memory leak
Index: Makefile.am
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -d -r1.2 -r1.2.2.1
--- Makefile.am 29 Sep 2003 01:42:40 -0000 1.2
+++ Makefile.am 22 Oct 2003 06:00:50 -0000 1.2.2.1
@@ -3,6 +3,7 @@
-I$(top_srcdir)/include \
-I$(top_srcdir)/mi \
-I$(top_srcdir)/render \
+ -I$(top_srcdir)/miext/damage \
$(XSERVER_CFLAGS)
noinst_LIBRARIES = libshadow.a
Index: shadow.c
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shadow.c,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- shadow.c 11 Sep 2003 05:12:51 -0000 1.16
+++ shadow.c 22 Oct 2003 06:00:50 -0000 1.16.2.1
@@ -38,20 +38,9 @@
#include "gcstruct.h"
#include "shadow.h"
-typedef struct _shadowGCPriv {
- GCOps *ops;
- GCFuncs *funcs;
-} shadowGCPrivRec, *shadowGCPrivPtr;
-
int shadowScrPrivateIndex;
-int shadowGCPrivateIndex;
int shadowGeneration;
[...1512 lines suppressed...]
+ PixmapPtr pPixmap;
+
+ pPixmap = (*pScreen->CreatePixmap) (pScreen, pScreen->width,
+ pScreen->height,
+ pScreen->rootDepth);
+ if (!pPixmap)
+ return FALSE;
+
if (!shadowSetup (pScreen))
+ {
+ (*pScreen->DestroyPixmap) (pPixmap);
return FALSE;
+ }
- if (!shadowAdd (pScreen, 0, update, window, SHADOW_ROTATE_0, 0))
- return FALSE;
+ shadowSet (pScreen, pPixmap, update, window, SHADOW_ROTATE_0, 0);
return TRUE;
}
Index: shadow.h
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shadow.h,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -d -r1.8 -r1.8.2.1
--- shadow.h 11 Sep 2003 05:12:51 -0000 1.8
+++ shadow.h 22 Oct 2003 06:00:50 -0000 1.8.2.1
@@ -31,6 +31,8 @@
#include "picturestr.h"
#endif
+#include "damage.h"
+
typedef struct _shadowBuf *shadowBufPtr;
typedef void (*ShadowUpdateProc) (ScreenPtr pScreen,
@@ -48,13 +50,17 @@
void *closure);
typedef struct _shadowBuf {
- shadowBufPtr pNext;
+
ShadowUpdateProc update;
ShadowWindowProc window;
- RegionRec damage;
PixmapPtr pPixmap;
void *closure;
int randr;
+ DamagePtr pDamage;
+
+ /* screen wrappers */
+ GetImageProcPtr GetImage;
+ CloseScreenProcPtr CloseScreen;
} shadowBufRec;
/* Match defines from randr extension */
@@ -68,31 +74,17 @@
#define SHADOW_REFLECT_Y 32
#define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
-typedef struct _shadowScrPriv {
- PaintWindowBackgroundProcPtr PaintWindowBackground;
- PaintWindowBorderProcPtr PaintWindowBorder;
- CopyWindowProcPtr CopyWindow;
- CloseScreenProcPtr CloseScreen;
- CreateGCProcPtr CreateGC;
- GetImageProcPtr GetImage;
-#ifdef RENDER
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
-#endif
- shadowBufPtr pBuf;
- BSFuncRec BackingStoreFuncs;
-} shadowScrPrivRec, *shadowScrPrivPtr;
-
extern int shadowScrPrivateIndex;
-#define shadowGetScrPriv(pScr) ((shadowScrPrivPtr) (pScr)->devPrivates[shadowScrPrivateIndex].ptr)
-#define shadowScrPriv(pScr) shadowScrPrivPtr pScrPriv = shadowGetScrPriv(pScr)
+#define shadowGetBuf(pScr) ((shadowBufPtr) (pScr)->devPrivates[shadowScrPrivateIndex].ptr)
+#define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
+#define shadowDamage(pBuf) DamageRegion(pBuf->pDamage)
Bool
shadowSetup (ScreenPtr pScreen);
Bool
-shadowAdd (ScreenPtr pScreen,
+shadowSet (ScreenPtr pScreen,
PixmapPtr pPixmap,
ShadowUpdateProc update,
ShadowWindowProc window,
@@ -100,10 +92,7 @@
void *closure);
void
-shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap);
-
-shadowBufPtr
-shadowFindBuf (WindowPtr pWindow);
+shadowUnset (ScreenPtr pScreen);
Bool
shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
@@ -163,10 +152,4 @@
shadowUpdateRotate32_270 (ScreenPtr pScreen,
shadowBufPtr pBuf);
-void
-shadowWrapGC (GCPtr pGC);
-
-void
-shadowUnwrapGC (GCPtr pGC);
-
#endif /* _SHADOW_H_ */
Index: shpacked.c
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shpacked.c,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- shpacked.c 11 Sep 2003 05:12:51 -0000 1.7
+++ shpacked.c 22 Oct 2003 06:00:50 -0000 1.7.2.1
@@ -42,7 +42,7 @@
shadowUpdatePacked (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage (pBuf);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = REGION_NUM_RECTS (damage);
BoxPtr pbox = REGION_RECTS (damage);
Index: shplanar.c
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shplanar.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -d -r1.6 -r1.6.2.1
--- shplanar.c 11 Sep 2003 05:12:51 -0000 1.6
+++ shplanar.c 22 Oct 2003 06:00:50 -0000 1.6.2.1
@@ -88,7 +88,7 @@
shadowUpdatePlanar4 (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = REGION_NUM_RECTS (damage);
BoxPtr pbox = REGION_RECTS (damage);
Index: shplanar8.c
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shplanar8.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -d -r1.6 -r1.6.2.1
--- shplanar8.c 11 Sep 2003 05:12:51 -0000 1.6
+++ shplanar8.c 22 Oct 2003 06:00:50 -0000 1.6.2.1
@@ -91,7 +91,7 @@
shadowUpdatePlanar4x8 (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = REGION_NUM_RECTS (damage);
BoxPtr pbox = REGION_RECTS (damage);
Index: shrotate.c
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shrotate.c,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- shrotate.c 11 Sep 2003 05:12:51 -0000 1.7
+++ shrotate.c 22 Oct 2003 06:00:50 -0000 1.7.2.1
@@ -52,7 +52,7 @@
shadowUpdateRotatePacked (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = REGION_NUM_RECTS (damage);
BoxPtr pbox = REGION_RECTS (damage);
Index: shrotpack.h
===================================================================
RCS file: /cvs/xserver/xserver/miext/shadow/shrotpack.h,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -d -r1.6 -r1.6.2.1
--- shrotpack.h 11 Sep 2003 05:12:51 -0000 1.6
+++ shrotpack.h 22 Oct 2003 06:00:50 -0000 1.6.2.1
@@ -92,7 +92,7 @@
FUNC (ScreenPtr pScreen,
shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
+ RegionPtr damage = shadowDamage(pBuf);
PixmapPtr pShadow = pBuf->pPixmap;
int nbox = REGION_NUM_RECTS (damage);
BoxPtr pbox = REGION_RECTS (damage);