summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2015-10-01 12:55:09 +0000
committertnn <tnn@pkgsrc.org>2015-10-01 12:55:09 +0000
commit9b0b4a02df53835c3f2f83bc2393f5209e60be46 (patch)
tree9f4233468efc33f14ec4307ef713a95f324edb14 /x11
parent0bbda9b1ef77988e6e37423f7fd3faef96cb745a (diff)
downloadpkgsrc-9b0b4a02df53835c3f2f83bc2393f5209e60be46.tar.gz
Import modular-xorg-xquartz-1.17.2 as x11/modular-xorg-xquartz.
The XQuartz project is an open-source effort to develop a version of the X.Org X Window System that runs on OS X. Together with supporting libraries and applications, it forms the X11.app that Apple has shipped with OS X since version 10.5.
Diffstat (limited to 'x11')
-rw-r--r--x11/modular-xorg-xquartz/DESCR4
-rw-r--r--x11/modular-xorg-xquartz/MESSAGE15
-rw-r--r--x11/modular-xorg-xquartz/Makefile138
-rw-r--r--x11/modular-xorg-xquartz/PLIST104
-rw-r--r--x11/modular-xorg-xquartz/distinfo19
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-fb_fb.h26
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-fb_fbpict.c348
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-fb_fbpict.h28
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-fb_fbscreen.c14
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-fb_fbtrap.c97
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-hw_xfree86_Makefile.am25
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-hw_xquartz_GL_indirect.c65
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-hw_xquartz_X11Controller.m33
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-hw_xquartz_pbproxy_Makefile.in15
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-mi_miexpose.c147
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-render_mipict.c17
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-render_mipict.h51
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-render_mitrap.c128
-rw-r--r--x11/modular-xorg-xquartz/patches/patch-render_mitri.c71
19 files changed, 1345 insertions, 0 deletions
diff --git a/x11/modular-xorg-xquartz/DESCR b/x11/modular-xorg-xquartz/DESCR
new file mode 100644
index 00000000000..1fce192f809
--- /dev/null
+++ b/x11/modular-xorg-xquartz/DESCR
@@ -0,0 +1,4 @@
+The XQuartz project is an open-source effort to develop a version of
+the X.Org X Window System that runs on OS X. Together with supporting
+libraries and applications, it forms the X11.app that Apple has shipped
+with OS X since version 10.5.
diff --git a/x11/modular-xorg-xquartz/MESSAGE b/x11/modular-xorg-xquartz/MESSAGE
new file mode 100644
index 00000000000..d5b711752af
--- /dev/null
+++ b/x11/modular-xorg-xquartz/MESSAGE
@@ -0,0 +1,15 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+To finish the installation of pkgsrc X11 on your Mac:
+
+$ sudo mv /Applications/Utilities/X11.app /Applications/Utilities/X11.app.bak
+$ sudo ln -s ${PREFIX}/Applications/Utilities/X11.app /Applications/Utilities
+
+$ echo "${PREFIX}/bin/xterm &" > ~/.xinitrc
+$ echo ${PREFIX}/bin/quartz-wm >> ~/.xinitrc
+$ ${PREFIX}/bin/startx -- ${PREFIX}/bin/Xquartz
+
+You can also launch X11.app from finder instead of the last step.
+
+===========================================================================
diff --git a/x11/modular-xorg-xquartz/Makefile b/x11/modular-xorg-xquartz/Makefile
new file mode 100644
index 00000000000..eee72aeab9e
--- /dev/null
+++ b/x11/modular-xorg-xquartz/Makefile
@@ -0,0 +1,138 @@
+# $NetBSD: Makefile,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+DISTNAME= xorg-server-1.17.2
+PKGNAME= ${DISTNAME:S/xorg-server/modular-xorg-xquartz/}
+CATEGORIES= x11
+MASTER_SITES= http://www.x.org/releases/individual/xserver/
+EXTRACT_SUFX= .tar.bz2
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.x.org/releases/individual/xserver/
+COMMENT= X11 server for Mac OS X
+LICENSE= mit
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake pkg-config
+USE_LANGUAGES= c c++ objc
+
+ONLY_FOR_PLATFORM= Darwin-*-*
+
+BUILD_DEFS+= VARBASE
+BUILD_DEFS_EFFECTS+= XKB_OUTPUT_DIR
+
+OWN_DIRS+= ${VARBASE}/log
+OWN_DIRS+= ${XKB_OUTPUT_DIR}
+XKB_OUTPUT_DIR?= ${VARBASE}/db/xkb # XXX sync with xkeyboard-config
+
+DEPENDS+= xkbcomp-[0-9]*:../../x11/xkbcomp
+DEPENDS+= xkeyboard-config-[0-9]*:../../x11/xkeyboard-config
+
+# Needed by X11.app:
+DEPENDS+= quartz-wm-[0-9]*:../../wm/quartz-wm
+DEPENDS+= xterm-[0-9]*:../../x11/xterm
+DEPENDS+= xinit-[0-9]*:../../x11/xinit
+
+LEGACY_FONT_PATHS=
+DEFAULT_FONT_PATHS=
+.for f in misc TTF OTF Type1 100dpi 75dpi cyrillic
+DEFAULT_FONT_PATHS+= ${PREFIX}/share/fonts/X11/${f}
+LEGACY_FONT_PATHS+= ${PREFIX}/lib/X11/fonts/${f}
+.endfor
+FONT_PATHS= ${DEFAULT_FONT_PATHS} ${LEGACY_FONT_PATHS}
+
+CONFIGURE_ARGS+= --enable-xquartz
+CONFIGURE_ARGS+= --disable-xorg
+CONFIGURE_ARGS+= --disable-xephyr
+CONFIGURE_ARGS+= --disable-kdrive
+CONFIGURE_ARGS+= --disable-config-hal
+CONFIGURE_ARGS+= --disable-dmx
+CONFIGURE_ARGS+= --disable-xwin
+CONFIGURE_ARGS+= --disable-xfake
+CONFIGURE_ARGS+= --disable-xfbdev
+
+CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q}
+CONFIGURE_ARGS+= --with-xkb-output=${XKB_OUTPUT_DIR:Q}
+CONFIGURE_ARGS+= --with-fontrootdir=${PREFIX}/share/fonts/X11
+CONFIGURE_ARGS+= --with-default-font-path=${FONT_PATHS:ts,:Q}
+
+CONFIGURE_ARGS+= --with-builder-addr="tech-x11@NetBSD.org"
+CONFIGURE_ARGS+= --with-os-vendor="The NetBSD Foundation"
+CONFIGURE_ARGS+= --with-os-name=${MACHINE_PLATFORM:Q}
+
+CONFIGURE_ARGS+= --enable-xtrans-send-fds
+CONFIGURE_ARGS+= --enable-dri
+CONFIGURE_ARGS+= --enable-dri2
+CONFIGURE_ARGS+= --enable-dri3
+CONFIGURE_ARGS+= --enable-glx
+CONFIGURE_ARGS+= --enable-aiglx
+CONFIGURE_ARGS+= --enable-glamor
+CONFIGURE_ARGS+= --enable-ipv6
+
+CONFIGURE_ARGS+= --with-apple-applications-dir=${PREFIX}/Applications/Utilities
+
+CONFIGURE_ENV+= APP_MAN_SUFFIX=1 FILE_MAN_SUFFIX=5
+CONFIGURE_ENV+= DRIVER_MAN_SUFFIX=4
+
+BUILD_DEPENDS+= tradcpp-[0-9]*:../../devel/tradcpp
+CONFIGURE_ENV+= ac_cv_path_RAWCPP="${PREFIX}/bin/tradcpp -Uunix"
+
+.include "../../security/nettle/buildlink3.mk"
+CONFIGURE_ARGS+= --with-sha1=libnettle
+
+MAKE_ENV+= OSX_SDK_PATH=${OSX_SDK_PATH}
+MESSAGE_SUBST+= PREFIX=${PREFIX}
+
+.include "../../devel/ncurses/buildlink3.mk"
+.include "../../devel/xorg-util-macros/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../fonts/libfontenc/buildlink3.mk"
+.include "../../graphics/libepoxy/buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../wm/libAppleWM/buildlink3.mk"
+.include "../../wm/applewmproto/buildlink3.mk"
+.include "../../x11/bigreqsproto/buildlink3.mk"
+.include "../../x11/compositeproto/buildlink3.mk"
+.include "../../x11/damageproto/buildlink3.mk"
+.include "../../x11/evieext/buildlink3.mk"
+.include "../../x11/fixesproto/buildlink3.mk"
+.include "../../x11/fontsproto/buildlink3.mk"
+.include "../../x11/inputproto/buildlink3.mk"
+.include "../../x11/kbproto/buildlink3.mk"
+.include "../../x11/libX11/buildlink3.mk"
+.include "../../x11/libXau/buildlink3.mk"
+.include "../../x11/libXaw/buildlink3.mk"
+.include "../../x11/libXext/buildlink3.mk"
+.include "../../x11/libXfixes/buildlink3.mk"
+.include "../../x11/libXfont/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.include "../../x11/libXxf86misc/buildlink3.mk"
+.include "../../x11/libXxf86vm/buildlink3.mk"
+.include "../../x11/libXinerama/buildlink3.mk"
+.include "../../x11/libxkbfile/buildlink3.mk"
+.include "../../x11/libxkbui/buildlink3.mk"
+.include "../../x11/pixman/buildlink3.mk"
+.include "../../x11/presentproto/buildlink3.mk"
+.include "../../x11/randrproto/buildlink3.mk"
+.include "../../x11/recordproto/buildlink3.mk"
+.include "../../x11/renderproto/buildlink3.mk"
+.include "../../x11/resourceproto/buildlink3.mk"
+.include "../../x11/scrnsaverproto/buildlink3.mk"
+.include "../../x11/trapproto/buildlink3.mk"
+.include "../../x11/videoproto/buildlink3.mk"
+.include "../../x11/xcmiscproto/buildlink3.mk"
+.include "../../x11/xextproto/buildlink3.mk"
+.include "../../x11/xcb-util-keysyms/buildlink3.mk"
+.include "../../x11/xf86bigfontproto/buildlink3.mk"
+.include "../../x11/xf86dgaproto/buildlink3.mk"
+.include "../../x11/xf86miscproto/buildlink3.mk"
+.include "../../x11/xf86vidmodeproto/buildlink3.mk"
+.include "../../x11/xineramaproto/buildlink3.mk"
+.include "../../x11/xproto/buildlink3.mk"
+.include "../../x11/xtrans/buildlink3.mk"
+.include "../../x11/glproto/buildlink3.mk"
+.include "../../x11/dri2proto/buildlink3.mk"
+.include "../../x11/dri3proto/buildlink3.mk"
+.include "../../x11/libxshmfence/buildlink3.mk"
+.include "../../x11/xf86driproto/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/x11/modular-xorg-xquartz/PLIST b/x11/modular-xorg-xquartz/PLIST
new file mode 100644
index 00000000000..52bf7f66b04
--- /dev/null
+++ b/x11/modular-xorg-xquartz/PLIST
@@ -0,0 +1,104 @@
+@comment $NetBSD: PLIST,v 1.1 2015/10/01 12:55:09 tnn Exp $
+Applications/Utilities/X11.app/Contents/Info.plist
+Applications/Utilities/X11.app/Contents/MacOS/X11
+Applications/Utilities/X11.app/Contents/MacOS/X11.bin
+Applications/Utilities/X11.app/Contents/PkgInfo
+Applications/Utilities/X11.app/Contents/Resources/Dutch.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/Dutch.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/Dutch.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/English.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/English.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/English.lproj/main.nib/designable.nib
+Applications/Utilities/X11.app/Contents/Resources/English.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/French.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/French.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/French.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/German.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/German.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/German.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/Italian.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/Italian.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/Italian.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/Japanese.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/Japanese.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/Japanese.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/Spanish.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/Spanish.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/Spanish.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/X11.icns
+Applications/Utilities/X11.app/Contents/Resources/ar.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/ar.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/ar.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/ca.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/ca.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/ca.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/cs.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/cs.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/cs.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/da.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/da.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/da.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/el.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/el.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/el.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/fi.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/fi.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/fi.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/he.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/he.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/he.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/hr.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/hr.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/hr.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/hu.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/hu.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/hu.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/ko.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/ko.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/ko.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/no.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/no.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/no.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/pl.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/pl.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/pl.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/pt.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/pt.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/pt.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/pt_PT.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/pt_PT.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/pt_PT.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/ro.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/ro.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/ro.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/ru.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/ru.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/ru.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/sk.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/sk.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/sk.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/sv.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/sv.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/sv.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/th.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/th.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/th.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/tr.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/tr.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/tr.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/uk.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/uk.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/uk.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/zh_CN.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/zh_CN.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/zh_CN.lproj/main.nib/keyedobjects.nib
+Applications/Utilities/X11.app/Contents/Resources/zh_TW.lproj/InfoPlist.strings
+Applications/Utilities/X11.app/Contents/Resources/zh_TW.lproj/Localizable.strings
+Applications/Utilities/X11.app/Contents/Resources/zh_TW.lproj/main.nib/keyedobjects.nib
+bin/Xquartz
+lib/X11/xserver/Xquartz.plist
+lib/xorg/protocol.txt
+man/man1/Xquartz.1
+man/man1/Xserver.1
+share/doc/xorg-server/Xserver-DTrace.xml
+var/db/xkb/README.compiled
diff --git a/x11/modular-xorg-xquartz/distinfo b/x11/modular-xorg-xquartz/distinfo
new file mode 100644
index 00000000000..90ec0056be5
--- /dev/null
+++ b/x11/modular-xorg-xquartz/distinfo
@@ -0,0 +1,19 @@
+$NetBSD: distinfo,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+SHA1 (xorg-server-1.17.2.tar.bz2) = 56ac29a82b99bcf4c7ba2fca41a44cfa18748262
+RMD160 (xorg-server-1.17.2.tar.bz2) = bf575a269f1e7b729992a20989be84e09fcc88a2
+Size (xorg-server-1.17.2.tar.bz2) = 5767983 bytes
+SHA1 (patch-fb_fb.h) = 82099b0982da0d9d64e3ae8f03393ec0df22f916
+SHA1 (patch-fb_fbpict.c) = 101645f653665c917c0f899b0eb771e7ff1280c4
+SHA1 (patch-fb_fbpict.h) = 686d6634e0cee9b56660787b616435c8134f8c61
+SHA1 (patch-fb_fbscreen.c) = 6bc92e7002f215430e8647337d596bfe99d3d63a
+SHA1 (patch-fb_fbtrap.c) = 60e74d8d6f86dfb24491b17170e02a6040ad9abb
+SHA1 (patch-hw_xfree86_Makefile.am) = 0388fa2a2cb08194def579c014848eaf66f02b24
+SHA1 (patch-hw_xquartz_GL_indirect.c) = f915ce2f6043c21cbaf6a656b7339776156b609e
+SHA1 (patch-hw_xquartz_X11Controller.m) = d25fb8915d6ee9b1214a346d3042b47a43ee46f8
+SHA1 (patch-hw_xquartz_pbproxy_Makefile.in) = a877cf56033544b46169757c1ceda5f17fe7a224
+SHA1 (patch-mi_miexpose.c) = e53cbee2330300ef016aae5a5ee9fe8a65efc46b
+SHA1 (patch-render_mipict.c) = fa9058f76d69d9227c41f16094a9ee9926214337
+SHA1 (patch-render_mipict.h) = 11ee673c750ce7860670110ce792ad9f0094d4ad
+SHA1 (patch-render_mitrap.c) = d31fdb56b129b4d5c131dd8caaac41cc37df9f99
+SHA1 (patch-render_mitri.c) = dfb0061cb39bfadea0ac32f77f03e988f958d14c
diff --git a/x11/modular-xorg-xquartz/patches/patch-fb_fb.h b/x11/modular-xorg-xquartz/patches/patch-fb_fb.h
new file mode 100644
index 00000000000..035bf3ac733
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-fb_fb.h
@@ -0,0 +1,26 @@
+$NetBSD: patch-fb_fb.h,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- fb/fb.h.orig 2014-11-17 05:51:18.000000000 +0000
++++ fb/fb.h
+@@ -1116,9 +1116,6 @@ extern _X_EXPORT void
+ extern _X_EXPORT Bool
+ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
+
+-extern _X_EXPORT void
+-fbDestroyGlyphCache(void);
+-
+ /*
+ * fbpixmap.c
+ */
+@@ -1326,8 +1323,7 @@ fbFillRegionSolid(DrawablePtr pDrawable,
+ RegionPtr pRegion, FbBits and, FbBits xor);
+
+ extern _X_EXPORT pixman_image_t *image_from_pict(PicturePtr pict,
+- Bool has_clip,
+- int *xoff, int *yoff);
++ Bool has_clip);
+
+ extern _X_EXPORT void free_pixman_pict(PicturePtr, pixman_image_t *);
+
diff --git a/x11/modular-xorg-xquartz/patches/patch-fb_fbpict.c b/x11/modular-xorg-xquartz/patches/patch-fb_fbpict.c
new file mode 100644
index 00000000000..392ad4800e8
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-fb_fbpict.c
@@ -0,0 +1,348 @@
+$NetBSD: patch-fb_fbpict.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- fb/fbpict.c.orig 2015-01-17 23:42:52.000000000 +0000
++++ fb/fbpict.c
+@@ -46,23 +46,18 @@ fbComposite(CARD8 op,
+ INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
+ {
+ pixman_image_t *src, *mask, *dest;
+- int src_xoff, src_yoff;
+- int msk_xoff, msk_yoff;
+- int dst_xoff, dst_yoff;
+-
+ miCompositeSourceValidate(pSrc);
+ if (pMask)
+ miCompositeSourceValidate(pMask);
+
+- src = image_from_pict(pSrc, FALSE, &src_xoff, &src_yoff);
+- mask = image_from_pict(pMask, FALSE, &msk_xoff, &msk_yoff);
+- dest = image_from_pict(pDst, TRUE, &dst_xoff, &dst_yoff);
++ src = image_from_pict(pSrc, TRUE);
++ mask = image_from_pict(pMask, TRUE);
++ dest = image_from_pict(pDst, TRUE);
+
+ if (src && dest && !(pMask && !mask)) {
+ pixman_image_composite(op, src, mask, dest,
+- xSrc + src_xoff, ySrc + src_yoff,
+- xMask + msk_xoff, yMask + msk_yoff,
+- xDst + dst_xoff, yDst + dst_yoff, width, height);
++ xSrc, ySrc, xMask, yMask, xDst, yDst,
++ width, height);
+ }
+
+ free_pixman_pict(pSrc, src);
+@@ -70,152 +65,6 @@ fbComposite(CARD8 op,
+ free_pixman_pict(pDst, dest);
+ }
+
+-static pixman_glyph_cache_t *glyphCache;
+-
+-void
+-fbDestroyGlyphCache(void)
+-{
+- if (glyphCache)
+- {
+- pixman_glyph_cache_destroy (glyphCache);
+- glyphCache = NULL;
+- }
+-}
+-
+-static void
+-fbUnrealizeGlyph(ScreenPtr pScreen,
+- GlyphPtr pGlyph)
+-{
+- if (glyphCache)
+- pixman_glyph_cache_remove (glyphCache, pGlyph, NULL);
+-}
+-
+-void
+-fbGlyphs(CARD8 op,
+- PicturePtr pSrc,
+- PicturePtr pDst,
+- PictFormatPtr maskFormat,
+- INT16 xSrc,
+- INT16 ySrc, int nlist,
+- GlyphListPtr list,
+- GlyphPtr *glyphs)
+-{
+-#define N_STACK_GLYPHS 512
+- ScreenPtr pScreen = pDst->pDrawable->pScreen;
+- pixman_glyph_t stack_glyphs[N_STACK_GLYPHS];
+- pixman_glyph_t *pglyphs = stack_glyphs;
+- pixman_image_t *srcImage, *dstImage;
+- int srcXoff, srcYoff, dstXoff, dstYoff;
+- GlyphPtr glyph;
+- int n_glyphs;
+- int x, y;
+- int i, n;
+- int xDst = list->xOff, yDst = list->yOff;
+-
+- miCompositeSourceValidate(pSrc);
+-
+- n_glyphs = 0;
+- for (i = 0; i < nlist; ++i)
+- n_glyphs += list[i].len;
+-
+- if (!glyphCache)
+- glyphCache = pixman_glyph_cache_create();
+-
+- pixman_glyph_cache_freeze (glyphCache);
+-
+- if (n_glyphs > N_STACK_GLYPHS) {
+- if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t))))
+- goto out;
+- }
+-
+- i = 0;
+- x = y = 0;
+- while (nlist--) {
+- x += list->xOff;
+- y += list->yOff;
+- n = list->len;
+- while (n--) {
+- const void *g;
+-
+- glyph = *glyphs++;
+-
+- if (!(g = pixman_glyph_cache_lookup (glyphCache, glyph, NULL))) {
+- pixman_image_t *glyphImage;
+- PicturePtr pPicture;
+- int xoff, yoff;
+-
+- pPicture = GetGlyphPicture(glyph, pScreen);
+- if (!pPicture) {
+- n_glyphs--;
+- goto next;
+- }
+-
+- if (!(glyphImage = image_from_pict(pPicture, FALSE, &xoff, &yoff)))
+- goto out;
+-
+- g = pixman_glyph_cache_insert(glyphCache, glyph, NULL,
+- glyph->info.x,
+- glyph->info.y,
+- glyphImage);
+-
+- free_pixman_pict(pPicture, glyphImage);
+-
+- if (!g)
+- goto out;
+- }
+-
+- pglyphs[i].x = x;
+- pglyphs[i].y = y;
+- pglyphs[i].glyph = g;
+- i++;
+-
+- next:
+- x += glyph->info.xOff;
+- y += glyph->info.yOff;
+- }
+- list++;
+- }
+-
+- if (!(srcImage = image_from_pict(pSrc, FALSE, &srcXoff, &srcYoff)))
+- goto out;
+-
+- if (!(dstImage = image_from_pict(pDst, TRUE, &dstXoff, &dstYoff)))
+- goto out_free_src;
+-
+- if (maskFormat) {
+- pixman_format_code_t format;
+- pixman_box32_t extents;
+-
+- format = maskFormat->format | (maskFormat->depth << 24);
+-
+- pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents);
+-
+- pixman_composite_glyphs(op, srcImage, dstImage, format,
+- xSrc + srcXoff + extents.x1 - xDst, ySrc + srcYoff + extents.y1 - yDst,
+- extents.x1, extents.y1,
+- extents.x1 + dstXoff, extents.y1 + dstYoff,
+- extents.x2 - extents.x1,
+- extents.y2 - extents.y1,
+- glyphCache, n_glyphs, pglyphs);
+- }
+- else {
+- pixman_composite_glyphs_no_mask(op, srcImage, dstImage,
+- xSrc + srcXoff - xDst, ySrc + srcYoff - yDst,
+- dstXoff, dstYoff,
+- glyphCache, n_glyphs, pglyphs);
+- }
+-
+- free_pixman_pict(pDst, dstImage);
+-
+-out_free_src:
+- free_pixman_pict(pSrc, srcImage);
+-
+-out:
+- pixman_glyph_cache_thaw(glyphCache);
+- if (pglyphs != stack_glyphs)
+- free(pglyphs);
+-}
+-
+ static pixman_image_t *
+ create_solid_fill_image(PicturePtr pict)
+ {
+@@ -289,20 +138,22 @@ create_conical_gradient_image(PictGradie
+ }
+
+ static pixman_image_t *
+-create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
++create_bits_picture(PicturePtr pict, Bool has_clip)
+ {
+- PixmapPtr pixmap;
+ FbBits *bits;
+ FbStride stride;
+- int bpp;
++ int bpp, xoff, yoff;
+ pixman_image_t *image;
+
+- fbGetDrawablePixmap(pict->pDrawable, pixmap, *xoff, *yoff);
+- fbGetPixmapBitsData(pixmap, bits, stride, bpp);
++ fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
++
++ bits = (FbBits*)((CARD8*)bits +
++ (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
++ (pict->pDrawable->x + xoff) * (bpp / 8));
+
+ image = pixman_image_create_bits((pixman_format_code_t) pict->format,
+- pixmap->drawable.width,
+- pixmap->drawable.height, (uint32_t *) bits,
++ pict->pDrawable->width,
++ pict->pDrawable->height, (uint32_t *) bits,
+ stride * sizeof(FbStride));
+
+ if (!image)
+@@ -321,56 +172,30 @@ create_bits_picture(PicturePtr pict, Boo
+ if (pict->clientClip)
+ pixman_image_set_has_client_clip(image, TRUE);
+
+- if (*xoff || *yoff)
+- pixman_region_translate(pict->pCompositeClip, *xoff, *yoff);
++ pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
+
+ pixman_image_set_clip_region(image, pict->pCompositeClip);
+
+- if (*xoff || *yoff)
+- pixman_region_translate(pict->pCompositeClip, -*xoff, -*yoff);
++ pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
+ }
+
+ /* Indexed table */
+ if (pict->pFormat->index.devPrivate)
+ pixman_image_set_indexed(image, pict->pFormat->index.devPrivate);
+
+- /* Add in drawable origin to position within the image */
+- *xoff += pict->pDrawable->x;
+- *yoff += pict->pDrawable->y;
+-
+ return image;
+ }
+
+ static pixman_image_t *image_from_pict_internal(PicturePtr pict, Bool has_clip,
+- int *xoff, int *yoff,
+ Bool is_alpha_map);
+
+ static void
+-set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip,
+- int *xoff, int *yoff, Bool is_alpha_map)
++set_image_properties(pixman_image_t * image, PicturePtr pict, Bool is_alpha_map)
+ {
+ pixman_repeat_t repeat;
+ pixman_filter_t filter;
+
+ if (pict->transform) {
+- /* For source images, adjust the transform to account
+- * for the drawable offset within the pixman image,
+- * then set the offset to 0 as it will be used
+- * to compute positions within the transformed image.
+- */
+- if (!has_clip) {
+- struct pixman_transform adjusted;
+-
+- adjusted = *pict->transform;
+- pixman_transform_translate(&adjusted,
+- NULL,
+- pixman_int_to_fixed(*xoff),
+- pixman_int_to_fixed(*yoff));
+- pixman_image_set_transform(image, &adjusted);
+- *xoff = 0;
+- *yoff = 0;
+- }
+- else
+ pixman_image_set_transform(image, pict->transform);
+ }
+
+@@ -399,10 +224,8 @@ set_image_properties(pixman_image_t * im
+ * as the alpha map for this operation
+ */
+ if (pict->alphaMap && !is_alpha_map) {
+- int alpha_xoff, alpha_yoff;
+ pixman_image_t *alpha_map =
+- image_from_pict_internal(pict->alphaMap, FALSE, &alpha_xoff,
+- &alpha_yoff, TRUE);
++ image_from_pict_internal(pict->alphaMap, TRUE, TRUE);
+
+ pixman_image_set_alpha_map(image, alpha_map, pict->alphaOrigin.x,
+ pict->alphaOrigin.y);
+@@ -436,8 +259,7 @@ set_image_properties(pixman_image_t * im
+ }
+
+ static pixman_image_t *
+-image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
+- Bool is_alpha_map)
++image_from_pict_internal(PicturePtr pict, Bool has_clip, Bool is_alpha_map)
+ {
+ pixman_image_t *image = NULL;
+
+@@ -445,7 +267,7 @@ image_from_pict_internal(PicturePtr pict
+ return NULL;
+
+ if (pict->pDrawable) {
+- image = create_bits_picture(pict, has_clip, xoff, yoff);
++ image = create_bits_picture(pict, has_clip);
+ }
+ else if (pict->pSourcePict) {
+ SourcePict *sp = pict->pSourcePict;
+@@ -463,19 +285,17 @@ image_from_pict_internal(PicturePtr pict
+ else if (sp->type == SourcePictTypeConical)
+ image = create_conical_gradient_image(gradient);
+ }
+- *xoff = *yoff = 0;
+ }
+
+ if (image)
+- set_image_properties(image, pict, has_clip, xoff, yoff, is_alpha_map);
+-
++ set_image_properties (image, pict, is_alpha_map);
+ return image;
+ }
+
+ pixman_image_t *
+-image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
++image_from_pict (PicturePtr pict, Bool has_clip)
+ {
+- return image_from_pict_internal(pict, has_clip, xoff, yoff, FALSE);
++ return image_from_pict_internal (pict, has_clip, FALSE);
+ }
+
+ void
+@@ -495,14 +315,11 @@ fbPictureInit(ScreenPtr pScreen, PictFor
+ return FALSE;
+ ps = GetPictureScreen(pScreen);
+ ps->Composite = fbComposite;
+- ps->Glyphs = fbGlyphs;
+- ps->UnrealizeGlyph = fbUnrealizeGlyph;
++ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+ ps->RasterizeTrapezoid = fbRasterizeTrapezoid;
+- ps->Trapezoids = fbTrapezoids;
+ ps->AddTraps = fbAddTraps;
+ ps->AddTriangles = fbAddTriangles;
+- ps->Triangles = fbTriangles;
+
+ return TRUE;
+ }
diff --git a/x11/modular-xorg-xquartz/patches/patch-fb_fbpict.h b/x11/modular-xorg-xquartz/patches/patch-fb_fbpict.h
new file mode 100644
index 00000000000..b9615505293
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-fb_fbpict.h
@@ -0,0 +1,28 @@
+$NetBSD: patch-fb_fbpict.h,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- fb/fbpict.h.orig 2014-11-17 05:51:18.000000000 +0000
++++ fb/fbpict.h
+@@ -65,20 +65,11 @@ fbTrapezoids(CARD8 op,
+ INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps);
+
+ extern _X_EXPORT void
++
+ fbTriangles(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int ntris, xTriangle * tris);
+
+-extern _X_EXPORT void
+-fbGlyphs(CARD8 op,
+- PicturePtr pSrc,
+- PicturePtr pDst,
+- PictFormatPtr maskFormat,
+- INT16 xSrc,
+- INT16 ySrc, int nlist,
+- GlyphListPtr list,
+- GlyphPtr *glyphs);
+-
+ #endif /* _FBPICT_H_ */
diff --git a/x11/modular-xorg-xquartz/patches/patch-fb_fbscreen.c b/x11/modular-xorg-xquartz/patches/patch-fb_fbscreen.c
new file mode 100644
index 00000000000..b80162459e1
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-fb_fbscreen.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-fb_fbscreen.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- fb/fbscreen.c.orig 2014-10-23 22:11:20.000000000 +0000
++++ fb/fbscreen.c
+@@ -32,7 +32,6 @@ fbCloseScreen(ScreenPtr pScreen)
+ int d;
+ DepthPtr depths = pScreen->allowedDepths;
+
+- fbDestroyGlyphCache();
+ for (d = 0; d < pScreen->numDepths; d++)
+ free(depths[d].vids);
+ free(depths);
diff --git a/x11/modular-xorg-xquartz/patches/patch-fb_fbtrap.c b/x11/modular-xorg-xquartz/patches/patch-fb_fbtrap.c
new file mode 100644
index 00000000000..7e5bb347363
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-fb_fbtrap.c
@@ -0,0 +1,97 @@
+$NetBSD: patch-fb_fbtrap.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- fb/fbtrap.c.orig 2014-10-23 22:11:20.000000000 +0000
++++ fb/fbtrap.c
+@@ -36,13 +36,12 @@ fbAddTraps(PicturePtr pPicture,
+ INT16 x_off, INT16 y_off, int ntrap, xTrap * traps)
+ {
+ pixman_image_t *image;
+- int dst_xoff, dst_yoff;
+
+- if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff)))
++ if (!(image = image_from_pict (pPicture, FALSE)))
+ return;
+
+- pixman_add_traps(image, x_off + dst_xoff, y_off + dst_yoff,
+- ntrap, (pixman_trap_t *) traps);
++ pixman_add_traps(image, x_off, y_off,
++ ntrap, (pixman_trap_t *)traps);
+
+ free_pixman_pict(pPicture, image);
+ }
+@@ -52,13 +51,12 @@ fbRasterizeTrapezoid(PicturePtr pPicture
+ xTrapezoid * trap, int x_off, int y_off)
+ {
+ pixman_image_t *image;
+- int dst_xoff, dst_yoff;
+
+- if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff)))
++ if (!(image = image_from_pict (pPicture, FALSE)))
+ return;
+
+- pixman_rasterize_trapezoid(image, (pixman_trapezoid_t *) trap,
+- x_off + dst_xoff, y_off + dst_yoff);
++ pixman_rasterize_trapezoid(image, (pixman_trapezoid_t *)trap,
++ x_off, y_off);
+
+ free_pixman_pict(pPicture, image);
+ }
+@@ -68,14 +66,12 @@ fbAddTriangles(PicturePtr pPicture,
+ INT16 x_off, INT16 y_off, int ntri, xTriangle * tris)
+ {
+ pixman_image_t *image;
+- int dst_xoff, dst_yoff;
+
+- if (!(image = image_from_pict(pPicture, FALSE, &dst_xoff, &dst_yoff)))
++ if (!(image = image_from_pict (pPicture, FALSE)))
+ return;
+
+- pixman_add_triangles(image,
+- dst_xoff + x_off, dst_yoff + y_off,
+- ntri, (pixman_triangle_t *) tris);
++ pixman_add_triangles(image, x_off, y_off, ntri,
++ (pixman_triangle_t *)tris);
+
+ free_pixman_pict(pPicture, image);
+ }
+@@ -98,13 +94,11 @@ fbShapes(CompositeShapesFunc composite,
+ int16_t ySrc, int nshapes, int shape_size, const uint8_t * shapes)
+ {
+ pixman_image_t *src, *dst;
+- int src_xoff, src_yoff;
+- int dst_xoff, dst_yoff;
+
+ miCompositeSourceValidate(pSrc);
+
+- src = image_from_pict(pSrc, FALSE, &src_xoff, &src_yoff);
+- dst = image_from_pict(pDst, TRUE, &dst_xoff, &dst_yoff);
++ src = image_from_pict(pSrc, FALSE);
++ dst = image_from_pict(pDst, TRUE);
+
+ if (src && dst) {
+ pixman_format_code_t format;
+@@ -121,9 +115,8 @@ fbShapes(CompositeShapesFunc composite,
+
+ for (i = 0; i < nshapes; ++i) {
+ composite(op, src, dst, format,
+- xSrc + src_xoff,
+- ySrc + src_yoff,
+- dst_xoff, dst_yoff, 1, shapes + i * shape_size);
++ xSrc, ySrc, 0, 0,
++ 1, shapes + i * shape_size);
+ }
+ }
+ else {
+@@ -143,8 +136,8 @@ fbShapes(CompositeShapesFunc composite,
+ }
+
+ composite(op, src, dst, format,
+- xSrc + src_xoff,
+- ySrc + src_yoff, dst_xoff, dst_yoff, nshapes, shapes);
++ xSrc, ySrc, 0, 0,
++ nshapes, shapes);
+ }
+
+ DamageRegionProcessPending(pDst->pDrawable);
diff --git a/x11/modular-xorg-xquartz/patches/patch-hw_xfree86_Makefile.am b/x11/modular-xorg-xquartz/patches/patch-hw_xfree86_Makefile.am
new file mode 100644
index 00000000000..3a9b09fa96f
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-hw_xfree86_Makefile.am
@@ -0,0 +1,25 @@
+$NetBSD: patch-hw_xfree86_Makefile.am,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- hw/xfree86/Makefile.am.orig 2015-01-17 23:42:52.000000000 +0000
++++ hw/xfree86/Makefile.am
+@@ -48,8 +48,7 @@ DIST_SUBDIRS = common ddc i2c x86emu int
+ bin_PROGRAMS = Xorg
+ nodist_Xorg_SOURCES = sdksyms.c
+
+-AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
+-AM_CPPFLAGS = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
++AM_CPPFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
+ -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \
+ -I$(srcdir)/dri -I$(srcdir)/dri2 -I$(top_srcdir)/dri3
+
+@@ -135,7 +134,7 @@ CLEANFILES = sdksyms.c sdksyms.dep Xorg.
+ EXTRA_DIST += sdksyms.sh
+
+ sdksyms.dep sdksyms.c: sdksyms.sh
+- $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(AM_CPPFLAGS)
++ $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CPPFLAGS) $(AM_CPPFLAGS)
+
+ SDKSYMS_DEP = sdksyms.dep
+ -include $(SDKSYMS_DEP)
diff --git a/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_GL_indirect.c b/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_GL_indirect.c
new file mode 100644
index 00000000000..34a1ff15e12
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_GL_indirect.c
@@ -0,0 +1,65 @@
+$NetBSD: patch-hw_xquartz_GL_indirect.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- hw/xquartz/GL/indirect.c.orig 2014-02-05 03:08:57.000000000 +0000
++++ hw/xquartz/GL/indirect.c
+@@ -52,6 +52,7 @@
+
+ #include "visualConfigs.h"
+ #include "dri.h"
++#include "extension_string.h"
+
+ #include "darwin.h"
+ #define GLAQUA_DEBUG_MSG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", \
+@@ -111,6 +112,10 @@ typedef struct __GLXAquaDrawable __GLXAq
+ */
+ struct __GLXAquaScreen {
+ __GLXscreen base;
++
++ /* Supported GLX extensions */
++ unsigned char glx_enable_bits[__GLX_EXT_BYTES];
++
+ int index;
+ int num_vis;
+ };
+@@ -541,13 +546,33 @@ __glXAquaScreenProbe(ScreenPtr pScreen)
+
+ screen->base.GLXmajor = 1;
+ screen->base.GLXminor = 4;
+- screen->base.GLXextensions = strdup("GLX_SGIX_fbconfig "
+- "GLX_SGIS_multisample "
+- "GLX_ARB_multisample "
+- "GLX_EXT_visual_info "
+- "GLX_EXT_import_context ");
+
+- /*We may be able to add more GLXextensions at a later time. */
++ memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES);
++
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info");
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating");
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context");
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method");
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig");
++
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIS_multisample");
++ __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_multisample");
++
++ //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context");
++ //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile");
++
++ // Generate the GLX extensions string (overrides that set by __glXScreenInit())
++ {
++ unsigned int buffer_size =
++ __glXGetExtensionString(screen->glx_enable_bits, NULL);
++ if (buffer_size > 0) {
++ free(screen->base.GLXextensions);
++
++ screen->base.GLXextensions = xnfalloc(buffer_size);
++ __glXGetExtensionString(screen->glx_enable_bits,
++ screen->base.GLXextensions);
++ }
++ }
+
+ return &screen->base;
+ }
diff --git a/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_X11Controller.m b/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_X11Controller.m
new file mode 100644
index 00000000000..dc917da198e
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_X11Controller.m
@@ -0,0 +1,33 @@
+$NetBSD: patch-hw_xquartz_X11Controller.m,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+Clang says we must take the address of asl_log_descriptor. Do as it says.
+
+--- hw/xquartz/X11Controller.m.orig 2014-04-18 21:33:02.000000000 +0000
++++ hw/xquartz/X11Controller.m
+@@ -364,7 +364,7 @@ extern char *bundle_id_prefix;
+ }
+
+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+- if (asl_log_descriptor) {
++ if (&asl_log_descriptor) {
+ char *asl_sender;
+ aslmsg amsg = asl_new(ASL_TYPE_MSG);
+ assert(amsg);
+@@ -414,7 +414,7 @@ extern char *bundle_id_prefix;
+
+ case 0: /* child2 */
+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+- if (asl_log_descriptor) {
++ if (&asl_log_descriptor) {
+ /* Replace our stdout/stderr */
+ dup2(stdout_pipe[1], STDOUT_FILENO);
+ dup2(stderr_pipe[1], STDERR_FILENO);
+@@ -443,7 +443,7 @@ extern char *bundle_id_prefix;
+ }
+
+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+- if (asl_log_descriptor) {
++ if (&asl_log_descriptor) {
+ /* Close the write ends of the pipe */
+ close(stdout_pipe[1]);
+ close(stderr_pipe[1]);
diff --git a/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_pbproxy_Makefile.in b/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_pbproxy_Makefile.in
new file mode 100644
index 00000000000..d69287479d2
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-hw_xquartz_pbproxy_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-hw_xquartz_pbproxy_Makefile.in,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+Fix build with xcode 7. Use pkgrsc detected SDK path.
+
+--- hw/xquartz/pbproxy/Makefile.in.orig 2015-06-16 15:43:07.000000000 +0000
++++ hw/xquartz/pbproxy/Makefile.in
+@@ -556,7 +556,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-AM_CPPFLAGS = -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
++AM_CPPFLAGS = -F$(OSX_SDK_PATH)/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
+ -DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\" $(am__append_1)
+ AM_CFLAGS = $(XPBPROXY_CFLAGS)
+ AM_OBJCFLAGS = $(XPBPROXY_CFLAGS)
diff --git a/x11/modular-xorg-xquartz/patches/patch-mi_miexpose.c b/x11/modular-xorg-xquartz/patches/patch-mi_miexpose.c
new file mode 100644
index 00000000000..f063b8ac5e2
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-mi_miexpose.c
@@ -0,0 +1,147 @@
+$NetBSD: patch-mi_miexpose.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- mi/miexpose.c.orig 2015-01-17 23:42:52.000000000 +0000
++++ mi/miexpose.c
+@@ -408,6 +408,7 @@ void RootlessSetPixmapOfAncestors(Window
+ void RootlessStartDrawing(WindowPtr pWin);
+ void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
+ Bool IsFramedWindow(WindowPtr pWin);
++#include "../fb/fb.h"
+ #endif
+
+ void
+@@ -437,23 +438,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr
+ Bool solid = TRUE;
+ DrawablePtr drawable = &pWin->drawable;
+
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
++ ErrorF(" Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
++ prgn->extents.x2 - prgn->extents.x1,
++ prgn->extents.y2 - prgn->extents.y1);
++ ErrorF(" Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
++ pWin->winSize.extents.x1, pWin->winSize.extents.y1,
++ pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
++ pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
++ ErrorF(" Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
++ pWin->drawable.width, pWin->drawable.height);
++#endif
++
+ #ifdef ROOTLESS
+ if (!drawable || drawable->type == UNDRAWABLE_WINDOW)
+ return;
++#endif
+
+- if (IsFramedWindow(pWin)) {
++ if (what == PW_BACKGROUND)
++ {
++#ifdef ROOTLESS
++ if(IsFramedWindow(pWin)) {
+ RootlessStartDrawing(pWin);
+ RootlessDamageRegion(pWin, prgn);
+
+- if (pWin->backgroundState == ParentRelative) {
+- if ((what == PW_BACKGROUND) ||
+- (what == PW_BORDER && !pWin->borderIsPixel))
++ if(pWin->backgroundState == ParentRelative) {
+ RootlessSetPixmapOfAncestors(pWin);
+ }
+ }
+ #endif
+
+- if (what == PW_BACKGROUND) {
+ while (pWin->backgroundState == ParentRelative)
+ pWin = pWin->parent;
+
+@@ -478,6 +493,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr
+ else {
+ PixmapPtr pixmap;
+
++#ifdef ROOTLESS
++ if(IsFramedWindow(pWin)) {
++ RootlessStartDrawing(pWin);
++ RootlessDamageRegion(pWin, prgn);
++
++ if(!pWin->borderIsPixel &&
++ pWin->backgroundState == ParentRelative) {
++ RootlessSetPixmapOfAncestors(pWin);
++ }
++ }
++#endif
++
+ tile_x_off = drawable->x;
+ tile_y_off = drawable->y;
+
+@@ -486,6 +513,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr
+ return;
+ pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
+ drawable = &pixmap->drawable;
++
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF(" Draw: %d %d %d %d\n",
++ drawable->x, drawable->y, drawable->width, drawable->height);
++#endif
++
+ #ifdef COMPOSITE
+ draw_x_off = pixmap->screen_x;
+ draw_y_off = pixmap->screen_y;
+@@ -548,6 +581,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr
+ ChangeGC(NullClient, pGC, gcmask, gcval);
+ ValidateGC(drawable, pGC);
+
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF(" GC: %d %d %d %d\n",
++ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
++ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
++ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
++#endif
++
++#ifdef XQUARTZ
++ /* Looks like our clipping isn't set right for some reason:
++ * http://xquartz.macosforge.org/trac/ticket/290
++ */
++ if(what == PW_BORDER) {
++
++#if 0
++ if(solid) {
++#if 1
++ fbFillRegionSolid(&pWin->drawable,
++ prgn,
++ 0,
++ fbReplicatePixel(fill.pixel,
++ pWin->drawable.bitsPerPixel));
++#else
++ fbFillRegionSolid(drawable,
++ prgn,
++ 0,
++ fbReplicatePixel(fill.pixel,
++ drawable->bitsPerPixel));
++#endif
++ return;
++ }
++#endif
++
++ pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
++ pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
++ pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
++ pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
++
++ if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
++ pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
++ if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
++ pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
++ }
++#endif
++
++#ifdef XQUARTZ_CLIP_DEBUG
++ ErrorF(" GC: %d %d %d %d\n",
++ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
++ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
++ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
++#endif
++
+ numRects = RegionNumRects(prgn);
+ pbox = RegionRects(prgn);
+ for (i = numRects; --i >= 0; pbox++, prect++) {
diff --git a/x11/modular-xorg-xquartz/patches/patch-render_mipict.c b/x11/modular-xorg-xquartz/patches/patch-render_mipict.c
new file mode 100644
index 00000000000..f6b93241ad7
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-render_mipict.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-render_mipict.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- render/mipict.c.orig 2014-11-17 05:51:18.000000000 +0000
++++ render/mipict.c
+@@ -575,8 +575,8 @@ miPictureInit(ScreenPtr pScreen, PictFor
+ ps->Composite = 0; /* requires DDX support */
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+- ps->Trapezoids = 0;
+- ps->Triangles = 0;
++ ps->Trapezoids = miTrapezoids;
++ ps->Triangles = miTriangles;
+
+ ps->RasterizeTrapezoid = 0; /* requires DDX support */
+ ps->AddTraps = 0; /* requires DDX support */
diff --git a/x11/modular-xorg-xquartz/patches/patch-render_mipict.h b/x11/modular-xorg-xquartz/patches/patch-render_mipict.h
new file mode 100644
index 00000000000..0d4754e24eb
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-render_mipict.h
@@ -0,0 +1,51 @@
+$NetBSD: patch-render_mipict.h,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- render/mipict.h.orig 2015-01-17 23:42:52.000000000 +0000
++++ render/mipict.h
+@@ -122,6 +122,16 @@ miCompositeRects(CARD8 op,
+ xRenderColor * color, int nRect, xRectangle *rects);
+
+ extern _X_EXPORT void
++miTriangles (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntri,
++ xTriangle *tris);
++
++extern _X_EXPORT void
+
+ miTriStrip(CARD8 op,
+ PicturePtr pSrc,
+@@ -137,10 +147,27 @@ miTriFan(CARD8 op,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
+
++extern _X_EXPORT PicturePtr
++miCreateAlphaPicture (ScreenPtr pScreen,
++ PicturePtr pDst,
++ PictFormatPtr pPictFormat,
++ CARD16 width,
++ CARD16 height);
++
+ extern _X_EXPORT void
+ miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
+
+ extern _X_EXPORT void
++miTrapezoids (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntrap,
++ xTrapezoid *traps);
++
++extern _X_EXPORT void
+ miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds);
+
+ extern _X_EXPORT void
diff --git a/x11/modular-xorg-xquartz/patches/patch-render_mitrap.c b/x11/modular-xorg-xquartz/patches/patch-render_mitrap.c
new file mode 100644
index 00000000000..1e8e01d9ecc
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-render_mitrap.c
@@ -0,0 +1,128 @@
+$NetBSD: patch-render_mitrap.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- render/mitrap.c.orig 2014-02-12 03:43:50.000000000 +0000
++++ render/mitrap.c
+@@ -34,6 +34,55 @@
+ #include "picturestr.h"
+ #include "mipict.h"
+
++PicturePtr
++miCreateAlphaPicture (ScreenPtr pScreen,
++ PicturePtr pDst,
++ PictFormatPtr pPictFormat,
++ CARD16 width,
++ CARD16 height)
++{
++ PixmapPtr pPixmap;
++ PicturePtr pPicture;
++ GCPtr pGC;
++ int error;
++ xRectangle rect;
++
++ if (width > 32767 || height > 32767)
++ return 0;
++
++ if (!pPictFormat)
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++ if (!pPictFormat)
++ return 0;
++ }
++
++ pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
++ pPictFormat->depth, 0);
++ if (!pPixmap)
++ return 0;
++ pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
++ if (!pGC)
++ {
++ (*pScreen->DestroyPixmap) (pPixmap);
++ return 0;
++ }
++ ValidateGC (&pPixmap->drawable, pGC);
++ rect.x = 0;
++ rect.y = 0;
++ rect.width = width;
++ rect.height = height;
++ (*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
++ FreeScratchGC (pGC);
++ pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
++ 0, 0, serverClient, &error);
++ (*pScreen->DestroyPixmap) (pPixmap);
++ return pPicture;
++}
++
+ static xFixed
+ miLineFixedX(xLineFixed * l, xFixed y, Bool ceil)
+ {
+@@ -79,3 +128,65 @@ miTrapezoidBounds(int ntrap, xTrapezoid
+ box->x2 = x2;
+ }
+ }
++
++
++void
++miTrapezoids (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntrap,
++ xTrapezoid *traps)
++{
++ ScreenPtr pScreen = pDst->pDrawable->pScreen;
++ PictureScreenPtr ps = GetPictureScreen(pScreen);
++
++ /*
++ * Check for solid alpha add
++ */
++ if (op == PictOpAdd && miIsSolidAlpha (pSrc))
++ {
++ for (; ntrap; ntrap--, traps++)
++ (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0);
++ }
++ else if (maskFormat)
++ {
++ PicturePtr pPicture;
++ BoxRec bounds;
++ INT16 xDst, yDst;
++ INT16 xRel, yRel;
++
++ xDst = traps[0].left.p1.x >> 16;
++ yDst = traps[0].left.p1.y >> 16;
++
++ miTrapezoidBounds (ntrap, traps, &bounds);
++ if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
++ return;
++ pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ if (!pPicture)
++ return;
++ for (; ntrap; ntrap--, traps++)
++ (*ps->RasterizeTrapezoid) (pPicture, traps,
++ -bounds.x1, -bounds.y1);
++ xRel = bounds.x1 + xSrc - xDst;
++ yRel = bounds.y1 + ySrc - yDst;
++ CompositePicture (op, pSrc, pPicture, pDst,
++ xRel, yRel, 0, 0, bounds.x1, bounds.y1,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ FreePicture (pPicture, 0);
++ }
++ else
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++ for (; ntrap; ntrap--, traps++)
++ miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
++ }
++}
diff --git a/x11/modular-xorg-xquartz/patches/patch-render_mitri.c b/x11/modular-xorg-xquartz/patches/patch-render_mitri.c
new file mode 100644
index 00000000000..715ced4179a
--- /dev/null
+++ b/x11/modular-xorg-xquartz/patches/patch-render_mitri.c
@@ -0,0 +1,71 @@
+$NetBSD: patch-render_mitri.c,v 1.1 2015/10/01 12:55:09 tnn Exp $
+
+http://cgit.freedesktop.org/~jeremyhu/xserver/log/?h=server-1.17-apple
+
+--- render/mitri.c.orig 2014-02-05 03:08:58.000000000 +0000
++++ render/mitri.c
+@@ -65,3 +65,64 @@ miTriangleBounds(int ntri, xTriangle * t
+ {
+ miPointFixedBounds(ntri * 3, (xPointFixed *) tris, bounds);
+ }
++
++
++void
++miTriangles (CARD8 op,
++ PicturePtr pSrc,
++ PicturePtr pDst,
++ PictFormatPtr maskFormat,
++ INT16 xSrc,
++ INT16 ySrc,
++ int ntri,
++ xTriangle *tris)
++{
++ ScreenPtr pScreen = pDst->pDrawable->pScreen;
++ PictureScreenPtr ps = GetPictureScreen(pScreen);
++
++ /*
++ * Check for solid alpha add
++ */
++ if (op == PictOpAdd && miIsSolidAlpha (pSrc))
++ {
++ (*ps->AddTriangles) (pDst, 0, 0, ntri, tris);
++ }
++ else if (maskFormat)
++ {
++ BoxRec bounds;
++ PicturePtr pPicture;
++ INT16 xDst, yDst;
++ INT16 xRel, yRel;
++
++ xDst = tris[0].p1.x >> 16;
++ yDst = tris[0].p1.y >> 16;
++
++ miTriangleBounds (ntri, tris, &bounds);
++ if (bounds.x2 <= bounds.x1 || bounds.y2 <= bounds.y1)
++ return;
++ pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
++ bounds.x2 - bounds.x1,
++ bounds.y2 - bounds.y1);
++ if (!pPicture)
++ return;
++ (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris);
++
++ xRel = bounds.x1 + xSrc - xDst;
++ yRel = bounds.y1 + ySrc - yDst;
++ CompositePicture (op, pSrc, pPicture, pDst,
++ xRel, yRel, 0, 0, bounds.x1, bounds.y1,
++ bounds.x2 - bounds.x1, bounds.y2 - bounds.y1);
++ FreePicture (pPicture, 0);
++ }
++ else
++ {
++ if (pDst->polyEdge == PolyEdgeSharp)
++ maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
++ else
++ maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
++
++ for (; ntri; ntri--, tris++)
++ miTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris);
++ }
++}
++