summaryrefslogtreecommitdiff
path: root/xserver/composite
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2013-06-07 17:28:57 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2013-06-07 17:28:57 +0000
commitc0190187060808fe0ad2a09b31f4244757572ff9 (patch)
treeb028697436476ae3ff34218b0b233a233d8a7818 /xserver/composite
parent33eda071f5846d332b428de759c5b1649e9cf1ba (diff)
Update to X server 1.14.1. Tested by many during t2k13. Thanks.
Diffstat (limited to 'xserver/composite')
-rw-r--r--xserver/composite/Makefile.in16
-rw-r--r--xserver/composite/compalloc.c9
-rw-r--r--xserver/composite/compext.c63
-rw-r--r--xserver/composite/compinit.c4
-rw-r--r--xserver/composite/compint.h11
-rw-r--r--xserver/composite/compositeext.h2
-rw-r--r--xserver/composite/compwindow.c32
7 files changed, 68 insertions, 69 deletions
diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in
index 350a01c5c..995f52536 100644
--- a/xserver/composite/Makefile.in
+++ b/xserver/composite/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.12.3 from Makefile.am.
+# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
@@ -213,13 +213,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@
DOXYGEN = @DOXYGEN@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
DRI2PROTO_LIBS = @DRI2PROTO_LIBS@
-DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@
-DRIPROTO_LIBS = @DRIPROTO_LIBS@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
-DRI_CFLAGS = @DRI_CFLAGS@
DRI_DRIVER_PATH = @DRI_DRIVER_PATH@
-DRI_LIBS = @DRI_LIBS@
DSYMUTIL = @DSYMUTIL@
DTRACE = @DTRACE@
DUMPBIN = @DUMPBIN@
@@ -241,6 +237,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@
FOP = @FOP@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
+GLX_SYS_LIBS = @GLX_SYS_LIBS@
GLX_TLS = @GLX_TLS@
GL_CFLAGS = @GL_CFLAGS@
GL_LIBS = @GL_LIBS@
@@ -265,6 +262,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@
+LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
@@ -280,7 +278,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
MAIN_LIB = @MAIN_LIB@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -379,6 +376,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_LIBS = @XNEST_LIBS@
XNEST_SYS_LIBS = @XNEST_SYS_LIBS@
XORG_CFLAGS = @XORG_CFLAGS@
+XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@
XORG_INCS = @XORG_INCS@
XORG_LIBS = @XORG_LIBS@
XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@
@@ -493,7 +491,7 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -518,9 +516,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
diff --git a/xserver/composite/compalloc.c b/xserver/composite/compalloc.c
index 15a6cd24f..cc69c68f2 100644
--- a/xserver/composite/compalloc.c
+++ b/xserver/composite/compalloc.c
@@ -55,14 +55,13 @@ compScreenUpdate(ScreenPtr pScreen)
}
static void
-compBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask)
+compBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask)
{
- ScreenPtr pScreen = screenInfo.screens[i];
CompScreenPtr cs = GetCompScreen(pScreen);
pScreen->BlockHandler = cs->BlockHandler;
compScreenUpdate(pScreen);
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
/* Next damage will restore the block handler */
cs->BlockHandler = NULL;
@@ -561,8 +560,8 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
}
}
else {
- PictFormatPtr pSrcFormat = compWindowFormat(pParent);
- PictFormatPtr pDstFormat = compWindowFormat(pWin);
+ PictFormatPtr pSrcFormat = PictureWindowFormat(pParent);
+ PictFormatPtr pDstFormat = PictureWindowFormat(pWin);
XID inferiors = IncludeInferiors;
int error;
diff --git a/xserver/composite/compext.c b/xserver/composite/compext.c
index 940eed1fc..8641eff5e 100644
--- a/xserver/composite/compext.c
+++ b/xserver/composite/compext.c
@@ -48,6 +48,7 @@
#include "compint.h"
#include "xace.h"
#include "protocol-versions.h"
+#include "extinit.h"
static CARD8 CompositeReqCode;
static DevPrivateKeyRec CompositeClientPrivateKeyRec;
@@ -107,14 +108,15 @@ static int
ProcCompositeQueryVersion(ClientPtr client)
{
CompositeClientPtr pCompositeClient = GetCompositeClient(client);
- xCompositeQueryVersionReply rep;
+ xCompositeQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0
+ };
REQUEST(xCompositeQueryVersionReq);
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) {
rep.majorVersion = stuff->majorVersion;
rep.minorVersion = stuff->minorVersion;
@@ -131,7 +133,7 @@ ProcCompositeQueryVersion(ClientPtr client)
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xCompositeQueryVersionReply), &rep);
return Success;
}
@@ -311,18 +313,19 @@ ProcCompositeGetOverlayWindow(ClientPtr client)
return rc;
}
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.overlayWin = cs->pOverlayWin->drawable.id;
+ rep = (xCompositeGetOverlayWindowReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .overlayWin = cs->pOverlayWin->drawable.id
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.overlayWin);
}
- (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply,
- (char *) &rep);
+ WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
return Success;
}
@@ -497,6 +500,28 @@ SProcCompositeDispatch(ClientPtr client)
return BadRequest;
}
+/** @see GetDefaultBytes */
+static void
+GetCompositeClientWindowBytes(pointer value, XID id, ResourceSizePtr size)
+{
+ WindowPtr window = value;
+
+ /* Currently only pixmap bytes are reported to clients. */
+ size->resourceSize = 0;
+
+ /* Calculate pixmap reference sizes. */
+ size->pixmapRefSize = 0;
+ if (window->redirectDraw != RedirectDrawNone)
+ {
+ SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
+ ResourceSizeRec pixmapSize = { 0, 0 };
+ ScreenPtr screen = window->drawable.pScreen;
+ PixmapPtr pixmap = screen->GetWindowPixmap(window);
+ pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
+ size->pixmapRefSize += pixmapSize.pixmapRefSize;
+ }
+}
+
void
CompositeExtensionInit(void)
{
@@ -529,6 +554,9 @@ CompositeExtensionInit(void)
if (!CompositeClientWindowType)
return;
+ SetResourceTypeSizeFunc(CompositeClientWindowType,
+ GetCompositeClientWindowBytes);
+
CompositeClientSubwindowsType = CreateNewResourceType
(FreeCompositeClientSubwindows, "CompositeClientSubwindows");
if (!CompositeClientSubwindowsType)
@@ -818,18 +846,19 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client)
cs = GetCompScreen(screenInfo.screens[0]);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.overlayWin = cs->pOverlayWin->drawable.id;
+ rep = (xCompositeGetOverlayWindowReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .overlayWin = cs->pOverlayWin->drawable.id
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.overlayWin);
}
- (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply,
- (char *) &rep);
+ WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep);
return Success;
}
diff --git a/xserver/composite/compinit.c b/xserver/composite/compinit.c
index eaa125681..bc1130e78 100644
--- a/xserver/composite/compinit.c
+++ b/xserver/composite/compinit.c
@@ -53,7 +53,7 @@ DevPrivateKeyRec CompWindowPrivateKeyRec;
DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
static Bool
-compCloseScreen(int index, ScreenPtr pScreen)
+compCloseScreen(ScreenPtr pScreen)
{
CompScreenPtr cs = GetCompScreen(pScreen);
Bool ret;
@@ -82,7 +82,7 @@ compCloseScreen(int index, ScreenPtr pScreen)
free(cs);
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
- ret = (*pScreen->CloseScreen) (index, pScreen);
+ ret = (*pScreen->CloseScreen) (pScreen);
return ret;
}
diff --git a/xserver/composite/compint.h b/xserver/composite/compint.h
index 6c4272e5b..45b5824a9 100644
--- a/xserver/composite/compint.h
+++ b/xserver/composite/compint.h
@@ -71,6 +71,7 @@
#include "damageextint.h"
#include "xfixes.h"
#include <X11/extensions/compositeproto.h>
+#include "compositeext.h"
#include <assert.h>
/*
@@ -182,7 +183,6 @@ extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
#define GetCompSubwindows(w) ((CompSubwindowsPtr) \
dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
-extern RESTYPE CompositeClientWindowType;
extern RESTYPE CompositeClientSubwindowsType;
extern RESTYPE CompositeClientOverlayType;
@@ -229,13 +229,6 @@ compReallocPixmap(WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, int bw);
/*
- * compext.c
- */
-
-void
- CompositeExtensionInit(void);
-
-/*
* compinit.c
*/
@@ -272,8 +265,6 @@ void
#define compCheckTree(s)
#endif
-PictFormatPtr compWindowFormat(WindowPtr pWin);
-
void
compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap);
diff --git a/xserver/composite/compositeext.h b/xserver/composite/compositeext.h
index 600604d8d..0b148f029 100644
--- a/xserver/composite/compositeext.h
+++ b/xserver/composite/compositeext.h
@@ -35,4 +35,6 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
VisualID * vids,
int nVisuals);
+extern _X_EXPORT RESTYPE CompositeClientWindowType;
+
#endif /* _COMPOSITEEXT_H_ */
diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c
index 6eb624b11..0be7a1b34 100644
--- a/xserver/composite/compwindow.c
+++ b/xserver/composite/compwindow.c
@@ -208,7 +208,8 @@ updateOverlayWindow(ScreenPtr pScreen)
return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
}
- /* Let's be on the safe side and not assume an overlay window is always allocated. */
+ /* Let's be on the safe side and not assume an overlay window is
+ always allocated. */
return Success;
}
@@ -631,28 +632,6 @@ compGetRedirectBorderClip(WindowPtr pWin)
return &cw->borderClip;
}
-static VisualPtr
-compGetWindowVisual(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- VisualID vid = wVisual(pWin);
- int i;
-
- for (i = 0; i < pScreen->numVisuals; i++)
- if (pScreen->visuals[i].vid == vid)
- return &pScreen->visuals[i];
- return 0;
-}
-
-PictFormatPtr
-compWindowFormat(WindowPtr pWin)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
-
- return PictureMatchVisual(pScreen, pWin->drawable.depth,
- compGetWindowVisual(pWin));
-}
-
static void
compWindowUpdateAutomatic(WindowPtr pWin)
{
@@ -660,8 +639,8 @@ compWindowUpdateAutomatic(WindowPtr pWin)
ScreenPtr pScreen = pWin->drawable.pScreen;
WindowPtr pParent = pWin->parent;
PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin);
- PictFormatPtr pSrcFormat = compWindowFormat(pWin);
- PictFormatPtr pDstFormat = compWindowFormat(pWin->parent);
+ PictFormatPtr pSrcFormat = PictureWindowFormat(pWin);
+ PictFormatPtr pDstFormat = PictureWindowFormat(pWin->parent);
int error;
RegionPtr pRegion = DamageRegion(cw->damage);
PicturePtr pSrcPicture = CreatePicture(0, &pSrcPixmap->drawable,
@@ -700,7 +679,8 @@ compWindowUpdateAutomatic(WindowPtr pWin)
/*
* And paint
*/
- CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture, 0, 0, /* src_x, src_y */
+ CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture,
+ 0, 0, /* src_x, src_y */
0, 0, /* msk_x, msk_y */
pSrcPixmap->screen_x - pParent->drawable.x,
pSrcPixmap->screen_y - pParent->drawable.y,