From befd4fa677adbac8b7a0d9353693797bfda66caf Mon Sep 17 00:00:00 2001 From: Alexis Christoforides Date: Fri, 4 Nov 2016 10:46:01 -0400 Subject: [PATCH] Move the maintained common-use packages back to the bockbuild repo --- bockbuild/MacSDK/atk.py | 1 - bockbuild/MacSDK/cairo.py | 40 - bockbuild/MacSDK/expat.py | 1 - bockbuild/MacSDK/fontconfig.py | 22 - bockbuild/MacSDK/freetype.py | 1 - bockbuild/MacSDK/gdk-pixbuf.py | 34 - bockbuild/MacSDK/gettext.py | 31 - bockbuild/MacSDK/glib.py | 79 - bockbuild/MacSDK/gtk-engines.py | 2 - bockbuild/MacSDK/gtk-quartz-engine.py | 13 - bockbuild/MacSDK/gtk-sharp.py | 14 - bockbuild/MacSDK/hicolor-icon-theme.py | 1 - bockbuild/MacSDK/ige-mac-integration.py | 3 - bockbuild/MacSDK/intltool.py | 10 - bockbuild/MacSDK/libcroco.py | 6 - bockbuild/MacSDK/libffi.py | 7 - bockbuild/MacSDK/libgif.py | 1 - bockbuild/MacSDK/libglade.py | 1 - bockbuild/MacSDK/libjpeg.py | 8 - bockbuild/MacSDK/libpng.py | 9 - bockbuild/MacSDK/librsvg.py | 27 - bockbuild/MacSDK/libtiff.py | 26 - bockbuild/MacSDK/libxml2.py | 19 - bockbuild/MacSDK/murrine.py | 15 - bockbuild/MacSDK/pango.py | 51 - bockbuild/MacSDK/patches/cairo-cglayer.patch | 2187 ----------------- ...o-fix-CGFontGetGlyphPath-deprecation.patch | 67 - .../cairo-fix-color-bitmap-fonts.patch | 189 -- .../MacSDK/patches/cairo-quartz-crash.patch | 9 - .../fsharp-assemblysearchpath-fix.patch | 132 - ...dd-getter-setter-for-the-2x-variants.patch | 56 - ...d-2x-variants-as-pixbuf-gobject-data.patch | 99 - ...gdk-quartz-set-fix-modifiers-hack-v3.patch | 178 -- .../MacSDK/patches/glib-recursive-poll.patch | 73 - .../pango-coretext-astral-plane-1.patch | 26 - .../pango-coretext-astral-plane-2.patch | 109 - .../pango-coretext-condensed-trait.patch | 14 - .../pango-coretext-fix-yosemite-crasher.patch | 187 -- .../patches/pango-disable-ligatures.patch | 46 - ...t_font_descriptor_get_weight-crasher.patch | 13 - .../patches/pango-relative-config-file.patch | 25 - .../pango-system-font-check-version.patch | 70 - .../patches/pango-system-font-single.patch | 543 ---- .../MacSDK/patches/tiff-4.0.2-macosx-2.patch | 22 - bockbuild/MacSDK/pixman.py | 6 - bockbuild/MacSDK/pkg-config.py | 4 - external/bockbuild | 2 +- 47 files changed, 1 insertion(+), 4478 deletions(-) delete mode 100644 bockbuild/MacSDK/atk.py delete mode 100644 bockbuild/MacSDK/cairo.py delete mode 100644 bockbuild/MacSDK/expat.py delete mode 100644 bockbuild/MacSDK/fontconfig.py delete mode 100644 bockbuild/MacSDK/freetype.py delete mode 100644 bockbuild/MacSDK/gdk-pixbuf.py delete mode 100644 bockbuild/MacSDK/gettext.py delete mode 100644 bockbuild/MacSDK/glib.py delete mode 100644 bockbuild/MacSDK/gtk-engines.py delete mode 100644 bockbuild/MacSDK/gtk-quartz-engine.py delete mode 100644 bockbuild/MacSDK/gtk-sharp.py delete mode 100644 bockbuild/MacSDK/hicolor-icon-theme.py delete mode 100644 bockbuild/MacSDK/ige-mac-integration.py delete mode 100644 bockbuild/MacSDK/intltool.py delete mode 100644 bockbuild/MacSDK/libcroco.py delete mode 100644 bockbuild/MacSDK/libffi.py delete mode 100644 bockbuild/MacSDK/libgif.py delete mode 100644 bockbuild/MacSDK/libglade.py delete mode 100644 bockbuild/MacSDK/libjpeg.py delete mode 100644 bockbuild/MacSDK/libpng.py delete mode 100644 bockbuild/MacSDK/librsvg.py delete mode 100644 bockbuild/MacSDK/libtiff.py delete mode 100644 bockbuild/MacSDK/libxml2.py delete mode 100644 bockbuild/MacSDK/murrine.py delete mode 100644 bockbuild/MacSDK/pango.py delete mode 100644 bockbuild/MacSDK/patches/cairo-cglayer.patch delete mode 100644 bockbuild/MacSDK/patches/cairo-fix-CGFontGetGlyphPath-deprecation.patch delete mode 100644 bockbuild/MacSDK/patches/cairo-fix-color-bitmap-fonts.patch delete mode 100644 bockbuild/MacSDK/patches/cairo-quartz-crash.patch delete mode 100644 bockbuild/MacSDK/patches/fsharp-assemblysearchpath-fix.patch delete mode 100644 bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch delete mode 100644 bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch delete mode 100644 bockbuild/MacSDK/patches/gdk-quartz-set-fix-modifiers-hack-v3.patch delete mode 100644 bockbuild/MacSDK/patches/glib-recursive-poll.patch delete mode 100644 bockbuild/MacSDK/patches/pango-coretext-astral-plane-1.patch delete mode 100644 bockbuild/MacSDK/patches/pango-coretext-astral-plane-2.patch delete mode 100644 bockbuild/MacSDK/patches/pango-coretext-condensed-trait.patch delete mode 100644 bockbuild/MacSDK/patches/pango-coretext-fix-yosemite-crasher.patch delete mode 100644 bockbuild/MacSDK/patches/pango-disable-ligatures.patch delete mode 100644 bockbuild/MacSDK/patches/pango-fix-ct_font_descriptor_get_weight-crasher.patch delete mode 100644 bockbuild/MacSDK/patches/pango-relative-config-file.patch delete mode 100644 bockbuild/MacSDK/patches/pango-system-font-check-version.patch delete mode 100644 bockbuild/MacSDK/patches/pango-system-font-single.patch delete mode 100644 bockbuild/MacSDK/patches/tiff-4.0.2-macosx-2.patch delete mode 100644 bockbuild/MacSDK/pixman.py delete mode 100644 bockbuild/MacSDK/pkg-config.py diff --git a/bockbuild/MacSDK/atk.py b/bockbuild/MacSDK/atk.py deleted file mode 100644 index dd563230885..00000000000 --- a/bockbuild/MacSDK/atk.py +++ /dev/null @@ -1 +0,0 @@ -GnomeXzPackage('atk', version_major='2.8', version_minor='0') diff --git a/bockbuild/MacSDK/cairo.py b/bockbuild/MacSDK/cairo.py deleted file mode 100644 index 9a3aa92f065..00000000000 --- a/bockbuild/MacSDK/cairo.py +++ /dev/null @@ -1,40 +0,0 @@ -class CairoPackage (CairoGraphicsXzPackage): - - def __init__(self): - CairoGraphicsXzPackage.__init__(self, 'cairo', '1.12.14') - self.sources.extend([ - 'patches/cairo-quartz-crash.patch', - 'patches/cairo-fix-color-bitmap-fonts.patch', - 'patches/cairo-fix-CGFontGetGlyphPath-deprecation.patch', - # 'patches/cairo-cglayer.patch', - ]) - - def prep(self): - Package.prep(self) - - if Package.profile.name == 'darwin': - for p in range(1, len(self.local_sources)): - self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') - - def build(self): - self.configure_flags = [ - '--enable-pdf', - ] - - if Package.profile.name == 'darwin': - self.configure_flags.extend([ - '--enable-quartz', - '--enable-quartz-font', - '--enable-quartz-image', - '--disable-xlib', - '--without-x' - ]) - elif Package.profile.name == 'linux': - self.configure_flags.extend([ - '--disable-quartz', - '--with-x' - ]) - - Package.build(self) - -CairoPackage() diff --git a/bockbuild/MacSDK/expat.py b/bockbuild/MacSDK/expat.py deleted file mode 100644 index 57b52d656f0..00000000000 --- a/bockbuild/MacSDK/expat.py +++ /dev/null @@ -1 +0,0 @@ -SourceForgePackage('expat', 'expat', '2.0.1') diff --git a/bockbuild/MacSDK/fontconfig.py b/bockbuild/MacSDK/fontconfig.py deleted file mode 100644 index 8d890be6073..00000000000 --- a/bockbuild/MacSDK/fontconfig.py +++ /dev/null @@ -1,22 +0,0 @@ -class FontConfigPackage (Package): - - def __init__(self): - Package.__init__(self, 'fontconfig', '2.10.2', - configure_flags=['--disable-docs'], - sources=[ - 'http://www.fontconfig.org/release/%{name}-%{version}.tar.gz' - ], - # note: a non-empty DESTDIR keeps fc-cache from running at - # install-time - ) - - def build(self): - if Package.profile.name == 'darwin': - self.configure_flags.extend([ - '--with-cache-dir="~/Library/Caches/com.xamarin.fontconfig"', - '--with-default-fonts=/System/Library/Fonts', - '--with-add-fonts=/Library/Fonts,/Network/Library/Fonts,/System/Library/Fonts' - ]) - Package.build(self) - -FontConfigPackage() diff --git a/bockbuild/MacSDK/freetype.py b/bockbuild/MacSDK/freetype.py deleted file mode 100644 index c7e86f65107..00000000000 --- a/bockbuild/MacSDK/freetype.py +++ /dev/null @@ -1 +0,0 @@ -SourceForgePackage('%{name}', 'freetype', '2.5.0.1') diff --git a/bockbuild/MacSDK/gdk-pixbuf.py b/bockbuild/MacSDK/gdk-pixbuf.py deleted file mode 100644 index e28ecb31377..00000000000 --- a/bockbuild/MacSDK/gdk-pixbuf.py +++ /dev/null @@ -1,34 +0,0 @@ -class GdkPixbufPackage (GnomeXzPackage): - - def __init__(self): - GnomeXzPackage.__init__( - self, - 'gdk-pixbuf', - version_major='2.28', - version_minor='2') - - if Package.profile.name == 'darwin': - self.sources.extend([ - 'patches/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch', - 'patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch', - ]) - - self.configure_flags.extend(['--enable-gtk-doc-html=no']) - - def prep(self): - Package.prep(self) - if Package.profile.name == 'darwin': - for p in range(1, len(self.local_sources)): - self.sh( - 'patch -p1 --ignore-whitespace < "%{local_sources[' + str(p) + ']}"') - - def deploy(self): - self.loaders_cache = 'lib/gdk-pixbuf-2.0/2.10.0/loaders.cache' - self.sh('gdk-pixbuf-query-loaders --update-cache ') - - # mark the file for destaging - self.sh( - 'cp %{staged_profile}/%{loaders_cache} %{staged_profile}/%{loaders_cache}.release') - self.extra_stage_files = [self.loaders_cache] - -GdkPixbufPackage() diff --git a/bockbuild/MacSDK/gettext.py b/bockbuild/MacSDK/gettext.py deleted file mode 100644 index 78cc86147e7..00000000000 --- a/bockbuild/MacSDK/gettext.py +++ /dev/null @@ -1,31 +0,0 @@ -class GettextPackage (GnuPackage): - - def __init__(self): - GnuPackage.__init__(self, 'gettext', '0.18.2', - configure_flags=[ - '--disable-java', - '--disable-libasprintf', - '--disable-openmp', - '--with-included-glib' - ] - ) - - if Package.profile.name == 'darwin': - self.configure_flags.extend([ - # only build the tools, osx has the lib - # https://github.com/mxcl/homebrew/blob/master/Library/Formula/gettext.rb - #'--without-included-gettext', - ]) - self.sources.extend([ - # Don't build samples - # https://trac.macports.org/export/79183/trunk/dports/devel/gettext/files/patch-gettext-tools-Makefile.in - 'patches/gettext-no-samples.patch', - ]) - - def prep(self): - Package.prep(self) - if Package.profile.name == 'darwin': - for p in range(1, len(self.local_sources)): - self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') - -GettextPackage() diff --git a/bockbuild/MacSDK/glib.py b/bockbuild/MacSDK/glib.py deleted file mode 100644 index bd9cd3d7ca9..00000000000 --- a/bockbuild/MacSDK/glib.py +++ /dev/null @@ -1,79 +0,0 @@ -class GlibPackage (GnomeXzPackage): - - def __init__(self): - GnomeXzPackage.__init__(self, - 'glib', - version_major='2.36', - version_minor='4') - - self.darwin = Package.profile.name == 'darwin' - - if self.darwin: - # link to specific revisions for glib 2.30.x - self.sources.extend([ - # https://trac.macports.org/export/91680/trunk/dports/devel/glib2/files/config.h.ed - 'patches/glib/config.h.ed', - # https://trac.macports.org/export/98985/trunk/dports/devel/glib2/files/patch-configure.diff - 'patches/glib/patch-configure.diff', - # https://trac.macports.org/export/42728/trunk/dports/devel/glib2/files/patch-gi18n.h.diff - 'patches/glib/patch-gi18n.h.diff', - # https://trac.macports.org/export/92608/trunk/dports/devel/glib2/files/patch-gio_gdbusprivate.c.diff - 'patches/glib/patch-gio_gdbusprivate.c.diff', - # https://trac.macports.org/export/49466/trunk/dports/devel/glib2/files/patch-gio_xdgmime_xdgmime.c.diff - 'patches/glib/patch-gio_xdgmime_xdgmime.c.diff', - # https://trac.macports.org/export/91680/trunk/dports/devel/glib2/files/patch-glib-2.0.pc.in.diff - 'patches/glib/patch-glib-2.0.pc.in.diff', - # https://trac.macports.org/export/64476/trunk/dports/devel/glib2/files/patch-glib_gunicollate.c.diff - 'patches/glib/patch-glib_gunicollate.c.diff', - - # Bug 6156 - [gtk] Quitting the application with unsaved file and answering Cancel results in crash - # https://bugzilla.xamarin.com/attachment.cgi?id=2214 - 'patches/glib-recursive-poll.patch', - ]) - - def prep(self): - Package.prep(self) - if self.darwin: - for p in range(2, 8): - self.sh('patch -p0 < %{local_sources[' + str(p) + ']}') - for p in range(8, len(self.local_sources)): - self.sh( - 'patch --ignore-whitespace -p1 < %{local_sources[' + str(p) + ']}') - - def arch_build(self, arch): - if arch == 'darwin-universal': # multi-arch build pass - self.local_ld_flags = ['-arch i386', '-arch x86_64'] - self.local_gcc_flags = ['-arch i386', '-arch x86_64', '-Os'] - self.local_configure_flags = ['--disable-dependency-tracking'] - else: - Package.arch_build(self, arch) - - if self.darwin: - self.local_configure_flags.extend(['--disable-compile-warnings']) - - def build(self): - # modified build for darwin - if self.darwin: - self.local_configure_flags.extend(['--disable-compile-warnings']) - Package.configure(self) - self.sh([ - # 'autoconf', - #'%{configure} --disable-compile-warnings', - 'ed - config.h < %{local_sources[1]}', - # work around - # https://bugzilla.gnome.org/show_bug.cgi?id=700350 - 'touch docs/reference/*/Makefile.in', - 'touch docs/reference/*/*/Makefile.in', - #'%{make}' - ]) - Package.make(self) - else: - Package.build(self) - - def install(self): - Package.install(self) - if self.darwin: - # FIXME: necessary? - self.sh('rm -f %{staged_prefix}/lib/charset.alias') - -GlibPackage() diff --git a/bockbuild/MacSDK/gtk-engines.py b/bockbuild/MacSDK/gtk-engines.py deleted file mode 100644 index d3a6d4a6d1c..00000000000 --- a/bockbuild/MacSDK/gtk-engines.py +++ /dev/null @@ -1,2 +0,0 @@ -GnomePackage('gtk-engines', version_major='2.20', version_minor='2', - configure_flags=['']) diff --git a/bockbuild/MacSDK/gtk-quartz-engine.py b/bockbuild/MacSDK/gtk-quartz-engine.py deleted file mode 100644 index a55a5afda47..00000000000 --- a/bockbuild/MacSDK/gtk-quartz-engine.py +++ /dev/null @@ -1,13 +0,0 @@ -class GtkQuartzEnginePackage (Package): - - def __init__(self): - Package.__init__(self, 'gtk-quartz-engine', - sources=[ - 'git://github.com/mono/gtk-quartz-engine.git'], - override_properties={ - 'configure': './autogen.sh --prefix=%{package_prefix}', - 'needs_lipo': True - }, - revision='9555a08f0c9c98d02153c9d77b54a2dd83ce5d6f') - -GtkQuartzEnginePackage() diff --git a/bockbuild/MacSDK/gtk-sharp.py b/bockbuild/MacSDK/gtk-sharp.py deleted file mode 100644 index 815b2e4f126..00000000000 --- a/bockbuild/MacSDK/gtk-sharp.py +++ /dev/null @@ -1,14 +0,0 @@ -class GtkSharp212ReleasePackage (Package): - - def __init__(self): - Package.__init__(self, 'gtk-sharp', - sources=['git://github.com/mono/gtk-sharp.git'], - git_branch='gtk-sharp-2-12-branch', - revision='f092864bce996c4ac51a13281069067d1e7e6d4b', - override_properties={ - 'configure': './bootstrap-2.12 --prefix=%{package_prefix}', - } - ) - self.make = 'make CSC=mcs' - -GtkSharp212ReleasePackage() diff --git a/bockbuild/MacSDK/hicolor-icon-theme.py b/bockbuild/MacSDK/hicolor-icon-theme.py deleted file mode 100644 index 7387aa05483..00000000000 --- a/bockbuild/MacSDK/hicolor-icon-theme.py +++ /dev/null @@ -1 +0,0 @@ -FreeDesktopPackage('icon-theme', 'hicolor-icon-theme', '0.12') diff --git a/bockbuild/MacSDK/ige-mac-integration.py b/bockbuild/MacSDK/ige-mac-integration.py deleted file mode 100644 index e381a9e0383..00000000000 --- a/bockbuild/MacSDK/ige-mac-integration.py +++ /dev/null @@ -1,3 +0,0 @@ -SourceForgePackage('gtk-osx', 'ige-mac-integration', '0.9.4', ['--without-compile-warnings'], - override_properties={'configure': './configure --prefix="%{staged_prefix}"', - 'makeinstall': 'make install'}) diff --git a/bockbuild/MacSDK/intltool.py b/bockbuild/MacSDK/intltool.py deleted file mode 100644 index 4550fb1fcc4..00000000000 --- a/bockbuild/MacSDK/intltool.py +++ /dev/null @@ -1,10 +0,0 @@ -class IntltoolPackage (Package): - - def __init__(self): - Package.__init__(self, 'intltool', '0.50.2', - sources=[ - 'https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz' - ] - ) - -IntltoolPackage() diff --git a/bockbuild/MacSDK/libcroco.py b/bockbuild/MacSDK/libcroco.py deleted file mode 100644 index 45ff45caace..00000000000 --- a/bockbuild/MacSDK/libcroco.py +++ /dev/null @@ -1,6 +0,0 @@ -GnomeXzPackage('libcroco', version_major='0.6', version_minor='8', - configure_flags=[ - '--host=i386-apple-darwin', - '--disable-Bsymbolic', - '--enable-gtk-doc-html=no' - ]) diff --git a/bockbuild/MacSDK/libffi.py b/bockbuild/MacSDK/libffi.py deleted file mode 100644 index 1aecc54764f..00000000000 --- a/bockbuild/MacSDK/libffi.py +++ /dev/null @@ -1,7 +0,0 @@ -class LibFfiPackage (Package): - - def __init__(self): - Package.__init__(self, 'libffi', '3.0.13', sources=[ - 'ftp://sourceware.org/pub/%{name}/%{name}-%{version}.tar.gz']) - -LibFfiPackage() diff --git a/bockbuild/MacSDK/libgif.py b/bockbuild/MacSDK/libgif.py deleted file mode 100644 index 0ae053c4869..00000000000 --- a/bockbuild/MacSDK/libgif.py +++ /dev/null @@ -1 +0,0 @@ -SourceForgePackage('giflib', 'giflib', '4.1.6') diff --git a/bockbuild/MacSDK/libglade.py b/bockbuild/MacSDK/libglade.py deleted file mode 100644 index 7553ebf199a..00000000000 --- a/bockbuild/MacSDK/libglade.py +++ /dev/null @@ -1 +0,0 @@ -GnomePackage('libglade', '2.6', '4') diff --git a/bockbuild/MacSDK/libjpeg.py b/bockbuild/MacSDK/libjpeg.py deleted file mode 100644 index 5fd850f95c7..00000000000 --- a/bockbuild/MacSDK/libjpeg.py +++ /dev/null @@ -1,8 +0,0 @@ -class LibJpegPackage (Package): - - def __init__(self): - Package.__init__(self, 'libjpeg', '8', sources=[ - 'http://www.ijg.org/files/jpegsrc.v8.tar.gz']) - self.source_dir_name = 'jpeg-8' - -LibJpegPackage() diff --git a/bockbuild/MacSDK/libpng.py b/bockbuild/MacSDK/libpng.py deleted file mode 100644 index 5224e588b6a..00000000000 --- a/bockbuild/MacSDK/libpng.py +++ /dev/null @@ -1,9 +0,0 @@ -class LibPngPackage (Package): - - def __init__(self): - Package.__init__(self, 'libpng', '1.4.12', - sources=[ - 'http://downloads.sourceforge.net/project/libpng/libpng14/older-releases/1.4.12/libpng-1.4.12.tar.xz'], - configure_flags=['--enable-shared']) - -LibPngPackage() diff --git a/bockbuild/MacSDK/librsvg.py b/bockbuild/MacSDK/librsvg.py deleted file mode 100644 index a45c7f68ff6..00000000000 --- a/bockbuild/MacSDK/librsvg.py +++ /dev/null @@ -1,27 +0,0 @@ -class LibrsvgPackage(GnomeXzPackage): - - def __init__(self): - GnomeXzPackage.__init__(self, 'librsvg', version_major='2.37', version_minor='0', - configure_flags=['--disable-Bsymbolic', '--disable-introspection']) - - make = 'make DESTDIR=%{stage_root}' - - def install(self): - # handle some mislocation - misdir = '%s%s' % (self.stage_root, self.staged_profile) - unprotect_dir(self.stage_root) - - Package.install(self) - # scoop up - if not os.path.exists(misdir): - error('Could not find mislocated libsrvg files') - - self.sh( - 'rsync -a --ignore-existing %s/* %s' % - (misdir, self.staged_prefix)) - self.sh('rm -rf %s/*' % misdir) - - def deploy(self): - self.sh('gdk-pixbuf-query-loaders --update-cache') - -LibrsvgPackage() diff --git a/bockbuild/MacSDK/libtiff.py b/bockbuild/MacSDK/libtiff.py deleted file mode 100644 index 844c5c349f8..00000000000 --- a/bockbuild/MacSDK/libtiff.py +++ /dev/null @@ -1,26 +0,0 @@ -class LibTiffPackage (Package): - - def __init__(self): - Package.__init__(self, 'tiff', '4.0.3', - configure_flags=[ - ], - sources=[ - 'http://download.osgeo.org/libtiff/tiff-%{version}.tar.gz', - ]) - - self.needs_lipo = True - - if Package.profile.name == 'darwin': - self.sources.extend([ - # Fix Snow Leopard build - # http://jira.freeswitch.org/secure/attachment/17487/tiff-4.0.2-macosx-2.patch - 'patches/tiff-4.0.2-macosx-2.patch' - ]) - - def prep(self): - Package.prep(self) - if Package.profile.name == 'darwin': - for p in range(1, len(self.local_sources)): - self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') - -LibTiffPackage() diff --git a/bockbuild/MacSDK/libxml2.py b/bockbuild/MacSDK/libxml2.py deleted file mode 100644 index fb45650a2b2..00000000000 --- a/bockbuild/MacSDK/libxml2.py +++ /dev/null @@ -1,19 +0,0 @@ -class LibXmlPackage (Package): - - def __init__(self): - Package.__init__(self, - 'libxml2', - '2.9.1', - configure_flags=['--with-python=no'], - sources=[ - 'ftp://xmlsoft.org/%{name}/%{name}-%{version}.tar.gz', - ] - ) - - def prep(self): - Package.prep(self) - if Package.profile.name == 'darwin': - for p in range(1, len(self.local_sources)): - self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') - -LibXmlPackage() diff --git a/bockbuild/MacSDK/murrine.py b/bockbuild/MacSDK/murrine.py deleted file mode 100644 index 5c84ff4fb68..00000000000 --- a/bockbuild/MacSDK/murrine.py +++ /dev/null @@ -1,15 +0,0 @@ -class MurrinePackage (GnomeXzPackage): - - def __init__(self): - GnomePackage.__init__(self, - 'murrine', - version_major='0.98', - version_minor='2') - - # FIXME: this may need porting - # self.sources.append ('patches/murrine-osx.patch') - - def prep(self): - Package.prep(self) - -MurrinePackage() diff --git a/bockbuild/MacSDK/pango.py b/bockbuild/MacSDK/pango.py deleted file mode 100644 index 0691078cd88..00000000000 --- a/bockbuild/MacSDK/pango.py +++ /dev/null @@ -1,51 +0,0 @@ -class PangoPackage (GnomeXzPackage): - - def __init__(self): - GnomePackage.__init__(self, - 'pango', - version_major='1.35', - version_minor='0', - configure_flags=[ - '--without-x', - '--enable-gtk-doc-html=no' - ] - ) - - self.sources.extend([ - # 1 - # Bug 321419 - Allow environment var substitution in Pango config - # https://bugzilla.gnome.org/show_bug.cgi?id=321419 - 'patches/pango-relative-config-file.patch', - - # BXC 10257 - Characters outside the Basic Multilingual Plane don't render correctly - # https://bugzilla.xamarin.com/show_bug.cgi?id=10257 - 'patches/pango-coretext-astral-plane-1.patch', - 'patches/pango-coretext-astral-plane-2.patch', - - # Bug 15787 - Caret position is wrong when there are ligatures - # https://bugzilla.xamarin.com/show_bug.cgi?id=15787 - 'patches/pango-disable-ligatures.patch', - - # https://bugzilla.xamarin.com/show_bug.cgi?id=22199 - 'patches/pango-fix-ct_font_descriptor_get_weight-crasher.patch', - - # https://bugzilla.gnome.org/show_bug.cgi?id=734372 - 'patches/pango-coretext-condensed-trait.patch', - - # https://bugzilla.xamarin.com/show_bug.cgi?id=32938 - 'patches/pango-coretext-fix-yosemite-crasher.patch', - - 'patches/pango-system-font-single.patch', - 'patches/pango-system-font-check-version.patch' - ]) - - def prep(self): - GnomePackage.prep(self) - if Package.profile.name == 'darwin': - for p in range(1, len(self.local_sources)): - self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"') - - def deploy(self): - self.sh('pango-querymodules --update-cache') - -PangoPackage() diff --git a/bockbuild/MacSDK/patches/cairo-cglayer.patch b/bockbuild/MacSDK/patches/cairo-cglayer.patch deleted file mode 100644 index 4965d6008b6..00000000000 --- a/bockbuild/MacSDK/patches/cairo-cglayer.patch +++ /dev/null @@ -1,2187 +0,0 @@ ---- a/src/cairo-quartz-font.c 2012-11-13 18:20:00.000000000 -0800 -+++ b/src/cairo-quartz-font.c 2012-11-13 18:06:56.000000000 -0800 -@@ -90,8 +90,9 @@ static int (*CGFontGetAscentPtr) (CGFont - static int (*CGFontGetDescentPtr) (CGFontRef fontRef) = NULL; - static int (*CGFontGetLeadingPtr) (CGFontRef fontRef) = NULL; - --/* Not public anymore in 64-bits nor in 10.7 */ --static ATSFontRef (*FMGetATSFontRefFromFontPtr) (FMFont iFont) = NULL; -+/* CTFontCreateWithGraphicsFont is not public until 10.5. */ -+typedef const struct __CTFontDescriptor *CTFontDescriptorRef; -+static CTFontRef (*CTFontCreateWithGraphicsFontPtr) (CGFontRef, CGFloat, const CGAffineTransform *, CTFontDescriptorRef) = NULL; - - static cairo_bool_t _cairo_quartz_font_symbol_lookup_done = FALSE; - static cairo_bool_t _cairo_quartz_font_symbols_present = FALSE; -@@ -130,7 +131,7 @@ quartz_font_ensure_symbols(void) - CGContextGetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing"); - CGContextSetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextSetAllowsFontSmoothing"); - -- FMGetATSFontRefFromFontPtr = dlsym(RTLD_DEFAULT, "FMGetATSFontRefFromFont"); -+ CTFontCreateWithGraphicsFontPtr = dlsym(RTLD_DEFAULT, "CTFontCreateWithGraphicsFont"); - - if ((CGFontCreateWithFontNamePtr || CGFontCreateWithNamePtr) && - CGFontGetGlyphBBoxesPtr && -@@ -155,6 +156,7 @@ struct _cairo_quartz_font_face { - cairo_font_face_t base; - - CGFontRef cgFont; -+ CTFontRef ctFont; - }; - - /* -@@ -239,6 +241,10 @@ _cairo_quartz_font_face_destroy (void *a - { - cairo_quartz_font_face_t *font_face = (cairo_quartz_font_face_t*) abstract_face; - -+ if (font_face->ctFont) { -+ CFRelease (font_face->ctFont); -+ } -+ - CGFontRelease (font_face->cgFont); - } - -@@ -363,6 +369,12 @@ cairo_quartz_font_face_create_for_cgfont - - font_face->cgFont = CGFontRetain (font); - -+ if (CTFontCreateWithGraphicsFontPtr) { -+ font_face->ctFont = CTFontCreateWithGraphicsFontPtr (font, 1.0, NULL, NULL); -+ } else { -+ font_face->ctFont = NULL; -+ } -+ - _cairo_font_face_init (&font_face->base, &_cairo_quartz_font_face_backend); - - return &font_face->base; -@@ -782,49 +794,10 @@ _cairo_quartz_scaled_font_get_cg_font_re - return ffont->cgFont; - } - --/* -- * compat with old ATSUI backend -- */ -- --/** -- * cairo_quartz_font_face_create_for_atsu_font_id -- * @font_id: an ATSUFontID for the font. -- * -- * Creates a new font for the Quartz font backend based on an -- * #ATSUFontID. This font can then be used with -- * cairo_set_font_face() or cairo_scaled_font_create(). -- * -- * Return value: a newly created #cairo_font_face_t. Free with -- * cairo_font_face_destroy() when you are done using it. -- * -- * Since: 1.6 -- **/ --cairo_font_face_t * --cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id) -+CTFontRef -+_cairo_quartz_scaled_font_get_ct_font_ref (cairo_scaled_font_t *abstract_font) - { -- quartz_font_ensure_symbols(); -- -- if (FMGetATSFontRefFromFontPtr != NULL) { -- ATSFontRef atsFont = FMGetATSFontRefFromFontPtr (font_id); -- CGFontRef cgFont = CGFontCreateWithPlatformFont (&atsFont); -- cairo_font_face_t *ff; -- -- ff = cairo_quartz_font_face_create_for_cgfont (cgFont); -- -- CGFontRelease (cgFont); -- -- return ff; -- } else { -- _cairo_error_throw (CAIRO_STATUS_NO_MEMORY); -- return (cairo_font_face_t *)&_cairo_font_face_nil; -- } --} -- --/* This is the old name for the above function, exported for compat purposes */ --cairo_font_face_t *cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id); -+ cairo_quartz_font_face_t *ffont = _cairo_quartz_scaled_to_face(abstract_font); - --cairo_font_face_t * --cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id) --{ -- return cairo_quartz_font_face_create_for_atsu_font_id (font_id); -+ return ffont->ctFont; - } ---- a/src/cairo-quartz-image-surface.c 2010-06-18 04:47:13.000000000 -0700 -+++ b/src/cairo-quartz-image-surface.c 2012-11-13 18:06:56.000000000 -0800 -@@ -148,6 +148,8 @@ _cairo_quartz_image_surface_flush (void - surface->image = newImage; - CGImageRelease (oldImage); - -+ surface->base.is_clear = surface->imageSurface->base.is_clear; -+ - return CAIRO_STATUS_SUCCESS; - } - -@@ -270,6 +272,8 @@ cairo_quartz_image_surface_create (cairo - qisurf->image = image; - qisurf->imageSurface = image_surface; - -+ qisurf->base.is_clear = image_surface->base.is_clear; -+ - return &qisurf->base; - } - ---- a/src/cairo-quartz-private.h 2010-12-25 06:21:34.000000000 -0800 -+++ b/src/cairo-quartz-private.h 2012-11-13 18:06:56.000000000 -0800 -@@ -50,6 +50,9 @@ typedef CGFloat cairo_quartz_float_t; - typedef float cairo_quartz_float_t; - #endif - -+/* define CTFontRef for pre-10.5 SDKs */ -+typedef const struct __CTFont *CTFontRef; -+ - typedef struct cairo_quartz_surface { - cairo_surface_t base; - -@@ -60,21 +63,22 @@ typedef struct cairo_quartz_surface { - cairo_surface_t *imageSurfaceEquiv; - - cairo_surface_clipper_t clipper; -- cairo_rectangle_int_t extents; - -- /* These are stored while drawing operations are in place, set up -- * by quartz_setup_source() and quartz_finish_source() -+ /** -+ * If non-null, this is a CGImage representing the contents of the surface. -+ * We clear this out before any painting into the surface, so that we -+ * don't force a copy to be created. - */ -- CGAffineTransform sourceTransform; -+ CGImageRef bitmapContextImage; - -- CGImageRef sourceImage; -- cairo_surface_t *sourceImageSurface; -- CGRect sourceImageRect; -+ /** -+ * If non-null, this is the CGLayer for the surface. -+ */ -+ CGLayerRef cgLayer; - -- CGShadingRef sourceShading; -- CGPatternRef sourcePattern; -+ cairo_rectangle_int_t extents; - -- CGInterpolationQuality oldInterpolationQuality; -+ cairo_bool_t ownsData; - } cairo_quartz_surface_t; - - typedef struct cairo_quartz_image_surface { -@@ -103,6 +107,9 @@ _cairo_quartz_create_cgimage (cairo_form - CGFontRef - _cairo_quartz_scaled_font_get_cg_font_ref (cairo_scaled_font_t *sfont); - -+CTFontRef -+_cairo_quartz_scaled_font_get_ct_font_ref (cairo_scaled_font_t *sfont); -+ - #else - - # error Cairo was not compiled with support for the quartz backend ---- a/src/cairo-quartz-surface.c 2012-11-13 18:20:00.000000000 -0800 -+++ b/src/cairo-quartz-surface.c 2012-11-13 18:06:56.000000000 -0800 -@@ -41,6 +41,8 @@ - - #include "cairo-error-private.h" - #include "cairo-surface-clipper-private.h" -+#include "cairo-gstate-private.h" -+#include "cairo-private.h" - - #include - -@@ -77,6 +79,11 @@ - * This macro can be used to conditionally compile backend-specific code. - */ - -+/* Here are some of the differences between cairo and CoreGraphics -+ - cairo has only a single source active at once vs. CoreGraphics having -+ separate sources for stroke and fill -+*/ -+ - /* This method is private, but it exists. Its params are are exposed - * as args to the NS* method, but not as CG. - */ -@@ -126,6 +133,12 @@ static void (*CGContextSetShouldAntialia - static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL; - static bool (*CGContextGetAllowsFontSmoothingPtr) (CGContextRef) = NULL; - static CGPathRef (*CGContextCopyPathPtr) (CGContextRef) = NULL; -+static CGFloat (*CGContextGetAlphaPtr) (CGContextRef) = NULL; -+ -+/* CTFontDrawGlyphs is not available until 10.7 */ -+static void (*CTFontDrawGlyphsPtr) (CTFontRef, const CGGlyph[], const CGPoint[], size_t, CGContextRef) = NULL; -+ -+static SInt32 _cairo_quartz_osx_version = 0x0; - - static cairo_bool_t _cairo_quartz_symbol_lookup_done = FALSE; - -@@ -160,6 +173,14 @@ static void quartz_ensure_symbols(void) - CGContextCopyPathPtr = dlsym(RTLD_DEFAULT, "CGContextCopyPath"); - CGContextGetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing"); - CGContextSetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextSetAllowsFontSmoothing"); -+ CGContextGetAlphaPtr = dlsym(RTLD_DEFAULT, "CGContextGetAlpha"); -+ -+ CTFontDrawGlyphsPtr = dlsym(RTLD_DEFAULT, "CTFontDrawGlyphs"); -+ -+ if (Gestalt(gestaltSystemVersion, &_cairo_quartz_osx_version) != noErr) { -+ // assume 10.5 -+ _cairo_quartz_osx_version = 0x1050; -+ } - - _cairo_quartz_symbol_lookup_done = TRUE; - } -@@ -430,6 +446,7 @@ _cairo_quartz_cairo_operator_to_quartz_c - case CAIRO_OPERATOR_HSL_LUMINOSITY: - default: - assert (0); -+ return kPrivateCGCompositeClear; - } - } - -@@ -598,10 +615,13 @@ _cairo_quartz_cairo_matrix_to_quartz (co - typedef struct { - bool isClipping; - CGGlyph *cg_glyphs; -- CGSize *cg_advances; -+ union { -+ CGSize *cg_advances; -+ CGPoint *cg_positions; -+ } u; - size_t nglyphs; - CGAffineTransform textTransform; -- CGFontRef font; -+ cairo_scaled_font_t *scaled_font; - CGPoint origin; - } unbounded_show_glyphs_t; - -@@ -679,12 +699,6 @@ _cairo_quartz_fixup_unbounded_operation - else - CGContextEOFillPath (cgc); - } else if (op->op == UNBOUNDED_SHOW_GLYPHS) { -- CGContextSetFont (cgc, op->u.show_glyphs.font); -- CGContextSetFontSize (cgc, 1.0); -- CGContextSetTextMatrix (cgc, CGAffineTransformIdentity); -- CGContextTranslateCTM (cgc, op->u.show_glyphs.origin.x, op->u.show_glyphs.origin.y); -- CGContextConcatCTM (cgc, op->u.show_glyphs.textTransform); -- - if (op->u.show_glyphs.isClipping) { - /* Note that the comment in show_glyphs about kCGTextClip - * and the text transform still applies here; however, the -@@ -693,12 +707,25 @@ _cairo_quartz_fixup_unbounded_operation - CGContextSetTextDrawingMode (cgc, kCGTextClip); - CGContextSaveGState (cgc); - } -+ CGContextTranslateCTM (cgc, op->u.show_glyphs.origin.x, op->u.show_glyphs.origin.y); -+ CGContextConcatCTM (cgc, op->u.show_glyphs.textTransform); -+ if (CTFontDrawGlyphsPtr) { -+ CTFontDrawGlyphsPtr (_cairo_quartz_scaled_font_get_ct_font_ref (op->u.show_glyphs.scaled_font), -+ op->u.show_glyphs.cg_glyphs, -+ op->u.show_glyphs.u.cg_positions, -+ op->u.show_glyphs.nglyphs, -+ cgc); -+ } else { -+ CGContextSetFont (cgc, _cairo_quartz_scaled_font_get_cg_font_ref (op->u.show_glyphs.scaled_font)); -+ CGContextSetFontSize (cgc, 1.0); -+ CGContextSetTextMatrix (cgc, CGAffineTransformIdentity); -+ -+ CGContextShowGlyphsWithAdvances (cgc, -+ op->u.show_glyphs.cg_glyphs, -+ op->u.show_glyphs.u.cg_advances, -+ op->u.show_glyphs.nglyphs); - -- CGContextShowGlyphsWithAdvances (cgc, -- op->u.show_glyphs.cg_glyphs, -- op->u.show_glyphs.cg_advances, -- op->u.show_glyphs.nglyphs); -- -+ } - if (op->u.show_glyphs.isClipping) { - CGContextClearRect (cgc, clipBoxRound); - CGContextRestoreGState (cgc); -@@ -1102,12 +1129,12 @@ DataProviderReleaseCallback (void *info, - { - quartz_source_image_t *source_img = info; - _cairo_surface_release_source_image (source_img->surface, source_img->image_out, source_img->image_extra); -+ cairo_surface_destroy (source_img->surface); - free (source_img); - } - - static cairo_status_t --_cairo_surface_to_cgimage (cairo_surface_t *target, -- cairo_surface_t *source, -+_cairo_surface_to_cgimage (cairo_surface_t *source, - CGImageRef *image_out) - { - cairo_status_t status; -@@ -1127,9 +1154,14 @@ _cairo_surface_to_cgimage (cairo_surface - } - - if (_cairo_quartz_is_cgcontext_bitmap_context (surface->cgContext)) { -- *image_out = CGBitmapContextCreateImage (surface->cgContext); -- if (*image_out) -- return CAIRO_STATUS_SUCCESS; -+ if (!surface->bitmapContextImage) { -+ surface->bitmapContextImage = -+ CGBitmapContextCreateImage (surface->cgContext); -+ } -+ if (surface->bitmapContextImage) { -+ *image_out = CGImageRetain (surface->bitmapContextImage); -+ return CAIRO_STATUS_SUCCESS; -+ } - } - } - -@@ -1137,10 +1169,11 @@ _cairo_surface_to_cgimage (cairo_surface - if (source_img == NULL) - return _cairo_error (CAIRO_STATUS_NO_MEMORY); - -- source_img->surface = source; -+ source_img->surface = cairo_surface_reference(source); - - status = _cairo_surface_acquire_source_image (source_img->surface, &source_img->image_out, &source_img->image_extra); - if (status) { -+ cairo_surface_destroy (source_img->surface); - free (source_img); - return status; - } -@@ -1251,7 +1284,7 @@ _cairo_quartz_cairo_repeating_surface_pa - is_bounded = _cairo_surface_get_extents (pat_surf, &extents); - assert (is_bounded); - -- status = _cairo_surface_to_cgimage ((cairo_surface_t*) dest, pat_surf, &image); -+ status = _cairo_surface_to_cgimage (pat_surf, &image); - if (status) - return status; - if (image == NULL) -@@ -1322,16 +1355,43 @@ typedef enum { - DO_SHADING, - DO_PATTERN, - DO_IMAGE, -+ DO_TILED_IMAGE, -+ DO_LAYER, - DO_UNSUPPORTED, -- DO_NOTHING, -- DO_TILED_IMAGE -+ DO_NOTHING - } cairo_quartz_action_t; - --static cairo_quartz_action_t -+/* State used during a drawing operation. */ -+typedef struct { -+ CGContextRef context; -+ cairo_quartz_action_t action; -+ -+ // Used with DO_SHADING, DO_IMAGE, DO_TILED_IMAGE and DO_LAYER -+ CGAffineTransform transform; -+ -+ // Used with DO_IMAGE and DO_TILED_IMAGE -+ CGImageRef image; -+ cairo_surface_t *imageSurface; -+ -+ // Used with DO_IMAGE, DO_TILED_IMAGE and DO_LAYER -+ CGRect imageRect; -+ -+ // Used with DO_LAYER -+ CGLayerRef layer; -+ -+ // Used with DO_SHADING -+ CGShadingRef shading; -+ -+ // Used with DO_PATTERN -+ CGPatternRef pattern; -+} cairo_quartz_drawing_state_t; -+ -+static void - _cairo_quartz_setup_fallback_source (cairo_quartz_surface_t *surface, -- const cairo_pattern_t *source) -+ const cairo_pattern_t *source, -+ cairo_quartz_drawing_state_t *state) - { -- CGRect clipBox = CGContextGetClipBoundingBox (surface->cgContext); -+ CGRect clipBox = CGContextGetClipBoundingBox (state->context); - double x0, y0, w, h; - - cairo_surface_t *fallback; -@@ -1340,8 +1400,10 @@ _cairo_quartz_setup_fallback_source (cai - cairo_status_t status; - - if (clipBox.size.width == 0.0f || -- clipBox.size.height == 0.0f) -- return DO_NOTHING; -+ clipBox.size.height == 0.0f) { -+ state->action = DO_NOTHING; -+ return; -+ } - - x0 = floor(clipBox.origin.x); - y0 = floor(clipBox.origin.y); -@@ -1384,18 +1446,21 @@ _cairo_quartz_setup_fallback_source (cai - } - #endif - -- status = _cairo_surface_to_cgimage (&surface->base, fallback, &img); -- if (status) -- return DO_UNSUPPORTED; -- if (img == NULL) -- return DO_NOTHING; -- -- surface->sourceImageRect = CGRectMake (0.0, 0.0, w, h); -- surface->sourceImage = img; -- surface->sourceImageSurface = fallback; -- surface->sourceTransform = CGAffineTransformMakeTranslation (x0, y0); -+ status = _cairo_surface_to_cgimage (fallback, &img); -+ if (status) { -+ state->action = DO_UNSUPPORTED; -+ return; -+ } -+ if (img == NULL) { -+ state->action = DO_NOTHING; -+ return; -+ } - -- return DO_IMAGE; -+ state->imageRect = CGRectMake (0.0, 0.0, w, h); -+ state->image = img; -+ state->imageSurface = fallback; -+ state->transform = CGAffineTransformMakeTranslation (x0, y0); -+ state->action = DO_IMAGE; - } - - /* -@@ -1411,10 +1476,11 @@ based on the extents of the object (the - we don't want the rasterization of the entire gradient to depend on the - clip region). - */ --static cairo_quartz_action_t -+static void - _cairo_quartz_setup_linear_source (cairo_quartz_surface_t *surface, - const cairo_linear_pattern_t *lpat, -- cairo_rectangle_int_t *extents) -+ cairo_rectangle_int_t *extents, -+ cairo_quartz_drawing_state_t *state) - { - const cairo_pattern_t *abspat = &lpat->base.base; - cairo_matrix_t mat; -@@ -1424,9 +1490,10 @@ _cairo_quartz_setup_linear_source (cairo - bool extend = abspat->extend == CAIRO_EXTEND_PAD; - - if (lpat->base.n_stops == 0) { -- CGContextSetRGBStrokeColor (surface->cgContext, 0., 0., 0., 0.); -- CGContextSetRGBFillColor (surface->cgContext, 0., 0., 0., 0.); -- return DO_SOLID; -+ CGContextSetRGBStrokeColor (state->context, 0., 0., 0., 0.); -+ CGContextSetRGBFillColor (state->context, 0., 0., 0., 0.); -+ state->action = DO_SOLID; -+ return; - } - - if (lpat->p1.x == lpat->p2.x && -@@ -1436,12 +1503,13 @@ _cairo_quartz_setup_linear_source (cairo - * Whatever the correct behaviour is, let's at least have only pixman's - * implementation to worry about. - */ -- return _cairo_quartz_setup_fallback_source (surface, abspat); -+ _cairo_quartz_setup_fallback_source (surface, abspat, state); -+ return; - } - - mat = abspat->matrix; - cairo_matrix_invert (&mat); -- _cairo_quartz_cairo_matrix_to_quartz (&mat, &surface->sourceTransform); -+ _cairo_quartz_cairo_matrix_to_quartz (&mat, &state->transform); - - rgb = CGColorSpaceCreateDeviceRGB(); - -@@ -1461,21 +1529,22 @@ _cairo_quartz_setup_linear_source (cairo - extents); - } - -- surface->sourceShading = CGShadingCreateAxial (rgb, -- start, end, -- gradFunc, -- extend, extend); -+ state->shading = CGShadingCreateAxial (rgb, -+ start, end, -+ gradFunc, -+ extend, extend); - - CGColorSpaceRelease(rgb); - CGFunctionRelease(gradFunc); - -- return DO_SHADING; -+ state->action = DO_SHADING; - } - --static cairo_quartz_action_t -+static void - _cairo_quartz_setup_radial_source (cairo_quartz_surface_t *surface, - const cairo_radial_pattern_t *rpat, -- cairo_rectangle_int_t *extents) -+ cairo_rectangle_int_t *extents, -+ cairo_quartz_drawing_state_t *state) - { - const cairo_pattern_t *abspat = &rpat->base.base; - cairo_matrix_t mat; -@@ -1494,9 +1563,10 @@ _cairo_quartz_setup_radial_source (cairo - double centerDistance = sqrt (dx*dx + dy*dy); - - if (rpat->base.n_stops == 0) { -- CGContextSetRGBStrokeColor (surface->cgContext, 0., 0., 0., 0.); -- CGContextSetRGBFillColor (surface->cgContext, 0., 0., 0., 0.); -- return DO_SOLID; -+ CGContextSetRGBStrokeColor (state->context, 0., 0., 0., 0.); -+ CGContextSetRGBFillColor (state->context, 0., 0., 0., 0.); -+ state->action = DO_SOLID; -+ return; - } - - if (r2 <= centerDistance + r1 + 1e-6 && /* circle 2 doesn't contain circle 1 */ -@@ -1507,12 +1577,13 @@ _cairo_quartz_setup_radial_source (cairo - * implementation to worry about. - * Note that this also catches the cases where r1 == r2. - */ -- return _cairo_quartz_setup_fallback_source (surface, abspat); -+ _cairo_quartz_setup_fallback_source (surface, abspat, state); -+ return; - } - - mat = abspat->matrix; - cairo_matrix_invert (&mat); -- _cairo_quartz_cairo_matrix_to_quartz (&mat, &surface->sourceTransform); -+ _cairo_quartz_cairo_matrix_to_quartz (&mat, &state->transform); - - rgb = CGColorSpaceCreateDeviceRGB(); - -@@ -1531,90 +1602,79 @@ _cairo_quartz_setup_radial_source (cairo - extents); - } - -- surface->sourceShading = CGShadingCreateRadial (rgb, -- start, -- r1, -- end, -- r2, -- gradFunc, -- extend, extend); -+ state->shading = CGShadingCreateRadial (rgb, -+ start, -+ r1, -+ end, -+ r2, -+ gradFunc, -+ extend, extend); - - CGColorSpaceRelease(rgb); - CGFunctionRelease(gradFunc); - -- return DO_SHADING; -+ state->action = DO_SHADING; - } - --static cairo_quartz_action_t --_cairo_quartz_setup_source (cairo_quartz_surface_t *surface, -- const cairo_pattern_t *source, -- cairo_rectangle_int_t *extents) -+static void -+_cairo_quartz_setup_surface_source (cairo_quartz_surface_t *surface, -+ const cairo_surface_pattern_t *spat, -+ cairo_rectangle_int_t *extents, -+ cairo_quartz_drawing_state_t *state) - { -- assert (!(surface->sourceImage || surface->sourceShading || surface->sourcePattern)); -- -- surface->oldInterpolationQuality = CGContextGetInterpolationQuality (surface->cgContext); -- CGContextSetInterpolationQuality (surface->cgContext, _cairo_quartz_filter_to_quartz (source->filter)); -+ const cairo_pattern_t *source = &spat->base; -+ CGContextRef context = state->context; - -- if (source->type == CAIRO_PATTERN_TYPE_SOLID) { -- cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) source; -- -- CGContextSetRGBStrokeColor (surface->cgContext, -- solid->color.red, -- solid->color.green, -- solid->color.blue, -- solid->color.alpha); -- CGContextSetRGBFillColor (surface->cgContext, -- solid->color.red, -- solid->color.green, -- solid->color.blue, -- solid->color.alpha); -- -- return DO_SOLID; -- } -- -- if (source->type == CAIRO_PATTERN_TYPE_LINEAR) { -- const cairo_linear_pattern_t *lpat = (const cairo_linear_pattern_t *)source; -- return _cairo_quartz_setup_linear_source (surface, lpat, extents); -- } -- -- if (source->type == CAIRO_PATTERN_TYPE_RADIAL) { -- const cairo_radial_pattern_t *rpat = (const cairo_radial_pattern_t *)source; -- return _cairo_quartz_setup_radial_source (surface, rpat, extents); -- } -- -- if (source->type == CAIRO_PATTERN_TYPE_SURFACE && -- (source->extend == CAIRO_EXTEND_NONE || (CGContextDrawTiledImagePtr && source->extend == CAIRO_EXTEND_REPEAT))) -+ if (source->extend == CAIRO_EXTEND_NONE || source->extend == CAIRO_EXTEND_PAD || -+ (CGContextDrawTiledImagePtr && source->extend == CAIRO_EXTEND_REPEAT)) - { -- const cairo_surface_pattern_t *spat = (const cairo_surface_pattern_t *) source; - cairo_surface_t *pat_surf = spat->surface; - CGImageRef img; - cairo_matrix_t m = spat->base.matrix; - cairo_rectangle_int_t extents; -- cairo_status_t status; - CGAffineTransform xform; - CGRect srcRect; - cairo_fixed_t fw, fh; - cairo_bool_t is_bounded; -+ cairo_bool_t repeat = source->extend == CAIRO_EXTEND_REPEAT; -+ cairo_status_t status; - -- status = _cairo_surface_to_cgimage ((cairo_surface_t *) surface, pat_surf, &img); -- if (status) -- return DO_UNSUPPORTED; -- if (img == NULL) -- return DO_NOTHING; -+ cairo_matrix_invert(&m); -+ _cairo_quartz_cairo_matrix_to_quartz (&m, &state->transform); - -- CGContextSetRGBFillColor (surface->cgContext, 0, 0, 0, 1); -+ /* Draw nonrepeating CGLayer surface using DO_LAYER */ -+ if (!repeat && cairo_surface_get_type (pat_surf) == CAIRO_SURFACE_TYPE_QUARTZ) { -+ cairo_quartz_surface_t *quartz_surf = (cairo_quartz_surface_t *) pat_surf; -+ if (quartz_surf->cgLayer) { -+ state->imageRect = CGRectMake (0, 0, quartz_surf->extents.width, quartz_surf->extents.height); -+ state->layer = quartz_surf->cgLayer; -+ state->action = DO_LAYER; -+ return; -+ } -+ } -+ -+ status = _cairo_surface_to_cgimage (pat_surf, &img); -+ if (status) { -+ state->action = DO_UNSUPPORTED; -+ return; -+ } -+ if (img == NULL) { -+ state->action = DO_NOTHING; -+ return; -+ } - -- surface->sourceImage = img; -+ /* XXXroc what is this for? */ -+ CGContextSetRGBFillColor (surface->cgContext, 0, 0, 0, 1); - -- cairo_matrix_invert(&m); -- _cairo_quartz_cairo_matrix_to_quartz (&m, &surface->sourceTransform); -+ state->image = img; - - is_bounded = _cairo_surface_get_extents (pat_surf, &extents); - assert (is_bounded); - -- if (source->extend == CAIRO_EXTEND_NONE) { -- surface->sourceImageRect = CGRectMake (0, 0, extents.width, extents.height); -- return DO_IMAGE; -+ if (!repeat) { -+ state->imageRect = CGRectMake (0, 0, extents.width, extents.height); -+ state->action = DO_IMAGE; -+ return; - } - - /* Quartz seems to tile images at pixel-aligned regions only -- this -@@ -1624,8 +1684,8 @@ _cairo_quartz_setup_source (cairo_quartz - * epsilon), and if not, fall back to the CGPattern type. - */ - -- xform = CGAffineTransformConcat (CGContextGetCTM (surface->cgContext), -- surface->sourceTransform); -+ xform = CGAffineTransformConcat (CGContextGetCTM (context), -+ state->transform); - - srcRect = CGRectMake (0, 0, extents.width, extents.height); - srcRect = CGRectApplyAffineTransform (srcRect, xform); -@@ -1646,101 +1706,218 @@ _cairo_quartz_setup_source (cairo_quartz - - srcRect = CGRectApplyAffineTransform (srcRect, xform); - -- surface->sourceImageRect = srcRect; -- -- return DO_TILED_IMAGE; -+ state->imageRect = srcRect; -+ state->action = DO_TILED_IMAGE; -+ return; - } - - /* Fall through to generic SURFACE case */ - } - -- if (source->type == CAIRO_PATTERN_TYPE_SURFACE) { -- cairo_quartz_float_t patternAlpha = 1.0f; -- CGColorSpaceRef patternSpace; -- CGPatternRef pattern; -- cairo_int_status_t status; -- -- status = _cairo_quartz_cairo_repeating_surface_pattern_to_quartz (surface, source, &pattern); -- if (status == CAIRO_INT_STATUS_NOTHING_TO_DO) -- return DO_NOTHING; -- if (status) -- return DO_UNSUPPORTED; -- -- // Save before we change the pattern, colorspace, etc. so that -- // we can restore and make sure that quartz releases our -- // pattern (which may be stack allocated) -- CGContextSaveGState(surface->cgContext); -- -- patternSpace = CGColorSpaceCreatePattern(NULL); -- CGContextSetFillColorSpace (surface->cgContext, patternSpace); -- CGContextSetFillPattern (surface->cgContext, pattern, &patternAlpha); -- CGContextSetStrokeColorSpace (surface->cgContext, patternSpace); -- CGContextSetStrokePattern (surface->cgContext, pattern, &patternAlpha); -- CGColorSpaceRelease (patternSpace); -- -- /* Quartz likes to munge the pattern phase (as yet unexplained -- * why); force it to 0,0 as we've already baked in the correct -- * pattern translation into the pattern matrix -- */ -- CGContextSetPatternPhase (surface->cgContext, CGSizeMake(0,0)); -- -- surface->sourcePattern = pattern; -+ CGFloat patternAlpha = 1.0f; -+ CGColorSpaceRef patternSpace; -+ CGPatternRef pattern; -+ cairo_int_status_t status; - -- return DO_PATTERN; -+ status = _cairo_quartz_cairo_repeating_surface_pattern_to_quartz (surface, source, &pattern); -+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO) { -+ state->action = DO_NOTHING; -+ return; -+ } -+ if (status) { -+ state->action = DO_UNSUPPORTED; -+ return; - } - -- return DO_UNSUPPORTED; -+ patternSpace = CGColorSpaceCreatePattern (NULL); -+ CGContextSetFillColorSpace (context, patternSpace); -+ CGContextSetFillPattern (context, pattern, &patternAlpha); -+ CGContextSetStrokeColorSpace (context, patternSpace); -+ CGContextSetStrokePattern (context, pattern, &patternAlpha); -+ CGColorSpaceRelease (patternSpace); -+ -+ /* Quartz likes to munge the pattern phase (as yet unexplained -+ * why); force it to 0,0 as we've already baked in the correct -+ * pattern translation into the pattern matrix -+ */ -+ CGContextSetPatternPhase (context, CGSizeMake(0,0)); -+ -+ state->pattern = pattern; -+ state->action = DO_PATTERN; -+ return; - } - -+/** -+ * Call this before any operation that can modify the contents of a -+ * cairo_quartz_surface_t. -+ */ - static void --_cairo_quartz_teardown_source (cairo_quartz_surface_t *surface, -- const cairo_pattern_t *source) -+_cairo_quartz_surface_will_change (cairo_quartz_surface_t *surface) - { -- CGContextSetInterpolationQuality (surface->cgContext, surface->oldInterpolationQuality); -+ if (surface->bitmapContextImage) { -+ CGImageRelease (surface->bitmapContextImage); -+ surface->bitmapContextImage = NULL; -+ } -+} - -- if (surface->sourceImage) { -- CGImageRelease(surface->sourceImage); -- surface->sourceImage = NULL; -+/** -+ * Sets up internal state to be used to draw the source mask, stored in -+ * cairo_quartz_state_t. Guarantees to call CGContextSaveGState on -+ * surface->cgContext. -+ */ -+static cairo_quartz_drawing_state_t -+_cairo_quartz_setup_state (cairo_quartz_surface_t *surface, -+ const cairo_pattern_t *source, -+ cairo_operator_t op, -+ cairo_rectangle_int_t *extents) -+{ -+ CGContextRef context = surface->cgContext; -+ cairo_quartz_drawing_state_t state; -+ cairo_status_t status; - -- cairo_surface_destroy(surface->sourceImageSurface); -- surface->sourceImageSurface = NULL; -+ state.context = context; -+ state.image = NULL; -+ state.imageSurface = NULL; -+ state.layer = NULL; -+ state.shading = NULL; -+ state.pattern = NULL; -+ -+ _cairo_quartz_surface_will_change (surface); -+ -+ // Save before we change the pattern, colorspace, etc. so that -+ // we can restore and make sure that quartz releases our -+ // pattern (which may be stack allocated) -+ CGContextSaveGState(context); -+ -+ CGContextSetInterpolationQuality (context, _cairo_quartz_filter_to_quartz (source->filter)); -+ -+ status = _cairo_quartz_surface_set_cairo_operator (surface, op); -+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO) { -+ state.action = DO_NOTHING; -+ return state; -+ } -+ if (status) { -+ state.action = DO_UNSUPPORTED; -+ return state; - } - -- if (surface->sourceShading) { -- CGShadingRelease(surface->sourceShading); -- surface->sourceShading = NULL; -+ if (source->type == CAIRO_PATTERN_TYPE_SOLID) { -+ cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) source; -+ -+ CGContextSetRGBStrokeColor (context, -+ solid->color.red, -+ solid->color.green, -+ solid->color.blue, -+ solid->color.alpha); -+ CGContextSetRGBFillColor (context, -+ solid->color.red, -+ solid->color.green, -+ solid->color.blue, -+ solid->color.alpha); -+ -+ state.action = DO_SOLID; -+ return state; -+ } -+ -+ if (source->type == CAIRO_PATTERN_TYPE_LINEAR) { -+ const cairo_linear_pattern_t *lpat = (const cairo_linear_pattern_t *)source; -+ _cairo_quartz_setup_linear_source (surface, lpat, extents, &state); -+ return state; -+ } -+ -+ if (source->type == CAIRO_PATTERN_TYPE_RADIAL) { -+ const cairo_radial_pattern_t *rpat = (const cairo_radial_pattern_t *)source; -+ _cairo_quartz_setup_radial_source (surface, rpat, extents, &state); -+ return state; - } - -- if (surface->sourcePattern) { -- CGPatternRelease(surface->sourcePattern); -- // To tear down the pattern and colorspace -- CGContextRestoreGState(surface->cgContext); -+ if (source->type == CAIRO_PATTERN_TYPE_SURFACE) { -+ if (op == CAIRO_OPERATOR_OVER && _cairo_pattern_is_opaque (source, NULL) && -+ CGContextGetAlphaPtr && -+ CGContextGetAlphaPtr (surface->cgContext) == 1.0) { -+ // Quartz won't touch pixels outside the bounds of the -+ // source surface, so we can just go ahead and use Copy here -+ // to accelerate things. -+ // Quartz won't necessarily be able to do this optimization internally; -+ // for CGLayer surfaces, we can know all the pixels are opaque -+ // (because it's CONTENT_COLOR), but Quartz won't know. -+ CGContextSetCompositeOperation (context, kPrivateCGCompositeCopy); -+ } - -- surface->sourcePattern = NULL; -+ const cairo_surface_pattern_t *spat = (const cairo_surface_pattern_t *) source; -+ _cairo_quartz_setup_surface_source (surface, spat, extents, &state); -+ return state; - } --} - -+ state.action = DO_UNSUPPORTED; -+ return state; -+} - -+/** -+ * 1) Tears down internal state used to draw the source -+ * 2) Does CGContextRestoreGState(state->context) -+ */ - static void --_cairo_quartz_draw_image (cairo_quartz_surface_t *surface, cairo_operator_t op, cairo_quartz_action_t action) -+_cairo_quartz_teardown_state (cairo_quartz_drawing_state_t *state) - { -- assert (surface && surface->sourceImage && (action == DO_IMAGE || action == DO_TILED_IMAGE)); -+ if (state->image) { -+ CGImageRelease(state->image); -+ } - -- CGContextConcatCTM (surface->cgContext, surface->sourceTransform); -- CGContextTranslateCTM (surface->cgContext, 0, surface->sourceImageRect.size.height); -- CGContextScaleCTM (surface->cgContext, 1, -1); -- -- if (action == DO_IMAGE) { -- CGContextDrawImage (surface->cgContext, surface->sourceImageRect, surface->sourceImage); -- if (!_cairo_operator_bounded_by_source(op)) { -- CGContextBeginPath (surface->cgContext); -- CGContextAddRect (surface->cgContext, surface->sourceImageRect); -- CGContextAddRect (surface->cgContext, CGContextGetClipBoundingBox (surface->cgContext)); -- CGContextSetRGBFillColor (surface->cgContext, 0, 0, 0, 0); -- CGContextEOFillPath (surface->cgContext); -+ if (state->imageSurface) { -+ cairo_surface_destroy(state->imageSurface); -+ } -+ -+ if (state->shading) { -+ CGShadingRelease(state->shading); -+ } -+ -+ if (state->pattern) { -+ CGPatternRelease(state->pattern); -+ } -+ -+ CGContextRestoreGState(state->context); -+} -+ -+ -+static void -+_cairo_quartz_draw_image (cairo_quartz_drawing_state_t *state, cairo_operator_t op) -+{ -+ assert (state && -+ ((state->image && (state->action == DO_IMAGE || state->action == DO_TILED_IMAGE)) || -+ (state->layer && state->action == DO_LAYER))); -+ -+ CGContextConcatCTM (state->context, state->transform); -+ CGContextTranslateCTM (state->context, 0, state->imageRect.size.height); -+ CGContextScaleCTM (state->context, 1, -1); -+ -+ if (state->action == DO_TILED_IMAGE) { -+ CGContextDrawTiledImagePtr (state->context, state->imageRect, state->image); -+ /* no need to worry about unbounded operators, since tiled images -+ fill the entire clip region */ -+ } else { -+ if (state->action == DO_LAYER) { -+ /* Note that according to Apple docs it's completely legal -+ * to draw a CGLayer to any CGContext, even one it wasn't -+ * created for. -+ */ -+ CGContextSetInterpolationQuality (state->context, kCGInterpolationNone); -+ CGContextDrawLayerAtPoint (state->context, state->imageRect.origin, -+ state->layer); -+ } else { -+ CGContextDrawImage (state->context, state->imageRect, state->image); -+ } -+ -+ /* disable this EXTEND_NONE correctness code because we use this path -+ * for both EXTEND_NONE and EXTEND_PAD */ -+ if (0 && !_cairo_operator_bounded_by_source (op)) { -+ CGContextBeginPath (state->context); -+ CGContextAddRect (state->context, state->imageRect); -+ CGContextAddRect (state->context, CGContextGetClipBoundingBox (state->context)); -+ CGContextSetRGBFillColor (state->context, 0, 0, 0, 0); -+ CGContextEOFillPath (state->context); - } -- } else -- CGContextDrawTiledImagePtr (surface->cgContext, surface->sourceImageRect, surface->sourceImage); -+ } - } - - -@@ -1762,6 +1939,7 @@ _cairo_quartz_get_image (cairo_quartz_su - } - - if (surface->imageSurfaceEquiv) { -+ CGContextFlush(surface->cgContext); - *image_out = (cairo_image_surface_t*) cairo_surface_reference(surface->imageSurfaceEquiv); - return CAIRO_STATUS_SUCCESS; - } -@@ -1773,6 +1951,7 @@ _cairo_quartz_get_image (cairo_quartz_su - CGColorSpaceRef colorspace; - unsigned int color_comps; - -+ CGContextFlush(surface->cgContext); - imageData = (unsigned char *) CGBitmapContextGetData(surface->cgContext); - - #ifdef USE_10_3_WORKAROUNDS -@@ -1860,53 +2039,79 @@ _cairo_quartz_surface_finish (void *abst - - surface->cgContext = NULL; - -+ if (surface->bitmapContextImage) { -+ CGImageRelease (surface->bitmapContextImage); -+ surface->bitmapContextImage = NULL; -+ } -+ - if (surface->imageSurfaceEquiv) { -+ if (surface->ownsData) -+ _cairo_image_surface_assume_ownership_of_data (surface->imageSurfaceEquiv); - cairo_surface_destroy (surface->imageSurfaceEquiv); - surface->imageSurfaceEquiv = NULL; -+ } else if (surface->imageData && surface->ownsData) { -+ free (surface->imageData); - } - -- if (surface->imageData) { -- free (surface->imageData); -- surface->imageData = NULL; -+ surface->imageData = NULL; -+ -+ if (surface->cgLayer) { -+ CGLayerRelease (surface->cgLayer); - } - - return CAIRO_STATUS_SUCCESS; - } - - static cairo_status_t --_cairo_quartz_surface_acquire_source_image (void *abstract_surface, -- cairo_image_surface_t **image_out, -- void **image_extra) -+_cairo_quartz_surface_acquire_image (void *abstract_surface, -+ cairo_image_surface_t **image_out, -+ void **image_extra) - { - cairo_int_status_t status; - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - -- //ND((stderr, "%p _cairo_quartz_surface_acquire_source_image\n", surface)); -- -- status = _cairo_quartz_get_image (surface, image_out); -- if (status) -- return _cairo_error (CAIRO_STATUS_NO_MEMORY); -- - *image_extra = NULL; - -- return CAIRO_STATUS_SUCCESS; --} -+ /* ND((stderr, "%p _cairo_quartz_surface_acquire_image\n", surface)); */ - --static cairo_surface_t * --_cairo_quartz_surface_snapshot (void *abstract_surface) --{ -- cairo_int_status_t status; -- cairo_quartz_surface_t *surface = abstract_surface; -- cairo_image_surface_t *image; -+ status = _cairo_quartz_get_image (surface, image_out); - -- if (surface->imageSurfaceEquiv) -- return NULL; -+ if (status == CAIRO_INT_STATUS_UNSUPPORTED && surface->cgLayer) { -+ /* copy the layer into a Quartz bitmap context so we can get the data */ -+ cairo_surface_t *tmp = -+ cairo_quartz_surface_create (CAIRO_FORMAT_ARGB32, -+ surface->extents.width, -+ surface->extents.height); -+ cairo_quartz_surface_t *tmp_surface = (cairo_quartz_surface_t *) tmp; -+ -+ /* if surface creation failed, we won't have a Quartz surface here */ -+ if (cairo_surface_get_type (tmp) == CAIRO_SURFACE_TYPE_QUARTZ && -+ tmp_surface->imageSurfaceEquiv) { -+ CGContextSaveGState (tmp_surface->cgContext); -+ CGContextTranslateCTM (tmp_surface->cgContext, 0, surface->extents.height); -+ CGContextScaleCTM (tmp_surface->cgContext, 1, -1); -+ /* Note that according to Apple docs it's completely legal -+ * to draw a CGLayer to any CGContext, even one it wasn't -+ * created for. -+ */ -+ CGContextDrawLayerAtPoint (tmp_surface->cgContext, -+ CGPointMake (0.0, 0.0), -+ surface->cgLayer); -+ CGContextRestoreGState (tmp_surface->cgContext); -+ -+ *image_out = (cairo_image_surface_t*) -+ cairo_surface_reference(tmp_surface->imageSurfaceEquiv); -+ *image_extra = tmp; -+ status = CAIRO_STATUS_SUCCESS; -+ } else { -+ cairo_surface_destroy (tmp); -+ } -+ } - -- status = _cairo_quartz_get_image (surface, &image); -- if (unlikely (status)) -- return _cairo_surface_create_in_error (CAIRO_STATUS_NO_MEMORY); -+ if (status) -+ return _cairo_error (CAIRO_STATUS_NO_MEMORY); - -- return &image->base; -+ return CAIRO_STATUS_SUCCESS; - } - - static void -@@ -1915,6 +2120,10 @@ _cairo_quartz_surface_release_source_ima - void *image_extra) - { - cairo_surface_destroy ((cairo_surface_t *) image); -+ -+ if (image_extra) { -+ cairo_surface_destroy ((cairo_surface_t *) image_extra); -+ } - } - - -@@ -1926,18 +2135,16 @@ _cairo_quartz_surface_acquire_dest_image - void **image_extra) - { - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; -- cairo_int_status_t status; - - ND((stderr, "%p _cairo_quartz_surface_acquire_dest_image\n", surface)); - -- status = _cairo_quartz_get_image (surface, image_out); -- if (status) -- return _cairo_error (CAIRO_STATUS_NO_MEMORY); -- - *image_rect = surface->extents; - *image_extra = NULL; - -- return CAIRO_STATUS_SUCCESS; -+ _cairo_quartz_surface_will_change (surface); -+ -+ return _cairo_quartz_surface_acquire_image (abstract_surface, -+ image_out, image_extra); - } - - static void -@@ -1947,11 +2154,31 @@ _cairo_quartz_surface_release_dest_image - cairo_rectangle_int_t *image_rect, - void *image_extra) - { -- //cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; -- -- //ND((stderr, "%p _cairo_quartz_surface_release_dest_image\n", surface)); -+ /* ND((stderr, "%p _cairo_quartz_surface_release_dest_image\n", surface)); */ - - cairo_surface_destroy ((cairo_surface_t *) image); -+ -+ if (image_extra) { -+ /* we need to write the data from the temp surface back to the layer */ -+ cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; -+ cairo_quartz_surface_t *tmp_surface = (cairo_quartz_surface_t *) image_extra; -+ CGImageRef img; -+ cairo_status_t status = _cairo_surface_to_cgimage (&tmp_surface->base, &img); -+ if (status) { -+ cairo_surface_destroy (&tmp_surface->base); -+ return; -+ } -+ -+ CGContextSaveGState (surface->cgContext); -+ CGContextTranslateCTM (surface->cgContext, 0, surface->extents.height); -+ CGContextScaleCTM (surface->cgContext, 1, -1); -+ CGContextDrawImage (surface->cgContext, -+ CGRectMake (0.0, 0.0, surface->extents.width, surface->extents.height), -+ img); -+ CGContextRestoreGState (surface->cgContext); -+ -+ cairo_surface_destroy (&tmp_surface->base); -+ } - } - - static cairo_surface_t * -@@ -1960,10 +2187,13 @@ _cairo_quartz_surface_create_similar (vo - int width, - int height) - { -- /*cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface;*/ -- -+ cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - cairo_format_t format; - -+ if (surface->cgLayer) -+ return cairo_quartz_surface_create_cg_layer (abstract_surface, content, -+ width, height); -+ - if (content == CAIRO_CONTENT_COLOR_ALPHA) - format = CAIRO_FORMAT_ARGB32; - else if (content == CAIRO_CONTENT_COLOR) -@@ -2027,7 +2257,7 @@ _cairo_quartz_surface_clone_similar (voi - } - } - -- status = _cairo_surface_to_cgimage ((cairo_surface_t*) abstract_surface, src, &quartz_image); -+ status = _cairo_surface_to_cgimage (src, &quartz_image); - if (status) - return CAIRO_INT_STATUS_UNSUPPORTED; - -@@ -2087,7 +2317,7 @@ _cairo_quartz_surface_paint_cg (void *ab - { - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - cairo_int_status_t rv = CAIRO_STATUS_SUCCESS; -- cairo_quartz_action_t action; -+ cairo_quartz_drawing_state_t state; - - ND((stderr, "%p _cairo_quartz_surface_paint op %d source->type %d\n", surface, op, source->type)); - -@@ -2098,31 +2328,24 @@ _cairo_quartz_surface_paint_cg (void *ab - if (unlikely (rv)) - return rv; - -- rv = _cairo_quartz_surface_set_cairo_operator (surface, op); -- if (unlikely (rv)) -- return rv == CAIRO_INT_STATUS_NOTHING_TO_DO ? CAIRO_STATUS_SUCCESS : rv; -+ state = _cairo_quartz_setup_state (surface, source, op, NULL); - -- action = _cairo_quartz_setup_source (surface, source, NULL); -- -- if (action == DO_SOLID || action == DO_PATTERN) { -- CGContextFillRect (surface->cgContext, CGRectMake(surface->extents.x, -- surface->extents.y, -- surface->extents.width, -- surface->extents.height)); -- } else if (action == DO_SHADING) { -- CGContextSaveGState (surface->cgContext); -- CGContextConcatCTM (surface->cgContext, surface->sourceTransform); -- CGContextDrawShading (surface->cgContext, surface->sourceShading); -- CGContextRestoreGState (surface->cgContext); -- } else if (action == DO_IMAGE || action == DO_TILED_IMAGE) { -- CGContextSaveGState (surface->cgContext); -- _cairo_quartz_draw_image (surface, op, action); -- CGContextRestoreGState (surface->cgContext); -- } else if (action != DO_NOTHING) { -+ if (state.action == DO_SOLID || state.action == DO_PATTERN) { -+ CGContextFillRect (state.context, CGRectMake(surface->extents.x, -+ surface->extents.y, -+ surface->extents.width, -+ surface->extents.height)); -+ } else if (state.action == DO_SHADING) { -+ CGContextConcatCTM (state.context, state.transform); -+ CGContextDrawShading (state.context, state.shading); -+ } else if (state.action == DO_IMAGE || state.action == DO_TILED_IMAGE || -+ state.action == DO_LAYER) { -+ _cairo_quartz_draw_image (&state, op); -+ } else if (state.action != DO_NOTHING) { - rv = CAIRO_INT_STATUS_UNSUPPORTED; - } - -- _cairo_quartz_teardown_source (surface, source); -+ _cairo_quartz_teardown_state (&state); - - ND((stderr, "-- paint\n")); - return rv; -@@ -2186,7 +2409,7 @@ _cairo_quartz_surface_fill_cg (void *abs - { - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - cairo_int_status_t rv = CAIRO_STATUS_SUCCESS; -- cairo_quartz_action_t action; -+ cairo_quartz_drawing_state_t state; - CGPathRef path_for_unbounded = NULL; - - ND((stderr, "%p _cairo_quartz_surface_fill op %d source->type %d\n", surface, op, source->type)); -@@ -2198,14 +2421,6 @@ _cairo_quartz_surface_fill_cg (void *abs - if (unlikely (rv)) - return rv; - -- rv = _cairo_quartz_surface_set_cairo_operator (surface, op); -- if (unlikely (rv)) -- return rv == CAIRO_INT_STATUS_NOTHING_TO_DO ? CAIRO_STATUS_SUCCESS : rv; -- -- CGContextSaveGState (surface->cgContext); -- -- CGContextSetShouldAntialias (surface->cgContext, (antialias != CAIRO_ANTIALIAS_NONE)); -- - if (_cairo_quartz_source_needs_extents (source)) - { - /* We don't need precise extents since these are only used to -@@ -2213,46 +2428,47 @@ _cairo_quartz_surface_fill_cg (void *abs - object. */ - cairo_rectangle_int_t path_extents; - _cairo_path_fixed_approximate_fill_extents (path, &path_extents); -- action = _cairo_quartz_setup_source (surface, source, &path_extents); -+ state = _cairo_quartz_setup_state (surface, source, op, &path_extents); - } else { -- action = _cairo_quartz_setup_source (surface, source, NULL); -+ state = _cairo_quartz_setup_state (surface, source, op, NULL); - } - -- _cairo_quartz_cairo_path_to_quartz_context (path, surface->cgContext); -+ CGContextSetShouldAntialias (state.context, (antialias != CAIRO_ANTIALIAS_NONE)); -+ -+ _cairo_quartz_cairo_path_to_quartz_context (path, state.context); - - if (!_cairo_operator_bounded_by_mask(op) && CGContextCopyPathPtr) -- path_for_unbounded = CGContextCopyPathPtr (surface->cgContext); -+ path_for_unbounded = CGContextCopyPathPtr (state.context); - -- if (action == DO_SOLID || action == DO_PATTERN) { -+ if (state.action == DO_SOLID || state.action == DO_PATTERN) { - if (fill_rule == CAIRO_FILL_RULE_WINDING) -- CGContextFillPath (surface->cgContext); -+ CGContextFillPath (state.context); - else -- CGContextEOFillPath (surface->cgContext); -- } else if (action == DO_SHADING) { -+ CGContextEOFillPath (state.context); -+ } else if (state.action == DO_SHADING) { - - // we have to clip and then paint the shading; we can't fill - // with the shading - if (fill_rule == CAIRO_FILL_RULE_WINDING) -- CGContextClip (surface->cgContext); -+ CGContextClip (state.context); - else -- CGContextEOClip (surface->cgContext); -+ CGContextEOClip (state.context); - -- CGContextConcatCTM (surface->cgContext, surface->sourceTransform); -- CGContextDrawShading (surface->cgContext, surface->sourceShading); -- } else if (action == DO_IMAGE || action == DO_TILED_IMAGE) { -+ CGContextConcatCTM (state.context, state.transform); -+ CGContextDrawShading (state.context, state.shading); -+ } else if (state.action == DO_IMAGE || state.action == DO_TILED_IMAGE || -+ state.action == DO_LAYER) { - if (fill_rule == CAIRO_FILL_RULE_WINDING) -- CGContextClip (surface->cgContext); -+ CGContextClip (state.context); - else -- CGContextEOClip (surface->cgContext); -+ CGContextEOClip (state.context); - -- _cairo_quartz_draw_image (surface, op, action); -- } else if (action != DO_NOTHING) { -+ _cairo_quartz_draw_image (&state, op); -+ } else if (state.action != DO_NOTHING) { - rv = CAIRO_INT_STATUS_UNSUPPORTED; - } - -- _cairo_quartz_teardown_source (surface, source); -- -- CGContextRestoreGState (surface->cgContext); -+ _cairo_quartz_teardown_state (&state); - - if (path_for_unbounded) { - unbounded_op_data_t ub; -@@ -2319,7 +2535,7 @@ _cairo_quartz_surface_stroke_cg (void *a - { - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - cairo_int_status_t rv = CAIRO_STATUS_SUCCESS; -- cairo_quartz_action_t action; -+ cairo_quartz_drawing_state_t state; - CGAffineTransform origCTM, strokeTransform; - CGPathRef path_for_unbounded = NULL; - -@@ -2336,16 +2552,25 @@ _cairo_quartz_surface_stroke_cg (void *a - if (unlikely (rv)) - return rv == CAIRO_INT_STATUS_NOTHING_TO_DO ? CAIRO_STATUS_SUCCESS : rv; - -+ if (_cairo_quartz_source_needs_extents (source)) -+ { -+ cairo_rectangle_int_t path_extents; -+ _cairo_path_fixed_approximate_stroke_extents (path, style, ctm, &path_extents); -+ state = _cairo_quartz_setup_state (surface, source, op, &path_extents); -+ } else { -+ state = _cairo_quartz_setup_state (surface, source, op, NULL); -+ } -+ - // Turning antialiasing off used to cause misrendering with - // single-pixel lines (e.g. 20,10.5 -> 21,10.5 end up being rendered as 2 pixels). - // That's been since fixed in at least 10.5, and in the latest 10.4 dot releases. -- CGContextSetShouldAntialias (surface->cgContext, (antialias != CAIRO_ANTIALIAS_NONE)); -- CGContextSetLineWidth (surface->cgContext, style->line_width); -- CGContextSetLineCap (surface->cgContext, _cairo_quartz_cairo_line_cap_to_quartz (style->line_cap)); -- CGContextSetLineJoin (surface->cgContext, _cairo_quartz_cairo_line_join_to_quartz (style->line_join)); -- CGContextSetMiterLimit (surface->cgContext, style->miter_limit); -+ CGContextSetShouldAntialias (state.context, (antialias != CAIRO_ANTIALIAS_NONE)); -+ CGContextSetLineWidth (state.context, style->line_width); -+ CGContextSetLineCap (state.context, _cairo_quartz_cairo_line_cap_to_quartz (style->line_cap)); -+ CGContextSetLineJoin (state.context, _cairo_quartz_cairo_line_join_to_quartz (style->line_join)); -+ CGContextSetMiterLimit (state.context, style->miter_limit); - -- origCTM = CGContextGetCTM (surface->cgContext); -+ origCTM = CGContextGetCTM (state.context); - - if (style->dash && style->num_dashes) { - #define STATIC_DASH 32 -@@ -2368,72 +2593,62 @@ _cairo_quartz_surface_stroke_cg (void *a - if (fdash != sdash) - free (fdash); - } else -- CGContextSetLineDash (surface->cgContext, 0, NULL, 0); -+ CGContextSetLineDash (state.context, 0, NULL, 0); - -- CGContextSaveGState (surface->cgContext); - -+ _cairo_quartz_cairo_path_to_quartz_context (path, state.context); - -- if (_cairo_quartz_source_needs_extents (source)) -- { -- cairo_rectangle_int_t path_extents; -- _cairo_path_fixed_approximate_stroke_extents (path, style, ctm, &path_extents); -- action = _cairo_quartz_setup_source (surface, source, &path_extents); -- } else { -- action = _cairo_quartz_setup_source (surface, source, NULL); -- } -- -- _cairo_quartz_cairo_path_to_quartz_context (path, surface->cgContext); -+ _cairo_quartz_cairo_matrix_to_quartz (ctm, &strokeTransform); -+ CGContextConcatCTM (state.context, strokeTransform); - - if (!_cairo_operator_bounded_by_mask (op) && CGContextCopyPathPtr) -- path_for_unbounded = CGContextCopyPathPtr (surface->cgContext); -- -- _cairo_quartz_cairo_matrix_to_quartz (ctm, &strokeTransform); -- CGContextConcatCTM (surface->cgContext, strokeTransform); -+ path_for_unbounded = CGContextCopyPathPtr (state.context); - -- if (action == DO_SOLID || action == DO_PATTERN) { -- CGContextStrokePath (surface->cgContext); -- } else if (action == DO_IMAGE || action == DO_TILED_IMAGE) { -- CGContextReplacePathWithStrokedPath (surface->cgContext); -- CGContextClip (surface->cgContext); -- -- CGContextSetCTM (surface->cgContext, origCTM); -- _cairo_quartz_draw_image (surface, op, action); -- } else if (action == DO_SHADING) { -- CGContextReplacePathWithStrokedPath (surface->cgContext); -- CGContextClip (surface->cgContext); -- -- CGContextSetCTM (surface->cgContext, origCTM); -- -- CGContextConcatCTM (surface->cgContext, surface->sourceTransform); -- CGContextDrawShading (surface->cgContext, surface->sourceShading); -- } else if (action != DO_NOTHING) { -+ if (state.action == DO_SOLID || state.action == DO_PATTERN) { -+ CGContextStrokePath (state.context); -+ } else if (state.action == DO_IMAGE || state.action == DO_TILED_IMAGE || -+ state.action == DO_LAYER) { -+ CGContextReplacePathWithStrokedPath (state.context); -+ CGContextClip (state.context); -+ -+ CGContextSetCTM (state.context, origCTM); -+ _cairo_quartz_draw_image (&state, op); -+ } else if (state.action == DO_SHADING) { -+ CGContextReplacePathWithStrokedPath (state.context); -+ CGContextClip (state.context); -+ -+ CGContextSetCTM (state.context, origCTM); -+ -+ CGContextConcatCTM (state.context, state.transform); -+ CGContextDrawShading (state.context, state.shading); -+ } else if (state.action != DO_NOTHING) { - rv = CAIRO_INT_STATUS_UNSUPPORTED; -+ goto BAIL; - } - -- _cairo_quartz_teardown_source (surface, source); -- -- CGContextRestoreGState (surface->cgContext); -- - if (path_for_unbounded) { - unbounded_op_data_t ub; - ub.op = UNBOUNDED_STROKE_FILL; - ub.u.stroke_fill.fill_rule = CAIRO_FILL_RULE_WINDING; - -- CGContextBeginPath (surface->cgContext); -- CGContextAddPath (surface->cgContext, path_for_unbounded); -+ CGContextBeginPath (state.context); -+ CGContextAddPath (state.context, path_for_unbounded); - CGPathRelease (path_for_unbounded); - -- CGContextSaveGState (surface->cgContext); -- CGContextConcatCTM (surface->cgContext, strokeTransform); -- CGContextReplacePathWithStrokedPath (surface->cgContext); -- CGContextRestoreGState (surface->cgContext); -+ CGContextSaveGState (state.context); -+ CGContextConcatCTM (state.context, strokeTransform); -+ CGContextReplacePathWithStrokedPath (state.context); -+ CGContextRestoreGState (state.context); - -- ub.u.stroke_fill.cgPath = CGContextCopyPathPtr (surface->cgContext); -+ ub.u.stroke_fill.cgPath = CGContextCopyPathPtr (state.context); - - _cairo_quartz_fixup_unbounded_operation (surface, &ub, antialias); - CGPathRelease (ub.u.stroke_fill.cgPath); - } - -+ BAIL: -+ _cairo_quartz_teardown_state (&state); -+ - ND((stderr, "-- stroke\n")); - return rv; - } -@@ -2490,18 +2705,22 @@ _cairo_quartz_surface_show_glyphs_cg (vo - CGGlyph glyphs_static[STATIC_BUF_SIZE]; - CGSize cg_advances_static[STATIC_BUF_SIZE]; - CGGlyph *cg_glyphs = &glyphs_static[0]; -+ /* We'll use the cg_advances array for either advances or positions, -+ depending which API we're using to actually draw. The types involved -+ have the same size, so this is safe. */ - CGSize *cg_advances = &cg_advances_static[0]; - - cairo_rectangle_int_t glyph_extents; - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - cairo_int_status_t rv = CAIRO_STATUS_SUCCESS; -- cairo_quartz_action_t action; -+ cairo_quartz_drawing_state_t state; - cairo_quartz_float_t xprev, yprev; - int i; - CGFontRef cgfref = NULL; - - cairo_bool_t isClipping = FALSE; - cairo_bool_t didForceFontSmoothing = FALSE; -+ cairo_antialias_t effective_antialiasing; - - if (IS_EMPTY(surface)) - return CAIRO_STATUS_SUCCESS; -@@ -2516,54 +2735,51 @@ _cairo_quartz_surface_show_glyphs_cg (vo - if (unlikely (rv)) - return rv; - -- rv = _cairo_quartz_surface_set_cairo_operator (surface, op); -- if (unlikely (rv)) -- return rv == CAIRO_INT_STATUS_NOTHING_TO_DO ? CAIRO_STATUS_SUCCESS : rv; -- -- CGContextSaveGState (surface->cgContext); -- - if (_cairo_quartz_source_needs_extents (source) && - !_cairo_scaled_font_glyph_device_extents (scaled_font, glyphs, num_glyphs, - &glyph_extents, NULL)) - { -- action = _cairo_quartz_setup_source (surface, source, &glyph_extents); -+ state = _cairo_quartz_setup_state (surface, source, op, &glyph_extents); - } else { -- action = _cairo_quartz_setup_source (surface, source, NULL); -+ state = _cairo_quartz_setup_state (surface, source, op, NULL); - } - -- if (action == DO_SOLID || action == DO_PATTERN) { -- CGContextSetTextDrawingMode (surface->cgContext, kCGTextFill); -- } else if (action == DO_IMAGE || action == DO_TILED_IMAGE || action == DO_SHADING) { -- CGContextSetTextDrawingMode (surface->cgContext, kCGTextClip); -+ if (state.action == DO_SOLID || state.action == DO_PATTERN) { -+ CGContextSetTextDrawingMode (state.context, kCGTextFill); -+ } else if (state.action == DO_IMAGE || state.action == DO_TILED_IMAGE || -+ state.action == DO_SHADING || state.action == DO_LAYER) { -+ CGContextSetTextDrawingMode (state.context, kCGTextClip); - isClipping = TRUE; - } else { -- if (action != DO_NOTHING) -+ if (state.action != DO_NOTHING) - rv = CAIRO_INT_STATUS_UNSUPPORTED; - goto BAIL; - } - - /* this doesn't addref */ - cgfref = _cairo_quartz_scaled_font_get_cg_font_ref (scaled_font); -- CGContextSetFont (surface->cgContext, cgfref); -- CGContextSetFontSize (surface->cgContext, 1.0); -+ CGContextSetFont (state.context, cgfref); -+ CGContextSetFontSize (state.context, 1.0); -+ -+ effective_antialiasing = scaled_font->options.antialias; - - switch (scaled_font->options.antialias) { - case CAIRO_ANTIALIAS_SUBPIXEL: -- CGContextSetShouldAntialias (surface->cgContext, TRUE); -- CGContextSetShouldSmoothFonts (surface->cgContext, TRUE); -+ CGContextSetShouldAntialias (state.context, TRUE); -+ CGContextSetShouldSmoothFonts (state.context, TRUE); - if (CGContextSetAllowsFontSmoothingPtr && -- !CGContextGetAllowsFontSmoothingPtr (surface->cgContext)) -+ !CGContextGetAllowsFontSmoothingPtr (state.context)) - { - didForceFontSmoothing = TRUE; -- CGContextSetAllowsFontSmoothingPtr (surface->cgContext, TRUE); -+ CGContextSetAllowsFontSmoothingPtr (state.context, TRUE); - } - break; - case CAIRO_ANTIALIAS_NONE: -- CGContextSetShouldAntialias (surface->cgContext, FALSE); -+ CGContextSetShouldAntialias (state.context, FALSE); - break; - case CAIRO_ANTIALIAS_GRAY: -- CGContextSetShouldAntialias (surface->cgContext, TRUE); -- CGContextSetShouldSmoothFonts (surface->cgContext, FALSE); -+ CGContextSetShouldAntialias (state.context, TRUE); -+ CGContextSetShouldSmoothFonts (state.context, FALSE); - break; - case CAIRO_ANTIALIAS_DEFAULT: - /* Don't do anything */ -@@ -2584,57 +2800,84 @@ _cairo_quartz_surface_show_glyphs_cg (vo - } - } - -+ /* scale(1,-1) * scaled_font->scale */ - textTransform = CGAffineTransformMake (scaled_font->scale.xx, - scaled_font->scale.yx, - -scaled_font->scale.xy, - -scaled_font->scale.yy, - 0, 0); -- _cairo_quartz_cairo_matrix_to_quartz (&scaled_font->scale_inverse, &invTextTransform); - -- CGContextSetTextMatrix (surface->cgContext, CGAffineTransformIdentity); -+ /* scaled_font->scale_inverse * scale(1,-1) */ -+ invTextTransform = CGAffineTransformMake (scaled_font->scale_inverse.xx, -+ -scaled_font->scale_inverse.yx, -+ scaled_font->scale_inverse.xy, -+ -scaled_font->scale_inverse.yy, -+ 0.0, 0.0); - -- /* Convert our glyph positions to glyph advances. We need n-1 advances, -- * since the advance at index 0 is applied after glyph 0. */ -- xprev = glyphs[0].x; -- yprev = glyphs[0].y; -- -- cg_glyphs[0] = glyphs[0].index; -- -- for (i = 1; i < num_glyphs; i++) { -- cairo_quartz_float_t xf = glyphs[i].x; -- cairo_quartz_float_t yf = glyphs[i].y; -- cg_glyphs[i] = glyphs[i].index; -- cg_advances[i - 1] = CGSizeApplyAffineTransform(CGSizeMake (xf - xprev, yf - yprev), invTextTransform); -- xprev = xf; -- yprev = yf; -- } -+ CGContextSetTextMatrix (state.context, CGAffineTransformIdentity); - - /* Translate to the first glyph's position before drawing */ -- ctm = CGContextGetCTM (surface->cgContext); -- CGContextTranslateCTM (surface->cgContext, glyphs[0].x, glyphs[0].y); -- CGContextConcatCTM (surface->cgContext, textTransform); -- -- CGContextShowGlyphsWithAdvances (surface->cgContext, -- cg_glyphs, -- cg_advances, -- num_glyphs); -- -- CGContextSetCTM (surface->cgContext, ctm); -+ ctm = CGContextGetCTM (state.context); -+ CGContextTranslateCTM (state.context, glyphs[0].x, glyphs[0].y); -+ CGContextConcatCTM (state.context, textTransform); -+ -+ if (CTFontDrawGlyphsPtr) { -+ /* If CTFontDrawGlyphs is available (i.e. OS X 10.7 or later), we want to use -+ * that in preference to CGContextShowGlyphsWithAdvances so that colored-bitmap -+ * fonts like Apple Color Emoji will render properly. -+ * For this, we need to convert our glyph positions to Core Graphics's CGPoint. -+ * We borrow the cg_advances array, as CGPoint and CGSize are the same size. */ -+ -+ CGPoint *cg_positions = (CGPoint*) cg_advances; -+ cairo_quartz_float_t origin_x = glyphs[0].x; -+ cairo_quartz_float_t origin_y = glyphs[0].y; -+ -+ for (i = 0; i < num_glyphs; i++) { -+ CGPoint pt = CGPointMake (glyphs[i].x - origin_x, glyphs[i].y - origin_y); -+ cg_positions[i] = CGPointApplyAffineTransform (pt, invTextTransform); -+ cg_glyphs[i] = glyphs[i].index; -+ } - -- if (action == DO_IMAGE || action == DO_TILED_IMAGE) { -- _cairo_quartz_draw_image (surface, op, action); -- } else if (action == DO_SHADING) { -- CGContextConcatCTM (surface->cgContext, surface->sourceTransform); -- CGContextDrawShading (surface->cgContext, surface->sourceShading); -+ CTFontDrawGlyphsPtr (_cairo_quartz_scaled_font_get_ct_font_ref (scaled_font), -+ cg_glyphs, cg_positions, num_glyphs, state.context); -+ } else { -+ /* Convert our glyph positions to glyph advances. We need n-1 advances, -+ * since the advance at index 0 is applied after glyph 0. */ -+ xprev = glyphs[0].x; -+ yprev = glyphs[0].y; -+ -+ cg_glyphs[0] = glyphs[0].index; -+ -+ for (i = 1; i < num_glyphs; i++) { -+ cairo_quartz_float_t xf = glyphs[i].x; -+ cairo_quartz_float_t yf = glyphs[i].y; -+ cg_glyphs[i] = glyphs[i].index; -+ cg_advances[i - 1] = CGSizeApplyAffineTransform(CGSizeMake (xf - xprev, yf - yprev), invTextTransform); -+ xprev = xf; -+ yprev = yf; -+ } -+ -+ CGContextShowGlyphsWithAdvances (state.context, -+ cg_glyphs, -+ cg_advances, -+ num_glyphs); -+ } -+ -+ CGContextSetCTM (state.context, ctm); -+ -+ if (state.action == DO_IMAGE || state.action == DO_TILED_IMAGE || -+ state.action == DO_LAYER) { -+ _cairo_quartz_draw_image (&state, op); -+ } else if (state.action == DO_SHADING) { -+ CGContextConcatCTM (state.context, state.transform); -+ CGContextDrawShading (state.context, state.shading); - } - - BAIL: -- _cairo_quartz_teardown_source (surface, source); -- - if (didForceFontSmoothing) -- CGContextSetAllowsFontSmoothingPtr (surface->cgContext, FALSE); -+ CGContextSetAllowsFontSmoothingPtr (state.context, FALSE); - -- CGContextRestoreGState (surface->cgContext); -+ _cairo_quartz_teardown_state (&state); - - if (rv == CAIRO_STATUS_SUCCESS && - cgfref && -@@ -2645,10 +2888,17 @@ BAIL: - - ub.u.show_glyphs.isClipping = isClipping; - ub.u.show_glyphs.cg_glyphs = cg_glyphs; -- ub.u.show_glyphs.cg_advances = cg_advances; -+ if (CTFontDrawGlyphsPtr) { -+ /* we're using Core Text API: the cg_advances array was -+ reused (above) for glyph positions */ -+ CGPoint *cg_positions = (CGPoint*) cg_advances; -+ ub.u.show_glyphs.u.cg_positions = cg_positions; -+ } else { -+ ub.u.show_glyphs.u.cg_advances = cg_advances; -+ } - ub.u.show_glyphs.nglyphs = num_glyphs; - ub.u.show_glyphs.textTransform = textTransform; -- ub.u.show_glyphs.font = cgfref; -+ ub.u.show_glyphs.scaled_font = scaled_font; - ub.u.show_glyphs.origin = CGPointMake (glyphs[0].x, glyphs[0].y); - - _cairo_quartz_fixup_unbounded_operation (surface, &ub, scaled_font->options.antialias); -@@ -2717,7 +2967,7 @@ _cairo_quartz_surface_mask_with_surface - cairo_status_t status = CAIRO_STATUS_SUCCESS; - CGAffineTransform ctm, mask_matrix; - -- status = _cairo_surface_to_cgimage ((cairo_surface_t *) surface, pat_surf, &img); -+ status = _cairo_surface_to_cgimage (pat_surf, &img); - if (status) - return status; - if (img == NULL) { -@@ -2820,7 +3070,9 @@ _cairo_quartz_surface_mask_cg (void *abs - if (unlikely (rv)) - return rv; - -- if (mask->type == CAIRO_PATTERN_TYPE_SOLID) { -+ /* Using CGContextSetAlpha to implement mask alpha doesn't work for all operators. */ -+ if (mask->type == CAIRO_PATTERN_TYPE_SOLID && -+ op == CAIRO_OPERATOR_OVER) { - /* This is easy; we just need to paint with the alpha. */ - cairo_solid_pattern_t *solid_mask = (cairo_solid_pattern_t *) mask; - -@@ -2834,8 +3086,11 @@ _cairo_quartz_surface_mask_cg (void *abs - /* If we have CGContextClipToMask, we can do more complex masks */ - if (CGContextClipToMaskPtr) { - /* For these, we can skip creating a temporary surface, since we already have one */ -- if (mask->type == CAIRO_PATTERN_TYPE_SURFACE && mask->extend == CAIRO_EXTEND_NONE) -+ /* For some reason this doesn't work reliably on OS X 10.5. See bug 721663. */ -+ if (_cairo_quartz_osx_version >= 0x1060 && mask->type == CAIRO_PATTERN_TYPE_SURFACE && -+ mask->extend == CAIRO_EXTEND_NONE) { - return _cairo_quartz_surface_mask_with_surface (surface, op, source, (cairo_surface_pattern_t *) mask, clip); -+ } - - return _cairo_quartz_surface_mask_with_generic (surface, op, source, mask, clip); - } -@@ -2920,13 +3175,24 @@ _cairo_quartz_surface_clipper_intersect_ - return CAIRO_STATUS_SUCCESS; - } - -+static cairo_status_t -+_cairo_quartz_surface_mark_dirty_rectangle (void *abstract_surface, -+ int x, int y, -+ int width, int height) -+{ -+ cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; -+ _cairo_quartz_surface_will_change (surface); -+ return CAIRO_STATUS_SUCCESS; -+} -+ -+ - // XXXtodo implement show_page; need to figure out how to handle begin/end - - static const struct _cairo_surface_backend cairo_quartz_surface_backend = { - CAIRO_SURFACE_TYPE_QUARTZ, - _cairo_quartz_surface_create_similar, - _cairo_quartz_surface_finish, -- _cairo_quartz_surface_acquire_source_image, -+ _cairo_quartz_surface_acquire_image, - _cairo_quartz_surface_release_source_image, - _cairo_quartz_surface_acquire_dest_image, - _cairo_quartz_surface_release_dest_image, -@@ -2942,7 +3208,7 @@ static const struct _cairo_surface_backe - NULL, /* old_show_glyphs */ - NULL, /* get_font_options */ - NULL, /* flush */ -- NULL, /* mark_dirty_rectangle */ -+ _cairo_quartz_surface_mark_dirty_rectangle, - NULL, /* scaled_font_fini */ - NULL, /* scaled_glyph_fini */ - -@@ -2952,7 +3218,7 @@ static const struct _cairo_surface_backe - _cairo_quartz_surface_fill, - _cairo_quartz_surface_show_glyphs, - -- _cairo_quartz_surface_snapshot, -+ NULL, /* snapshot */ - NULL, /* is_similar */ - NULL /* fill_stroke */ - }; -@@ -3004,6 +3270,9 @@ _cairo_quartz_surface_create_internal (C - - surface->imageData = NULL; - surface->imageSurfaceEquiv = NULL; -+ surface->bitmapContextImage = NULL; -+ surface->cgLayer = NULL; -+ surface->ownsData = TRUE; - - return surface; - } -@@ -3056,6 +3325,81 @@ cairo_quartz_surface_create_for_cg_conte - } - - /** -+ * cairo_quartz_cglayer_surface_create_similar -+ * @surface: The returned surface can be efficiently drawn into this -+ * destination surface (if tiling is not used)." -+ * @content: the content type of the surface -+ * @width: width of the surface, in pixels -+ * @height: height of the surface, in pixels -+ * -+ * Creates a Quartz surface backed by a CGLayer, if the given surface -+ * is a Quartz surface; the CGLayer is created to match the surface's -+ * Quartz context. Otherwise just calls cairo_surface_create_similar. -+ * The returned surface can be efficiently blitted to the given surface, -+ * but tiling and 'extend' modes other than NONE are not so efficient. -+ * -+ * Return value: the newly created surface. -+ * -+ * Since: 1.10 -+ **/ -+cairo_surface_t * -+cairo_quartz_surface_create_cg_layer (cairo_surface_t *surface, -+ cairo_content_t content, -+ unsigned int width, -+ unsigned int height) -+{ -+ cairo_quartz_surface_t *surf; -+ CGLayerRef layer; -+ CGContextRef ctx; -+ CGContextRef cgContext; -+ -+ cgContext = cairo_quartz_surface_get_cg_context (surface); -+ if (!cgContext) -+ return cairo_surface_create_similar (surface, content, -+ width, height); -+ -+ -+ if (!_cairo_quartz_verify_surface_size(width, height)) -+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE)); -+ -+ /* If we pass zero width or height into CGLayerCreateWithContext below, -+ * it will fail. -+ */ -+ if (width == 0 || height == 0) { -+ return (cairo_surface_t*) -+ _cairo_quartz_surface_create_internal (NULL, content, -+ width, height); -+ } -+ -+ layer = CGLayerCreateWithContext (cgContext, -+ CGSizeMake (width, height), -+ NULL); -+ if (!layer) -+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); -+ -+ ctx = CGLayerGetContext (layer); -+ CGContextSetInterpolationQuality (ctx, kCGInterpolationNone); -+ /* Flip it when we draw into it, so that when we finally composite it -+ * to a flipped target, the directions match and Quartz will optimize -+ * the composition properly -+ */ -+ CGContextTranslateCTM (ctx, 0, height); -+ CGContextScaleCTM (ctx, 1, -1); -+ -+ CGContextRetain (ctx); -+ surf = _cairo_quartz_surface_create_internal (ctx, content, -+ width, height); -+ if (surf->base.status) { -+ CGLayerRelease (layer); -+ // create_internal will have set an error -+ return (cairo_surface_t*) surf; -+ } -+ surf->cgLayer = layer; -+ -+ return (cairo_surface_t *) surf; -+} -+ -+/** - * cairo_quartz_surface_create - * @format: format of pixels in the surface to create - * @width: width of the surface, in pixels -@@ -3075,13 +3419,93 @@ cairo_quartz_surface_create (cairo_forma - unsigned int width, - unsigned int height) - { -+ int stride; -+ unsigned char *data; -+ -+ if (!_cairo_quartz_verify_surface_size(width, height)) -+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE)); -+ -+ if (width == 0 || height == 0) { -+ return (cairo_surface_t*) _cairo_quartz_surface_create_internal (NULL, _cairo_content_from_format (format), -+ width, height); -+ } -+ -+ if (format == CAIRO_FORMAT_ARGB32 || -+ format == CAIRO_FORMAT_RGB24) -+ { -+ stride = width * 4; -+ } else if (format == CAIRO_FORMAT_A8) { -+ stride = width; -+ } else if (format == CAIRO_FORMAT_A1) { -+ /* I don't think we can usefully support this, as defined by -+ * cairo_format_t -- these are 1-bit pixels stored in 32-bit -+ * quantities. -+ */ -+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); -+ } else { -+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); -+ } -+ -+ /* The Apple docs say that for best performance, the stride and the data -+ * pointer should be 16-byte aligned. malloc already aligns to 16-bytes, -+ * so we don't have to anything special on allocation. -+ */ -+ stride = (stride + 15) & ~15; -+ -+ data = _cairo_malloc_ab (height, stride); -+ if (!data) { -+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); -+ } -+ -+ /* zero the memory to match the image surface behaviour */ -+ memset (data, 0, height * stride); -+ -+ cairo_quartz_surface_t *surf; -+ surf = (cairo_quartz_surface_t *) cairo_quartz_surface_create_for_data -+ (data, format, width, height, stride); -+ if (surf->base.status) { -+ free (data); -+ return (cairo_surface_t *) surf; -+ } -+ -+ // We created this data, so we can delete it. -+ surf->ownsData = TRUE; -+ -+ return (cairo_surface_t *) surf; -+} -+ -+/** -+ * cairo_quartz_surface_create_for_data -+ * @data: a pointer to a buffer supplied by the application in which -+ * to write contents. This pointer must be suitably aligned for any -+ * kind of variable, (for example, a pointer returned by malloc). -+ * @format: format of pixels in the surface to create -+ * @width: width of the surface, in pixels -+ * @height: height of the surface, in pixels -+ * -+ * Creates a Quartz surface backed by a CGBitmap. The surface is -+ * created using the Device RGB (or Device Gray, for A8) color space. -+ * All Cairo operations, including those that require software -+ * rendering, will succeed on this surface. -+ * -+ * Return value: the newly created surface. -+ * -+ * Since: 1.12 -+ **/ -+cairo_surface_t * -+cairo_quartz_surface_create_for_data (unsigned char *data, -+ cairo_format_t format, -+ unsigned int width, -+ unsigned int height, -+ unsigned int stride) -+{ - cairo_quartz_surface_t *surf; - CGContextRef cgc; - CGColorSpaceRef cgColorspace; - CGBitmapInfo bitinfo; -- void *imageData; -- int stride; -+ void *imageData = data; - int bitsPerComponent; -+ unsigned int i; - - // verify width and height of surface - if (!_cairo_quartz_verify_surface_size(width, height)) -@@ -3102,10 +3526,8 @@ cairo_quartz_surface_create (cairo_forma - else - bitinfo |= kCGImageAlphaNoneSkipFirst; - bitsPerComponent = 8; -- stride = width * 4; - } else if (format == CAIRO_FORMAT_A8) { - cgColorspace = NULL; -- stride = width; - bitinfo = kCGImageAlphaOnly; - bitsPerComponent = 8; - } else if (format == CAIRO_FORMAT_A1) { -@@ -3118,21 +3540,6 @@ cairo_quartz_surface_create (cairo_forma - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); - } - -- /* The Apple docs say that for best performance, the stride and the data -- * pointer should be 16-byte aligned. malloc already aligns to 16-bytes, -- * so we don't have to anything special on allocation. -- */ -- stride = (stride + 15) & ~15; -- -- imageData = _cairo_malloc_ab (height, stride); -- if (!imageData) { -- CGColorSpaceRelease (cgColorspace); -- return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); -- } -- -- /* zero the memory to match the image surface behaviour */ -- memset (imageData, 0, height * stride); -- - cgc = CGBitmapContextCreate (imageData, - width, - height, -@@ -3161,7 +3568,19 @@ cairo_quartz_surface_create (cairo_forma - } - - surf->imageData = imageData; -- surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride); -+ -+ cairo_surface_t* tmpImageSurfaceEquiv = -+ cairo_image_surface_create_for_data (imageData, format, -+ width, height, stride); -+ -+ if (cairo_surface_status (tmpImageSurfaceEquiv)) { -+ // Tried & failed to create an imageSurfaceEquiv! -+ cairo_surface_destroy (tmpImageSurfaceEquiv); -+ surf->imageSurfaceEquiv = NULL; -+ } else { -+ surf->imageSurfaceEquiv = tmpImageSurfaceEquiv; -+ surf->ownsData = FALSE; -+ } - - return (cairo_surface_t *) surf; - } -@@ -3193,6 +3612,74 @@ _cairo_surface_is_quartz (const cairo_su - return surface->backend == &cairo_quartz_surface_backend; - } - -+CGContextRef -+cairo_quartz_get_cg_context_with_clip (cairo_t *cr) -+{ -+ -+ cairo_surface_t *surface = cr->gstate->target; -+ cairo_clip_t *clip = &cr->gstate->clip; -+ cairo_status_t status; -+ -+ cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t*)surface; -+ -+ if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_QUARTZ) -+ return NULL; -+ -+ if (!clip->path) { -+ if (clip->all_clipped) { -+ /* Save the state before we set an empty clip rect so that -+ * our previous clip will be restored */ -+ -+ /* _cairo_surface_clipper_set_clip doesn't deal with -+ * clip->all_clipped because drawing is normally discarded earlier */ -+ CGRect empty = {{0,0}, {0,0}}; -+ CGContextClipToRect (quartz->cgContext, empty); -+ CGContextSaveGState (quartz->cgContext); -+ -+ return quartz->cgContext; -+ } -+ -+ /* an empty clip is represented by NULL */ -+ clip = NULL; -+ } -+ -+ status = _cairo_surface_clipper_set_clip (&quartz->clipper, clip); -+ -+ /* Save the state after we set the clip so that it persists -+ * after we restore */ -+ CGContextSaveGState (quartz->cgContext); -+ -+ if (unlikely (status)) -+ return NULL; -+ -+ return quartz->cgContext; -+} -+ -+void -+cairo_quartz_finish_cg_context_with_clip (cairo_t *cr) -+{ -+ cairo_surface_t *surface = cr->gstate->target; -+ -+ cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t*)surface; -+ -+ if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_QUARTZ) -+ return; -+ -+ CGContextRestoreGState (quartz->cgContext); -+} -+ -+cairo_surface_t * -+cairo_quartz_surface_get_image (cairo_surface_t *surface) -+{ -+ cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t *)surface; -+ cairo_image_surface_t *image; -+ -+ if (_cairo_quartz_get_image(quartz, &image)) -+ return NULL; -+ -+ return (cairo_surface_t *)image; -+} -+ - /* Debug stuff */ - - #ifdef QUARTZ_DEBUG ---- a/src/cairo-quartz.h 2012-11-13 18:20:00.000000000 -0800 -+++ b/src/cairo-quartz.h 2012-11-13 18:06:56.000000000 -0800 -@@ -50,6 +50,19 @@ cairo_quartz_surface_create (cairo_forma - unsigned int height); - - cairo_public cairo_surface_t * -+cairo_quartz_surface_create_for_data (unsigned char *data, -+ cairo_format_t format, -+ unsigned int width, -+ unsigned int height, -+ unsigned int stride); -+ -+cairo_public cairo_surface_t * -+cairo_quartz_surface_create_cg_layer (cairo_surface_t *surface, -+ cairo_content_t content, -+ unsigned int width, -+ unsigned int height); -+ -+cairo_public cairo_surface_t * - cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext, - unsigned int width, - unsigned int height); -@@ -57,6 +70,15 @@ cairo_quartz_surface_create_for_cg_conte - cairo_public CGContextRef - cairo_quartz_surface_get_cg_context (cairo_surface_t *surface); - -+cairo_public CGContextRef -+cairo_quartz_get_cg_context_with_clip (cairo_t *cr); -+ -+cairo_public void -+cairo_quartz_finish_cg_context_with_clip (cairo_t *cr); -+ -+cairo_public cairo_surface_t * -+cairo_quartz_surface_get_image (cairo_surface_t *surface); -+ - #if CAIRO_HAS_QUARTZ_FONT - - /* -@@ -66,8 +88,10 @@ cairo_quartz_surface_get_cg_context (cai - cairo_public cairo_font_face_t * - cairo_quartz_font_face_create_for_cgfont (CGFontRef font); - -+#ifndef __LP64__ - cairo_public cairo_font_face_t * - cairo_quartz_font_face_create_for_atsu_font_id (ATSUFontID font_id); -+#endif - - #endif /* CAIRO_HAS_QUARTZ_FONT */ \ No newline at end of file diff --git a/bockbuild/MacSDK/patches/cairo-fix-CGFontGetGlyphPath-deprecation.patch b/bockbuild/MacSDK/patches/cairo-fix-CGFontGetGlyphPath-deprecation.patch deleted file mode 100644 index 66dc48ab746..00000000000 --- a/bockbuild/MacSDK/patches/cairo-fix-CGFontGetGlyphPath-deprecation.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 9d460070fca2c0a61aac60ba7cad6f9a6af82309 Mon Sep 17 00:00:00 2001 -From: Andrea Canciani -Date: Tue, 9 Dec 2014 16:13:00 +0100 -Subject: [PATCH] quartz: Remove call to obsolete CGFontGetGlyphPath - -CGFontGetGlyphPath was not public and is not available anymore on -modern OSX/iOS systems. The same functionality is available through -the CoreText API since OSX 10.5. - -Based on a patch by Simon Cozens. - -Fixes https://bugs.freedesktop.org/show_bug.cgi?id=84324 ---- - src/cairo-quartz-font.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c -index e6a379a..02f3426 100644 ---- a/src/cairo-quartz-font.c -+++ b/src/cairo-quartz-font.c -@@ -81,9 +81,6 @@ static void (*CGFontGetGlyphsForUnicharsPtr) (CGFontRef, const UniChar[], const - static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL; - static bool (*CGContextGetAllowsFontSmoothingPtr) (CGContextRef) = NULL; - --/* Not public in the least bit */ --static CGPathRef (*CGFontGetGlyphPathPtr) (CGFontRef fontRef, CGAffineTransform *textTransform, int unknown, CGGlyph glyph) = NULL; -- - /* CGFontGetHMetrics isn't public, but the other functions are public/present in 10.5 */ - typedef struct { - int ascent; -@@ -127,7 +124,6 @@ quartz_font_ensure_symbols(void) - /* These have the same name in 10.4 and 10.5 */ - CGFontGetUnitsPerEmPtr = dlsym(RTLD_DEFAULT, "CGFontGetUnitsPerEm"); - CGFontGetGlyphAdvancesPtr = dlsym(RTLD_DEFAULT, "CGFontGetGlyphAdvances"); -- CGFontGetGlyphPathPtr = dlsym(RTLD_DEFAULT, "CGFontGetGlyphPath"); - - CGFontGetHMetricsPtr = dlsym(RTLD_DEFAULT, "CGFontGetHMetrics"); - CGFontGetAscentPtr = dlsym(RTLD_DEFAULT, "CGFontGetAscent"); -@@ -144,7 +140,6 @@ quartz_font_ensure_symbols(void) - CGFontGetGlyphsForUnicharsPtr && - CGFontGetUnitsPerEmPtr && - CGFontGetGlyphAdvancesPtr && -- CGFontGetGlyphPathPtr && - (CGFontGetHMetricsPtr || (CGFontGetAscentPtr && CGFontGetDescentPtr && CGFontGetLeadingPtr))) - _cairo_quartz_font_symbols_present = TRUE; - -@@ -550,6 +545,7 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font, - CGGlyph glyph = _cairo_quartz_scaled_glyph_index (scaled_glyph); - CGAffineTransform textMatrix; - CGPathRef glyphPath; -+ CTFontRef ctFont; - cairo_path_fixed_t *path; - - if (glyph == INVALID_GLYPH) { -@@ -564,7 +560,9 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font, - -font->base.scale.yy, - 0, 0); - -- glyphPath = CGFontGetGlyphPathPtr (font_face->cgFont, &textMatrix, 0, glyph); -+ ctFont = CTFontCreateWithGraphicsFont (font_face->cgFont, 1.0, NULL, NULL); -+ glyphPath = CTFontCreatePathForGlyph (ctFont, glyph, &textMatrix); -+ CFRelease (ctFont); - if (!glyphPath) - return CAIRO_INT_STATUS_UNSUPPORTED; - --- -1.9.3 (Apple Git-50) diff --git a/bockbuild/MacSDK/patches/cairo-fix-color-bitmap-fonts.patch b/bockbuild/MacSDK/patches/cairo-fix-color-bitmap-fonts.patch deleted file mode 100644 index 3860cc6e2ea..00000000000 --- a/bockbuild/MacSDK/patches/cairo-fix-color-bitmap-fonts.patch +++ /dev/null @@ -1,189 +0,0 @@ -diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c -index a9bbbdc..48eb071 100644 ---- a/src/cairo-quartz-font.c -+++ b/src/cairo-quartz-font.c -@@ -95,6 +95,10 @@ static int (*CGFontGetAscentPtr) (CGFontRef fontRef) = NULL; - static int (*CGFontGetDescentPtr) (CGFontRef fontRef) = NULL; - static int (*CGFontGetLeadingPtr) (CGFontRef fontRef) = NULL; - -+/* CTFontCreateWithGraphicsFont is not public until 10.5. */ -+typedef const struct __CTFontDescriptor *CTFontDescriptorRef; -+static CTFontRef (*CTFontCreateWithGraphicsFontPtr) (CGFontRef, CGFloat, const CGAffineTransform *, CTFontDescriptorRef) = NULL; -+ - /* Not public anymore in 64-bits nor in 10.7 */ - static ATSFontRef (*FMGetATSFontRefFromFontPtr) (FMFont iFont) = NULL; - -@@ -137,6 +141,8 @@ quartz_font_ensure_symbols(void) - CGContextGetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing"); - CGContextSetAllowsFontSmoothingPtr = dlsym(RTLD_DEFAULT, "CGContextSetAllowsFontSmoothing"); - -+ CTFontCreateWithGraphicsFontPtr = dlsym(RTLD_DEFAULT, "CTFontCreateWithGraphicsFont"); -+ - FMGetATSFontRefFromFontPtr = dlsym(RTLD_DEFAULT, "FMGetATSFontRefFromFont"); - - if ((CGFontCreateWithFontNamePtr || CGFontCreateWithNamePtr) && -@@ -162,6 +168,7 @@ struct _cairo_quartz_font_face { - cairo_font_face_t base; - - CGFontRef cgFont; -+ CTFontRef ctFont; - }; - - /* -@@ -246,6 +253,10 @@ _cairo_quartz_font_face_destroy (void *abstract_face) - { - cairo_quartz_font_face_t *font_face = (cairo_quartz_font_face_t*) abstract_face; - -+ if (font_face->ctFont) { -+ CFRelease (font_face->ctFont); -+ } -+ - CGFontRelease (font_face->cgFont); - } - -@@ -370,6 +381,12 @@ cairo_quartz_font_face_create_for_cgfont (CGFontRef font) - - font_face->cgFont = CGFontRetain (font); - -+ if (CTFontCreateWithGraphicsFontPtr) { -+ font_face->ctFont = CTFontCreateWithGraphicsFontPtr (font, 1.0, NULL, NULL); -+ } else { -+ font_face->ctFont = NULL; -+ } -+ - _cairo_font_face_init (&font_face->base, &_cairo_quartz_font_face_backend); - - return &font_face->base; -@@ -812,6 +829,14 @@ _cairo_quartz_scaled_font_get_cg_font_ref (cairo_scaled_font_t *abstract_font) - return ffont->cgFont; - } - -+CTFontRef -+_cairo_quartz_scaled_font_get_ct_font_ref (cairo_scaled_font_t *abstract_font) -+{ -+ cairo_quartz_font_face_t *ffont = _cairo_quartz_scaled_to_face(abstract_font); -+ -+ return ffont->ctFont; -+} -+ - /* - * compat with old ATSUI backend - */ -diff --git a/src/cairo-quartz-private.h b/src/cairo-quartz-private.h -index f841a49..3c1e5aa 100644 ---- a/src/cairo-quartz-private.h -+++ b/src/cairo-quartz-private.h -@@ -57,6 +57,9 @@ typedef enum { - DO_TILED_IMAGE - } cairo_quartz_action_t; - -+/* define CTFontRef for pre-10.5 SDKs */ -+typedef const struct __CTFont *CTFontRef; -+ - typedef struct cairo_quartz_surface { - cairo_surface_t base; - -@@ -97,6 +100,9 @@ CairoQuartzCreateCGImage (cairo_format_t format, - cairo_private CGFontRef - _cairo_quartz_scaled_font_get_cg_font_ref (cairo_scaled_font_t *sfont); - -+CTFontRef -+_cairo_quartz_scaled_font_get_ct_font_ref (cairo_scaled_font_t *sfont); -+ - #else - - # error Cairo was not compiled with support for the quartz backend -diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c -index 1e2bbec..417255c 100644 ---- a/src/cairo-quartz-surface.c -+++ b/src/cairo-quartz-surface.c -@@ -123,6 +123,9 @@ static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL; - static unsigned int (*CGContextGetTypePtr) (CGContextRef) = NULL; - static bool (*CGContextGetAllowsFontSmoothingPtr) (CGContextRef) = NULL; - -+/* CTFontDrawGlyphs is not available until 10.7 */ -+static void (*CTFontDrawGlyphsPtr) (CTFontRef, const CGGlyph[], const CGPoint[], size_t, CGContextRef) = NULL; -+ - static cairo_bool_t _cairo_quartz_symbol_lookup_done = FALSE; - - /* -@@ -155,6 +158,8 @@ static void quartz_ensure_symbols (void) - CGContextGetAllowsFontSmoothingPtr = dlsym (RTLD_DEFAULT, "CGContextGetAllowsFontSmoothing"); - CGContextSetAllowsFontSmoothingPtr = dlsym (RTLD_DEFAULT, "CGContextSetAllowsFontSmoothing"); - -+ CTFontDrawGlyphsPtr = dlsym(RTLD_DEFAULT, "CTFontDrawGlyphs"); -+ - _cairo_quartz_symbol_lookup_done = TRUE; - } - -@@ -2026,30 +2031,50 @@ _cairo_quartz_cg_glyphs (const cairo_compositor_t *compositor, - CGContextSetTextPosition (state.cgMaskContext, 0.0, 0.0); - CGContextSetTextMatrix (state.cgMaskContext, CGAffineTransformIdentity); - -- /* Convert our glyph positions to glyph advances. We need n-1 advances, -- * since the advance at index 0 is applied after glyph 0. */ -- xprev = glyphs[0].x; -- yprev = glyphs[0].y; -- -- cg_glyphs[0] = glyphs[0].index; -- -- for (i = 1; i < num_glyphs; i++) { -- cairo_quartz_float_t xf = glyphs[i].x; -- cairo_quartz_float_t yf = glyphs[i].y; -- cg_glyphs[i] = glyphs[i].index; -- cg_advances[i - 1] = CGSizeApplyAffineTransform (CGSizeMake (xf - xprev, yf - yprev), invTextTransform); -- xprev = xf; -- yprev = yf; -- } -- - /* Translate to the first glyph's position before drawing */ - CGContextTranslateCTM (state.cgMaskContext, glyphs[0].x, glyphs[0].y); - CGContextConcatCTM (state.cgMaskContext, textTransform); - -- CGContextShowGlyphsWithAdvances (state.cgMaskContext, -- cg_glyphs, -- cg_advances, -- num_glyphs); -+ if (CTFontDrawGlyphsPtr) { -+ /* If CTFontDrawGlyphs is available (i.e. OS X 10.7 or later), we want to use -+ * that in preference to CGContextShowGlyphsWithAdvances so that colored-bitmap -+ * fonts like Apple Color Emoji will render properly. -+ * For this, we need to convert our glyph positions to Core Graphics's CGPoint. -+ * We borrow the cg_advances array, as CGPoint and CGSize are the same size. */ -+ -+ CGPoint *cg_positions = (CGPoint*) cg_advances; -+ cairo_quartz_float_t origin_x = glyphs[0].x; -+ cairo_quartz_float_t origin_y = glyphs[0].y; -+ -+ for (i = 0; i < num_glyphs; i++) { -+ CGPoint pt = CGPointMake (glyphs[i].x - origin_x, glyphs[i].y - origin_y); -+ cg_positions[i] = CGPointApplyAffineTransform (pt, invTextTransform); -+ cg_glyphs[i] = glyphs[i].index; -+ } -+ -+ CTFontDrawGlyphsPtr (_cairo_quartz_scaled_font_get_ct_font_ref (scaled_font), -+ cg_glyphs, cg_positions, num_glyphs, state.cgMaskContext); -+ } else { -+ /* Convert our glyph positions to glyph advances. We need n-1 advances, -+ * since the advance at index 0 is applied after glyph 0. */ -+ xprev = glyphs[0].x; -+ yprev = glyphs[0].y; -+ -+ cg_glyphs[0] = glyphs[0].index; -+ -+ for (i = 1; i < num_glyphs; i++) { -+ cairo_quartz_float_t xf = glyphs[i].x; -+ cairo_quartz_float_t yf = glyphs[i].y; -+ cg_glyphs[i] = glyphs[i].index; -+ cg_advances[i - 1] = CGSizeApplyAffineTransform (CGSizeMake (xf - xprev, yf - yprev), invTextTransform); -+ xprev = xf; -+ yprev = yf; -+ } -+ CGContextShowGlyphsWithAdvances (state.cgMaskContext, -+ cg_glyphs, -+ cg_advances, -+ num_glyphs); -+ } - - CGContextConcatCTM (state.cgMaskContext, invTextTransform); - CGContextTranslateCTM (state.cgMaskContext, -glyphs[0].x, -glyphs[0].y); diff --git a/bockbuild/MacSDK/patches/cairo-quartz-crash.patch b/bockbuild/MacSDK/patches/cairo-quartz-crash.patch deleted file mode 100644 index a1e64f1c503..00000000000 --- a/bockbuild/MacSDK/patches/cairo-quartz-crash.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/src/cairo-quartz-surface.c 2013-03-28 19:19:15.000000000 -0400 -+++ b/src/cairo-quartz-surface.c 2013-03-28 19:19:28.000000000 -0400 -@@ -1379,7 +1379,6 @@ - CGContextDrawLayerInRect (surface->cgContext, - state->clipRect, - state->layer); -- CGContextRelease (state->cgDrawContext); - CGLayerRelease (state->layer); - } diff --git a/bockbuild/MacSDK/patches/fsharp-assemblysearchpath-fix.patch b/bockbuild/MacSDK/patches/fsharp-assemblysearchpath-fix.patch deleted file mode 100644 index 305904bdf0f..00000000000 --- a/bockbuild/MacSDK/patches/fsharp-assemblysearchpath-fix.patch +++ /dev/null @@ -1,132 +0,0 @@ -From b02965711a387b015a6af4b9d26bbdabf10fc5b4 Mon Sep 17 00:00:00 2001 -From: Mikayla Hutchinson -Date: Mon, 1 Aug 2016 13:47:41 -0400 -Subject: [PATCH 1/2] Remove xbuild workarounds - -They do not work Mono 4.6+ where the underlying bug is fixed ---- - src/FSharpSource.targets | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets -index eb57269..ea3656f 100755 ---- a/src/FSharpSource.targets -+++ b/src/FSharpSource.targets -@@ -306,8 +306,6 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do - $(DefineConstants);PUT_TYPE_PROVIDERS_IN_FSCORE - $(DefineConstants);QUERIES_IN_FSLIB - -- -- $(MSBuildExtensionsPath32)\..\xbuild-frameworks\.NETPortable\v4.0 - - - -@@ -348,8 +346,6 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do - netcore - Profile7 - v4.5 -- -- $(MSBuildExtensionsPath32)\..\xbuild-frameworks\.NETPortable\v4.5 - $(OtherFlags) --targetprofile:netcore - - -@@ -389,8 +385,6 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do - netcore - Profile78 - v4.5 -- -- $(MSBuildExtensionsPath32)\..\xbuild-frameworks\.NETPortable\v4.5 - $(OtherFlags) --targetprofile:netcore - - -@@ -430,8 +424,6 @@ Some other NuGET monikers to support in the future, see http://docs.nuget.org/do - netcore - Profile259 - v4.5 -- -- $(MSBuildExtensionsPath32)\..\xbuild-frameworks\.NETPortable\v4.5 - $(OtherFlags) --targetprofile:netcore - - --- -2.7.4 (Apple Git-66) - - -From e57cb16ee7927bb31b2c9b63e1b2e394bf9f9932 Mon Sep 17 00:00:00 2001 -From: Mikayla Hutchinson -Date: Mon, 1 Aug 2016 13:48:23 -0400 -Subject: [PATCH 2/2] Remove dead code - -Remove Mono workarounds for missing files. Mono has been -shipping the files for some time now. ---- - .../FSharp.Build/Microsoft.Portable.FSharp.Targets | 52 ---------------------- - 1 file changed, 52 deletions(-) - -diff --git a/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets b/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets -index 8c99ab6..ee5f9b1 100644 ---- a/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets -+++ b/src/fsharp/FSharp.Build/Microsoft.Portable.FSharp.Targets -@@ -24,60 +24,8 @@ Copyright (C) Microsoft Corporation. All rights reserved. - Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\Portable\v4.0\Microsoft.Portable.Common.targets') AND - !Exists('$(MSBuildExtensionsPath32)\Microsoft\Portable\Microsoft.Portable.Core.props')"/> - -- -- -- -- -- Any CPU -- -- Portable -- .NETPortable -- .NET Portable Subset -- -- false -- true -- -- true -- -- -- -- - - -- -- -- -- -- $(ResolveReferencesDependsOn); -- ImplicitlyExpandTargetFramework; -- -- -- -- $(ImplicitlyExpandTargetFrameworkDependsOn); -- GetReferenceAssemblyPaths -- -- -- -- -- -- -- -- -- false -- ImplicitlyExpandTargetFramework -- True -- -- -- -- -- - - --- -2.7.4 (Apple Git-66) diff --git a/bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch b/bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch deleted file mode 100644 index 2ca1c6acb83..00000000000 --- a/bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-Add-getter-setter-for-the-2x-variants.patch +++ /dev/null @@ -1,56 +0,0 @@ -From f6d2db5a0c105785ee6f03717966ef0dbb1421f6 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Tue, 16 Jul 2013 10:32:11 +0200 -Subject: [PATCH] pixbuf: Add getter/setter for the 2x variants - ---- - gdk-pixbuf/gdk-pixbuf-core.h | 3 +++ - gdk-pixbuf/gdk-pixbuf.c | 22 ++++++++++++++++++++++ - 2 files changed, 25 insertions(+) - -diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h -index eb4d0a1..60c4ea3 100644 ---- a/gdk-pixbuf/gdk-pixbuf-core.h -+++ b/gdk-pixbuf/gdk-pixbuf-core.h -@@ -474,6 +474,9 @@ GdkPixbuf *gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src); - const gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf, - const gchar *key); - -+GdkPixbuf * gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf); -+void gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf, -+ GdkPixbuf *hires); - - G_END_DECLS - -diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c -index 0e13f27..d61f2c7 100644 ---- a/gdk-pixbuf/gdk-pixbuf.c -+++ b/gdk-pixbuf/gdk-pixbuf.c -@@ -990,3 +990,25 @@ gdk_pixbuf_get_property (GObject *object, - break; - } - } -+ -+GdkPixbuf * -+gdk_pixbuf_get_hires_variant (GdkPixbuf *pixbuf) -+{ -+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); -+ -+ return g_object_get_data (G_OBJECT (pixbuf), -+ "gdk-pixbuf-2x-variant"); -+} -+ -+void -+gdk_pixbuf_set_hires_variant (GdkPixbuf *pixbuf, -+ GdkPixbuf *hires) -+{ -+ g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); -+ g_return_if_fail (GDK_IS_PIXBUF (hires)); -+ -+ g_object_set_data_full (G_OBJECT (pixbuf), -+ "gdk-pixbuf-2x-variant", -+ g_object_ref (hires), -+ (GDestroyNotify) g_object_unref); -+} --- -1.8.3.2 diff --git a/bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch b/bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch deleted file mode 100644 index 80d3d399ef0..00000000000 --- a/bockbuild/MacSDK/patches/gdk-pixbuf/0001-pixbuf-load-2x-variants-as-pixbuf-gobject-data.patch +++ /dev/null @@ -1,99 +0,0 @@ ->From de5d91aa15cc98795a68c8e553eb4baadaa0e501 Mon Sep 17 00:00:00 2001 -From: Carlos Garnacho -Date: Fri, 17 May 2013 15:56:28 +0200 -Subject: [PATCH] pixbuf: load "@2x" variants as pixbuf gobject data - -if a variant of the filename is found that has a "@2x" appended -to the file name (before the extension), such file is loaded -and added as GObject data to the pixbuf ---- - gdk-pixbuf/gdk-pixbuf-io.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 55 insertions(+) - -diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c -index dac21b8..ed98cd3 100644 ---- a/gdk-pixbuf/gdk-pixbuf-io.c -+++ b/gdk-pixbuf/gdk-pixbuf-io.c -@@ -1025,6 +1025,40 @@ _gdk_pixbuf_generic_image_load (GdkPixbufModule *module, - return pixbuf; - } - -+static gboolean -+_gdk_pixbuf_file_is_scaled (const gchar *filename) -+{ -+ gchar *basename, *ext; -+ -+ basename = g_path_get_basename (filename); -+ ext = strrchr (basename, '.'); -+ -+ if (!ext) -+ ext = &basename[strlen(basename)]; -+ -+ if (ext > basename + 3 && strncmp (ext - 3, "@2x", 3) == 0) -+ return TRUE; -+ -+ return FALSE; -+} -+ -+static gchar * -+_gdk_pixbuf_compose_scaled_filename (const gchar *filename) -+{ -+ gchar *ext, *first, *composed; -+ -+ ext = strrchr (filename, '.'); -+ -+ if (!ext) -+ return NULL; -+ -+ first = g_strndup (filename, ext - filename); -+ composed = g_strdup_printf ("%s@2x%s", first, ext); -+ g_free (first); -+ -+ return composed; -+} -+ - /** - * gdk_pixbuf_new_from_file: - * @filename: Name of file to load, in the GLib file name encoding -@@ -1049,11 +1083,13 @@ gdk_pixbuf_new_from_file (const char *filename, - guchar buffer[SNIFF_BUFFER_SIZE]; - GdkPixbufModule *image_module; - gchar *display_name; -+ gboolean filename_is_scaled; - - g_return_val_if_fail (filename != NULL, NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - display_name = g_filename_display_name (filename); -+ filename_is_scaled = _gdk_pixbuf_file_is_scaled (filename); - - f = g_fopen (filename, "rb"); - if (!f) { -@@ -1097,6 +1133,25 @@ gdk_pixbuf_new_from_file (const char *filename, - pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error); - fclose (f); - -+ if (pixbuf && !filename_is_scaled) { -+ GdkPixbuf *scaled_pixbuf = NULL; -+ gchar *scaled_filename; -+ -+ scaled_filename = _gdk_pixbuf_compose_scaled_filename (filename); -+ -+ if (scaled_filename) { -+ scaled_pixbuf = gdk_pixbuf_new_from_file (scaled_filename, NULL); -+ g_free (scaled_filename); -+ } -+ -+ if (scaled_pixbuf) { -+ g_object_set_data_full (G_OBJECT (pixbuf), -+ "gdk-pixbuf-2x-variant", -+ scaled_pixbuf, -+ (GDestroyNotify) g_object_unref); -+ } -+ } -+ - if (pixbuf == NULL && error != NULL && *error == NULL) { - - /* I don't trust these crufty longjmp()'ing image libs --- -1.8.3.rc1 diff --git a/bockbuild/MacSDK/patches/gdk-quartz-set-fix-modifiers-hack-v3.patch b/bockbuild/MacSDK/patches/gdk-quartz-set-fix-modifiers-hack-v3.patch deleted file mode 100644 index cbeb4299317..00000000000 --- a/bockbuild/MacSDK/patches/gdk-quartz-set-fix-modifiers-hack-v3.patch +++ /dev/null @@ -1,178 +0,0 @@ -diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c -index a8800f7..ec6a893 100644 ---- a/gdk/quartz/gdkevents-quartz.c -+++ b/gdk/quartz/gdkevents-quartz.c -@@ -292,10 +292,19 @@ get_keyboard_modifiers_from_ns_flags (NSUInteger nsflags) - modifiers |= GDK_SHIFT_MASK; - if (nsflags & NSControlKeyMask) - modifiers |= GDK_CONTROL_MASK; -- if (nsflags & NSAlternateKeyMask) -- modifiers |= GDK_MOD1_MASK; -- if (nsflags & NSCommandKeyMask) -- modifiers |= GDK_MOD2_MASK; -+ -+ if (gdk_quartz_get_fix_modifiers ()) -+ { -+ if (nsflags & NSAlternateKeyMask) -+ modifiers |= GDK_MOD1_MASK; -+ if (nsflags & NSCommandKeyMask) -+ modifiers |= GDK_MOD2_MASK; -+ } -+ else -+ { -+ if (nsflags & NSCommandKeyMask) -+ modifiers |= GDK_MOD1_MASK; -+ } - - return modifiers; - } -@@ -930,7 +939,7 @@ fill_key_event (GdkWindow *window, - { - case GDK_Meta_R: - case GDK_Meta_L: -- mask = GDK_MOD2_MASK; -+ mask = gdk_quartz_get_fix_modifiers () ? GDK_MOD2_MASK : GDK_MOD1_MASK; - break; - case GDK_Shift_R: - case GDK_Shift_L: -@@ -941,7 +950,7 @@ fill_key_event (GdkWindow *window, - break; - case GDK_Alt_R: - case GDK_Alt_L: -- mask = GDK_MOD1_MASK; -+ mask = gdk_quartz_get_fix_modifiers () ? GDK_MOD1_MASK : GDK_MOD2_MASK; - break; - case GDK_Control_R: - case GDK_Control_L: -@@ -1089,9 +1098,9 @@ _gdk_quartz_events_get_current_keyboard_modifiers (void) - if (carbon_modifiers & controlKey) - modifiers |= GDK_CONTROL_MASK; - if (carbon_modifiers & optionKey) -- modifiers |= GDK_MOD1_MASK; -+ modifiers |= (gdk_quartz_get_fix_modifiers () ? GDK_MOD1_MASK : GDK_MOD2_MASK); - if (carbon_modifiers & cmdKey) -- modifiers |= GDK_MOD2_MASK; -+ modifiers |= (gdk_quartz_get_fix_modifiers () ? GDK_MOD2_MASK : GDK_MOD1_MASK); - - return modifiers; - } -diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c -index 53c6d5e..31dbab1 100644 ---- a/gdk/quartz/gdkglobals-quartz.c -+++ b/gdk/quartz/gdkglobals-quartz.c -@@ -41,3 +41,17 @@ gdk_quartz_osx_version (void) - else - return minor; - } -+ -+static gboolean fix_modifiers = FALSE; -+ -+void -+gdk_quartz_set_fix_modifiers (gboolean fix) -+{ -+ fix_modifiers = fix; -+} -+ -+gboolean -+gdk_quartz_get_fix_modifiers (void) -+{ -+ return fix_modifiers; -+} -diff --git a/gdk/quartz/gdkkeys-quartz.c b/gdk/quartz/gdkkeys-quartz.c -index 19a20f5..c7ceec6 100644 ---- a/gdk/quartz/gdkkeys-quartz.c -+++ b/gdk/quartz/gdkkeys-quartz.c -@@ -693,11 +693,11 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap, - for (bit = GDK_SHIFT_MASK; bit < GDK_BUTTON1_MASK; bit <<= 1) - { - if (translate_keysym (hardware_keycode, -- (bit == GDK_MOD1_MASK) ? 0 : group, -+ (bit == (gdk_quartz_get_fix_modifiers () ? GDK_MOD1_MASK : GDK_MOD2_MASK)) ? 0 : group, - state & ~bit, - NULL, NULL) != - translate_keysym (hardware_keycode, -- (bit == GDK_MOD1_MASK) ? 1 : group, -+ (bit == (gdk_quartz_get_fix_modifiers () ? GDK_MOD1_MASK : GDK_MOD2_MASK)) ? 1 : group, - state | bit, - NULL, NULL)) - tmp_modifiers |= bit; -@@ -718,16 +718,32 @@ void - gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap, - GdkModifierType *state) - { -- if (*state & GDK_MOD2_MASK) -- *state |= GDK_META_MASK; -+ if (gdk_quartz_get_fix_modifiers ()) -+ { -+ if (*state & GDK_MOD2_MASK) -+ *state |= GDK_META_MASK; -+ } -+ else -+ { -+ if (*state & GDK_MOD1_MASK) -+ *state |= GDK_META_MASK; -+ } - } - - gboolean - gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap, - GdkModifierType *state) - { -- if (*state & GDK_META_MASK) -- *state |= GDK_MOD2_MASK; -+ if (gdk_quartz_get_fix_modifiers ()) -+ { -+ if (*state & GDK_META_MASK) -+ *state |= GDK_MOD2_MASK; -+ } -+ else -+ { -+ if (*state & GDK_META_MASK) -+ *state |= GDK_MOD1_MASK; -+ } - - return TRUE; - } -diff --git a/gdk/quartz/gdkquartz.h b/gdk/quartz/gdkquartz.h -index 742d651..ed0ba35 100644 ---- a/gdk/quartz/gdkquartz.h -+++ b/gdk/quartz/gdkquartz.h -@@ -58,6 +58,9 @@ id gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext - NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event); - GdkOSXVersion gdk_quartz_osx_version (void); - -+void gdk_quartz_set_fix_modifiers (gboolean fix); -+gboolean gdk_quartz_get_fix_modifiers (void); -+ - G_END_DECLS - - #endif /* __GDK_QUARTZ_H__ */ -diff --git a/gtk/gtkprivate.h b/gtk/gtkprivate.h -index 6386c32..aa1cc74 100644 ---- a/gtk/gtkprivate.h -+++ b/gtk/gtkprivate.h -@@ -122,7 +122,7 @@ gboolean _gtk_fnmatch (const char *pattern, - #ifndef GDK_WINDOWING_QUARTZ - #define GTK_NO_TEXT_INPUT_MOD_MASK (GDK_MOD1_MASK | GDK_CONTROL_MASK) - #else --#define GTK_NO_TEXT_INPUT_MOD_MASK (GDK_MOD2_MASK | GDK_CONTROL_MASK) -+#define GTK_NO_TEXT_INPUT_MOD_MASK (gdk_quartz_get_fix_modifiers () ? (GDK_MOD2_MASK | GDK_CONTROL_MASK) : (GDK_MOD1_MASK | GDK_CONTROL_MASK)) - #endif - - #ifndef GDK_WINDOWING_QUARTZ -@@ -130,13 +130,13 @@ gboolean _gtk_fnmatch (const char *pattern, - #define GTK_MODIFY_SELECTION_MOD_MASK GDK_CONTROL_MASK - #else - #define GTK_EXTEND_SELECTION_MOD_MASK GDK_SHIFT_MASK --#define GTK_MODIFY_SELECTION_MOD_MASK GDK_MOD2_MASK -+#define GTK_MODIFY_SELECTION_MOD_MASK (gdk_quartz_get_fix_modifiers () ? GDK_MOD2_MASK : GDK_MOD1_MASK) - #endif - - #ifndef GDK_WINDOWING_QUARTZ - #define GTK_TOGGLE_GROUP_MOD_MASK 0 - #else --#define GTK_TOGGLE_GROUP_MOD_MASK GDK_MOD1_MASK -+#define GTK_TOGGLE_GROUP_MOD_MASK (gdk_quartz_get_fix_modifiers () ? GDK_MOD1_MASK : 0) - #endif - - gboolean _gtk_button_event_triggers_context_menu (GdkEventButton *event); diff --git a/bockbuild/MacSDK/patches/glib-recursive-poll.patch b/bockbuild/MacSDK/patches/glib-recursive-poll.patch deleted file mode 100644 index b84c9d09de8..00000000000 --- a/bockbuild/MacSDK/patches/glib-recursive-poll.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 5dfd206b09f91cba45fa8e2b66e1b57aafe30868 Mon Sep 17 00:00:00 2001 -From: Kristian Rietveld -Date: Mon, 8 Jul 2013 12:02:00 +0200 -Subject: [PATCH] Make g_main_context_iterate resilient to recursion in poll - -On OS X, main loop recursion may happen during the call the poll. -As a result, the allocated poll array may be re-allocated (note that -it is always enlarged, never shrunk). By always using cached_poll_array -after the poll function, reads from bad memory are avoided. ---- - glib/gmain.c | 28 +++++++++++++++------------- - 1 file changed, 15 insertions(+), 13 deletions(-) - -diff --git a/glib/gmain.c b/glib/gmain.c -index 077a935..529f2b6 100644 ---- a/glib/gmain.c -+++ b/glib/gmain.c -@@ -3065,8 +3065,7 @@ g_main_context_iterate (GMainContext *context, - gint max_priority; - gint timeout; - gboolean some_ready; -- gint nfds, allocated_nfds; -- GPollFD *fds = NULL; -+ gint nfds; - - UNLOCK_CONTEXT (context); - -@@ -3095,29 +3094,32 @@ g_main_context_iterate (GMainContext *context, - context->cached_poll_array = g_new (GPollFD, context->n_poll_records); - } - -- allocated_nfds = context->cached_poll_array_size; -- fds = context->cached_poll_array; -- - UNLOCK_CONTEXT (context); - - g_main_context_prepare (context, &max_priority); - -- while ((nfds = g_main_context_query (context, max_priority, &timeout, fds, -- allocated_nfds)) > allocated_nfds) -+ while ((nfds = g_main_context_query (context, max_priority, &timeout, -+ context->cached_poll_array, -+ context->cached_poll_array_size)) -+ > context->cached_poll_array_size) - { - LOCK_CONTEXT (context); -- g_free (fds); -- context->cached_poll_array_size = allocated_nfds = nfds; -- context->cached_poll_array = fds = g_new (GPollFD, nfds); -+ g_free (context->cached_poll_array); -+ context->cached_poll_array_size = nfds; -+ context->cached_poll_array = g_new (GPollFD, nfds); - UNLOCK_CONTEXT (context); - } - - if (!block) - timeout = 0; - -- g_main_context_poll (context, timeout, max_priority, fds, nfds); -- -- some_ready = g_main_context_check (context, max_priority, fds, nfds); -+ g_main_context_poll (context, timeout, max_priority, -+ context->cached_poll_array, -+ nfds); -+ -+ some_ready = g_main_context_check (context, max_priority, -+ context->cached_poll_array, -+ nfds); - - if (dispatch) - g_main_context_dispatch (context); --- -1.7.10 diff --git a/bockbuild/MacSDK/patches/pango-coretext-astral-plane-1.patch b/bockbuild/MacSDK/patches/pango-coretext-astral-plane-1.patch deleted file mode 100644 index 70be34793a6..00000000000 --- a/bockbuild/MacSDK/patches/pango-coretext-astral-plane-1.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3cab26a0468bab855ed2eb13e4f334176e109483 Mon Sep 17 00:00:00 2001 -From: Kristian Rietveld -Date: Tue, 19 Mar 2013 11:23:09 +0100 -Subject: [PATCH 1/2] Simply process entire bitmap obtained from the core text - font - ---- - pango/pangocoretext.c | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/pango/pangocoretext.c b/pango/pangocoretext.c -index 36bcd82..1d46271 100644 ---- a/pango/pangocoretext.c -+++ b/pango/pangocoretext.c -@@ -89,8 +89,7 @@ ct_font_descriptor_get_coverage (CTFontDescriptorRef desc) - bitmap = CFCharacterSetCreateBitmapRepresentation (kCFAllocatorDefault, - charset); - -- /* We only handle the BMP plane */ -- length = MIN (CFDataGetLength (bitmap), 8192); -+ length = CFDataGetLength (bitmap); - ptr = CFDataGetBytePtr (bitmap); - - /* FIXME: can and should this be done more efficiently? */ --- -1.7.4.4 diff --git a/bockbuild/MacSDK/patches/pango-coretext-astral-plane-2.patch b/bockbuild/MacSDK/patches/pango-coretext-astral-plane-2.patch deleted file mode 100644 index 92dc8d16eb4..00000000000 --- a/bockbuild/MacSDK/patches/pango-coretext-astral-plane-2.patch +++ /dev/null @@ -1,109 +0,0 @@ -661f8c0b920f5da Mon Sep 17 00:00:00 2001 -From: Kristian Rietveld -Date: Tue, 19 Mar 2013 11:23:49 +0100 -Subject: [PATCH 2/2] Detect and handle characters encoded in two UTF16 code - points - -Another important change: gi->index should point at the current -character, not the current into the string. Before this change, -the current character equaled the current index into the string. ---- - modules/basic/basic-coretext.c | 55 ++++++++++++++++++++++++++++----------- - 1 files changed, 39 insertions(+), 16 deletions(-) - -diff --git a/modules/basic/basic-coretext.c b/modules/basic/basic-coretext.c -index 33ce479..06b648e 100644 ---- a/modules/basic/basic-coretext.c -+++ b/modules/basic/basic-coretext.c -@@ -166,7 +166,42 @@ run_iterator_run_is_non_monotonic (struct RunIterator *iter) - static gunichar - run_iterator_get_character (struct RunIterator *iter) - { -- return CFStringGetCharacterAtIndex (iter->cstr, iter->current_indices[iter->ct_i]); -+ int lower, upper; -+ -+ lower = iter->current_indices[iter->ct_i]; -+ if (iter->ct_i + 1 < CTRunGetGlyphCount (iter->current_run)) -+ upper = iter->current_indices[iter->ct_i + 1]; -+ else -+ { -+ CFRange range = CTRunGetStringRange (iter->current_run); -+ upper = range.location + range.length; -+ } -+ -+ if (upper - lower == 1) -+ return CFStringGetCharacterAtIndex (iter->cstr, lower); -+ if (upper - lower == 2) -+ { -+ /* Character is encoded in two UTF16 code points. */ -+ gunichar *ch; -+ gunichar retval; -+ gunichar2 orig[2]; -+ -+ orig[0] = CFStringGetCharacterAtIndex (iter->cstr, lower); -+ orig[1] = CFStringGetCharacterAtIndex (iter->cstr, lower + 1); -+ -+ ch = g_utf16_to_ucs4 (orig, 2, NULL, NULL, NULL); -+ retval = *ch; -+ g_free (ch); -+ -+ return retval; -+ } -+ -+ /* This should not be reached, because other cases cannot occur. Instead -+ * of crashing, return the first character which will likely be displayed -+ * as unknown glyph. -+ */ -+ -+ return CFStringGetCharacterAtIndex (iter->cstr, lower); - } - - static CGGlyph -@@ -175,12 +210,6 @@ run_iterator_get_cgglyph (struct RunIterator *iter) - return iter->current_cgglyphs[iter->ct_i]; - } - --static CFIndex --run_iterator_get_index (struct RunIterator *iter) --{ -- return iter->current_indices[iter->ct_i]; --} -- - static gboolean - run_iterator_create (struct RunIterator *iter, - const char *text, -@@ -336,7 +365,7 @@ create_core_text_glyph_list (const char *text, - struct GlyphInfo *gi; - - gi = g_slice_new (struct GlyphInfo); -- gi->index = run_iterator_get_index (&riter); -+ gi->index = riter.total_ct_i; - gi->cgglyph = run_iterator_get_cgglyph (&riter); - gi->wc = run_iterator_get_character (&riter); - -@@ -376,9 +405,8 @@ basic_engine_shape (PangoEngineShape *engine, - * glyph sequence generated by the CoreText typesetter: - * # E.g. zero-width spaces do not end up in the CoreText glyph sequence. We have - * to manually account for the gap in the character indices. -- * # Sometimes, CoreText generates two glyph for the same character index. We -- * currently handle this "properly" as in we do not crash or corrupt memory, -- * but that's about it. -+ * # Sometimes, CoreText generates two glyph for the same character index. These -+ * are properly composed into a single 32-bit gunichar. - * # Due to mismatches in size, the CoreText glyph sequence can either be longer or - * shorter than the PangoGlyphString. Note that the size of the PangoGlyphString - * should match the number of characters in "text". -@@ -390,11 +418,6 @@ basic_engine_shape (PangoEngineShape *engine, - * increasing/decreasing. - * - * FIXME items for future fixing: -- * # CoreText strings are UTF16, and the indices *often* refer to characters, -- * but not *always*. Notable exception is when a character is encoded using -- * two UTF16 code points. This are two characters in a CFString. At this point -- * advancing a single character in the CFString and advancing a single character -- * using g_utf8_next_char in the const char string goes out of sync. - * # We currently don't bother about LTR, Pango core appears to fix this up for us. - * (Even when we cared warnings were generated that strings were in the wrong - * order, this should be investigated). --- -1.7.4.4 diff --git a/bockbuild/MacSDK/patches/pango-coretext-condensed-trait.patch b/bockbuild/MacSDK/patches/pango-coretext-condensed-trait.patch deleted file mode 100644 index 7b68888abe3..00000000000 --- a/bockbuild/MacSDK/patches/pango-coretext-condensed-trait.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c -index 53b2676..2b30a07 100644 ---- a/pango/pangocoretext-fontmap.c -+++ b/pango/pangocoretext-fontmap.c -@@ -411,6 +411,9 @@ _pango_core_text_font_description_from_ct_font_descriptor (CTFontDescriptorRef d - else - pango_font_description_set_style (font_desc, PANGO_STYLE_NORMAL); - -+ if ((font_traits & kCTFontCondensedTrait) == kCTFontCondensedTrait) -+ pango_font_description_set_stretch (font_desc, PANGO_STRETCH_CONDENSED); -+ - if (ct_font_descriptor_is_small_caps (desc)) - pango_font_description_set_variant (font_desc, PANGO_VARIANT_SMALL_CAPS); - else diff --git a/bockbuild/MacSDK/patches/pango-coretext-fix-yosemite-crasher.patch b/bockbuild/MacSDK/patches/pango-coretext-fix-yosemite-crasher.patch deleted file mode 100644 index 16c8d364faa..00000000000 --- a/bockbuild/MacSDK/patches/pango-coretext-fix-yosemite-crasher.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff --git a/modules/basic/.libs/basic-coretext.o b/modules/basic/.libs/basic-coretext.o -index 13cce67..80c3268 100644 -Binary files a/modules/basic/.libs/basic-coretext.o and b/modules/basic/.libs/basic-coretext.o differ -diff --git a/modules/basic/.libs/pango-basic-coretext.so b/modules/basic/.libs/pango-basic-coretext.so -index 70bb117..d0940c4 100755 -Binary files a/modules/basic/.libs/pango-basic-coretext.so and b/modules/basic/.libs/pango-basic-coretext.so differ -diff --git a/modules/basic/basic-coretext.c b/modules/basic/basic-coretext.c -index c34460a..46d83ff 100644 ---- a/modules/basic/basic-coretext.c -+++ b/modules/basic/basic-coretext.c -@@ -92,6 +92,7 @@ struct RunIterator - CTRunRef current_run; - CFIndex *current_indices; - const CGGlyph *current_cgglyphs; -+ CGGlyph *current_cgglyphs_buffer; - CTRunStatus current_run_status; - }; - -@@ -101,6 +102,9 @@ run_iterator_free_current_run (struct RunIterator *iter) - iter->current_run_number = -1; - iter->current_run = NULL; - iter->current_cgglyphs = NULL; -+ if (iter->current_cgglyphs_buffer) -+ free (iter->current_cgglyphs_buffer); -+ iter->current_cgglyphs_buffer = NULL; - if (iter->current_indices) - free (iter->current_indices); - iter->current_indices = NULL; -@@ -116,10 +120,18 @@ run_iterator_set_current_run (struct RunIterator *iter, - - iter->current_run_number = run_number; - iter->current_run = CFArrayGetValueAtIndex (iter->runs, run_number); -+ ct_glyph_count = CTRunGetGlyphCount (iter->current_run); -+ - iter->current_run_status = CTRunGetStatus (iter->current_run); - iter->current_cgglyphs = CTRunGetGlyphsPtr (iter->current_run); -+ if (!iter->current_cgglyphs) -+ { -+ iter->current_cgglyphs_buffer = (CGGlyph *)malloc (sizeof (CGGlyph) * ct_glyph_count); -+ CTRunGetGlyphs (iter->current_run, CFRangeMake (0, ct_glyph_count), -+ iter->current_cgglyphs_buffer); -+ iter->current_cgglyphs = iter->current_cgglyphs_buffer; -+ } - -- ct_glyph_count = CTRunGetGlyphCount (iter->current_run); - iter->current_indices = malloc (sizeof (CFIndex *) * ct_glyph_count); - CTRunGetStringIndices (iter->current_run, CFRangeMake (0, ct_glyph_count), - iter->current_indices); -@@ -237,6 +249,7 @@ run_iterator_create (struct RunIterator *iter, - iter->current_run = NULL; - iter->current_indices = NULL; - iter->current_cgglyphs = NULL; -+ iter->current_cgglyphs_buffer = NULL; - - /* Create CTLine */ - attributes = CFDictionaryCreate (kCFAllocatorDefault, -diff --git a/modules/basic/basic-coretext.c.orig b/modules/basic/basic-coretext.c.orig -index 0a2c27f..c34460a 100644 ---- a/modules/basic/basic-coretext.c.orig -+++ b/modules/basic/basic-coretext.c.orig -@@ -166,7 +166,42 @@ run_iterator_run_is_non_monotonic (struct RunIterator *iter) - static gunichar - run_iterator_get_character (struct RunIterator *iter) - { -- return CFStringGetCharacterAtIndex (iter->cstr, iter->current_indices[iter->ct_i]); -+ int lower, upper; -+ -+ lower = iter->current_indices[iter->ct_i]; -+ if (iter->ct_i + 1 < CTRunGetGlyphCount (iter->current_run)) -+ upper = iter->current_indices[iter->ct_i + 1]; -+ else -+ { -+ CFRange range = CTRunGetStringRange (iter->current_run); -+ upper = range.location + range.length; -+ } -+ -+ if (upper - lower == 1) -+ return CFStringGetCharacterAtIndex (iter->cstr, lower); -+ if (upper - lower == 2) -+ { -+ /* Character is encoded in two UTF16 code points. */ -+ gunichar *ch; -+ gunichar retval; -+ gunichar2 orig[2]; -+ -+ orig[0] = CFStringGetCharacterAtIndex (iter->cstr, lower); -+ orig[1] = CFStringGetCharacterAtIndex (iter->cstr, lower + 1); -+ -+ ch = g_utf16_to_ucs4 (orig, 2, NULL, NULL, NULL); -+ retval = *ch; -+ g_free (ch); -+ -+ return retval; -+ } -+ -+ /* This should not be reached, because other cases cannot occur. Instead -+ * of crashing, return the first character which will likely be displayed -+ * as unknown glyph. -+ */ -+ -+ return CFStringGetCharacterAtIndex (iter->cstr, lower); - } - - static CGGlyph -@@ -175,12 +210,6 @@ run_iterator_get_cgglyph (struct RunIterator *iter) - return iter->current_cgglyphs[iter->ct_i]; - } - --static CFIndex --run_iterator_get_index (struct RunIterator *iter) --{ -- return iter->current_indices[iter->ct_i]; --} -- - static gboolean - run_iterator_create (struct RunIterator *iter, - const char *text, -@@ -190,13 +219,17 @@ run_iterator_create (struct RunIterator *iter, - char *copy; - CFDictionaryRef attributes; - CFAttributedStringRef attstr; -+ int val = 0; -+ CFNumberRef number = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &val); - - CFTypeRef keys[] = { -- (CFTypeRef) kCTFontAttributeName -+ (CFTypeRef) kCTFontAttributeName, -+ kCTLigatureAttributeName - }; - - CFTypeRef values[] = { -- ctfont -+ ctfont, -+ number - }; - - /* Initialize RunIterator structure */ -@@ -209,7 +242,7 @@ run_iterator_create (struct RunIterator *iter, - attributes = CFDictionaryCreate (kCFAllocatorDefault, - (const void **)keys, - (const void **)values, -- 1, -+ sizeof (keys) / sizeof (keys[0]), - &kCFCopyStringDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - -@@ -233,6 +266,7 @@ run_iterator_create (struct RunIterator *iter, - iter->line = CTLineCreateWithAttributedString (attstr); - iter->runs = CTLineGetGlyphRuns (iter->line); - -+ CFRelease (number); - CFRelease (attstr); - CFRelease (attributes); - -@@ -336,7 +370,7 @@ create_core_text_glyph_list (const char *text, - struct GlyphInfo *gi; - - gi = g_slice_new (struct GlyphInfo); -- gi->index = run_iterator_get_index (&riter); -+ gi->index = riter.total_ct_i; - gi->cgglyph = run_iterator_get_cgglyph (&riter); - gi->wc = run_iterator_get_character (&riter); - -@@ -378,9 +412,8 @@ basic_engine_shape (PangoEngineShape *engine, - * glyph sequence generated by the CoreText typesetter: - * # E.g. zero-width spaces do not end up in the CoreText glyph sequence. We have - * to manually account for the gap in the character indices. -- * # Sometimes, CoreText generates two glyph for the same character index. We -- * currently handle this "properly" as in we do not crash or corrupt memory, -- * but that's about it. -+ * # Sometimes, CoreText generates two glyph for the same character index. These -+ * are properly composed into a single 32-bit gunichar. - * # Due to mismatches in size, the CoreText glyph sequence can either be longer or - * shorter than the PangoGlyphString. Note that the size of the PangoGlyphString - * should match the number of characters in "text". -@@ -392,11 +425,6 @@ basic_engine_shape (PangoEngineShape *engine, - * increasing/decreasing. - * - * FIXME items for future fixing: -- * # CoreText strings are UTF16, and the indices *often* refer to characters, -- * but not *always*. Notable exception is when a character is encoded using -- * two UTF16 code points. This are two characters in a CFString. At this point -- * advancing a single character in the CFString and advancing a single character -- * using g_utf8_next_char in the const char string goes out of sync. - * # We currently don't bother about LTR, Pango core appears to fix this up for us. - * (Even when we cared warnings were generated that strings were in the wrong - * order, this should be investigated). diff --git a/bockbuild/MacSDK/patches/pango-disable-ligatures.patch b/bockbuild/MacSDK/patches/pango-disable-ligatures.patch deleted file mode 100644 index ca9140d5d75..00000000000 --- a/bockbuild/MacSDK/patches/pango-disable-ligatures.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/modules/basic/.libs/basic-coretext.o b/modules/basic/.libs/basic-coretext.o -index f013cbc..270a4f4 100644 -Binary files a/modules/basic/.libs/basic-coretext.o and b/modules/basic/.libs/basic-coretext.o differ -diff --git a/modules/basic/.libs/pango-basic-coretext.so b/modules/basic/.libs/pango-basic-coretext.so -index 2cbf3ef..fec3e0f 100755 -Binary files a/modules/basic/.libs/pango-basic-coretext.so and b/modules/basic/.libs/pango-basic-coretext.so differ -diff --git a/modules/basic/basic-coretext.c b/modules/basic/basic-coretext.c -index 82c2b48..c34460a 100644 ---- a/modules/basic/basic-coretext.c -+++ b/modules/basic/basic-coretext.c -@@ -219,13 +219,17 @@ run_iterator_create (struct RunIterator *iter, - char *copy; - CFDictionaryRef attributes; - CFAttributedStringRef attstr; -+ int val = 0; -+ CFNumberRef number = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &val); - - CFTypeRef keys[] = { -- (CFTypeRef) kCTFontAttributeName -+ (CFTypeRef) kCTFontAttributeName, -+ kCTLigatureAttributeName - }; - - CFTypeRef values[] = { -- ctfont -+ ctfont, -+ number - }; - - /* Initialize RunIterator structure */ -@@ -238,7 +242,7 @@ run_iterator_create (struct RunIterator *iter, - attributes = CFDictionaryCreate (kCFAllocatorDefault, - (const void **)keys, - (const void **)values, -- 1, -+ sizeof (keys) / sizeof (keys[0]), - &kCFCopyStringDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - -@@ -262,6 +266,7 @@ run_iterator_create (struct RunIterator *iter, - iter->line = CTLineCreateWithAttributedString (attstr); - iter->runs = CTLineGetGlyphRuns (iter->line); - -+ CFRelease (number); - CFRelease (attstr); - CFRelease (attributes); diff --git a/bockbuild/MacSDK/patches/pango-fix-ct_font_descriptor_get_weight-crasher.patch b/bockbuild/MacSDK/patches/pango-fix-ct_font_descriptor_get_weight-crasher.patch deleted file mode 100644 index 124692bd21a..00000000000 --- a/bockbuild/MacSDK/patches/pango-fix-ct_font_descriptor_get_weight-crasher.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c -index bcbb173..53b2676 100644 ---- a/pango/pangocoretext-fontmap.c -+++ b/pango/pangocoretext-fontmap.c -@@ -297,7 +297,7 @@ ct_font_descriptor_get_weight (CTFontDescriptorRef desc) - cf_number = (CFNumberRef)CFDictionaryGetValue (dict, - kCTFontWeightTrait); - -- if (CFNumberGetValue (cf_number, kCFNumberCGFloatType, &value)) -+ if (cf_number != NULL && CFNumberGetValue (cf_number, kCFNumberCGFloatType, &value)) - { - if (value < ct_weight_min || value > ct_weight_max) - { diff --git a/bockbuild/MacSDK/patches/pango-relative-config-file.patch b/bockbuild/MacSDK/patches/pango-relative-config-file.patch deleted file mode 100644 index ec7a4c1a8b0..00000000000 --- a/bockbuild/MacSDK/patches/pango-relative-config-file.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: pango/pango-utils.c -=================================================================== ---- a/pango/pango-utils.c (revision 2425) -+++ b/pango/pango-utils.c (working copy) -@@ -567,6 +567,20 @@ read_config_file (const char *filename, - gchar *value = g_key_file_get_value(key_file, group, key, &key_error); - if (value != NULL) - { -+ if (!g_path_is_absolute (value)) -+ { -+ gchar *dirname; -+ gchar *absolute_path; -+ -+ dirname = g_path_get_dirname (filename); -+ absolute_path = g_build_filename (dirname, value, NULL); -+ -+ g_free (dirname); -+ g_free (value); -+ -+ value = absolute_path; -+ } -+ - g_hash_table_insert (ht, - g_strdup_printf ("%s/%s", group, key), - value); diff --git a/bockbuild/MacSDK/patches/pango-system-font-check-version.patch b/bockbuild/MacSDK/patches/pango-system-font-check-version.patch deleted file mode 100644 index 3188dcde47c..00000000000 --- a/bockbuild/MacSDK/patches/pango-system-font-check-version.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/pango/pangocairo-coretextfontmap.c b/pango/pangocairo-coretextfontmap.c -index 6cb3809..c75737c 100644 ---- a/pango/pangocairo-coretextfontmap.c -+++ b/pango/pangocairo-coretextfontmap.c -@@ -185,9 +185,13 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap, - PangoContext *context, - const PangoFontDescription *description) - { -- char *descname = pango_font_description_get_family (description); -+ const char *descname = pango_font_description_get_family (description); -+ SInt32 major, minor; - -- if (strcmp (descname, "-apple-system-font") == 0) -+ Gestalt (gestaltSystemVersionMajor, &major); -+ Gestalt (gestaltSystemVersionMinor, &minor); -+ -+ if (major == 10 && minor>= 11 && strcmp (descname, "-apple-system-font") == 0) - { - PangoCoreTextFont *cfont; - NSFont *sysfont; -@@ -195,7 +199,6 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap, - cairo_matrix_t font_matrix; - PangoCoreTextFontsetKey fontset_key; - PangoCoreTextFontKey key; -- PangoLanguage *language; - PangoFontDescription *tmp_desc; - gboolean synthetic_italic = FALSE; - double abs_size = get_scaled_size (fontmap, context, description); -@@ -207,7 +210,7 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap, - PangoCairoCoreTextFont *cafont = g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT, NULL); - cfont = PANGO_CORE_TEXT_FONT (cafont); - cafont->abs_size = abs_size; -- _pango_core_text_font_set_ctfont (cfont, CFRetain (sysfont)); -+ _pango_core_text_font_set_ctfont (cfont, (CTFontRef)CFRetain (sysfont)); - - tmp_desc = pango_font_description_copy_static (description); - -@@ -261,7 +264,7 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap, - } - } - -- return PANGO_FONT_MAP_CLASS (pango_cairo_core_text_font_map_parent_class)->load_font (fontmap, context, description); -+ return (PangoCoreTextFont*) PANGO_FONT_MAP_CLASS (pango_cairo_core_text_font_map_parent_class)->load_font (PANGO_FONT_MAP (fontmap), context, description); - } - - static void -diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c -index 4234bf1..c395c91 100644 ---- a/pango/pangocoretext-fontmap.c -+++ b/pango/pangocoretext-fontmap.c -@@ -1367,6 +1367,7 @@ pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap) - CTFontCollectionRef collection; - CFArrayRef ctfaces; - CFIndex i, count; -+ SInt32 major, minor; - - ctfontmap->serial = 1; - ctfontmap->families = g_hash_table_new_full (g_str_hash, g_str_equal, -@@ -1430,7 +1431,10 @@ pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap) - CFRelease (dict); - } - -- if (true) -+ Gestalt (gestaltSystemVersionMajor, &major); -+ Gestalt (gestaltSystemVersionMinor, &minor); -+ -+ if (major == 10 && minor >= 11) - { - NSFont *sysfont = [NSFont systemFontOfSize: 0.0]; - NSString *name = [[NSFont fontWithName: [[sysfont fontDescriptor] postscriptName] size: 0.0] familyName]; diff --git a/bockbuild/MacSDK/patches/pango-system-font-single.patch b/bockbuild/MacSDK/patches/pango-system-font-single.patch deleted file mode 100644 index c20822216ca..00000000000 --- a/bockbuild/MacSDK/patches/pango-system-font-single.patch +++ /dev/null @@ -1,543 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 42c04ef..1260b8a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -185,7 +185,7 @@ changequote(,)dnl - if test "x$GCC" = "xyes"; then - case " $CFLAGS " in - *[\ \ ]-Wall[\ \ ]*) ;; -- *) CFLAGS="$CFLAGS -Wall" ;; -+ *) CFLAGS="$CFLAGS -Wall -ObjC" ;; - esac - fi - changequote([,])dnl -diff --git a/pango/pangocairo-coretext.h b/pango/pangocairo-coretext.h -index 31faf9b..f562587 100644 ---- a/pango/pangocairo-coretext.h -+++ b/pango/pangocairo-coretext.h -@@ -43,6 +43,19 @@ struct _PangoCairoCoreTextFontMap - gdouble dpi; - }; - -+struct _PangoCairoCoreTextFont -+{ -+ PangoCoreTextFont font; -+ PangoCairoFontPrivate cf_priv; -+ -+ int abs_size; -+}; -+ -+struct _PangoCairoCoreTextFontClass -+{ -+ PangoCoreTextFontClass parent_class; -+}; -+ - GType pango_cairo_core_text_font_map_get_type (void) G_GNUC_CONST; - - PangoCoreTextFont * -diff --git a/pango/pangocairo-coretextfont.c b/pango/pangocairo-coretextfont.c -index 0f2a9ef..463b6e2 100644 ---- a/pango/pangocairo-coretextfont.c -+++ b/pango/pangocairo-coretextfont.c -@@ -23,6 +23,7 @@ - - #include "config.h" - -+#import - #include - - #include "pango-impl-utils.h" -@@ -32,21 +33,6 @@ - #include "pangocairo-coretext.h" - #include "pangocairo-coretextfont.h" - --struct _PangoCairoCoreTextFont --{ -- PangoCoreTextFont font; -- PangoCairoFontPrivate cf_priv; -- -- int abs_size; --}; -- --struct _PangoCairoCoreTextFontClass --{ -- PangoCoreTextFontClass parent_class; --}; -- -- -- - static cairo_font_face_t *pango_cairo_core_text_font_create_font_face (PangoCairoFont *font); - static PangoFontMetrics *pango_cairo_core_text_font_create_base_metrics_for_context (PangoCairoFont *font, - PangoContext *context); -@@ -204,6 +190,75 @@ pango_cairo_core_text_font_init (PangoCairoCoreTextFont *cafont G_GNUC_UNUSED) - { - } - -+static gchar * -+gchar_from_cf_string (CFStringRef str) -+{ -+ CFIndex len; -+ gchar *buffer; -+ -+ /* GetLength returns the number of UTF-16 pairs, so this number -+ * times 2 should definitely give us enough space for UTF8. -+ * We add one for the terminating zero. -+ */ -+ len = CFStringGetLength (str) * 2 + 1; -+ buffer = g_new0 (char, len); -+ CFStringGetCString (str, buffer, len, kCFStringEncodingUTF8); -+ -+ return buffer; -+} -+ -+static gchar * -+ct_font_descriptor_get_family_name (CTFontDescriptorRef desc, -+ gboolean may_fail) -+{ -+ CFStringRef cf_str; -+ char *buffer; -+ -+ cf_str = CTFontDescriptorCopyAttribute (desc, kCTFontFamilyNameAttribute); -+ if (!cf_str) -+ { -+ int i; -+ -+ /* No font family name is set, try to retrieve font name and deduce -+ * the family name from that instead. -+ */ -+ cf_str = CTFontDescriptorCopyAttribute (desc, kCTFontNameAttribute); -+ if (!cf_str) -+ { -+ if (may_fail) -+ return NULL; -+ -+ /* This font is likely broken, return a default family name ... */ -+ return g_strdup ("Sans"); -+ } -+ -+ buffer = gchar_from_cf_string (cf_str); -+ CFRelease (cf_str); -+ -+ for (i = 0; i < strlen (buffer); i++) -+ if (buffer[i] == '-') -+ break; -+ -+ if (i < strlen (buffer)) -+ { -+ char *ret; -+ -+ ret = g_strndup (buffer, i); -+ g_free (buffer); -+ -+ return ret; -+ } -+ else -+ return buffer; -+ } -+ /* else */ -+ -+ buffer = gchar_from_cf_string (cf_str); -+ CFRelease (cf_str); -+ -+ return buffer; -+} -+ - PangoCoreTextFont * - _pango_cairo_core_text_font_new (PangoCairoCoreTextFontMap *cafontmap, - PangoCoreTextFontKey *key) -diff --git a/pango/pangocairo-coretextfontmap.c b/pango/pangocairo-coretextfontmap.c -index ba5dcec..6cb3809 100644 ---- a/pango/pangocairo-coretextfontmap.c -+++ b/pango/pangocairo-coretextfontmap.c -@@ -26,6 +26,9 @@ - #include "pangocairo.h" - #include "pangocairo-private.h" - #include "pangocairo-coretext.h" -+#include "pangocairo-coretextfont.h" -+ -+#import - - typedef struct _PangoCairoCoreTextFontMapClass PangoCairoCoreTextFontMapClass; - -@@ -161,6 +164,106 @@ pango_cairo_core_text_font_map_context_key_equal (PangoCoreTextFontMap *fontmap - return cairo_font_options_equal (key_a, key_b); - } - -+static int -+get_scaled_size (PangoCoreTextFontMap *fontmap, -+ PangoContext *context, -+ const PangoFontDescription *desc) -+{ -+ double size = pango_font_description_get_size (desc); -+ -+ if (!pango_font_description_get_size_is_absolute (desc)) -+ { -+ double dpi = pango_cairo_core_text_font_map_get_resolution_core_text (fontmap, context); -+ size = size * dpi / 72.; -+ } -+ -+ return .5 + pango_matrix_get_font_scale_factor (pango_context_get_matrix (context)) * size; -+} -+ -+static PangoCoreTextFont * -+pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap, -+ PangoContext *context, -+ const PangoFontDescription *description) -+{ -+ char *descname = pango_font_description_get_family (description); -+ -+ if (strcmp (descname, "-apple-system-font") == 0) -+ { -+ PangoCoreTextFont *cfont; -+ NSFont *sysfont; -+ CTFontDescriptorRef ctfontdescriptor; -+ cairo_matrix_t font_matrix; -+ PangoCoreTextFontsetKey fontset_key; -+ PangoCoreTextFontKey key; -+ PangoLanguage *language; -+ PangoFontDescription *tmp_desc; -+ gboolean synthetic_italic = FALSE; -+ double abs_size = get_scaled_size (fontmap, context, description); -+ double size = pango_units_to_double (abs_size) / pango_matrix_get_font_scale_factor (pango_context_get_matrix (context)); -+ -+ sysfont = [NSFont systemFontOfSize: size]; -+ ctfontdescriptor = (CTFontDescriptorRef)[sysfont fontDescriptor]; -+ -+ PangoCairoCoreTextFont *cafont = g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT, NULL); -+ cfont = PANGO_CORE_TEXT_FONT (cafont); -+ cafont->abs_size = abs_size; -+ _pango_core_text_font_set_ctfont (cfont, CFRetain (sysfont)); -+ -+ tmp_desc = pango_font_description_copy_static (description); -+ -+ _pango_core_text_fontset_key_init (&fontset_key, -+ fontmap, -+ context, -+ tmp_desc, -+ pango_context_get_language (context)); -+ _pango_core_text_font_key_init (&key, -+ fontmap, -+ &fontset_key, -+ ctfontdescriptor, -+ synthetic_italic); -+ -+ if (pango_core_text_font_key_get_synthetic_italic (&key)) -+ synthetic_italic = TRUE; -+ -+ if (synthetic_italic) -+ { -+ cairo_matrix_init (&font_matrix, -+ 1, 0, -+ -0.25, 1, -+ 0, 0); -+ } -+ else -+ { -+ cairo_matrix_init_identity (&font_matrix); -+ } -+ -+ cairo_matrix_scale (&font_matrix, size, size); -+ -+ _pango_cairo_font_private_initialize (&cafont->cf_priv, -+ (PangoCairoFont *)cafont, -+ pango_core_text_font_key_get_gravity (&key), -+ pango_core_text_font_key_get_context_key (&key), -+ pango_core_text_font_key_get_matrix (&key), -+ &font_matrix); -+ -+ PangoCoreTextFont *tmp_font = _pango_core_text_font_map_lookup_font (fontmap, &key); -+ if (tmp_font) -+ { -+ g_object_ref (tmp_font); -+ return tmp_font; -+ } -+ else -+ { -+ g_object_ref (cfont); -+ _pango_core_text_font_map_add (PANGO_CORE_TEXT_FONT_MAP (fontmap), &key, cfont); -+ -+ return cfont; -+ } -+ } -+ -+ return PANGO_FONT_MAP_CLASS (pango_cairo_core_text_font_map_parent_class)->load_font (fontmap, context, description); -+} -+ - static void - pango_cairo_core_text_font_map_class_init (PangoCairoCoreTextFontMapClass *class) - { -@@ -170,6 +273,7 @@ pango_cairo_core_text_font_map_class_init (PangoCairoCoreTextFontMapClass *class - - object_class->finalize = pango_cairo_core_text_font_map_finalize; - -+ fontmap_class->load_font = pango_cairo_core_text_font_map_load_font; - fontmap_class->get_serial = pango_cairo_core_text_font_map_get_serial; - fontmap_class->changed = pango_cairo_core_text_font_map_changed; - -diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c -index bcbb173..4234bf1 100644 ---- a/pango/pangocoretext-fontmap.c -+++ b/pango/pangocoretext-fontmap.c -@@ -28,6 +28,7 @@ - #include "pango-impl-utils.h" - #include "modules.h" - -+#import - #include - - typedef struct _FontHashKey FontHashKey; -@@ -826,28 +827,12 @@ get_scaled_size (PangoCoreTextFontMap *fontmap, - return .5 + pango_matrix_get_font_scale_factor (pango_context_get_matrix (context)) * size; - } - -- --/* -- * PangoCoreTextFontsetKey -- */ --struct _PangoCoreTextFontsetKey --{ -- PangoCoreTextFontMap *fontmap; -- PangoLanguage *language; -- PangoFontDescription *desc; -- PangoMatrix matrix; -- int pixelsize; -- double resolution; -- PangoGravity gravity; -- gpointer context_key; --}; -- --static void --pango_core_text_fontset_key_init (PangoCoreTextFontsetKey *key, -- PangoCoreTextFontMap *fontmap, -- PangoContext *context, -- const PangoFontDescription *desc, -- PangoLanguage *language) -+void -+_pango_core_text_fontset_key_init (PangoCoreTextFontsetKey *key, -+ PangoCoreTextFontMap *fontmap, -+ PangoContext *context, -+ const PangoFontDescription *desc, -+ PangoLanguage *language) - { - if (!language && context) - language = pango_context_get_language (context); -@@ -960,27 +945,12 @@ pango_core_text_fontset_key_get_context_key (const PangoCoreTextFontsetKey *key) - return key->context_key; - } - --/* -- * PangoCoreTextFontKey -- */ --struct _PangoCoreTextFontKey --{ -- PangoCoreTextFontMap *fontmap; -- CTFontDescriptorRef ctfontdescriptor; -- PangoMatrix matrix; -- PangoGravity gravity; -- int pixelsize; -- double resolution; -- gboolean synthetic_italic; -- gpointer context_key; --}; -- --static void --pango_core_text_font_key_init (PangoCoreTextFontKey *key, -- PangoCoreTextFontMap *ctfontmap, -- PangoCoreTextFontsetKey *fontset_key, -- CTFontDescriptorRef ctdescriptor, -- gboolean synthetic_italic) -+void -+_pango_core_text_font_key_init (PangoCoreTextFontKey *key, -+ PangoCoreTextFontMap *ctfontmap, -+ PangoCoreTextFontsetKey *fontset_key, -+ CTFontDescriptorRef ctdescriptor, -+ gboolean synthetic_italic) - { - key->fontmap = ctfontmap; - key->ctfontdescriptor = ctdescriptor; -@@ -1104,14 +1074,24 @@ pango_core_text_font_key_get_ctfontdescriptor (const PangoCoreTextFontKey *key) - return key->ctfontdescriptor; - } - -+PangoCoreTextFont * -+_pango_core_text_font_map_lookup_font (PangoCoreTextFontMap *fontmap, -+ PangoCoreTextFontKey *key) -+{ -+ return g_hash_table_lookup (fontmap->font_hash, key); -+} - -- --static void --pango_core_text_font_map_add (PangoCoreTextFontMap *ctfontmap, -- PangoCoreTextFontKey *key, -- PangoCoreTextFont *ctfont) -+void -+_pango_core_text_font_map_add (PangoCoreTextFontMap *ctfontmap, -+ PangoCoreTextFontKey *key, -+ PangoCoreTextFont *ctfont) - { - PangoCoreTextFontKey *key_copy; -+ PangoCoreTextFont *tmp; -+ -+ tmp = g_hash_table_lookup (ctfontmap->font_hash, key); -+ if (tmp) -+ return; - - _pango_core_text_font_set_font_map (ctfont, ctfontmap); - -@@ -1130,8 +1110,8 @@ pango_core_text_font_map_new_font (PangoCoreTextFontMap *fontmap, - PangoCoreTextFont *font; - PangoCoreTextFontKey key; - -- pango_core_text_font_key_init (&key, fontmap, fontset_key, ctfontdescriptor, -- synthetic_italic); -+ _pango_core_text_font_key_init (&key, fontmap, fontset_key, ctfontdescriptor, -+ synthetic_italic); - - font = g_hash_table_lookup (fontmap->font_hash, &key); - if (font) -@@ -1144,7 +1124,7 @@ pango_core_text_font_map_new_font (PangoCoreTextFontMap *fontmap, - if (!font) - return NULL; - -- pango_core_text_font_map_add (fontmap, &key, font); -+ _pango_core_text_font_map_add (fontmap, &key, font); - - return font; - } -@@ -1295,8 +1275,8 @@ pango_core_text_font_map_load_fontset (PangoFontMap *fontmap, - PangoCoreTextFontMap *ctfontmap = PANGO_CORE_TEXT_FONT_MAP (fontmap); - static gboolean warned_full_fallback = FALSE; /* MT-safe */ - -- pango_core_text_fontset_key_init (&key, ctfontmap, -- context, desc, language); -+ _pango_core_text_fontset_key_init (&key, ctfontmap, -+ context, desc, language); - - fontset = g_hash_table_lookup (ctfontmap->fontset_hash, &key); - -@@ -1320,8 +1300,8 @@ pango_core_text_font_map_load_fontset (PangoFontMap *fontmap, - tmp_desc = pango_font_description_copy_static (desc); - pango_font_description_set_family_static (tmp_desc, "Sans"); - -- pango_core_text_fontset_key_init (&key, ctfontmap, context, tmp_desc, -- language); -+ _pango_core_text_fontset_key_init (&key, ctfontmap, context, tmp_desc, -+ language); - - fontset = g_hash_table_lookup (ctfontmap->fontset_hash, &key); - if (G_LIKELY (fontset)) -@@ -1450,6 +1430,53 @@ pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap) - CFRelease (dict); - } - -+ if (true) -+ { -+ NSFont *sysfont = [NSFont systemFontOfSize: 0.0]; -+ NSString *name = [[NSFont fontWithName: [[sysfont fontDescriptor] postscriptName] size: 0.0] familyName]; -+ -+ NSArray *fontfaces = [[NSFontManager sharedFontManager] availableMembersOfFontFamily: name]; -+ int num_faces = [fontfaces count]; -+ CFRelease (name); -+ -+ for (int faceindex = 0; faceindex < num_faces; faceindex++) -+ { -+ SInt64 font_traits; -+ char *buffer; -+ char *family_name; -+ CFNumberRef number; -+ CFDictionaryRef dict; -+ CTFontDescriptorRef desc = [sysfont fontDescriptor]; -+ -+ buffer = ct_font_descriptor_get_family_name (desc, TRUE); -+ if (!buffer) -+ continue; -+ -+ family_name = g_utf8_casefold (buffer, -1); -+ family = g_hash_table_lookup (ctfontmap->families, family_name); -+ if (!family) -+ { -+ family = g_object_new (PANGO_TYPE_CORE_TEXT_FAMILY, NULL); -+ g_hash_table_insert (ctfontmap->families, g_strdup ("-apple-system-font"), family); -+ family->family_name = g_strdup (buffer); -+ } -+ -+ g_free (buffer); -+ g_free (family_name); -+ -+ dict = CTFontDescriptorCopyAttribute (desc, kCTFontTraitsAttribute); -+ number = (CFNumberRef)CFDictionaryGetValue (dict, kCTFontSymbolicTrait); -+ -+ if (CFNumberGetValue (number, kCFNumberSInt64Type, &font_traits)) -+ { -+ if ((font_traits & kCTFontMonoSpaceTrait) == kCTFontMonoSpaceTrait) -+ family->is_monospace = TRUE; -+ } -+ -+ CFRelease (dict); -+ } -+ } -+ - /* Insert aliases */ - family = g_object_new (PANGO_TYPE_CORE_TEXT_FAMILY, NULL); - family->family_name = g_strdup ("Sans"); -diff --git a/pango/pangocoretext-private.h b/pango/pangocoretext-private.h -index 8076eae..5c6ce41 100644 ---- a/pango/pangocoretext-private.h -+++ b/pango/pangocoretext-private.h -@@ -81,6 +81,30 @@ struct _PangoCoreTextFontMapClass - PangoContext *context); - }; - -+struct _PangoCoreTextFontKey -+{ -+ PangoCoreTextFontMap *fontmap; -+ CTFontDescriptorRef ctfontdescriptor; -+ PangoMatrix matrix; -+ PangoGravity gravity; -+ int pixelsize; -+ double resolution; -+ gboolean synthetic_italic; -+ gpointer context_key; -+}; -+ -+struct _PangoCoreTextFontsetKey -+{ -+ PangoCoreTextFontMap *fontmap; -+ PangoLanguage *language; -+ PangoFontDescription *desc; -+ PangoMatrix matrix; -+ int pixelsize; -+ double resolution; -+ PangoGravity gravity; -+ gpointer context_key; -+}; -+ - - GType pango_core_text_font_map_get_type (void) G_GNUC_CONST; - -@@ -97,6 +121,24 @@ void _pango_core_text_font_set_font_key (PangoCoreTextF - void _pango_core_text_font_set_ctfont (PangoCoreTextFont *font, - CTFontRef font_ref); - -+void _pango_core_text_fontset_key_init (PangoCoreTextFontsetKey *key, -+ PangoCoreTextFontMap *fontmap, -+ PangoContext *context, -+ const PangoFontDescription *desc, -+ PangoLanguage *language); -+void _pango_core_text_font_key_init (PangoCoreTextFontKey *key, -+ PangoCoreTextFontMap *ctfontmap, -+ PangoCoreTextFontsetKey *fontset_key, -+ CTFontDescriptorRef ctdescriptor, -+ gboolean synthetic_italic); -+ -+void _pango_core_text_font_map_add (PangoCoreTextFontMap *ctfontmap, -+ PangoCoreTextFontKey *key, -+ PangoCoreTextFont *ctfont); -+ -+PangoCoreTextFont *_pango_core_text_font_map_lookup_font (PangoCoreTextFontMap *fontmap, -+ PangoCoreTextFontKey *key); -+ - PangoFontDescription *_pango_core_text_font_description_from_ct_font_descriptor (CTFontDescriptorRef desc); - - int pango_core_text_font_key_get_absolute_size (const PangoCoreTextFontKey *key); diff --git a/bockbuild/MacSDK/patches/tiff-4.0.2-macosx-2.patch b/bockbuild/MacSDK/patches/tiff-4.0.2-macosx-2.patch deleted file mode 100644 index a5f74df5a68..00000000000 --- a/bockbuild/MacSDK/patches/tiff-4.0.2-macosx-2.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/libs/tiff-4.0.2/tools/tiffgt.c b/libs/tiff-4.0.2/tools/tiffgt.c -index de42039..4c8e509 100644 ---- a/tools/tiffgt.c -+++ b/tools/tiffgt.c -@@ -31,11 +31,16 @@ - #include - #include - --#if HAVE_APPLE_OPENGL_FRAMEWORK -+#if HAVE_OPENGL_GL_H - # include -+#endif -+#if HAVE_GLUT_GLUT_H - # include --#else -+#endif -+#if HAVE_GL_GL_H - # include -+#endif -+#if HAVE_GL_GLUT_H - # include - #endif diff --git a/bockbuild/MacSDK/pixman.py b/bockbuild/MacSDK/pixman.py deleted file mode 100644 index c0394a9bdfe..00000000000 --- a/bockbuild/MacSDK/pixman.py +++ /dev/null @@ -1,6 +0,0 @@ -class PixmanPackage (CairoGraphicsPackage): - - def __init__(self): - CairoGraphicsPackage.__init__(self, 'pixman', '0.30.0') - -PixmanPackage() diff --git a/bockbuild/MacSDK/pkg-config.py b/bockbuild/MacSDK/pkg-config.py deleted file mode 100644 index 6c62cbe047d..00000000000 --- a/bockbuild/MacSDK/pkg-config.py +++ /dev/null @@ -1,4 +0,0 @@ -package = FreeDesktopPackage('%{name}', 'pkg-config', '0.27', - configure_flags=["--with-internal-glib"]) - -package.needs_lipo = True diff --git a/external/bockbuild b/external/bockbuild index 6ed454e133f..ac5206d1bc9 160000 --- a/external/bockbuild +++ b/external/bockbuild @@ -1 +1 @@ -Subproject commit 6ed454e133f5e9361c8c0b53ef0f8f868df8801c +Subproject commit ac5206d1bc926fa2fea7a457b49ac37471135be9 -- 2.25.1