aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/miext/damage
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/miext/damage
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/miext/damage')
-rw-r--r--xorg-server/miext/damage/Makefile.in35
-rw-r--r--xorg-server/miext/damage/damage.c84
-rw-r--r--xorg-server/miext/damage/damage.h52
-rw-r--r--xorg-server/miext/damage/damagestr.h5
4 files changed, 139 insertions, 37 deletions
diff --git a/xorg-server/miext/damage/Makefile.in b/xorg-server/miext/damage/Makefile.in
index 0ee782889..8b2baded2 100644
--- a/xorg-server/miext/damage/Makefile.in
+++ b/xorg-server/miext/damage/Makefile.in
@@ -39,8 +39,11 @@ subdir = miext/damage
DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
+ $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/shave.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@@ -50,7 +53,8 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \
$(top_builddir)/include/xorg-config.h \
$(top_builddir)/include/xkb-config.h \
$(top_builddir)/include/xwin-config.h \
- $(top_builddir)/include/kdrive-config.h
+ $(top_builddir)/include/kdrive-config.h \
+ $(top_builddir)/include/version-config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
@@ -101,6 +105,7 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
+AM_MAKEFLAGS = @AM_MAKEFLAGS@
APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@
APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@
APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@
@@ -121,9 +126,12 @@ CCASDEPMODE = @CCASDEPMODE@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+CXX = @CXX@
CYGPATH_W = @CYGPATH_W@
DARWIN_LIBS = @DARWIN_LIBS@
DBUS_CFLAGS = @DBUS_CFLAGS@
@@ -152,7 +160,9 @@ 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@
@@ -161,9 +171,13 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
FGREP = @FGREP@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@
GLX_DEFINES = @GLX_DEFINES@
GL_CFLAGS = @GL_CFLAGS@
@@ -202,12 +216,13 @@ LTCOMPILE = @LTCOMPILE@
LTCXXCOMPILE = @LTCXXCOMPILE@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
+MAIN_LIB = @MAIN_LIB@
+MAKEFLAGS = @MAKEFLAGS@
MAKEINFO = @MAKEINFO@
MAKE_HTML = @MAKE_HTML@
MAKE_PDF = @MAKE_PDF@
MAKE_PS = @MAKE_PS@
MAKE_TEXT = @MAKE_TEXT@
-MESA_SOURCE = @MESA_SOURCE@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
@@ -227,7 +242,6 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
@@ -237,6 +251,7 @@ PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PROJECTROOT = @PROJECTROOT@
PS2PDF = @PS2PDF@
+Q = @Q@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
@@ -250,11 +265,10 @@ STRIP = @STRIP@
TSLIB_CFLAGS = @TSLIB_CFLAGS@
TSLIB_LIBS = @TSLIB_LIBS@
UTILS_SYS_LIBS = @UTILS_SYS_LIBS@
-VENDOR_MAN_VERSION = @VENDOR_MAN_VERSION@
-VENDOR_NAME = @VENDOR_NAME@
+V = @V@
VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@
-VENDOR_RELEASE = @VENDOR_RELEASE@
VERSION = @VERSION@
+WINDRES = @WINDRES@
X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@
X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@
XDMCP_CFLAGS = @XDMCP_CFLAGS@
@@ -290,6 +304,7 @@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@
XORG_SYS_LIBS = @XORG_SYS_LIBS@
XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@
XPBPROXY_LIBS = @XPBPROXY_LIBS@
+XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@
XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@
XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@
XSDL_INCS = @XSDL_INCS@
@@ -314,7 +329,6 @@ YFLAGS = @YFLAGS@
__XCONFIGFILE__ = @__XCONFIGFILE__@
abi_ansic = @abi_ansic@
abi_extension = @abi_extension@
-abi_font = @abi_font@
abi_videodrv = @abi_videodrv@
abi_xinput = @abi_xinput@
abs_builddir = @abs_builddir@
@@ -337,6 +351,7 @@ build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
driverdir = @driverdir@
dvidir = @dvidir@
@@ -368,7 +383,9 @@ psdir = @psdir@
sbindir = @sbindir@
sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
+shavedir = @shavedir@
srcdir = @srcdir@
+symbol_visibility = @symbol_visibility@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
diff --git a/xorg-server/miext/damage/damage.c b/xorg-server/miext/damage/damage.c
index fa2f27997..b7ec92a5b 100644
--- a/xorg-server/miext/damage/damage.c
+++ b/xorg-server/miext/damage/damage.c
@@ -1514,7 +1514,7 @@ damageText (DrawablePtr pDrawable,
imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16);
- charinfo = (CharInfoPtr *) xalloc(count * sizeof(CharInfoPtr));
+ charinfo = xalloc(count * sizeof(CharInfoPtr));
if (!charinfo)
return x;
@@ -1856,6 +1856,25 @@ damageCloseScreen (int i, ScreenPtr pScreen)
}
/**
+ * Default implementations of the damage management functions.
+ */
+void miDamageCreate (DamagePtr pDamage)
+{
+}
+
+void miDamageRegister (DrawablePtr pDrawable, DamagePtr pDamage)
+{
+}
+
+void miDamageUnregister (DrawablePtr pDrawable, DamagePtr pDamage)
+{
+}
+
+void miDamageDestroy (DamagePtr pDamage)
+{
+}
+
+/**
* Public functions for consumption outside this file.
*/
@@ -1866,6 +1885,9 @@ DamageSetup (ScreenPtr pScreen)
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
+ const DamageScreenFuncsRec miFuncs = {
+ miDamageCreate, miDamageRegister, miDamageUnregister, miDamageDestroy
+ };
if (dixLookupPrivate(&pScreen->devPrivates, damageScrPrivateKey))
return TRUE;
@@ -1873,7 +1895,7 @@ DamageSetup (ScreenPtr pScreen)
if (!dixRequestPrivate(damageGCPrivateKey, sizeof(DamageGCPrivRec)))
return FALSE;
- pScrPriv = (DamageScrPrivPtr) xalloc (sizeof (DamageScrPrivRec));
+ pScrPriv = xalloc (sizeof (DamageScrPrivRec));
if (!pScrPriv)
return FALSE;
@@ -1894,6 +1916,8 @@ DamageSetup (ScreenPtr pScreen)
}
#endif
+ pScrPriv->funcs = miFuncs;
+
dixSetPrivate(&pScreen->devPrivates, damageScrPrivateKey, pScrPriv);
return TRUE;
}
@@ -1906,6 +1930,7 @@ DamageCreate (DamageReportFunc damageReport,
ScreenPtr pScreen,
void *closure)
{
+ damageScrPriv(pScreen);
DamagePtr pDamage;
pDamage = xalloc (sizeof (DamageRec));
@@ -1927,6 +1952,11 @@ DamageCreate (DamageReportFunc damageReport,
pDamage->damageReportPostRendering = NULL;
pDamage->damageDestroy = damageDestroy;
pDamage->damageMarker = NULL;
+ pDamage->pScreen = pScreen;
+ pDamage->devPrivates = NULL;
+
+ (*pScrPriv->funcs.Create) (pDamage);
+
return pDamage;
}
@@ -1934,6 +1964,17 @@ void
DamageRegister (DrawablePtr pDrawable,
DamagePtr pDamage)
{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ damageScrPriv(pScreen);
+
+#if DAMAGE_VALIDATE_ENABLE
+ if (pDrawable->pScreen != pDamage->pScreen)
+ {
+ ErrorF ("DamageRegister called with mismatched screens\n");
+ abort ();
+ }
+#endif
+
if (pDrawable->type == DRAWABLE_WINDOW)
{
WindowPtr pWindow = (WindowPtr) pDrawable;
@@ -1956,6 +1997,7 @@ DamageRegister (DrawablePtr pDrawable,
pDamage->isWindow = FALSE;
pDamage->pDrawable = pDrawable;
damageInsertDamage (getDrawableDamageRef (pDrawable), pDamage);
+ (*pScrPriv->funcs.Register) (pDrawable, pDamage);
}
void
@@ -1970,6 +2012,11 @@ void
DamageUnregister (DrawablePtr pDrawable,
DamagePtr pDamage)
{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ damageScrPriv(pScreen);
+
+ (*pScrPriv->funcs.Unregister) (pDrawable, pDamage);
+
if (pDrawable->type == DRAWABLE_WINDOW)
{
WindowPtr pWindow = (WindowPtr) pDrawable;
@@ -2004,10 +2051,16 @@ DamageUnregister (DrawablePtr pDrawable,
void
DamageDestroy (DamagePtr pDamage)
{
+ ScreenPtr pScreen = pDamage->pScreen;
+ damageScrPriv(pScreen);
+
if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure);
- REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage);
- REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->pendingDamage);
+ (*pScrPriv->funcs.Destroy) (pDamage);
+ dixFreePrivates(pDamage->devPrivates);
+ pDamage->devPrivates = NULL;
+ REGION_UNINIT (pScreen, &pDamage->damage);
+ REGION_UNINIT (pScreen, &pDamage->pendingDamage);
xfree (pDamage);
}
@@ -2050,25 +2103,25 @@ DamageEmpty (DamagePtr pDamage)
REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage);
}
-_X_EXPORT RegionPtr
+RegionPtr
DamageRegion (DamagePtr pDamage)
{
return &pDamage->damage;
}
-_X_EXPORT RegionPtr
+RegionPtr
DamagePendingRegion (DamagePtr pDamage)
{
return &pDamage->pendingDamage;
}
-_X_EXPORT void
+void
DamageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion)
{
damageRegionAppend (pDrawable, pRegion, FALSE, -1);
}
-_X_EXPORT void
+void
DamageRegionProcessPending (DrawablePtr pDrawable)
{
damageRegionProcessPending (pDrawable);
@@ -2077,7 +2130,7 @@ DamageRegionProcessPending (DrawablePtr pDrawable)
/* If a damage marker is provided, then this function must be called after rendering is done. */
/* Please do call back so any future enhancements can assume this function is called. */
/* There are no strict timing requirements for calling this function, just as soon as (is cheaply) possible. */
-_X_EXPORT void
+void
DamageRegionRendered (DrawablePtr pDrawable, DamagePtr pDamage, RegionPtr pOldDamage, RegionPtr pRegion)
{
if (pDamage->damageReportPostRendering)
@@ -2085,7 +2138,7 @@ DamageRegionRendered (DrawablePtr pDrawable, DamagePtr pDamage, RegionPtr pOldDa
}
/* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */
-_X_EXPORT void
+void
DamageDamageRegion (DrawablePtr pDrawable,
RegionPtr pRegion)
{
@@ -2098,16 +2151,23 @@ DamageDamageRegion (DrawablePtr pDrawable,
damageRegionProcessPending (pDrawable);
}
-_X_EXPORT void
+void
DamageSetReportAfterOp (DamagePtr pDamage, Bool reportAfter)
{
pDamage->reportAfter = reportAfter;
}
-_X_EXPORT void
+void
DamageSetPostRenderingFunctions(DamagePtr pDamage, DamageReportFunc damageReportPostRendering,
DamageMarkerFunc damageMarker)
{
pDamage->damageReportPostRendering = damageReportPostRendering;
pDamage->damageMarker = damageMarker;
}
+
+DamageScreenFuncsPtr
+DamageGetScreenFuncs (ScreenPtr pScreen)
+{
+ damageScrPriv(pScreen);
+ return &pScrPriv->funcs;
+}
diff --git a/xorg-server/miext/damage/damage.h b/xorg-server/miext/damage/damage.h
index a70f1f86e..067016f38 100644
--- a/xorg-server/miext/damage/damage.h
+++ b/xorg-server/miext/damage/damage.h
@@ -43,10 +43,27 @@ typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure);
/* At some point DamageRegionRendered() must be called. */
typedef void (*DamageMarkerFunc) (DrawablePtr pDrawable, DamagePtr pDamage, RegionPtr pOldDamage, RegionPtr pRegion, void *closure);
-Bool
+typedef void (*DamageScreenCreateFunc) (DamagePtr);
+typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr);
+typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr);
+typedef void (*DamageScreenDestroyFunc) (DamagePtr);
+
+typedef struct _damageScreenFuncs {
+ DamageScreenCreateFunc Create;
+ DamageScreenRegisterFunc Register;
+ DamageScreenUnregisterFunc Unregister;
+ DamageScreenDestroyFunc Destroy;
+} DamageScreenFuncsRec, *DamageScreenFuncsPtr;
+
+extern _X_EXPORT void miDamageCreate (DamagePtr);
+extern _X_EXPORT void miDamageRegister (DrawablePtr, DamagePtr);
+extern _X_EXPORT void miDamageUnregister (DrawablePtr, DamagePtr);
+extern _X_EXPORT void miDamageDestroy (DamagePtr);
+
+extern _X_EXPORT Bool
DamageSetup (ScreenPtr pScreen);
-DamagePtr
+extern _X_EXPORT DamagePtr
DamageCreate (DamageReportFunc damageReport,
DamageDestroyFunc damageDestroy,
DamageReportLevel damageLevel,
@@ -54,55 +71,58 @@ DamageCreate (DamageReportFunc damageReport,
ScreenPtr pScreen,
void * closure);
-void
+extern _X_EXPORT void
DamageDrawInternal (ScreenPtr pScreen, Bool enable);
-void
+extern _X_EXPORT void
DamageRegister (DrawablePtr pDrawable,
DamagePtr pDamage);
-void
+extern _X_EXPORT void
DamageUnregister (DrawablePtr pDrawable,
DamagePtr pDamage);
-void
+extern _X_EXPORT void
DamageDestroy (DamagePtr pDamage);
-Bool
+extern _X_EXPORT Bool
DamageSubtract (DamagePtr pDamage,
const RegionPtr pRegion);
-void
+extern _X_EXPORT void
DamageEmpty (DamagePtr pDamage);
-RegionPtr
+extern _X_EXPORT RegionPtr
DamageRegion (DamagePtr pDamage);
-RegionPtr
+extern _X_EXPORT RegionPtr
DamagePendingRegion (DamagePtr pDamage);
/* In case of rendering, call this before the submitting the commands. */
-void
+extern _X_EXPORT void
DamageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion);
/* Call this directly after the rendering operation has been submitted. */
-void
+extern _X_EXPORT void
DamageRegionProcessPending (DrawablePtr pDrawable);
/* Call this some time after rendering is done, only relevant when a damageMarker is provided. */
-void
+extern _X_EXPORT void
DamageRegionRendered (DrawablePtr pDrawable, DamagePtr pDamage, RegionPtr pOldDamage, RegionPtr pRegion);
/* Avoid using this call, it only exists for API compatibility. */
-void
+extern _X_EXPORT void
DamageDamageRegion (DrawablePtr pDrawable,
const RegionPtr pRegion);
-void
+extern _X_EXPORT void
DamageSetReportAfterOp (DamagePtr pDamage, Bool reportAfter);
-void
+extern _X_EXPORT void
DamageSetPostRenderingFunctions(DamagePtr pDamage, DamageReportFunc damageReportPostRendering,
DamageMarkerFunc damageMarker);
+extern _X_EXPORT DamageScreenFuncsPtr
+DamageGetScreenFuncs (ScreenPtr);
+
#endif /* _DAMAGE_H_ */
diff --git a/xorg-server/miext/damage/damagestr.h b/xorg-server/miext/damage/damagestr.h
index 559a13659..d7435b2a1 100644
--- a/xorg-server/miext/damage/damagestr.h
+++ b/xorg-server/miext/damage/damagestr.h
@@ -53,6 +53,8 @@ typedef struct _damage {
Bool reportAfter;
RegionRec pendingDamage; /* will be flushed post submission at the latest */
RegionRec backupDamage; /* for use with damageMarker */
+ ScreenPtr pScreen;
+ PrivateRec *devPrivates;
} DamageRec;
typedef struct _damageScrPriv {
@@ -75,6 +77,9 @@ typedef struct _damageScrPriv {
GlyphsProcPtr Glyphs;
AddTrapsProcPtr AddTraps;
#endif
+
+ /* Table of wrappable function pointers */
+ DamageScreenFuncsRec funcs;
} DamageScrPrivRec, *DamageScrPrivPtr;
typedef struct _damageGCPriv {