diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
commit | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch) | |
tree | c1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/render | |
parent | dc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff) | |
download | vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2 vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip |
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/render')
-rw-r--r-- | xorg-server/render/Makefile.am | 1 | ||||
-rw-r--r-- | xorg-server/render/Makefile.in | 84 | ||||
-rw-r--r-- | xorg-server/render/animcur.c | 144 | ||||
-rw-r--r-- | xorg-server/render/filter.c | 82 | ||||
-rw-r--r-- | xorg-server/render/glyph.c | 31 | ||||
-rw-r--r-- | xorg-server/render/matrix.c | 88 | ||||
-rw-r--r-- | xorg-server/render/mipict.c | 2 | ||||
-rw-r--r-- | xorg-server/render/picture.c | 73 | ||||
-rw-r--r-- | xorg-server/render/picturestr.h | 51 | ||||
-rw-r--r-- | xorg-server/render/render.c | 21 |
10 files changed, 325 insertions, 252 deletions
diff --git a/xorg-server/render/Makefile.am b/xorg-server/render/Makefile.am index e53c7c746..216c6134e 100644 --- a/xorg-server/render/Makefile.am +++ b/xorg-server/render/Makefile.am @@ -6,6 +6,7 @@ librender_la_SOURCES = \ animcur.c \ filter.c \ glyph.c \ + matrix.c \ miindex.c \ mipict.c \ mirect.c \ diff --git a/xorg-server/render/Makefile.in b/xorg-server/render/Makefile.in index 6dcee4b9d..68f988079 100644 --- a/xorg-server/render/Makefile.in +++ b/xorg-server/render/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -45,7 +45,6 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/xorg-server.h \ $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xgl-config.h \ $(top_builddir)/include/xorg-config.h \ $(top_builddir)/include/xkb-config.h \ $(top_builddir)/include/xwin-config.h \ @@ -53,18 +52,15 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) librender_la_LIBADD = -am_librender_la_OBJECTS = animcur.lo filter.lo glyph.lo miindex.lo \ - mipict.lo mirect.lo mitrap.lo mitri.lo picture.lo render.lo \ - renderedge.lo +am_librender_la_OBJECTS = animcur.lo filter.lo glyph.lo matrix.lo \ + miindex.lo mipict.lo mirect.lo mitrap.lo mitri.lo picture.lo \ + render.lo renderedge.lo librender_la_OBJECTS = $(am_librender_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ @@ -90,8 +86,9 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ -APPDEFAULTDIR = @APPDEFAULTDIR@ APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ +APPLE_APPLICATION_ID = @APPLE_APPLICATION_ID@ +APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ @@ -112,10 +109,6 @@ CFLAGS = @CFLAGS@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DARWIN_LIBS = @DARWIN_LIBS@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -137,6 +130,7 @@ DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ +DOLT_BASH = @DOLT_BASH@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ @@ -146,18 +140,15 @@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ -FREETYPE_LIBS = @FREETYPE_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GL_CFLAGS = @GL_CFLAGS@ @@ -176,7 +167,7 @@ KDRIVE_LIBS = @KDRIVE_LIBS@ KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -190,7 +181,10 @@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LINUXDOC = @LINUXDOC@ +LIPO = @LIPO@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -202,8 +196,7 @@ MESA_SOURCE = @MESA_SOURCE@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ -MKFONTDIR = @MKFONTDIR@ -MKFONTSCALE = @MKFONTSCALE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -212,8 +205,8 @@ OBJCFLAGS = @OBJCFLAGS@ OBJCLINK = @OBJCLINK@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -246,7 +239,6 @@ VENDOR_NAME = @VENDOR_NAME@ VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ VENDOR_RELEASE = @VENDOR_RELEASE@ VERSION = @VERSION@ -X11APP_ARCHS = @X11APP_ARCHS@ X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ @@ -256,27 +248,12 @@ XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ XDMX_CFLAGS = @XDMX_CFLAGS@ XDMX_LIBS = @XDMX_LIBS@ XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEGLMODULES_CFLAGS = @XEGLMODULES_CFLAGS@ -XEGL_LIBS = @XEGL_LIBS@ -XEGL_SYS_LIBS = @XEGL_SYS_LIBS@ XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_DRI_LIBS = @XEPHYR_DRI_LIBS@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86MISC_CFLAGS = @XF86MISC_CFLAGS@ -XF86MISC_LIBS = @XF86MISC_LIBS@ XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XGLMODULES_CFLAGS = @XGLMODULES_CFLAGS@ -XGLMODULES_LIBS = @XGLMODULES_LIBS@ -XGLXMODULES_CFLAGS = @XGLXMODULES_CFLAGS@ -XGLXMODULES_LIBS = @XGLXMODULES_LIBS@ -XGLX_LIBS = @XGLX_LIBS@ -XGLX_SYS_LIBS = @XGLX_SYS_LIBS@ -XGL_LIBS = @XGL_LIBS@ -XGL_MODULE_PATH = @XGL_MODULE_PATH@ -XGL_SYS_LIBS = @XGL_SYS_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ @@ -287,10 +264,6 @@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORGCFG_DEP_CFLAGS = @XORGCFG_DEP_CFLAGS@ -XORGCFG_DEP_LIBS = @XORGCFG_DEP_LIBS@ -XORGCONFIG_DEP_CFLAGS = @XORGCONFIG_DEP_CFLAGS@ -XORGCONFIG_DEP_LIBS = @XORGCONFIG_DEP_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ @@ -299,13 +272,8 @@ XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ XORG_OS = @XORG_OS@ XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPRINTMODULES_CFLAGS = @XPRINTMODULES_CFLAGS@ -XPRINTMODULES_LIBS = @XPRINTMODULES_LIBS@ -XPRINTPROTO_CFLAGS = @XPRINTPROTO_CFLAGS@ -XPRINTPROTO_LIBS = @XPRINTPROTO_LIBS@ -XPRINT_CFLAGS = @XPRINT_CFLAGS@ -XPRINT_LIBS = @XPRINT_LIBS@ -XPRINT_SYS_LIBS = @XPRINT_SYS_LIBS@ +XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ +XPBPROXY_LIBS = @XPBPROXY_LIBS@ XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ XSDL_INCS = @XSDL_INCS@ @@ -338,8 +306,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -359,7 +326,6 @@ driverdir = @driverdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ extdir = @extdir@ -ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ @@ -369,12 +335,12 @@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ -launchagentsdir = @launchagentsdir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ logdir = @logdir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ @@ -392,14 +358,13 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -xglmoduledir = @xglmoduledir@ -xpconfigdir = @xpconfigdir@ noinst_LTLIBRARIES = librender.la AM_CFLAGS = $(DIX_CFLAGS) librender_la_SOURCES = \ animcur.c \ filter.c \ glyph.c \ + matrix.c \ miindex.c \ mipict.c \ mirect.c \ @@ -418,8 +383,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -464,6 +429,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animcur.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glyph.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miindex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mipict.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mirect.Plo@am__quote@ @@ -522,7 +488,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff --git a/xorg-server/render/animcur.c b/xorg-server/render/animcur.c index 125928931..d80094d98 100644 --- a/xorg-server/render/animcur.c +++ b/xorg-server/render/animcur.c @@ -44,6 +44,7 @@ #include "dixfontstr.h" #include "opaque.h" #include "picturestr.h" +#include "inputstr.h" #include "xace.h" typedef struct _AnimCurElt { @@ -80,7 +81,8 @@ typedef struct _AnimCurState { CARD32 time; } AnimCurStateRec, *AnimCurStatePtr; -static AnimCurStateRec animCurState; +/* What a waste. But we need an API change to alloc it per device only. */ +static AnimCurStateRec animCurState[MAXDEVICES]; static unsigned char empty[4]; @@ -89,9 +91,11 @@ static CursorBits animCursorBits = { }; static int AnimCurGeneration; -static DevPrivateKey AnimCurScreenPrivateKey = &AnimCurScreenPrivateKey; -#define IsAnimCur(c) ((c)->bits == &animCursorBits) +static int AnimCurScreenPrivateKeyIndex; +static DevPrivateKey AnimCurScreenPrivateKey = &AnimCurScreenPrivateKeyIndex; + +#define IsAnimCur(c) ((c) && ((c)->bits == &animCursorBits)) #define GetAnimCur(c) ((AnimCurPtr) ((c) + 1)) #define GetAnimCurScreen(s) ((AnimCurScreenPtr)dixLookupPrivate(&(s)->devPrivates, AnimCurScreenPrivateKey)) #define GetAnimCurScreenIfSet(s) GetAnimCurScreen(s) @@ -101,11 +105,13 @@ static DevPrivateKey AnimCurScreenPrivateKey = &AnimCurScreenPrivateKey; #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) static Bool -AnimCurDisplayCursor (ScreenPtr pScreen, +AnimCurDisplayCursor (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor); static Bool -AnimCurSetCursorPosition (ScreenPtr pScreen, +AnimCurSetCursorPosition (DeviceIntPtr pDev, + ScreenPtr pScreen, int x, int y, Bool generateEvent); @@ -133,7 +139,8 @@ AnimCurCloseScreen (int index, ScreenPtr pScreen) } static void -AnimCurCursorLimits (ScreenPtr pScreen, +AnimCurCursorLimits (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox) @@ -145,11 +152,13 @@ AnimCurCursorLimits (ScreenPtr pScreen, { AnimCurPtr ac = GetAnimCur(pCursor); - (*pScreen->CursorLimits) (pScreen, ac->elts[0].pCursor, pHotBox, pTopLeftBox); + (*pScreen->CursorLimits) (pDev, pScreen, ac->elts[0].pCursor, + pHotBox, pTopLeftBox); } else { - (*pScreen->CursorLimits) (pScreen, pCursor, pHotBox, pTopLeftBox); + (*pScreen->CursorLimits) (inputInfo.pointer, pScreen, pCursor, + pHotBox, pTopLeftBox); } Wrap (as, pScreen, CursorLimits, AnimCurCursorLimits); } @@ -168,40 +177,55 @@ AnimCurScreenBlockHandler (int screenNum, { ScreenPtr pScreen = screenInfo.screens[screenNum]; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); + DeviceIntPtr dev; + CARD32 now = 0, + soonest = ~0; /* earliest time to wakeup again */ - if (pScreen == animCurState.pScreen) + for (dev = inputInfo.devices; dev; dev = dev->next) { - CARD32 now = GetTimeInMillis (); - - if ((INT32) (now - animCurState.time) >= 0) + if (IsPointerDevice(dev) && pScreen == animCurState[dev->id].pScreen) { - AnimCurPtr ac = GetAnimCur(animCurState.pCursor); - int elt = (animCurState.elt + 1) % ac->nelt; - DisplayCursorProcPtr DisplayCursor; - - /* - * Not a simple Unwrap/Wrap as this - * isn't called along the DisplayCursor - * wrapper chain. - */ - DisplayCursor = pScreen->DisplayCursor; - pScreen->DisplayCursor = as->DisplayCursor; - (void) (*pScreen->DisplayCursor) (pScreen, ac->elts[elt].pCursor); - as->DisplayCursor = pScreen->DisplayCursor; - pScreen->DisplayCursor = DisplayCursor; - - animCurState.elt = elt; - animCurState.time = now + ac->elts[elt].delay; + if (!now) now = GetTimeInMillis (); + + if ((INT32) (now - animCurState[dev->id].time) >= 0) + { + AnimCurPtr ac = GetAnimCur(animCurState[dev->id].pCursor); + int elt = (animCurState[dev->id].elt + 1) % ac->nelt; + DisplayCursorProcPtr DisplayCursor; + + /* + * Not a simple Unwrap/Wrap as this + * isn't called along the DisplayCursor + * wrapper chain. + */ + DisplayCursor = pScreen->DisplayCursor; + pScreen->DisplayCursor = as->DisplayCursor; + (void) (*pScreen->DisplayCursor) (dev, + pScreen, + ac->elts[elt].pCursor); + as->DisplayCursor = pScreen->DisplayCursor; + pScreen->DisplayCursor = DisplayCursor; + + animCurState[dev->id].elt = elt; + animCurState[dev->id].time = now + ac->elts[elt].delay; + } + + if (soonest > animCurState[dev->id].time) + soonest = animCurState[dev->id].time; } - AdjustWaitForDelay (pTimeout, animCurState.time - now); } + + if (now) + AdjustWaitForDelay (pTimeout, soonest - now); + Unwrap (as, pScreen, BlockHandler); (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); Wrap (as, pScreen, BlockHandler, AnimCurScreenBlockHandler); } static Bool -AnimCurDisplayCursor (ScreenPtr pScreen, +AnimCurDisplayCursor (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); @@ -210,17 +234,18 @@ AnimCurDisplayCursor (ScreenPtr pScreen, Unwrap (as, pScreen, DisplayCursor); if (IsAnimCur(pCursor)) { - if (pCursor != animCurState.pCursor) + if (pCursor != animCurState[pDev->id].pCursor) { AnimCurPtr ac = GetAnimCur(pCursor); - ret = (*pScreen->DisplayCursor) (pScreen, ac->elts[0].pCursor); + ret = (*pScreen->DisplayCursor) + (pDev, pScreen, ac->elts[0].pCursor); if (ret) { - animCurState.elt = 0; - animCurState.time = GetTimeInMillis () + ac->elts[0].delay; - animCurState.pCursor = pCursor; - animCurState.pScreen = pScreen; + animCurState[pDev->id].elt = 0; + animCurState[pDev->id].time = GetTimeInMillis () + ac->elts[0].delay; + animCurState[pDev->id].pCursor = pCursor; + animCurState[pDev->id].pScreen = pScreen; } } else @@ -228,16 +253,17 @@ AnimCurDisplayCursor (ScreenPtr pScreen, } else { - animCurState.pCursor = 0; - animCurState.pScreen = 0; - ret = (*pScreen->DisplayCursor) (pScreen, pCursor); + animCurState[pDev->id].pCursor = 0; + animCurState[pDev->id].pScreen = 0; + ret = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor); } Wrap (as, pScreen, DisplayCursor, AnimCurDisplayCursor); return ret; } static Bool -AnimCurSetCursorPosition (ScreenPtr pScreen, +AnimCurSetCursorPosition (DeviceIntPtr pDev, + ScreenPtr pScreen, int x, int y, Bool generateEvent) @@ -246,15 +272,16 @@ AnimCurSetCursorPosition (ScreenPtr pScreen, Bool ret; Unwrap (as, pScreen, SetCursorPosition); - if (animCurState.pCursor) - animCurState.pScreen = pScreen; - ret = (*pScreen->SetCursorPosition) (pScreen, x, y, generateEvent); + if (animCurState[pDev->id].pCursor) + animCurState[pDev->id].pScreen = pScreen; + ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); Wrap (as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); return ret; } static Bool -AnimCurRealizeCursor (ScreenPtr pScreen, +AnimCurRealizeCursor (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); @@ -264,13 +291,14 @@ AnimCurRealizeCursor (ScreenPtr pScreen, if (IsAnimCur(pCursor)) ret = TRUE; else - ret = (*pScreen->RealizeCursor) (pScreen, pCursor); + ret = (*pScreen->RealizeCursor) (pDev, pScreen, pCursor); Wrap (as, pScreen, RealizeCursor, AnimCurRealizeCursor); return ret; } static Bool -AnimCurUnrealizeCursor (ScreenPtr pScreen, +AnimCurUnrealizeCursor (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); @@ -288,13 +316,14 @@ AnimCurUnrealizeCursor (ScreenPtr pScreen, ret = TRUE; } else - ret = (*pScreen->UnrealizeCursor) (pScreen, pCursor); + ret = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor); Wrap (as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor); return ret; } static void -AnimCurRecolorCursor (ScreenPtr pScreen, +AnimCurRecolorCursor (DeviceIntPtr pDev, + ScreenPtr pScreen, CursorPtr pCursor, Bool displayed) { @@ -307,12 +336,12 @@ AnimCurRecolorCursor (ScreenPtr pScreen, int i; for (i = 0; i < ac->nelt; i++) - (*pScreen->RecolorCursor) (pScreen, ac->elts[i].pCursor, + (*pScreen->RecolorCursor) (pDev, pScreen, ac->elts[i].pCursor, displayed && - animCurState.elt == i); + animCurState[pDev->id].elt == i); } else - (*pScreen->RecolorCursor) (pScreen, pCursor, displayed); + (*pScreen->RecolorCursor) (pDev, pScreen, pCursor, displayed); Wrap (as, pScreen, RecolorCursor, AnimCurRecolorCursor); } @@ -323,11 +352,14 @@ AnimCurInit (ScreenPtr pScreen) if (AnimCurGeneration != serverGeneration) { + int i; AnimCurGeneration = serverGeneration; - animCurState.pCursor = 0; - animCurState.pScreen = 0; - animCurState.elt = 0; - animCurState.time = 0; + for (i = 0; i < MAXDEVICES; i++) { + animCurState[i].pCursor = 0; + animCurState[i].pScreen = 0; + animCurState[i].elt = 0; + animCurState[i].time = 0; + } } as = (AnimCurScreenPtr) xalloc (sizeof (AnimCurScreenRec)); if (!as) diff --git a/xorg-server/render/filter.c b/xorg-server/render/filter.c index aa3eb1a9e..21eedca31 100644 --- a/xorg-server/render/filter.c +++ b/xorg-server/render/filter.c @@ -126,7 +126,9 @@ PictureFreeFilterIds (void) _X_EXPORT int PictureAddFilter (ScreenPtr pScreen, char *filter, - PictFilterValidateParamsProcPtr ValidateParams) + PictFilterValidateParamsProcPtr ValidateParams, + int width, + int height) { PictureScreenPtr ps = GetPictureScreen(pScreen); int id = PictureGetFilterId (filter, -1, TRUE); @@ -152,6 +154,8 @@ PictureAddFilter (ScreenPtr pScreen, ps->filters[i].name = PictureGetFilterName (id); ps->filters[i].id = id; ps->filters[i].ValidateParams = ValidateParams; + ps->filters[i].width = width; + ps->filters[i].height = height; return id; } @@ -213,21 +217,29 @@ PictureFindFilter (ScreenPtr pScreen, char *name, int len) } static Bool -convolutionFilterValidateParams (PicturePtr pPicture, +convolutionFilterValidateParams (ScreenPtr pScreen, int filter, xFixed *params, - int nparams) + int nparams, + int *width, + int *height) { + int w, h; if (nparams < 3) return FALSE; if (xFixedFrac (params[0]) || xFixedFrac (params[1])) return FALSE; + w = xFixedToInt (params[0]); + h = xFixedToInt (params[1]); + nparams -= 2; - if ((xFixedToInt (params[0]) * xFixedToInt (params[1])) > nparams) + if (w * h > nparams) return FALSE; + *width = w; + *height = h; return TRUE; } @@ -238,9 +250,9 @@ PictureSetDefaultFilters (ScreenPtr pScreen) if (!filterNames) if (!PictureSetDefaultIds ()) return FALSE; - if (PictureAddFilter (pScreen, FilterNearest, 0) < 0) + if (PictureAddFilter (pScreen, FilterNearest, 0, 1, 1) < 0) return FALSE; - if (PictureAddFilter (pScreen, FilterBilinear, 0) < 0) + if (PictureAddFilter (pScreen, FilterBilinear, 0, 2, 2) < 0) return FALSE; if (!PictureSetFilterAlias (pScreen, FilterNearest, FilterFast)) @@ -250,7 +262,7 @@ PictureSetDefaultFilters (ScreenPtr pScreen) if (!PictureSetFilterAlias (pScreen, FilterBilinear, FilterBest)) return FALSE; - if (PictureAddFilter (pScreen, FilterConvolution, convolutionFilterValidateParams) < 0) + if (PictureAddFilter (pScreen, FilterConvolution, convolutionFilterValidateParams, 0, 0) < 0) return FALSE; return TRUE; @@ -270,29 +282,52 @@ int SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams) { PictFilterPtr pFilter; - xFixed *new_params; - int i, s, result; + ScreenPtr pScreen; + + if (pPicture->pDrawable != NULL) + pScreen = pPicture->pDrawable->pScreen; + else + pScreen = screenInfo.screens[0]; - pFilter = PictureFindFilter (screenInfo.screens[0], name, len); + pFilter = PictureFindFilter (pScreen, name, len); - if (pPicture->pDrawable == NULL) { + if (!pFilter) + return BadName; + + if (pPicture->pDrawable == NULL) + { + int s; /* For source pictures, the picture isn't tied to a screen. So, ensure * that all screens can handle a filter we set for the picture. */ - for (s = 0; s < screenInfo.numScreens; s++) { - if (PictureFindFilter (screenInfo.screens[s], name, len)->id != - pFilter->id) - { + for (s = 1; s < screenInfo.numScreens; s++) + { + PictFilterPtr pScreenFilter; + pScreenFilter = PictureFindFilter (screenInfo.screens[s], + name, len); + if (!pScreenFilter || pScreenFilter->id != pFilter->id) return BadMatch; - } } } + return SetPicturePictFilter (pPicture, pFilter, params, nparams); +} + +int +SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, + xFixed *params, int nparams) +{ + ScreenPtr pScreen; + int i; + + if (pPicture->pDrawable) + pScreen = pPicture->pDrawable->pScreen; + else + pScreen = screenInfo.screens[0]; - if (!pFilter) - return BadName; if (pFilter->ValidateParams) { - if (!(*pFilter->ValidateParams) (pPicture, pFilter->id, params, nparams)) + int width, height; + if (!(*pFilter->ValidateParams) (pScreen, pFilter->id, params, nparams, &width, &height)) return BadMatch; } else if (nparams) @@ -300,7 +335,7 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int if (nparams != pPicture->filter_nparams) { - new_params = xalloc (nparams * sizeof (xFixed)); + xFixed *new_params = xalloc (nparams * sizeof (xFixed)); if (!new_params && nparams) return BadAlloc; xfree (pPicture->filter_params); @@ -311,9 +346,10 @@ SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int pPicture->filter_params[i] = params[i]; pPicture->filter = pFilter->id; - if (pPicture->pDrawable) { - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - PictureScreenPtr ps = GetPictureScreen(pScreen); + if (pPicture->pDrawable) + { + PictureScreenPtr ps = GetPictureScreen(pScreen); + int result; result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter, params, nparams); diff --git a/xorg-server/render/glyph.c b/xorg-server/render/glyph.c index 286e39d63..87b332e2a 100644 --- a/xorg-server/render/glyph.c +++ b/xorg-server/render/glyph.c @@ -26,8 +26,12 @@ #include <dix-config.h> #endif -#include <stddef.h> /* buggy openssl/sha.h wants size_t */ -#include <openssl/sha.h> +#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ +# include <sha1.h> +#else /* Use OpenSSL's libcrypto */ +# include <stddef.h> /* buggy openssl/sha.h wants size_t */ +# include <openssl/sha.h> +#endif #include "misc.h" #include "scrnintstr.h" @@ -88,14 +92,6 @@ static GlyphHashRec globalGlyphs[GlyphFormatNum]; static void FreeGlyphPrivates (GlyphPtr glyph) { - ScreenPtr pScreen; - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - pScreen = screenInfo.screens[i]; - dixFreePrivates(*GetGlyphPrivatesForScreen(glyph, pScreen)); - } - dixFreePrivates(glyph->devPrivates); glyph->devPrivates = NULL; } @@ -202,6 +198,14 @@ HashGlyph (xGlyphInfo *gi, unsigned long size, unsigned char sha1[20]) { +#ifdef HAVE_SHA1_IN_LIBMD /* Use libmd for SHA1 */ + SHA1_CTX ctx; + + SHA1Init (&ctx); + SHA1Update (&ctx, gi, sizeof (xGlyphInfo)); + SHA1Update (&ctx, bits, size); + SHA1Final (sha1, &ctx); +#else /* Use OpenSSL's libcrypto */ SHA_CTX ctx; int success; @@ -220,6 +224,7 @@ HashGlyph (xGlyphInfo *gi, success = SHA1_Final (sha1, &ctx); if (! success) return BadAlloc; +#endif return Success; } @@ -436,10 +441,9 @@ bail: Bool AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) { - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); + hash->table = xcalloc (hashSet->size, sizeof (GlyphRefRec)); if (!hash->table) return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); hash->hashSet = hashSet; hash->tableEntries = 0; return TRUE; @@ -508,10 +512,9 @@ AllocateGlyphSet (int fdepth, PictFormatPtr format) } size = sizeof (GlyphSetRec); - glyphSet = xalloc (size); + glyphSet = xcalloc (1, size); if (!glyphSet) return FALSE; - bzero((char *)glyphSet, size); if (!AllocateGlyphHash (&glyphSet->hash, &glyphHashSets[0])) { diff --git a/xorg-server/render/matrix.c b/xorg-server/render/matrix.c new file mode 100644 index 000000000..3b55eb989 --- /dev/null +++ b/xorg-server/render/matrix.c @@ -0,0 +1,88 @@ +/* + * Copyright © 2007 Keith Packard + * + * 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 the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS 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 "misc.h" +#include "scrnintstr.h" +#include "os.h" +#include "regionstr.h" +#include "validate.h" +#include "windowstr.h" +#include "input.h" +#include "resource.h" +#include "colormapst.h" +#include "cursorstr.h" +#include "dixstruct.h" +#include "gcstruct.h" +#include "servermd.h" +#include "picturestr.h" + +_X_EXPORT void +PictTransform_from_xRenderTransform (PictTransformPtr pict, + xRenderTransform *render) +{ + pict->matrix[0][0] = render->matrix11; + pict->matrix[0][1] = render->matrix12; + pict->matrix[0][2] = render->matrix13; + + pict->matrix[1][0] = render->matrix21; + pict->matrix[1][1] = render->matrix22; + pict->matrix[1][2] = render->matrix23; + + pict->matrix[2][0] = render->matrix31; + pict->matrix[2][1] = render->matrix32; + pict->matrix[2][2] = render->matrix33; +} + +_X_EXPORT void +xRenderTransform_from_PictTransform (xRenderTransform *render, + PictTransformPtr pict) +{ + render->matrix11 = pict->matrix[0][0]; + render->matrix12 = pict->matrix[0][1]; + render->matrix13 = pict->matrix[0][2]; + + render->matrix21 = pict->matrix[1][0]; + render->matrix22 = pict->matrix[1][1]; + render->matrix23 = pict->matrix[1][2]; + + render->matrix31 = pict->matrix[2][0]; + render->matrix32 = pict->matrix[2][1]; + render->matrix33 = pict->matrix[2][2]; +} + +_X_EXPORT Bool +PictureTransformPoint (PictTransformPtr transform, + PictVectorPtr vector) +{ + return pixman_transform_point(transform, vector); +} + +_X_EXPORT Bool +PictureTransformPoint3d (PictTransformPtr transform, + PictVectorPtr vector) +{ + return pixman_transform_point_3d(transform, vector); +} diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c index 87dccbbda..2fadd8c36 100644 --- a/xorg-server/render/mipict.c +++ b/xorg-server/render/mipict.c @@ -379,7 +379,7 @@ miCompositeSourceValidate (PicturePtr pPicture, t.vector[0] = IntToxFixed (points[i].x); t.vector[1] = IntToxFixed (points[i].y); t.vector[2] = xFixed1; - if (PictureTransformPoint (pPicture->transform, &t)) + if (pixman_transform_point (pPicture->transform, &t)) { int tx = xFixedToInt (t.vector[0]); int ty = xFixedToInt (t.vector[1]); diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index b7874bb64..d672ebc8c 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -43,8 +43,10 @@ #include "xace.h" #include "registry.h" -_X_EXPORT DevPrivateKey PictureScreenPrivateKey = &PictureScreenPrivateKey; -DevPrivateKey PictureWindowPrivateKey = &PictureWindowPrivateKey; +static int PictureScreenPrivateKeyIndex; +_X_EXPORT DevPrivateKey PictureScreenPrivateKey = &PictureScreenPrivateKeyIndex; +static int PictureWindowPrivateKeyIndex; +DevPrivateKey PictureWindowPrivateKey = &PictureWindowPrivateKeyIndex; static int PictureGeneration; RESTYPE PictureType; RESTYPE PictFormatType; @@ -314,10 +316,9 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) } - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = xcalloc (nformats, sizeof (PictFormatRec)); if (!pFormats) return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); for (f = 0; f < nformats; f++) { pFormats[f].id = FakeClientID (0); @@ -1779,67 +1780,3 @@ AddTraps (PicturePtr pPicture, (*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps); } -_X_EXPORT Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - *vector = result; - return TRUE; -} - - -_X_EXPORT Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector) -{ - PictVector result; - int i, j; - xFixed_32_32 partial; - xFixed_48_16 v; - - for (j = 0; j < 3; j++) - { - v = 0; - for (i = 0; i < 3; i++) - { - partial = ((xFixed_48_16) transform->matrix[j][i] * - (xFixed_48_16) vector->vector[i]); - v += partial >> 16; - } - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - result.vector[j] = (xFixed) v; - } - if (!result.vector[2]) - return FALSE; - for (j = 0; j < 2; j++) - { - partial = (xFixed_48_16) result.vector[j] << 16; - v = partial / result.vector[2]; - if (v > MAX_FIXED_48_16 || v < MIN_FIXED_48_16) - return FALSE; - vector->vector[j] = (xFixed) v; - } - vector->vector[2] = xFixed1; - return TRUE; -} diff --git a/xorg-server/render/picturestr.h b/xorg-server/render/picturestr.h index acd15c7fe..4d788fcfb 100644 --- a/xorg-server/render/picturestr.h +++ b/xorg-server/render/picturestr.h @@ -56,6 +56,9 @@ typedef struct _PictFormat { typedef struct pixman_vector PictVector, *PictVectorPtr; typedef struct pixman_transform PictTransform, *PictTransformPtr; +#define pict_f_vector pixman_f_vector +#define pict_f_transform pixman_f_transform + #define PICT_GRADIENT_STOPTABLE_SIZE 1024 #define SourcePictTypeSolidFill 0 #define SourcePictTypeLinear 1 @@ -184,12 +187,14 @@ typedef struct _Picture { SourcePictPtr pSourcePict; } PictureRec; -typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id, - xFixed *params, int nparams); +typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id, + xFixed *params, int nparams, + int *width, int *height); typedef struct { char *name; int id; PictFilterValidateParamsProcPtr ValidateParams; + int width, height; } PictFilterRec, *PictFilterPtr; #define PictFilterNearest 0 @@ -403,9 +408,6 @@ extern RESTYPE GlyphSetType; #define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey)) #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p) -#define GetGlyphPrivatesForScreen(glyph, s) \ - ((PrivateRec **)dixLookupPrivateAddr(&(glyph)->devPrivates, s)) - #define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\ pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\ if (!pPicture) { \ @@ -461,7 +463,9 @@ PictureGetFilterName (int id); int PictureAddFilter (ScreenPtr pScreen, char *filter, - PictFilterValidateParamsProcPtr ValidateParams); + PictFilterValidateParamsProcPtr ValidateParams, + int width, + int height); Bool PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias); @@ -476,7 +480,12 @@ PictFilterPtr PictureFindFilter (ScreenPtr pScreen, char *name, int len); int -SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams); +SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, + xFixed *params, int nparams); + +int +SetPictureFilter (PicturePtr pPicture, char *name, int len, + xFixed *params, int nparams); Bool PictureFinishInit (void); @@ -605,14 +614,6 @@ CompositeTriFan (CARD8 op, int npoints, xPointFixed *points); -Bool -PictureTransformPoint (PictTransformPtr transform, - PictVectorPtr vector); - -Bool -PictureTransformPoint3d (PictTransformPtr transform, - PictVectorPtr vector); - CARD32 PictureGradientColor (PictGradientStopPtr stop1, PictGradientStopPtr stop2, @@ -676,4 +677,24 @@ void PanoramiXRenderInit (void); void PanoramiXRenderReset (void); #endif +/* + * matrix.c + */ + +void +PictTransform_from_xRenderTransform (PictTransformPtr pict, + xRenderTransform *render); + +void +xRenderTransform_from_PictTransform (xRenderTransform *render, + PictTransformPtr pict); + +Bool +PictureTransformPoint (PictTransformPtr transform, + PictVectorPtr vector); + +Bool +PictureTransformPoint3d (PictTransformPtr transform, + PictVectorPtr vector); + #endif /* _PICTURESTR_H_ */ diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c index 638aa46a3..7cb93bd18 100644 --- a/xorg-server/render/render.c +++ b/xorg-server/render/render.c @@ -210,11 +210,9 @@ int (*SProcRenderVector[RenderNumberRequests])(ClientPtr) = { SProcRenderCreateConicalGradient }; -static void -RenderResetProc (ExtensionEntry *extEntry); - int RenderErrBase; -DevPrivateKey RenderClientPrivateKey; +static int RenderClientPrivateKeyIndex; +DevPrivateKey RenderClientPrivateKey = &RenderClientPrivateKeyIndex; typedef struct _RenderClient { int major_version; @@ -252,17 +250,12 @@ RenderExtensionInit (void) extEntry = AddExtension (RENDER_NAME, 0, RenderNumberErrors, ProcRenderDispatch, SProcRenderDispatch, - RenderResetProc, StandardMinorOpcode); + NULL, StandardMinorOpcode); if (!extEntry) return; RenderErrBase = extEntry->errorBase; } -static void -RenderResetProc (ExtensionEntry *extEntry) -{ -} - static int ProcRenderQueryVersion (ClientPtr client) { @@ -305,8 +298,6 @@ findVisual (ScreenPtr pScreen, VisualID vid) return 0; } -extern char *ConnectionInfo; - static int ProcRenderQueryPictFormats (ClientPtr client) { @@ -1580,21 +1571,19 @@ ProcRenderCreateCursor (ClientPtr client) stride = BitmapBytePad(width); nbytes_mono = stride*height; - srcbits = (unsigned char *)xalloc(nbytes_mono); + srcbits = xcalloc(1, nbytes_mono); if (!srcbits) { xfree (argbbits); return (BadAlloc); } - mskbits = (unsigned char *)xalloc(nbytes_mono); + mskbits = xcalloc(1, nbytes_mono); if (!mskbits) { xfree(argbbits); xfree(srcbits); return (BadAlloc); } - bzero ((char *) mskbits, nbytes_mono); - bzero ((char *) srcbits, nbytes_mono); if (pSrc->format == PICT_a8r8g8b8) { |