diff -Nru cairo-1.12.3+git20120521.aed94a5b/aclocal.m4 cairo-1.12.3+git20120530.25317dbd/aclocal.m4
--- cairo-1.12.3+git20120521.aed94a5b/aclocal.m4 2012-05-22 11:06:24.000000000 +0000
+++ cairo-1.12.3+git20120530.25317dbd/aclocal.m4 2012-05-31 07:31:29.000000000 +0000
@@ -14,8 +14,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
diff -Nru cairo-1.12.3+git20120521.aed94a5b/autogen.sh cairo-1.12.3+git20120530.25317dbd/autogen.sh
--- cairo-1.12.3+git20120521.aed94a5b/autogen.sh 2012-04-15 08:25:49.000000000 +0000
+++ cairo-1.12.3+git20120530.25317dbd/autogen.sh 2012-05-27 08:23:45.000000000 +0000
@@ -15,8 +15,9 @@
GTKDOCIZE=`which gtkdocize`
if test -z $GTKDOCIZE; then
- echo "*** No GTK-Doc found, please install it ***"
- exit 1
+ echo "*** No GTK-Doc found, documentation won't be generated ***"
+else
+ gtkdocize || exit $?
fi
# create dummy */Makefile.am.features and ChangeLog to make automake happy
@@ -24,8 +25,7 @@
> src/Makefile.am.features
touch ChangeLog
-gtkdocize || exit $?
-autoreconf --force --install --verbose || exit $?
+autoreconf --install --verbose || exit $?
cd $ORIGDIR
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff -Nru cairo-1.12.3+git20120521.aed94a5b/boilerplate/Makefile.in cairo-1.12.3+git20120530.25317dbd/boilerplate/Makefile.in
--- cairo-1.12.3+git20120521.aed94a5b/boilerplate/Makefile.in 2012-05-22 11:07:49.000000000 +0000
+++ cairo-1.12.3+git20120530.25317dbd/boilerplate/Makefile.in 2012-05-31 07:32:54.000000000 +0000
@@ -1047,9 +1047,9 @@
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu boilerplate/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign boilerplate/Makefile'; \
$(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu boilerplate/Makefile
+ $(AUTOMAKE) --foreign boilerplate/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff -Nru cairo-1.12.3+git20120521.aed94a5b/build/install-sh cairo-1.12.3+git20120530.25317dbd/build/install-sh
--- cairo-1.12.3+git20120521.aed94a5b/build/install-sh 2012-05-22 11:06:29.000000000 +0000
+++ cairo-1.12.3+git20120530.25317dbd/build/install-sh 2012-05-31 07:31:25.000000000 +0000
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-01-19.21; # UTC
+scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -156,10 +156,6 @@
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
- # Protect names problematic for `test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
shift;;
-T) no_target_directory=true;;
@@ -190,10 +186,6 @@
fi
shift # arg
dst_arg=$arg
- # Protect names problematic for `test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
done
fi
@@ -208,11 +200,7 @@
fi
if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
+ trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
@@ -240,9 +228,9 @@
for src
do
- # Protect names problematic for `test' and other utilities.
+ # Protect names starting with `-'.
case $src in
- -* | [=\(\)!]) src=./$src;;
+ -*) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -264,7 +252,12 @@
echo "$0: no destination specified." >&2
exit 1
fi
+
dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
@@ -392,7 +385,7 @@
case $dstdir in
/*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
+ -*) prefix='./';;
*) prefix='';;
esac
@@ -410,7 +403,7 @@
for d
do
- test X"$d" = X && continue
+ test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
diff -Nru cairo-1.12.3+git20120521.aed94a5b/ChangeLog cairo-1.12.3+git20120530.25317dbd/ChangeLog
--- cairo-1.12.3+git20120521.aed94a5b/ChangeLog 2012-05-22 11:09:40.000000000 +0000
+++ cairo-1.12.3+git20120530.25317dbd/ChangeLog 2012-05-31 07:34:46.000000000 +0000
@@ -1,5 +1,421 @@
# Generated by configure. Do not edit.
+commit 25317dbd88e96bb49fa760b50fe705a6a79ee2ec
+Author: Yuanhan Liu cairo_surface_mark_dirty()
after modifying it.
Example 1. Directly modifying an image surface
+Example 1. Directly modifying an image surface
void modify_image_surface (cairo_surface_t *surface) @@ -1445,10 +1445,13 @@ may be limited to theextents
orNULL
for the whole surface-Note, the use of the original surface as a target or source whilst it is -mapped is undefined. The result of mapping the surface multiple times is -undefined. Calling
cairo_surface_destroy()
orcairo_surface_finish()
on the -resulting image surface results in undefined behavior. +Note, the use of the original surface as a target or source whilst +it is mapped is undefined. The result of mapping the surface +multiple times is undefined. Callingcairo_surface_destroy()
or +cairo_surface_finish()
on the resulting image surface results in +undefined behavior. Changing the device transform of the image +surface or ofsurface
before the image surface is unmapped results +in undefined behavior.diff -Nru cairo-1.12.3+git20120521.aed94a5b/doc/public/Makefile.in cairo-1.12.3+git20120530.25317dbd/doc/public/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/doc/public/Makefile.in 2012-05-22 11:07:30.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/doc/public/Makefile.in 2012-05-31 07:32:35.000000000 +0000 @@ -1163,9 +1163,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/public/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/public/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu doc/public/Makefile + $(AUTOMAKE) --foreign doc/public/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/doc/public/xml/cairo-surface.xml cairo-1.12.3+git20120530.25317dbd/doc/public/xml/cairo-surface.xml --- cairo-1.12.3+git20120521.aed94a5b/doc/public/xml/cairo-surface.xml 2012-05-22 11:08:37.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/doc/public/xml/cairo-surface.xml 2012-05-31 07:33:43.000000000 +0000 @@ -1051,10 +1051,13 @@ may be limited to the
@@ -1467,7 +1470,9 @@ must use cairo_surface_unmap_image()
to destroy this image surface. This function always returns a valid pointer, but it will return a pointer to a "nil" surface ifother
is already in an error state -or any other error occurs. +or any other error occurs. If the returned pointer does not have an +error status, it is guaranteed to be an image surface whose format +is notCAIRO_FORMAT_INVALID
.extents orNULL for the whole surface-Note, the use of the original surface as a target or source whilst it is -mapped is undefined. The result of mapping the surface multiple times is -undefined. Calling cairo_surface_destroy() orcairo_surface_finish() on the -resulting image surface results in undefined behavior. +Note, the use of the original surface as a target or source whilst +it is mapped is undefined. The result of mapping the surface +multiple times is undefined. Callingcairo_surface_destroy() or +cairo_surface_finish() on the resulting image surface results in +undefined behavior. Changing the device transform of the image +surface or ofsurface before the image surface is unmapped results +in undefined behavior.@@ -1064,7 +1067,9 @@ must use surface :an existing surface used to extract the image from cairo_surface_unmap_image() to destroy this image surface. This function always returns a valid pointer, but it will return a pointer to a "nil" surface ifother is already in an error state -or any other error occurs. +or any other error occurs. If the returned pointer does not have an +error status, it is guaranteed to be an image surface whose format +is notCAIRO_FORMAT_INVALID .Since 1.12 cairo_surface_unmap_image () diff -Nru cairo-1.12.3+git20120521.aed94a5b/INSTALL cairo-1.12.3+git20120530.25317dbd/INSTALL --- cairo-1.12.3+git20120521.aed94a5b/INSTALL 2012-05-22 11:06:32.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/INSTALL 2012-05-22 11:10:45.000000000 +0000 @@ -1,370 +1,184 @@ -Installation Instructions -************************* +Quick-start build instructions +------------------------------ +1) Configure the package: -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. + ./configure - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. +2) Compile it: -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. + make +3) Install it: + + make install + +This final step may require temporary root access (eg. with sudo) if +you don't have write permission to the directory in which cairo will +be installed. + +NOTE: If you are working with source from git/cvs rather than from a tar +file, then you should use ./autogen.sh in place of ./configure +anywhere it is mentioned in these instructions. + +More detailed build instructions +-------------------------------- +1) Configure the package + + The first step in building cairo is to configure the package by + running the configure script. [Note: if you don't have a configure + script, skip down below to the Extremely detailed build + instructions.] + + The configure script attempts to automatically detect as much as + possible about your system. So, you should primarily just accept + its defaults by running: + + ./configure + + The configure script does accept a large number of options for + fine-tuning its behavior. See "./configure --help" for a complete + list. The most commonly used options are discussed here. + + --prefix=PREFIX + + This option specifies the directory under which the software + should be installed. By default configure will choose a + directory such as /usr/local. If you would like to install + cairo to some other location, pass the director to configure + with the --prefix option. For example: + + ./configure --prefix=/opt/cairo + + would install cairo into the /opt/cairo directory. You could + also choose a prefix directory within your home directory if + you don't have write access to any system-wide directory. + + After installing into a custom prefix, you will need to set + some environment variables to allow the software to be + found. Assuming the /opt/cairo prefix and assuming you are + using the bash shell, the following environment variables + should be set: + + PKG_CONFIG_PATH=/opt/cairo/lib/pkgconfig + LD_LIBRARY_PATH=/opt/cairo/lib + export PKG_CONFIG_PATH LD_LIBRARY_PATH + + (NOTE: On Mac OS X, at least, use DYLD_LIBRARY_PATH in place + of LD_LIBRARY_PATH above.) + + --enable-XYZ + --enable-XYZ=yes + --enable-XYZ=auto + --enable-XYZ=no + --disable-XYZ + + Cairo's various font and surface backends and other features can be + enabled or disabled at configure time. Features can be divided into + three categories based on their default state: + + * default=yes: These are the recommended features like PNG functions + and PS/PDF/SVG backends. It is highly recommended to not disable + these features but if that's really what one wants, they can be + disabled using --disable-XYZ. + + * default=auto: These are the "native" features, that is, they are + platform specific, like the Xlib surface backend. You probably + want one or two of these. They will be automatically enabled if + all their required facilities are available. Or you can use + --enable-XYZ or --disable-XYZ to make your desire clear, and then + cairo errs during configure if your intention cannot be followed. + + * default=no: These are the "experimental" features, and hence by + default off. Use --enabled-XYZ to enable them. + + The list of all features and their default state can be seen in the + output of ./configure --help. + +2) Compile the package: + + This step is very simple. Just: + + make + + The Makefiles included with cairo are designed to work on as many + different systems as possible. + + When cairo is compiled, you can also run some automated tests of + cairo with: + + make check + + NOTE: Some versions of X servers will cause the -xlib tests to + report failures in make check even when cairo is working just + fine. If you see failures in nothing but -xlib tests, please + examine the corresponding -xlib-out.png images and compare them to + the -ref.png reference images (the -xlib-diff.png images might also + be useful). If the results seem "close enough" please do not report + a bug against cairo as the "failures" you are seeing are just due + to subtle variations in X server implementations. + +3) Install the package: + + The final step is to install the package with: + + make install + + If you are installing to a system-wide location you may need to + temporarily acquire root access in order to perform this + operation. A good way to do this is to use the sudo program: + + sudo make install + +Extremely detailed build instructions +------------------------------------- +So you want to build cairo but it didn't come with a configure +script. This is probably because you have checked out the latest +in-development code via git. If you need to be on the bleeding edge, +(for example, because you're wanting to develop some aspect of cairo +itself), then you're in the right place and should read on. + +However, if you don't need such a bleeding-edge version of cairo, then +you might prefer to start by building the latest stable cairo release: + + http://cairographics.org/releases + +or perhaps the latest (unstable) development snapshot: + + http://cairographics.org/snapshots + +There you'll find nicely packaged tar files that include a configure +script so you can go back the the simpler instructions above. + +But you're still reading, so you're someone that loves to +learn. Excellent! We hope you'll learn enough to make some excellent +contributions to cairo. Since you're not using a packaged tar file, +you're going to need some additional tools beyond just a C compiler in +order to compile cairo. Specifically, you need the following utilities: + + automake + autoconf + autoheader + aclocal + libtoolize + pkg-config [at least version 0.16] + gtk-doc (recommended) + +Hopefully your platform of choice has packages readily available so +that you can easily install things with your system's package +management tool, (such as "apt-get install automake" on Debian or "yum +install automake" on Fedora, etc.). Note that Mac OS X ships with +glibtoolize instead of libtoolize. + +Once you have all of those packages installed, the next step is to run +the autogen.sh script. That can be as simple as: + + ./autogen.sh + +But before you run that command, note that the autogen.sh script +accepts all the same arguments as the configure script, (and in fact, +will generate the configure script and run it with the arguments you +provide). So go back up to step (1) above and see what additional +arguments you might want to pass, (such as prefix). Then continue with +the instructions, simply using ./autogen.sh in place of ./configure. + +Happy hacking! diff -Nru cairo-1.12.3+git20120521.aed94a5b/Makefile.in cairo-1.12.3+git20120530.25317dbd/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/Makefile.in 2012-05-22 11:06:32.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/Makefile.in 2012-05-31 07:31:36.000000000 +0000 @@ -488,15 +488,15 @@ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/perf/Makefile.in cairo-1.12.3+git20120530.25317dbd/perf/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/perf/Makefile.in 2012-05-22 11:06:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/perf/Makefile.in 2012-05-31 07:31:33.000000000 +0000 @@ -590,9 +590,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu perf/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign perf/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu perf/Makefile + $(AUTOMAKE) --foreign perf/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/perf/micro/Makefile.in cairo-1.12.3+git20120530.25317dbd/perf/micro/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/perf/micro/Makefile.in 2012-05-22 11:06:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/perf/micro/Makefile.in 2012-05-31 07:31:33.000000000 +0000 @@ -443,9 +443,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu perf/micro/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign perf/micro/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu perf/micro/Makefile + $(AUTOMAKE) --foreign perf/micro/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-bentley-ottmann-rectangular.c cairo-1.12.3+git20120530.25317dbd/src/cairo-bentley-ottmann-rectangular.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-bentley-ottmann-rectangular.c 2012-04-19 15:28:24.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-bentley-ottmann-rectangular.c 2012-05-24 06:37:16.000000000 +0000 @@ -487,6 +487,8 @@ } if (winding == 0) { + if (left->right != NULL) + edge_end_box (sweep, left, top); pos = right; continue; } @@ -557,7 +559,7 @@ } static inline cairo_bool_t -sweep_line_delete (sweep_line_t *sweep, rectangle_t *rectangle) +sweep_line_delete (sweep_line_t *sweep, rectangle_t *rectangle) { cairo_bool_t update; @@ -651,7 +653,6 @@ active_edges_to_traps (&sweep_line); update = FALSE; } - sweep_line.current_y = rectangle->bottom; } diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-directfb-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-directfb-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-directfb-surface.c 2012-03-22 22:31:51.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-directfb-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -40,7 +40,7 @@ #include "cairo-compositor-private.h" #include "cairo-default-context-private.h" #include "cairo-error-private.h" -#include "cairo-image-surface-private.h" +#include "cairo-image-surface-inline.h" #include "cairo-pattern-private.h" #include "cairo-surface-backend-private.h" #include "cairo-surface-fallback-private.h" @@ -171,7 +171,7 @@ return _cairo_image_surface_finish (abstract_surface); } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_dfb_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { @@ -184,7 +184,7 @@ int pitch; if (buffer->Lock (buffer, DSLF_READ | DSLF_WRITE, &data, &pitch)) - return _cairo_surface_create_in_error(_cairo_error (CAIRO_STATUS_NO_MEMORY)); + return _cairo_image_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); image = pixman_image_create_bits (surface->image.pixman_format, surface->image.width, @@ -192,19 +192,20 @@ data, pitch); if (image == NULL) { buffer->Unlock (buffer); - return _cairo_surface_create_in_error(_cairo_error (CAIRO_STATUS_NO_MEMORY)); + return _cairo_image_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); } _cairo_image_surface_init (&surface->image, image, surface->image.pixman_format); } - return _cairo_image_surface_map_to_image (&surface->image, extents); + return _cairo_surface_map_to_image (&surface->image.base, extents); } static cairo_int_status_t _cairo_dfb_surface_unmap_image (void *abstract_surface, cairo_image_surface_t *image) { - return CAIRO_INT_STATUS_SUCCESS; + cairo_dfb_surface_t *surface = abstract_surface; + return _cairo_surface_unmap_image (&surface->image.base, image); } static cairo_status_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-fallback-compositor.c cairo-1.12.3+git20120530.25317dbd/src/cairo-fallback-compositor.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-fallback-compositor.c 2012-03-01 20:07:54.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-fallback-compositor.c 2012-05-27 08:23:45.000000000 +0000 @@ -42,6 +42,7 @@ #include "cairoint.h" #include "cairo-compositor-private.h" +#include "cairo-image-surface-private.h" #include "cairo-surface-offset-private.h" /* high-level compositor interface */ @@ -50,41 +51,43 @@ _cairo_fallback_compositor_paint (const cairo_compositor_t *_compositor, cairo_composite_rectangles_t *extents) { - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_int_status_t status; TRACE ((stderr, "%s\n", __FUNCTION__)); - image = cairo_surface_map_to_image (extents->surface, &extents->unbounded); - status = _cairo_surface_offset_paint (image, + + image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded); + + status = _cairo_surface_offset_paint (&image->base, extents->unbounded.x, extents->unbounded.y, extents->op, &extents->source_pattern.base, extents->clip); - cairo_surface_unmap_image (extents->surface, image); - return status; + return _cairo_surface_unmap_image (extents->surface, image); } static cairo_int_status_t _cairo_fallback_compositor_mask (const cairo_compositor_t *_compositor, cairo_composite_rectangles_t *extents) { - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_int_status_t status; TRACE ((stderr, "%s\n", __FUNCTION__)); - image = cairo_surface_map_to_image (extents->surface, &extents->unbounded); - status = _cairo_surface_offset_mask (image, + + image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded); + + status = _cairo_surface_offset_mask (&image->base, extents->unbounded.x, extents->unbounded.y, extents->op, &extents->source_pattern.base, &extents->mask_pattern.base, extents->clip); - cairo_surface_unmap_image (extents->surface, image); - return status; + return _cairo_surface_unmap_image (extents->surface, image); } static cairo_int_status_t @@ -97,12 +100,14 @@ double tolerance, cairo_antialias_t antialias) { - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_int_status_t status; TRACE ((stderr, "%s\n", __FUNCTION__)); - image = cairo_surface_map_to_image (extents->surface, &extents->unbounded); - status = _cairo_surface_offset_stroke (image, + + image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded); + + status = _cairo_surface_offset_stroke (&image->base, extents->unbounded.x, extents->unbounded.y, extents->op, @@ -112,9 +117,8 @@ tolerance, antialias, extents->clip); - cairo_surface_unmap_image (extents->surface, image); - return status; + return _cairo_surface_unmap_image (extents->surface, image); } static cairo_int_status_t @@ -125,12 +129,14 @@ double tolerance, cairo_antialias_t antialias) { - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_int_status_t status; TRACE ((stderr, "%s\n", __FUNCTION__)); - image = cairo_surface_map_to_image (extents->surface, &extents->unbounded); - status = _cairo_surface_offset_fill (image, + + image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded); + + status = _cairo_surface_offset_fill (&image->base, extents->unbounded.x, extents->unbounded.y, extents->op, @@ -138,9 +144,8 @@ path, fill_rule, tolerance, antialias, extents->clip); - cairo_surface_unmap_image (extents->surface, image); - return status; + return _cairo_surface_unmap_image (extents->surface, image); } static cairo_int_status_t @@ -151,21 +156,22 @@ int num_glyphs, cairo_bool_t overlap) { - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_int_status_t status; TRACE ((stderr, "%s\n", __FUNCTION__)); - image = cairo_surface_map_to_image (extents->surface, &extents->unbounded); - status = _cairo_surface_offset_glyphs (image, + + image = _cairo_surface_map_to_image (extents->surface, &extents->unbounded); + + status = _cairo_surface_offset_glyphs (&image->base, extents->unbounded.x, extents->unbounded.y, extents->op, &extents->source_pattern.base, scaled_font, glyphs, num_glyphs, extents->clip); - cairo_surface_unmap_image (extents->surface, image); - return status; + return _cairo_surface_unmap_image (extents->surface, image); } const cairo_compositor_t _cairo_fallback_compositor = { diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-composite.c cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-composite.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-composite.c 2012-05-22 10:04:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-composite.c 2012-05-24 06:37:16.000000000 +0000 @@ -707,7 +707,6 @@ cairo_array_t* indices = &ctx->tristrip_indices; const unsigned short *indices_array = _cairo_array_index_const (indices, 0); - if (ctx->pre_shader) { cairo_gl_shader_t *prev_shader = ctx->current_shader; @@ -724,8 +723,8 @@ } static inline void -_cairo_gl_composite_draw (cairo_gl_context_t *ctx, - unsigned int count) +_cairo_gl_composite_draw_triangles (cairo_gl_context_t *ctx, + unsigned int count) { if (! ctx->pre_shader) { glDrawArrays (GL_TRIANGLES, 0, count); @@ -743,6 +742,27 @@ } static void +_cairo_gl_composite_draw_triangles_with_clip_region (cairo_gl_context_t *ctx, + unsigned int count) +{ + int i, num_rectangles; + + if (!ctx->clip_region) { + _cairo_gl_composite_draw_triangles (ctx, count); + return; + } + + num_rectangles = cairo_region_num_rectangles (ctx->clip_region); + for (i = 0; i < num_rectangles; i++) { + cairo_rectangle_int_t rect; + cairo_region_get_rectangle (ctx->clip_region, i, &rect); + + glScissor (rect.x, rect.y, rect.width, rect.height); + _cairo_gl_composite_draw_triangles (ctx, count); + } +} + +static void _cairo_gl_composite_unmap_vertex_buffer (cairo_gl_context_t *ctx) { ctx->vb_offset = 0; @@ -760,46 +780,25 @@ count = ctx->vb_offset / ctx->vertex_size; _cairo_gl_composite_unmap_vertex_buffer (ctx); - if ( _cairo_array_num_elements (&ctx->tristrip_indices) > 0) { + if (ctx->primitive_type == CAIRO_GL_PRIMITIVE_TYPE_TRISTRIPS) { _cairo_gl_composite_draw_tristrip (ctx); - } else if (ctx->clip_region) { - int i, num_rectangles = cairo_region_num_rectangles (ctx->clip_region); - - for (i = 0; i < num_rectangles; i++) { - cairo_rectangle_int_t rect; - - cairo_region_get_rectangle (ctx->clip_region, i, &rect); - - glScissor (rect.x, rect.y, rect.width, rect.height); - _cairo_gl_composite_draw (ctx, count); - } } else { - _cairo_gl_composite_draw (ctx, count); + assert (ctx->primitive_type == CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES); + _cairo_gl_composite_draw_triangles_with_clip_region (ctx, count); } for (i = 0; i < ARRAY_LENGTH (&ctx->glyph_cache); i++) _cairo_gl_glyph_cache_unlock (&ctx->glyph_cache[i]); } -typedef enum cairo_gl_geometry { - CAIRO_GL_GEOMETRY_TYPE_TRIANGLES, - CAIRO_GL_GEOMETRY_TYPE_TRISTRIPS -} cairo_gl_geometry_t; - static void _cairo_gl_composite_prepare_buffer (cairo_gl_context_t *ctx, unsigned int n_vertices, - cairo_gl_geometry_t geometry_type) + cairo_gl_primitive_type_t primitive_type) { - cairo_gl_dispatch_t *dispatch = &ctx->dispatch; - - size_t tristrip_indices =_cairo_array_num_elements (&ctx->tristrip_indices); - if (geometry_type == CAIRO_GL_GEOMETRY_TYPE_TRIANGLES && - tristrip_indices != 0) { - _cairo_gl_composite_flush (ctx); - } else if (geometry_type == CAIRO_GL_GEOMETRY_TYPE_TRISTRIPS && - ! _cairo_gl_context_is_flushed (ctx) && tristrip_indices == 0) { + if (ctx->primitive_type != primitive_type) { _cairo_gl_composite_flush (ctx); + ctx->primitive_type = primitive_type; } if (ctx->vb_offset + n_vertices * ctx->vertex_size > CAIRO_GL_VBO_SIZE) @@ -856,7 +855,7 @@ uint8_t alpha) { _cairo_gl_composite_prepare_buffer (ctx, 6, - CAIRO_GL_GEOMETRY_TYPE_TRIANGLES); + CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES); _cairo_gl_composite_emit_vertex (ctx, x1, y1, alpha); _cairo_gl_composite_emit_vertex (ctx, x2, y1, alpha); @@ -899,7 +898,7 @@ GLfloat glyph_y2) { _cairo_gl_composite_prepare_buffer (ctx, 6, - CAIRO_GL_GEOMETRY_TYPE_TRIANGLES); + CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES); _cairo_gl_composite_emit_glyph_vertex (ctx, x1, y1, glyph_x1, glyph_y1); _cairo_gl_composite_emit_glyph_vertex (ctx, x2, y1, glyph_x2, glyph_y1); @@ -987,7 +986,7 @@ const cairo_point_t quad[4]) { _cairo_gl_composite_prepare_buffer (ctx, 4, - CAIRO_GL_GEOMETRY_TYPE_TRISTRIPS); + CAIRO_GL_PRIMITIVE_TYPE_TRISTRIPS); _cairo_gl_composite_emit_point (ctx, &quad[0], 0); _cairo_gl_composite_emit_point (ctx, &quad[1], 0); @@ -1007,7 +1006,7 @@ const cairo_point_t triangle[3]) { _cairo_gl_composite_prepare_buffer (ctx, 3, - CAIRO_GL_GEOMETRY_TYPE_TRISTRIPS); + CAIRO_GL_PRIMITIVE_TYPE_TRISTRIPS); _cairo_gl_composite_emit_point (ctx, &triangle[0], 0); _cairo_gl_composite_emit_point (ctx, &triangle[1], 0); diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-device.c cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-device.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-device.c 2012-05-22 10:04:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-device.c 2012-05-25 04:40:54.000000000 +0000 @@ -273,6 +273,7 @@ return _cairo_error (CAIRO_STATUS_NO_MEMORY); } + ctx->primitive_type = CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES; _cairo_array_init (&ctx->tristrip_indices, sizeof (unsigned short)); /* PBO for any sort of texture upload */ @@ -318,7 +319,7 @@ #if CAIRO_HAS_GLESV2_SURFACE if (ctx->gl_flavor == CAIRO_GL_FLAVOR_DESKTOP) - return GL_DEPTH24_STENCIL8_OES; + return GL_DEPTH24_STENCIL8; #endif #if CAIRO_HAS_GL_SURFACE diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-operand.c cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-operand.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-operand.c 2012-05-22 10:04:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-operand.c 2012-05-30 20:53:04.000000000 +0000 @@ -223,7 +223,7 @@ * (unnormalized src -> unnormalized src) to * (unnormalized dst -> unnormalized src) */ - *operand = surface->operand; + _cairo_gl_operand_copy(operand, &surface->operand); attributes = &operand->texture.attributes; attributes->matrix = src->base.matrix; @@ -270,7 +270,7 @@ if (unlikely (status)) return status; - *operand = surface->operand; + _cairo_gl_operand_copy(operand, &surface->operand); attributes = &operand->texture.attributes; cairo_matrix_multiply (&attributes->matrix, @@ -292,8 +292,9 @@ cairo_status_t status; cairo_gl_surface_t *surface; cairo_gl_context_t *ctx; - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_bool_t src_is_gl_surface = FALSE; + cairo_rectangle_int_t map_extents; if (_src->type == CAIRO_PATTERN_TYPE_SURFACE) { cairo_surface_t* src_surface = ((cairo_surface_pattern_t *) _src)->surface; @@ -308,7 +309,9 @@ _cairo_gl_surface_create_scratch (ctx, CAIRO_CONTENT_COLOR_ALPHA, extents->width, extents->height); - image = cairo_surface_map_to_image (&surface->base, NULL); + map_extents = *extents; + map_extents.x = map_extents.y = 0; + image = _cairo_surface_map_to_image (&surface->base, &map_extents); /* If the pattern is a GL surface, it belongs to some other GL context, so we need to release this device while we paint it to the image. */ @@ -318,7 +321,7 @@ goto fail; } - status = _cairo_surface_offset_paint (image, extents->x, extents->y, + status = _cairo_surface_offset_paint (&image->base, extents->x, extents->y, CAIRO_OPERATOR_SOURCE, _src, NULL); if (src_is_gl_surface) { @@ -327,7 +330,7 @@ goto fail; } - cairo_surface_unmap_image (&surface->base, image); + status = _cairo_surface_unmap_image (&surface->base, image); status = _cairo_gl_context_release (ctx, status); if (unlikely (status)) goto fail; diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-private.h cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-private.h --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-private.h 2012-05-22 10:04:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-private.h 2012-05-24 06:37:16.000000000 +0000 @@ -213,6 +213,11 @@ CAIRO_GL_VAR_TEXCOORDS, } cairo_gl_var_type_t; +typedef enum cairo_gl_primitive_type { + CAIRO_GL_PRIMITIVE_TYPE_TRIANGLES, + CAIRO_GL_PRIMITIVE_TYPE_TRISTRIPS +} cairo_gl_primitive_type_t; + #define cairo_gl_var_type_hash(src,mask,spans,dest) ((spans) << 3) | ((mask) << 2 | (src << 1) | (dest)) #define CAIRO_GL_VAR_TYPE_MAX ((CAIRO_GL_VAR_TEXCOORDS << 3) | (CAIRO_GL_VAR_TEXCOORDS << 2) | (CAIRO_GL_VAR_TEXCOORDS << 1) | CAIRO_GL_VAR_TEXCOORDS) @@ -334,6 +339,8 @@ unsigned int vertex_size; cairo_region_t *clip_region; cairo_clip_t *clip; + + cairo_gl_primitive_type_t primitive_type; cairo_array_t tristrip_indices; cairo_bool_t has_mesa_pack_invert; diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-gl-surface.c 2012-05-22 10:04:29.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-gl-surface.c 2012-05-30 20:53:04.000000000 +0000 @@ -46,7 +46,7 @@ #include "cairo-compositor-private.h" #include "cairo-default-context-private.h" #include "cairo-error-private.h" -#include "cairo-image-surface-private.h" +#include "cairo-image-surface-inline.h" #include "cairo-surface-backend-private.h" static const cairo_surface_backend_t _cairo_gl_surface_backend; @@ -985,7 +985,7 @@ return _cairo_gl_context_release (ctx, status); } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_gl_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { @@ -995,7 +995,7 @@ GLenum format, type; pixman_format_code_t pixman_format; unsigned int cpp; - cairo_bool_t invert; + cairo_bool_t flipped, mesa_invert; cairo_status_t status; int y; @@ -1050,15 +1050,15 @@ extents->height, -1); if (unlikely (image->base.status)) - return &image->base; + return image; if (surface->base.serial == 0) - return &image->base; + return image; status = _cairo_gl_context_acquire (surface->base.device, &ctx); if (unlikely (status)) { cairo_surface_destroy (&image->base); - return _cairo_surface_create_in_error (status); + return _cairo_image_surface_create_in_error (status); } cairo_surface_set_device_offset (&image->base, -extents->x, -extents->y); @@ -1070,42 +1070,42 @@ _cairo_gl_composite_flush (ctx); _cairo_gl_context_set_destination (ctx, surface, FALSE); - invert = ! _cairo_gl_surface_is_texture (surface) && - ctx->has_mesa_pack_invert; + flipped = ! _cairo_gl_surface_is_texture (surface); + mesa_invert = flipped && ctx->has_mesa_pack_invert; glPixelStorei (GL_PACK_ALIGNMENT, 4); if (ctx->gl_flavor == CAIRO_GL_FLAVOR_DESKTOP) glPixelStorei (GL_PACK_ROW_LENGTH, image->stride / cpp); - if (invert) + if (mesa_invert) glPixelStorei (GL_PACK_INVERT_MESA, 1); y = extents->y; - if (! _cairo_gl_surface_is_texture (surface)) + if (flipped) y = surface->height - extents->y - extents->height; glReadPixels (extents->x, y, extents->width, extents->height, format, type, image->data); - if (invert) + if (mesa_invert) glPixelStorei (GL_PACK_INVERT_MESA, 0); status = _cairo_gl_context_release (ctx, status); if (unlikely (status)) { cairo_surface_destroy (&image->base); - return _cairo_surface_create_in_error (status); + return _cairo_image_surface_create_in_error (status); } /* We must invert the image manualy if we lack GL_MESA_pack_invert */ - if (! ctx->has_mesa_pack_invert && ! _cairo_gl_surface_is_texture (surface)) { + if (flipped && ! mesa_invert) { uint8_t stack[1024], *row = stack; uint8_t *top = image->data; uint8_t *bot = image->data + (image->height-1)*image->stride; - if (image->stride > sizeof(stack)) { + if (image->stride > (int)sizeof(stack)) { row = malloc (image->stride); if (unlikely (row == NULL)) { cairo_surface_destroy (&image->base); - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); + return _cairo_image_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); } } @@ -1121,7 +1121,7 @@ free(row); } - return &image->base; + return image; } static cairo_surface_t * @@ -1170,11 +1170,18 @@ _cairo_gl_surface_unmap_image (void *abstract_surface, cairo_image_surface_t *image) { - return _cairo_gl_surface_draw_image (abstract_surface, image, - 0, 0, - image->width, image->height, - image->base.device_transform_inverse.x0, - image->base.device_transform_inverse.y0); + cairo_int_status_t status; + + status = _cairo_gl_surface_draw_image (abstract_surface, image, + 0, 0, + image->width, image->height, + image->base.device_transform_inverse.x0, + image->base.device_transform_inverse.y0); + + cairo_surface_finish (&image->base); + cairo_surface_destroy (&image->base); + + return status; } static cairo_bool_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-image-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-image-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-image-surface.c 2012-04-28 06:19:25.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-image-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -794,7 +794,7 @@ return &clone->base; } -cairo_surface_t * +cairo_image_surface_t * _cairo_image_surface_map_to_image (void *abstract_other, const cairo_rectangle_int_t *extents) { @@ -814,13 +814,16 @@ other->stride); cairo_surface_set_device_offset (surface, -extents->x, -extents->y); - return surface; + return (cairo_image_surface_t *) surface; } cairo_int_status_t _cairo_image_surface_unmap_image (void *abstract_surface, cairo_image_surface_t *image) { + cairo_surface_finish (&image->base); + cairo_surface_destroy (&image->base); + return CAIRO_INT_STATUS_SUCCESS; } @@ -1202,3 +1205,56 @@ return image->color = CAIRO_IMAGE_IS_COLOR; } + +static const cairo_user_data_key_t clone_key; + +cairo_image_surface_t * +_cairo_image_surface_clone_subimage (cairo_surface_t *surface, + const cairo_rectangle_int_t *extents) +{ + cairo_surface_t *image; + cairo_surface_pattern_t pattern; + cairo_status_t status; + + image = cairo_surface_create_similar_image (surface, + _cairo_format_from_content (surface->content), + extents->width, + extents->height); + if (image->status) + return to_image_surface (image); + + /* TODO: check me with non-identity device_transform. Should we + * clone the scaling, too? */ + cairo_surface_set_device_offset (image, + -extents->x, + -extents->y); + + _cairo_pattern_init_for_surface (&pattern, surface); + pattern.base.filter = CAIRO_FILTER_NEAREST; + + status = _cairo_surface_paint (image, + CAIRO_OPERATOR_SOURCE, + &pattern.base, + NULL); + + _cairo_pattern_fini (&pattern.base); + + if (unlikely (status)) + goto error; + + status = cairo_surface_set_user_data (image, &clone_key, surface, NULL); + if (unlikely (status)) + goto error; + + return to_image_surface (image); + +error: + cairo_surface_destroy (image); + return to_image_surface (_cairo_surface_create_in_error (status)); +} + +cairo_bool_t +_cairo_image_surface_is_clone (cairo_image_surface_t *image) +{ + return cairo_surface_get_user_data (&image->base, &clone_key) != NULL; +} diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-image-surface-inline.h cairo-1.12.3+git20120530.25317dbd/src/cairo-image-surface-inline.h --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-image-surface-inline.h 2012-04-19 15:28:24.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-image-surface-inline.h 2012-05-27 08:23:45.000000000 +0000 @@ -42,6 +42,12 @@ CAIRO_BEGIN_DECLS +static inline cairo_image_surface_t * +_cairo_image_surface_create_in_error (cairo_status_t status) +{ + return (cairo_image_surface_t *) _cairo_surface_create_in_error (status); +} + static inline void _cairo_image_surface_set_parent (cairo_image_surface_t *image, cairo_surface_t *parent) diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-image-surface-private.h cairo-1.12.3+git20120530.25317dbd/src/cairo-image-surface-private.h --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-image-surface-private.h 2012-04-19 15:28:24.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-image-surface-private.h 2012-05-27 08:23:45.000000000 +0000 @@ -151,7 +151,7 @@ pixman_image_t *pixman_image, pixman_format_code_t pixman_format); -cairo_private cairo_surface_t * +cairo_private cairo_image_surface_t * _cairo_image_surface_map_to_image (void *abstract_other, const cairo_rectangle_int_t *extents); @@ -216,6 +216,13 @@ int dst_x, int dst_y, cairo_tristrip_t *strip); +cairo_private cairo_image_surface_t * +_cairo_image_surface_clone_subimage (cairo_surface_t *surface, + const cairo_rectangle_int_t *extents); + +cairo_private cairo_bool_t +_cairo_image_surface_is_clone (cairo_image_surface_t *surface); + CAIRO_END_DECLS #endif /* CAIRO_IMAGE_SURFACE_PRIVATE_H */ diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairoint.h cairo-1.12.3+git20120530.25317dbd/src/cairoint.h --- cairo-1.12.3+git20120521.aed94a5b/src/cairoint.h 2012-05-15 05:39:20.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairoint.h 2012-05-27 08:23:45.000000000 +0000 @@ -1304,6 +1304,14 @@ const cairo_pattern_t *source, const cairo_clip_t *clip); +cairo_private cairo_image_surface_t * +_cairo_surface_map_to_image (cairo_surface_t *surface, + const cairo_rectangle_int_t *extents); + +cairo_private cairo_int_status_t +_cairo_surface_unmap_image (cairo_surface_t *surface, + cairo_image_surface_t *image); + cairo_private cairo_status_t _cairo_surface_mask (cairo_surface_t *surface, cairo_operator_t op, @@ -1914,7 +1922,6 @@ slim_hidden_proto (cairo_surface_get_mime_data); slim_hidden_proto (cairo_surface_get_type); slim_hidden_proto (cairo_surface_has_show_text_glyphs); -slim_hidden_proto (cairo_surface_map_to_image); slim_hidden_proto (cairo_surface_mark_dirty); slim_hidden_proto (cairo_surface_mark_dirty_rectangle); slim_hidden_proto_no_warn (cairo_surface_reference); @@ -1924,7 +1931,6 @@ slim_hidden_proto (cairo_surface_show_page); slim_hidden_proto (cairo_surface_status); slim_hidden_proto (cairo_surface_supports_mime_type); -slim_hidden_proto (cairo_surface_unmap_image); slim_hidden_proto (cairo_text_cluster_allocate); slim_hidden_proto (cairo_text_cluster_free); slim_hidden_proto (cairo_toy_font_face_create); diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-os2-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-os2-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-os2-surface.c 2012-03-10 11:28:21.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-os2-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -585,7 +585,7 @@ DosReleaseMutexSem (surface->hmtx_use_private_fields); } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_os2_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { @@ -596,6 +596,7 @@ surface->pixel_array_lend_count++; DosReleaseMutexSem (local_os2_surface->hmtx_use_private_fields); + /* XXX: BROKEN! */ *image_out = _cairo_surface_create_for_rectangle_int (surface->image_surface, extents); diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-pdf-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-pdf-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-pdf-surface.c 2012-05-17 20:03:14.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-pdf-surface.c 2012-05-27 15:18:55.000000000 +0000 @@ -2681,11 +2681,28 @@ int alpha = 0; cairo_surface_t *free_me = NULL; cairo_surface_t *source; + const cairo_rectangle_int_t *extents; + int width; + int height; + cairo_bool_t is_subsurface; assert (pdf_source->type == CAIRO_PATTERN_TYPE_SURFACE); + extents = &pdf_source->hash_entry->extents; + width = pdf_source->hash_entry->width; + height = pdf_source->hash_entry->height; + is_subsurface = FALSE; source = pdf_source->surface; - if (_cairo_surface_is_snapshot (source)) + if (_cairo_surface_is_snapshot (source)) { free_me = source = _cairo_surface_snapshot_get_target (source); + } else if (source->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) { + cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) source; + + source = sub->target; + extents = &sub->extents; + width = extents->width; + height = extents->height; + is_subsurface = TRUE; + } old_width = surface->width; old_height = surface->height; @@ -2694,16 +2711,15 @@ _cairo_surface_clipper_init (&surface->clipper, _cairo_pdf_surface_clipper_intersect_clip_path); - _cairo_pdf_surface_set_size_internal (surface, - pdf_source->hash_entry->width, - pdf_source->hash_entry->height); + _cairo_pdf_surface_set_size_internal (surface, width, height); + /* Patterns are emitted after fallback images. The paginated mode * needs to be set to _RENDER while the recording surface is replayed * back to this surface. */ surface->paginated_mode = CAIRO_PAGINATED_MODE_RENDER; _cairo_pdf_group_resources_clear (&surface->resources); - _get_bbox_from_extents (pdf_source->hash_entry->height, &pdf_source->hash_entry->extents, &bbox); + _get_bbox_from_extents (height, extents, &bbox); status = _cairo_pdf_surface_open_content_stream (surface, &bbox, &pdf_source->hash_entry->surface_res, TRUE); if (unlikely (status)) goto err; @@ -2721,7 +2737,7 @@ } status = _cairo_recording_surface_replay_region (source, - NULL, + is_subsurface ? extents : NULL, &surface->base, CAIRO_RECORDING_REGION_NATIVE); assert (status != CAIRO_INT_STATUS_UNSUPPORTED); @@ -2743,89 +2759,13 @@ } static cairo_status_t -_cairo_pdf_surface_emit_recording_subsurface (cairo_pdf_surface_t *surface, - cairo_surface_t *recording_surface, - const cairo_rectangle_int_t *extents, - cairo_pdf_resource_t resource) -{ - double old_width, old_height; - cairo_paginated_mode_t old_paginated_mode; - cairo_surface_clipper_t old_clipper; - cairo_box_double_t bbox; - cairo_int_status_t status; - int alpha = 0; - - old_width = surface->width; - old_height = surface->height; - old_paginated_mode = surface->paginated_mode; - old_clipper = surface->clipper; - _cairo_surface_clipper_init (&surface->clipper, - _cairo_pdf_surface_clipper_intersect_clip_path); - - _cairo_pdf_surface_set_size_internal (surface, - extents->width, - extents->height); - /* Patterns are emitted after fallback images. The paginated mode - * needs to be set to _RENDER while the recording surface is replayed - * back to this surface. - */ - surface->paginated_mode = CAIRO_PAGINATED_MODE_RENDER; - _cairo_pdf_group_resources_clear (&surface->resources); - _get_bbox_from_extents (extents->height, extents, &bbox); - status = _cairo_pdf_surface_open_content_stream (surface, &bbox, &resource, TRUE); - if (unlikely (status)) - return status; - - if (cairo_surface_get_content (recording_surface) == CAIRO_CONTENT_COLOR) { - status = _cairo_pdf_surface_add_alpha (surface, 1.0, &alpha); - if (unlikely (status)) - return status; - - _cairo_output_stream_printf (surface->output, - "q /a%d gs 0 0 0 rg 0 0 %f %f re f Q\n", - alpha, - surface->width, - surface->height); - } - - status = _cairo_recording_surface_replay_region (recording_surface, - extents, - &surface->base, - CAIRO_RECORDING_REGION_NATIVE); - assert (status != CAIRO_INT_STATUS_UNSUPPORTED); - if (unlikely (status)) - return status; - - status = _cairo_pdf_surface_close_content_stream (surface); - - _cairo_surface_clipper_reset (&surface->clipper); - surface->clipper = old_clipper; - _cairo_pdf_surface_set_size_internal (surface, - old_width, - old_height); - surface->paginated_mode = old_paginated_mode; - - return status; -} - -static cairo_status_t _cairo_pdf_surface_emit_surface (cairo_pdf_surface_t *surface, cairo_pdf_source_surface_t *src_surface) { - if (src_surface->type == CAIRO_PATTERN_TYPE_SURFACE) { - if (src_surface->surface->type == CAIRO_SURFACE_TYPE_RECORDING) { - if (src_surface->surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE) { - cairo_surface_subsurface_t *sub = (cairo_surface_subsurface_t *) src_surface->surface; - return _cairo_pdf_surface_emit_recording_subsurface (surface, - sub->target, - &sub->extents, - src_surface->hash_entry->surface_res); - } else { - return _cairo_pdf_surface_emit_recording_surface (surface, - src_surface); - } - } - } + if (src_surface->type == CAIRO_PATTERN_TYPE_SURFACE && + src_surface->surface->type == CAIRO_SURFACE_TYPE_RECORDING) + return _cairo_pdf_surface_emit_recording_surface (surface, src_surface); + return _cairo_pdf_surface_emit_image_surface (surface, src_surface); } @@ -3442,6 +3382,7 @@ cairo_pdf_resource_t smask_resource; cairo_status_t status; char buf[100]; + double x1, y1, x2, y2; if (pdf_pattern->is_shading) { snprintf(buf, sizeof(buf), @@ -3457,13 +3398,36 @@ gradient_mask.id); } + if (pdf_pattern->is_shading) { + cairo_box_t box; + + /* When emitting a shading operator we are in cairo pattern + * coordinates. _cairo_pdf_surface_paint_gradient has set the + * ctm to the pattern matrix (including the convertion from + * pdf to cairo coordinates) */ + _cairo_box_from_rectangle (&box, &pdf_pattern->extents); + _cairo_box_to_doubles (&box, &x1, &y1, &x2, &y2); + _cairo_matrix_transform_bounding_box (&pdf_pattern->pattern->matrix, &x1, &y1, &x2, &y2, NULL); + } else { + cairo_box_double_t box; + + /* When emitting a shading pattern we are in pdf page + * coordinates. The color and alpha shading patterns painted + * in the XObject below contain the cairo pattern to pdf page + * matrix in the /Matrix entry of the pattern. */ + _get_bbox_from_extents (pdf_pattern->height, &pdf_pattern->extents, &box); + x1 = box.p1.x; + y1 = box.p1.y; + x2 = box.p2.x; + y2 = box.p2.y; + } status = _cairo_pdf_surface_open_stream (surface, NULL, surface->compress_content, " /Type /XObject\n" " /Subtype /Form\n" " /FormType 1\n" - " /BBox [ 0 0 %f %f ]\n" + " /BBox [ %f %f %f %f ]\n" " /Resources\n" " << /ExtGState\n" " << /a0 << /ca 1 /CA 1 >>" @@ -3476,8 +3440,7 @@ " /I true\n" " /CS /DeviceGray\n" " >>\n", - surface->width, - surface->height, + x1,y1,x2,y2, buf); if (unlikely (status)) return status; diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-ps-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-ps-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-ps-surface.c 2012-04-27 18:29:27.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-ps-surface.c 2012-05-27 15:18:55.000000000 +0000 @@ -2033,10 +2033,28 @@ cairo_surface_pattern_t *surface_pattern = (cairo_surface_pattern_t *) pattern; if (surface_pattern->surface->type == CAIRO_SURFACE_TYPE_RECORDING) { - if (pattern->extend == CAIRO_EXTEND_PAD) - return CAIRO_INT_STATUS_UNSUPPORTED; - else - return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN; + if (pattern->extend == CAIRO_EXTEND_PAD) { + cairo_box_t box; + cairo_rectangle_int_t rect; + cairo_rectangle_int_t rec_extents; + + /* get the operation extents in pattern space */ + _cairo_box_from_rectangle (&box, extents); + _cairo_matrix_transform_bounding_box_fixed (&pattern->matrix, &box, NULL); + _cairo_box_round_to_rectangle (&box, &rect); + + /* Check if surface needs padding to fill extents */ + if (_cairo_surface_get_extents (surface_pattern->surface, &rec_extents)) { + if (_cairo_fixed_integer_ceil(box.p1.x) < rec_extents.x || + _cairo_fixed_integer_ceil(box.p1.y) < rec_extents.y || + _cairo_fixed_integer_floor(box.p2.y) > rec_extents.x + rec_extents.width || + _cairo_fixed_integer_floor(box.p2.y) > rec_extents.y + rec_extents.height) + { + return CAIRO_INT_STATUS_UNSUPPORTED; + } + } + } + return CAIRO_INT_STATUS_ANALYZE_RECORDING_SURFACE_PATTERN; } } @@ -3158,10 +3176,11 @@ if (unlikely (status)) return status; - if (pattern->extend == CAIRO_EXTEND_PAD) { + if (pattern->extend == CAIRO_EXTEND_PAD && + pattern->type == CAIRO_PATTERN_TYPE_SURFACE && + ((cairo_surface_pattern_t *)pattern)->surface->type == CAIRO_SURFACE_TYPE_IMAGE) { cairo_image_surface_t *img; - assert (source->type == CAIRO_SURFACE_TYPE_IMAGE); img = (cairo_image_surface_t *) source; status = _cairo_ps_surface_create_padded_image_from_image (surface, img, diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-quartz-image-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-quartz-image-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-quartz-image-surface.c 2012-03-29 15:36:05.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-quartz-image-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -107,13 +107,12 @@ return CAIRO_STATUS_SUCCESS; } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_quartz_image_surface_map_to_image (void *asurface, const cairo_rectangle_int_t *extents) { cairo_quartz_image_surface_t *surface = (cairo_quartz_image_surface_t *) asurface; - - return cairo_surface_map_to_image (&surface->imageSurface->base, extents); + return _cairo_surface_map_to_image (&surface->imageSurface->base, extents); } static cairo_int_status_t @@ -121,9 +120,7 @@ cairo_image_surface_t *image) { cairo_quartz_image_surface_t *surface = (cairo_quartz_image_surface_t *) asurface; - - cairo_surface_unmap_image (&surface->imageSurface->base, &image->base); - return cairo_surface_status (&surface->imageSurface->base); + return _cairo_surface_unmap_image (&surface->imageSurface->base, image); } static cairo_bool_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-quartz-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-quartz-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-quartz-surface.c 2012-03-29 15:36:05.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-quartz-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -43,7 +43,7 @@ #include "cairo-compositor-private.h" #include "cairo-default-context-private.h" #include "cairo-error-private.h" -#include "cairo-image-surface-private.h" +#include "cairo-image-surface-inline.h" #include "cairo-pattern-private.h" #include "cairo-surface-backend-private.h" #include "cairo-surface-clipper-private.h" @@ -203,8 +203,9 @@ break; #endif - case CAIRO_FORMAT_RGB16_565: - case CAIRO_FORMAT_INVALID: + case CAIRO_FORMAT_RGB30: + case CAIRO_FORMAT_RGB16_565: + case CAIRO_FORMAT_INVALID: default: return NULL; } @@ -1385,96 +1386,82 @@ } } -/* - * get source/dest image implementation - */ - -/* Read the image from the surface's front buffer */ -static cairo_int_status_t -_cairo_quartz_get_image (cairo_quartz_surface_t *surface, - cairo_image_surface_t **image_out) +static cairo_image_surface_t * +_cairo_quartz_surface_map_to_image (void *abstract_surface, + const cairo_rectangle_int_t *extents) { - unsigned char *imageData; - cairo_image_surface_t *isurf; + cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; + unsigned int stride, bitinfo, bpp, color_comps; + CGColorSpaceRef colorspace; + void *imageData; + cairo_format_t format; - if (IS_EMPTY (surface)) { - *image_out = (cairo_image_surface_t*) cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); - return CAIRO_STATUS_SUCCESS; - } + if (surface->imageSurfaceEquiv) + return _cairo_surface_map_to_image (surface->imageSurfaceEquiv, extents); - if (surface->imageSurfaceEquiv) { - *image_out = (cairo_image_surface_t*) cairo_surface_reference (surface->imageSurfaceEquiv); - return CAIRO_STATUS_SUCCESS; - } + if (IS_EMPTY (surface)) + return (cairo_image_surface_t *) cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0); - if (_cairo_quartz_is_cgcontext_bitmap_context (surface->cgContext)) { - unsigned int stride; - unsigned int bitinfo; - unsigned int bpc, bpp; - CGColorSpaceRef colorspace; - unsigned int color_comps; - - imageData = (unsigned char *) CGBitmapContextGetData (surface->cgContext); - - bitinfo = CGBitmapContextGetBitmapInfo (surface->cgContext); - stride = CGBitmapContextGetBytesPerRow (surface->cgContext); - bpp = CGBitmapContextGetBitsPerPixel (surface->cgContext); - bpc = CGBitmapContextGetBitsPerComponent (surface->cgContext); - - // let's hope they don't add YUV under us - colorspace = CGBitmapContextGetColorSpace (surface->cgContext); - color_comps = CGColorSpaceGetNumberOfComponents (colorspace); - - // XXX TODO: We can handle all of these by converting to - // pixman masks, including non-native-endian masks - if (bpc != 8) - return CAIRO_INT_STATUS_UNSUPPORTED; + if (! _cairo_quartz_is_cgcontext_bitmap_context (surface->cgContext)) + return _cairo_image_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); - if (bpp != 32 && bpp != 8) - return CAIRO_INT_STATUS_UNSUPPORTED; + bitinfo = CGBitmapContextGetBitmapInfo (surface->cgContext); + bpp = CGBitmapContextGetBitsPerPixel (surface->cgContext); - if (color_comps != 3 && color_comps != 1) - return CAIRO_INT_STATUS_UNSUPPORTED; + // let's hope they don't add YUV under us + colorspace = CGBitmapContextGetColorSpace (surface->cgContext); + color_comps = CGColorSpaceGetNumberOfComponents (colorspace); - if (bpp == 32 && color_comps == 3 && - (bitinfo & kCGBitmapAlphaInfoMask) == kCGImageAlphaPremultipliedFirst && - (bitinfo & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Host) - { - isurf = (cairo_image_surface_t *) - cairo_image_surface_create_for_data (imageData, - CAIRO_FORMAT_ARGB32, - surface->extents.width, - surface->extents.height, - stride); - } else if (bpp == 32 && color_comps == 3 && - (bitinfo & kCGBitmapAlphaInfoMask) == kCGImageAlphaNoneSkipFirst && - (bitinfo & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Host) - { - isurf = (cairo_image_surface_t *) - cairo_image_surface_create_for_data (imageData, - CAIRO_FORMAT_RGB24, - surface->extents.width, - surface->extents.height, - stride); - } else if (bpp == 8 && color_comps == 1) - { - isurf = (cairo_image_surface_t *) - cairo_image_surface_create_for_data (imageData, - CAIRO_FORMAT_A8, - surface->extents.width, - surface->extents.height, - stride); - } else { - return CAIRO_INT_STATUS_UNSUPPORTED; - } - } else { - return CAIRO_INT_STATUS_UNSUPPORTED; + /* XXX TODO: We can handle many more data formats by + * converting to pixman_format_t */ + + if (bpp == 32 && color_comps == 3 && + (bitinfo & kCGBitmapAlphaInfoMask) == kCGImageAlphaPremultipliedFirst && + (bitinfo & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Host) + { + format = CAIRO_FORMAT_ARGB32; + } + else if (bpp == 32 && color_comps == 3 && + (bitinfo & kCGBitmapAlphaInfoMask) == kCGImageAlphaNoneSkipFirst && + (bitinfo & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Host) + { + format = CAIRO_FORMAT_RGB24; + } + else if (bpp == 8 && color_comps == 1) + { + format = CAIRO_FORMAT_A1; } + else + { + return _cairo_image_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); + } + + imageData = CGBitmapContextGetData (surface->cgContext); + stride = CGBitmapContextGetBytesPerRow (surface->cgContext); + + return (cairo_image_surface_t *) cairo_image_surface_create_for_data (imageData, + format, + extents->width, + extents->height, + stride); +} + +static cairo_int_status_t +_cairo_quartz_surface_unmap_image (void *abstract_surface, + cairo_image_surface_t *image) +{ + cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; + + if (surface->imageSurfaceEquiv) + return _cairo_surface_unmap_image (surface->imageSurfaceEquiv, image); + + cairo_surface_finish (&image->base); + cairo_surface_destroy (&image->base); - *image_out = isurf; return CAIRO_STATUS_SUCCESS; } + /* * Cairo surface backend implementations */ @@ -1513,35 +1500,20 @@ 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 (unlikely (status)) - return _cairo_error (CAIRO_STATUS_NO_MEMORY); - *image_extra = NULL; - return CAIRO_STATUS_SUCCESS; -} - -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; - - if (surface->imageSurfaceEquiv) - return NULL; - - status = _cairo_quartz_get_image (surface, &image); - if (unlikely (status)) - return _cairo_surface_create_in_error (CAIRO_STATUS_NO_MEMORY); + *image_out = _cairo_quartz_surface_map_to_image (surface, &surface->extents); + if (unlikely (cairo_surface_status(&(*image_out)->base))) { + cairo_surface_destroy (&(*image_out)->base); + *image_out = NULL; + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + } - return &image->base; + return CAIRO_STATUS_SUCCESS; } static void @@ -1549,38 +1521,7 @@ cairo_image_surface_t *image, void *image_extra) { - cairo_surface_destroy (&image->base); -} - - -static cairo_surface_t * -_cairo_quartz_surface_map_to_image (void *abstract_surface, - const cairo_rectangle_int_t *extents) -{ - cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; - cairo_image_surface_t *image; - cairo_surface_t *subsurface; - cairo_status_t status; - - status = _cairo_quartz_get_image (surface, &image); - if (unlikely (status)) - return _cairo_surface_create_in_error (status); - - /* Is this legitimate? shouldn't it return an image surface? */ - - subsurface = _cairo_surface_create_for_rectangle_int (&image->base, extents); - cairo_surface_destroy (&image->base); - - return subsurface; -} - -static cairo_int_status_t -_cairo_quartz_surface_unmap_image (void *abstract_surface, - cairo_image_surface_t *image) -{ - cairo_surface_destroy (&image->base); - - return CAIRO_STATUS_SUCCESS; + _cairo_quartz_surface_unmap_image (abstract_surface, image); } static cairo_surface_t * @@ -2219,7 +2160,7 @@ _cairo_surface_default_source, _cairo_quartz_surface_acquire_source_image, _cairo_quartz_surface_release_source_image, - _cairo_quartz_surface_snapshot, + NULL, /* snapshot */ NULL, /* copy_page */ NULL, /* show_page */ @@ -2273,6 +2214,7 @@ surface->cgContext = NULL; surface->cgContextBaseCTM = CGAffineTransformIdentity; surface->imageData = NULL; + surface->base.is_clear = TRUE; return surface; } @@ -2436,6 +2378,8 @@ return &surf->base; } + surf->base.is_clear = TRUE; + surf->imageData = imageData; surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride); diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface-backend-private.h cairo-1.12.3+git20120530.25317dbd/src/cairo-surface-backend-private.h --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface-backend-private.h 2012-02-15 17:20:00.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-surface-backend-private.h 2012-05-27 08:23:45.000000000 +0000 @@ -63,7 +63,7 @@ int width, int height); - cairo_surface_t * + cairo_image_surface_t * (*map_to_image) (void *surface, const cairo_rectangle_int_t *extents); cairo_int_status_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface.c 2012-05-10 06:40:11.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -599,6 +599,135 @@ slim_hidden_def (cairo_surface_create_similar_image); /** + * _cairo_surface_map_to_image: + * @surface: an existing surface used to extract the image from + * @extents: limit the extraction to an rectangular region + * + * Returns an image surface that is the most efficient mechanism for + * modifying the backing store of the target surface. The region + * retrieved is limited to @extents. + * + * Note, the use of the original surface as a target or source whilst + * it is mapped is undefined. The result of mapping the surface + * multiple times is undefined. Calling cairo_surface_destroy() or + * cairo_surface_finish() on the resulting image surface results in + * undefined behavior. Changing the device transform of the image + * surface or of @surface before the image surface is unmapped results + * in undefined behavior. + * + * Assumes that @surface is valid (CAIRO_STATUS_SUCCESS, + * non-finished). + * + * Return value: a pointer to the newly allocated image surface. The + * caller must use _cairo_surface_unmap_image() to destroy this image + * surface. + * + * This function always returns a valid pointer, but it will return a + * pointer to a "nil" surface if @other is already in an error state + * or any other error occurs. + * + * The returned image might have a %CAIRO_FORMAT_INVALID format. + **/ +cairo_image_surface_t * +_cairo_surface_map_to_image (cairo_surface_t *surface, + const cairo_rectangle_int_t *extents) +{ + cairo_image_surface_t *image = NULL; + + assert (extents != NULL); + + /* TODO: require map_to_image != NULL */ + if (surface->backend->map_to_image) + image = surface->backend->map_to_image (surface, extents); + + if (image == NULL) + image = _cairo_image_surface_clone_subimage (surface, extents); + + return image; +} + +/** + * _cairo_surface_unmap_image: + * @surface: the surface passed to _cairo_surface_map_to_image(). + * @image: the currently mapped image + * + * Unmaps the image surface as returned from + * _cairo_surface_map_to_image(). + * + * The content of the image will be uploaded to the target surface. + * Afterwards, the image is destroyed. + * + * Using an image surface which wasn't returned by + * _cairo_surface_map_to_image() results in undefined behavior. + * + * An image surface in error status can be passed to + * _cairo_surface_unmap_image(). + * + * Return value: the unmap status. + * + * Even if the unmap status is not successful, @image is destroyed. + **/ +cairo_int_status_t +_cairo_surface_unmap_image (cairo_surface_t *surface, + cairo_image_surface_t *image) +{ + cairo_surface_pattern_t pattern; + cairo_rectangle_int_t extents; + cairo_clip_t *clip; + cairo_int_status_t status; + + /* map_to_image can return error surfaces */ + if (unlikely (image->base.status)) { + status = image->base.status; + goto destroy; + } + + /* If the image is untouched just skip the update */ + if (image->base.serial == 0) { + status = CAIRO_STATUS_SUCCESS; + goto destroy; + } + + /* TODO: require unmap_image != NULL */ + if (surface->backend->unmap_image && + ! _cairo_image_surface_is_clone (image)) + { + status = surface->backend->unmap_image (surface, image); + if (status != CAIRO_INT_STATUS_UNSUPPORTED) + return status; + } + + _cairo_pattern_init_for_surface (&pattern, &image->base); + pattern.base.filter = CAIRO_FILTER_NEAREST; + + /* We have to apply the translate from map_to_image's extents.x and .y */ + cairo_matrix_init_translate (&pattern.base.matrix, + image->base.device_transform.x0, + image->base.device_transform.y0); + + /* And we also have to clip the operation to the image's extents */ + extents.x = image->base.device_transform_inverse.x0; + extents.y = image->base.device_transform_inverse.y0; + extents.width = image->width; + extents.height = image->height; + clip = _cairo_clip_intersect_rectangle (NULL, &extents); + + status = _cairo_surface_paint (surface, + CAIRO_OPERATOR_SOURCE, + &pattern.base, + clip); + + _cairo_pattern_fini (&pattern.base); + _cairo_clip_destroy (clip); + +destroy: + cairo_surface_finish (&image->base); + cairo_surface_destroy (&image->base); + + return status; +} + +/** * cairo_surface_map_to_image: * @surface: an existing surface used to extract the image from * @extents: limit the extraction to an rectangular region @@ -607,17 +736,22 @@ * modifying the backing store of the target surface. The region retrieved * may be limited to the @extents or %NULL for the whole surface * - * Note, the use of the original surface as a target or source whilst it is - * mapped is undefined. The result of mapping the surface multiple times is - * undefined. Calling cairo_surface_destroy() or cairo_surface_finish() on the - * resulting image surface results in undefined behavior. + * Note, the use of the original surface as a target or source whilst + * it is mapped is undefined. The result of mapping the surface + * multiple times is undefined. Calling cairo_surface_destroy() or + * cairo_surface_finish() on the resulting image surface results in + * undefined behavior. Changing the device transform of the image + * surface or of @surface before the image surface is unmapped results + * in undefined behavior. * * Return value: a pointer to the newly allocated image surface. The caller * must use cairo_surface_unmap_image() to destroy this image surface. * * This function always returns a valid pointer, but it will return a * pointer to a "nil" surface if @other is already in an error state - * or any other error occurs. + * or any other error occurs. If the returned pointer does not have an + * error status, it is guaranteed to be an image surface whose format + * is not %CAIRO_FORMAT_INVALID. * * Since: 1.12 **/ @@ -626,7 +760,8 @@ const cairo_rectangle_int_t *extents) { cairo_rectangle_int_t rect; - cairo_surface_t *image; + cairo_image_surface_t *image; + cairo_status_t status; if (unlikely (surface->status)) return _cairo_surface_create_in_error (surface->status); @@ -649,39 +784,21 @@ } } - image = NULL; - if (surface->backend->map_to_image) - image = surface->backend->map_to_image (surface, extents); + image = _cairo_surface_map_to_image (surface, extents); - if (image == NULL) { - cairo_surface_pattern_t pattern; - cairo_status_t status; - - image = cairo_surface_create_similar_image (surface, - _cairo_format_from_content (surface->content), - extents->width, - extents->height); - cairo_surface_set_device_offset (image, -extents->x, -extents->y); - - _cairo_pattern_init_for_surface (&pattern, surface); - pattern.base.filter = CAIRO_FILTER_NEAREST; - - status = _cairo_surface_paint (image, - CAIRO_OPERATOR_SOURCE, - &pattern.base, - NULL); - - _cairo_pattern_fini (&pattern.base); - - if (unlikely (status)) { - cairo_surface_destroy (image); - image = _cairo_surface_create_in_error (status); - } + status = image->base.status; + if (unlikely (status)) { + cairo_surface_destroy (&image->base); + return _cairo_surface_create_in_error (status); } - return image; + if (image->format == CAIRO_FORMAT_INVALID) { + cairo_surface_destroy (&image->base); + image = _cairo_image_surface_clone_subimage (surface, extents); + } + + return &image->base; } -slim_hidden_def (cairo_surface_map_to_image); /** * cairo_surface_unmap_image: @@ -702,7 +819,7 @@ cairo_surface_unmap_image (cairo_surface_t *surface, cairo_surface_t *image) { - cairo_int_status_t status; + cairo_int_status_t status = CAIRO_STATUS_SUCCESS; if (unlikely (surface->status)) { status = surface->status; @@ -712,7 +829,6 @@ status = _cairo_error (CAIRO_STATUS_SURFACE_FINISHED); goto error; } - if (unlikely (image->status)) { status = image->status; goto error; @@ -726,52 +842,18 @@ goto error; } - /* If the image is untouched just skip the update */ - if (image->serial == 0) { - status = CAIRO_STATUS_SUCCESS; - goto error; - } - - status = CAIRO_INT_STATUS_UNSUPPORTED; - if (surface->backend->unmap_image) - status = surface->backend->unmap_image (surface, (cairo_image_surface_t *) image); - if (status == CAIRO_INT_STATUS_UNSUPPORTED) { - cairo_image_surface_t *img = (cairo_image_surface_t *) image; - cairo_surface_pattern_t pattern; - cairo_clip_t *clip; - cairo_rectangle_int_t extents; - - _cairo_pattern_init_for_surface (&pattern, image); - pattern.base.filter = CAIRO_FILTER_NEAREST; - - /* We have to apply the translate from map_to_image's extents.x and .y */ - cairo_matrix_init_translate (&pattern.base.matrix, - image->device_transform.x0, - image->device_transform.y0); - - /* And we also have to clip the operation to the image's extents */ - extents.x = image->device_transform_inverse.x0; - extents.y = image->device_transform_inverse.y0; - extents.width = img->width; - extents.height = img->height; - clip = _cairo_clip_intersect_rectangle (NULL, &extents); - - status = _cairo_surface_paint (surface, - CAIRO_OPERATOR_SOURCE, - &pattern.base, - clip); + status = _cairo_surface_unmap_image (surface, + (cairo_image_surface_t *) image); + if (unlikely (status)) + _cairo_surface_set_error (surface, status); - _cairo_pattern_fini (&pattern.base); - _cairo_clip_destroy (clip); - } + return; error: + _cairo_surface_set_error (surface, status); cairo_surface_finish (image); cairo_surface_destroy (image); - if (status) - _cairo_surface_set_error (surface, status); } -slim_hidden_def (cairo_surface_unmap_image); cairo_surface_t * _cairo_surface_create_similar_solid (cairo_surface_t *other, diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface-observer.c cairo-1.12.3+git20120530.25317dbd/src/cairo-surface-observer.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface-observer.c 2012-04-19 15:28:24.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-surface-observer.c 2012-05-27 08:23:45.000000000 +0000 @@ -474,16 +474,12 @@ return NULL; } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_surface_observer_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { cairo_surface_observer_t *surface = abstract_surface; - - if (surface->target->backend->map_to_image == NULL) - return NULL; - - return surface->target->backend->map_to_image (surface->target, extents); + return _cairo_surface_map_to_image (surface->target, extents); } static cairo_int_status_t @@ -491,11 +487,7 @@ cairo_image_surface_t *image) { cairo_surface_observer_t *surface = abstract_surface; - - if (surface->target->backend->unmap_image == NULL) - return CAIRO_INT_STATUS_UNSUPPORTED; - - return surface->target->backend->unmap_image (surface->target, image); + return _cairo_surface_unmap_image (surface->target, image); } static void @@ -670,9 +662,9 @@ extents.width = 1; extents.height = 1; - cairo_surface_unmap_image (target, - cairo_surface_map_to_image (target, - &extents)); + _cairo_surface_unmap_image (target, + _cairo_surface_map_to_image (target, + &extents)); } static void diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface-subsurface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-surface-subsurface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-surface-subsurface.c 2012-04-27 18:29:27.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-surface-subsurface.c 2012-05-27 08:23:45.000000000 +0000 @@ -84,23 +84,19 @@ width, height); } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_surface_subsurface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { cairo_surface_subsurface_t *surface = abstract_surface; cairo_rectangle_int_t target_extents; - if (surface->target->backend->map_to_image == NULL) - return NULL; - target_extents.x = extents->x + surface->extents.x; target_extents.y = extents->y + surface->extents.y; target_extents.width = extents->width; target_extents.height = extents->height; - return surface->target->backend->map_to_image (surface->target, - &target_extents); + return _cairo_surface_map_to_image (surface->target, &target_extents); } static cairo_int_status_t @@ -108,11 +104,7 @@ cairo_image_surface_t *image) { cairo_surface_subsurface_t *surface = abstract_surface; - - if (surface->target->backend->unmap_image == NULL) - return CAIRO_INT_STATUS_UNSUPPORTED; - - return surface->target->backend->unmap_image (surface->target, image); + return _cairo_surface_unmap_image (surface->target, image); } static cairo_int_status_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-xcb-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-xcb-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-xcb-surface.c 2012-04-28 06:19:25.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-xcb-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -45,8 +45,8 @@ #include "cairo-composite-rectangles-private.h" #include "cairo-default-context-private.h" +#include "cairo-image-surface-inline.h" #include "cairo-list-inline.h" -#include "cairo-image-surface-private.h" #include "cairo-surface-backend-private.h" #if CAIRO_HAS_XLIB_XCB_FUNCTIONS @@ -755,21 +755,25 @@ return status; } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_xcb_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { cairo_xcb_surface_t *surface = abstract_surface; cairo_surface_t *image; + cairo_status_t status; if (surface->fallback) - return surface->fallback->base.backend->map_to_image (&surface->fallback->base, extents); + return _cairo_surface_map_to_image (&surface->fallback->base, extents); image = _get_image (surface, TRUE, extents->x, extents->y, extents->width, extents->height); - if (unlikely (image->status)) - return image; + status = cairo_surface_status (image); + if (unlikely (status)) { + cairo_surface_destroy(image); + return _cairo_image_surface_create_in_error (status); + } /* Do we have a deferred clear and this image surface does NOT cover the * whole xcb surface? Have to apply the clear in that case, else @@ -778,16 +782,16 @@ if (surface->deferred_clear && ! (extents->width == surface->width && extents->height == surface->height)) { - cairo_status_t status = _cairo_xcb_surface_clear (surface); + status = _cairo_xcb_surface_clear (surface); if (unlikely (status)) { cairo_surface_destroy(image); - return _cairo_surface_create_in_error (status); + return _cairo_image_surface_create_in_error (status); } } surface->deferred_clear = FALSE; cairo_surface_set_device_offset (image, -extents->x, -extents->y); - return image; + return (cairo_image_surface_t *) image; } static cairo_int_status_t @@ -795,10 +799,17 @@ cairo_image_surface_t *image) { cairo_xcb_surface_t *surface = abstract_surface; + cairo_int_status_t status; if (surface->fallback) - return surface->fallback->base.backend->unmap_image (&surface->fallback->base, image); - return _put_image (abstract_surface, image); + return _cairo_surface_unmap_image (&surface->fallback->base, image); + + status = _put_image (abstract_surface, image); + + cairo_surface_finish (&image->base); + cairo_surface_destroy (&image->base); + + return status; } static cairo_surface_t * diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-xlib-source.c cairo-1.12.3+git20120530.25317dbd/src/cairo-xlib-source.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-xlib-source.c 2012-04-19 15:28:24.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-xlib-source.c 2012-05-27 08:23:45.000000000 +0000 @@ -259,8 +259,9 @@ { Display *dpy = dst->display->display; cairo_xlib_surface_t *src; - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_status_t status; + cairo_rectangle_int_t map_extents; src = (cairo_xlib_surface_t *) _cairo_surface_create_similar_scratch (&dst->base, @@ -272,11 +273,14 @@ return None; } - image = cairo_surface_map_to_image (&src->base, NULL); - status = _cairo_surface_offset_paint (image, extents->x, extents->y, + map_extents = *extents; + map_extents.x = map_extents.y = 0; + + image = _cairo_surface_map_to_image (&src->base, &map_extents); + status = _cairo_surface_offset_paint (&image->base, extents->x, extents->y, CAIRO_OPERATOR_SOURCE, pattern, NULL); - cairo_surface_unmap_image (&src->base, image); + status = _cairo_surface_unmap_image (&src->base, image); if (unlikely (status)) { cairo_surface_destroy (&src->base); return _cairo_surface_create_in_error (status); @@ -909,10 +913,10 @@ int *src_x, int *src_y) { cairo_xlib_surface_t *src; - cairo_surface_t *image; + cairo_image_surface_t *image; cairo_surface_pattern_t local_pattern; cairo_status_t status; - cairo_rectangle_int_t upload, limit; + cairo_rectangle_int_t upload, limit, map_extents; cairo_matrix_t m; upload = *sample; @@ -939,12 +943,15 @@ cairo_matrix_init_translate (&local_pattern.base.matrix, upload.x, upload.y); - image = cairo_surface_map_to_image (&src->base, NULL); - status = _cairo_surface_paint (image, + map_extents = upload; + map_extents.x = map_extents.y = 0; + + image = _cairo_surface_map_to_image (&src->base, &map_extents); + status = _cairo_surface_paint (&image->base, CAIRO_OPERATOR_SOURCE, &local_pattern.base, NULL); - cairo_surface_unmap_image (&src->base, image); + status = _cairo_surface_unmap_image (&src->base, image); _cairo_pattern_fini (&local_pattern.base); if (unlikely (status)) { diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-xlib-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-xlib-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-xlib-surface.c 2012-04-28 06:19:25.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-xlib-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -1278,7 +1278,7 @@ cairo_surface_destroy (&image->base); } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_xlib_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { @@ -1287,18 +1287,25 @@ image = _get_image_surface (abstract_surface, extents); cairo_surface_set_device_offset (image, -extents->x, -extents->y); - return image; + return (cairo_image_surface_t *) image; } static cairo_int_status_t _cairo_xlib_surface_unmap_image (void *abstract_surface, cairo_image_surface_t *image) { - return _cairo_xlib_surface_draw_image (abstract_surface, image, - 0, 0, - image->width, image->height, - image->base.device_transform_inverse.x0, - image->base.device_transform_inverse.y0); + cairo_int_status_t status; + + status = _cairo_xlib_surface_draw_image (abstract_surface, image, + 0, 0, + image->width, image->height, + image->base.device_transform_inverse.x0, + image->base.device_transform_inverse.y0); + + cairo_surface_finish (&image->base); + cairo_surface_destroy (&image->base); + + return status; } static cairo_bool_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/cairo-xlib-xcb-surface.c cairo-1.12.3+git20120530.25317dbd/src/cairo-xlib-xcb-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/cairo-xlib-xcb-surface.c 2012-04-19 15:28:24.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/cairo-xlib-xcb-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -116,12 +116,12 @@ return cairo_surface_create_similar_image (&surface->xcb->base, format, width, height); } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_xlib_xcb_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { cairo_xlib_xcb_surface_t *surface = abstract_surface; - return cairo_surface_map_to_image (&surface->xcb->base, extents); + return _cairo_surface_map_to_image (&surface->xcb->base, extents); } static cairo_int_status_t @@ -129,13 +129,7 @@ cairo_image_surface_t *image) { cairo_xlib_xcb_surface_t *surface = abstract_surface; - - /* cairo_surface_unmap_image destroys the surface, so get a new reference - * for it to destroy. - */ - cairo_surface_reference (&image->base); - cairo_surface_unmap_image (&surface->xcb->base, &image->base); - return cairo_surface_status (&surface->xcb->base); + return _cairo_surface_unmap_image (&surface->xcb->base, image); } static cairo_surface_t * diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/Makefile.in cairo-1.12.3+git20120530.25317dbd/src/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/src/Makefile.in 2012-05-22 11:06:54.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/Makefile.in 2012-05-31 07:32:00.000000000 +0000 @@ -1704,9 +1704,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile + $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/skia/cairo-skia-surface.cpp cairo-1.12.3+git20120530.25317dbd/src/skia/cairo-skia-surface.cpp --- cairo-1.12.3+git20120521.aed94a5b/src/skia/cairo-skia-surface.cpp 2012-03-10 11:28:21.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/skia/cairo-skia-surface.cpp 2012-05-27 08:23:45.000000000 +0000 @@ -90,7 +90,7 @@ return CAIRO_STATUS_SUCCESS; } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_skia_surface_map_to_image (void *asurface, const cairo_rectangle_int_t *extents) { @@ -98,6 +98,7 @@ surface->bitmap->lockPixels (); + /* XXX: Broken! */ if (extents->width < surface->image.width || extents->height < surface->image.height) { diff -Nru cairo-1.12.3+git20120521.aed94a5b/src/win32/cairo-win32-display-surface.c cairo-1.12.3+git20120530.25317dbd/src/win32/cairo-win32-display-surface.c --- cairo-1.12.3+git20120521.aed94a5b/src/win32/cairo-win32-display-surface.c 2012-04-24 06:57:50.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/src/win32/cairo-win32-display-surface.c 2012-05-27 08:23:45.000000000 +0000 @@ -427,7 +427,7 @@ return CAIRO_STATUS_SUCCESS; } -static cairo_surface_t * +static cairo_image_surface_t * _cairo_win32_display_surface_map_to_image (void *abstract_surface, const cairo_rectangle_int_t *extents) { @@ -464,13 +464,13 @@ surface = to_win32_display_surface (surface->fallback); done: GdiFlush(); - return _cairo_image_surface_map_to_image (surface->image, extents); + return _cairo_surface_map_to_image (&surface->image->base, extents); err: cairo_surface_destroy (surface->fallback); surface->fallback = NULL; - return _cairo_surface_create_in_error (status); + return _cairo_image_surface_create_in_error (status); } static cairo_int_status_t @@ -499,7 +499,7 @@ _cairo_damage_add_rectangle (surface->fallback->damage, &r); } - return CAIRO_INT_STATUS_SUCCESS; + return _cairo_surface_unmap_image (&surface->image->base, image); } static cairo_status_t diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/bug-bo-collins.c cairo-1.12.3+git20120530.25317dbd/test/bug-bo-collins.c --- cairo-1.12.3+git20120521.aed94a5b/test/bug-bo-collins.c 1970-01-01 00:00:00.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/bug-bo-collins.c 2012-05-24 06:37:16.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Author: Chris Wilson + */ + +#include "cairo-test.h" + +static cairo_test_status_t +draw (cairo_t *cr, int width, int height) +{ + cairo_set_source_rgb (cr, 1, 1, 1); + cairo_paint (cr); + cairo_set_source_rgb (cr, 0, 0, 0); + + cairo_translate (cr, 0, 0); + cairo_save (cr); + cairo_rectangle (cr, 10, 10, 20, 20); + cairo_rectangle (cr, 20, 10, -10, 10); + cairo_clip (cr); + cairo_paint (cr); + cairo_restore (cr); + + cairo_translate (cr, 40, 0); + cairo_save (cr); + cairo_rectangle (cr, 10, 10, 20, 20); + cairo_rectangle (cr, 30, 10, -10, 10); + cairo_clip (cr); + cairo_paint (cr); + cairo_restore (cr); + + cairo_translate (cr, 0, 40); + cairo_save (cr); + cairo_rectangle (cr, 10, 10, 20, 20); + cairo_rectangle (cr, 30, 20, -10, 10); + cairo_clip (cr); + cairo_paint (cr); + cairo_restore (cr); + + cairo_translate (cr, -40, 0); + cairo_save (cr); + cairo_rectangle (cr, 10, 10, 20, 20); + cairo_rectangle (cr, 20, 20, -10, 10); + cairo_clip (cr); + cairo_paint (cr); + cairo_restore (cr); + + return CAIRO_TEST_SUCCESS; +} + +CAIRO_TEST (bug_bo_collins, + "Exercises a bug discovered by S. Christian Collins", + "clip, rectangular", /* keywords */ + NULL, /* requirements */ + 80, 80, + NULL, draw) diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/cairo-test-constructors.c cairo-1.12.3+git20120530.25317dbd/test/cairo-test-constructors.c --- cairo-1.12.3+git20120521.aed94a5b/test/cairo-test-constructors.c 2012-05-22 11:07:51.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/cairo-test-constructors.c 2012-05-31 07:32:56.000000000 +0000 @@ -34,6 +34,7 @@ extern void _register_bilevel_image (void); extern void _register_bug_40410 (void); extern void _register_bug_bo_rectangular (void); +extern void _register_bug_bo_collins (void); extern void _register_bug_bo_ricotz (void); extern void _register_bug_source_cu (void); extern void _register_bug_extents (void); @@ -546,6 +547,7 @@ _register_bilevel_image (); _register_bug_40410 (); _register_bug_bo_rectangular (); + _register_bug_bo_collins (); _register_bug_bo_ricotz (); _register_bug_source_cu (); _register_bug_extents (); diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/get-path-extents.c cairo-1.12.3+git20120530.25317dbd/test/get-path-extents.c --- cairo-1.12.3+git20120521.aed94a5b/test/get-path-extents.c 2011-08-07 07:51:39.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/get-path-extents.c 2012-05-24 06:37:16.000000000 +0000 @@ -110,7 +110,7 @@ int errors = 0; surface = cairo_surface_create_similar (cairo_get_group_target (cr), - CAIRO_CONTENT_COLOR, 100, 100); + CAIRO_CONTENT_COLOR, 1000, 1000); /* don't use cr accidentally */ cr = NULL; cr2 = cairo_create (surface); diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/Makefile.in cairo-1.12.3+git20120530.25317dbd/test/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/test/Makefile.in 2012-05-22 11:06:31.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/Makefile.in 2012-05-31 07:31:35.000000000 +0000 @@ -149,12 +149,12 @@ arc-looping-dash.c api-special-cases.c big-line.c \ big-empty-box.c big-empty-triangle.c big-little-box.c \ big-little-triangle.c big-trap.c bilevel-image.c bug-40410.c \ - bug-bo-rectangular.c bug-bo-ricotz.c bug-source-cu.c \ - bug-extents.c bug-seams.c caps.c checkerboard.c caps-joins.c \ - caps-joins-alpha.c caps-joins-curve.c caps-tails-curve.c \ - caps-sub-paths.c clear.c clear-source.c clip-all.c \ - clip-contexts.c clip-complex-shape.c clip-disjoint.c \ - clip-disjoint-hatching.c clip-device-offset.c \ + bug-bo-rectangular.c bug-bo-collins.c bug-bo-ricotz.c \ + bug-source-cu.c bug-extents.c bug-seams.c caps.c \ + checkerboard.c caps-joins.c caps-joins-alpha.c \ + caps-joins-curve.c caps-tails-curve.c caps-sub-paths.c clear.c \ + clear-source.c clip-all.c clip-contexts.c clip-complex-shape.c \ + clip-disjoint.c clip-disjoint-hatching.c clip-device-offset.c \ clip-double-free.c clip-draw-unbounded.c clip-empty.c \ clip-empty-group.c clip-empty-save.c clip-fill.c \ clip-fill-no-op.c clip-fill-rule.c \ @@ -358,6 +358,7 @@ cairo_test_suite-bilevel-image.$(OBJEXT) \ cairo_test_suite-bug-40410.$(OBJEXT) \ cairo_test_suite-bug-bo-rectangular.$(OBJEXT) \ + cairo_test_suite-bug-bo-collins.$(OBJEXT) \ cairo_test_suite-bug-bo-ricotz.$(OBJEXT) \ cairo_test_suite-bug-source-cu.$(OBJEXT) \ cairo_test_suite-bug-extents.$(OBJEXT) \ @@ -1069,12 +1070,12 @@ arc-looping-dash.c api-special-cases.c big-line.c \ big-empty-box.c big-empty-triangle.c big-little-box.c \ big-little-triangle.c big-trap.c bilevel-image.c bug-40410.c \ - bug-bo-rectangular.c bug-bo-ricotz.c bug-source-cu.c \ - bug-extents.c bug-seams.c caps.c checkerboard.c caps-joins.c \ - caps-joins-alpha.c caps-joins-curve.c caps-tails-curve.c \ - caps-sub-paths.c clear.c clear-source.c clip-all.c \ - clip-contexts.c clip-complex-shape.c clip-disjoint.c \ - clip-disjoint-hatching.c clip-device-offset.c \ + bug-bo-rectangular.c bug-bo-collins.c bug-bo-ricotz.c \ + bug-source-cu.c bug-extents.c bug-seams.c caps.c \ + checkerboard.c caps-joins.c caps-joins-alpha.c \ + caps-joins-curve.c caps-tails-curve.c caps-sub-paths.c clear.c \ + clear-source.c clip-all.c clip-contexts.c clip-complex-shape.c \ + clip-disjoint.c clip-disjoint-hatching.c clip-device-offset.c \ clip-double-free.c clip-draw-unbounded.c clip-empty.c \ clip-empty-group.c clip-empty-save.c clip-fill.c \ clip-fill-no-op.c clip-fill-rule.c \ @@ -1417,9 +1418,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile + $(AUTOMAKE) --foreign test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -1517,6 +1518,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-bitmap-font.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-buffer-diff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-bug-40410.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-bug-bo-collins.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-bug-bo-rectangular.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-bug-bo-ricotz.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cairo_test_suite-bug-extents.Po@am__quote@ @@ -2337,6 +2339,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cairo_test_suite_CFLAGS) $(CFLAGS) -c -o cairo_test_suite-bug-bo-rectangular.obj `if test -f 'bug-bo-rectangular.c'; then $(CYGPATH_W) 'bug-bo-rectangular.c'; else $(CYGPATH_W) '$(srcdir)/bug-bo-rectangular.c'; fi` +cairo_test_suite-bug-bo-collins.o: bug-bo-collins.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cairo_test_suite_CFLAGS) $(CFLAGS) -MT cairo_test_suite-bug-bo-collins.o -MD -MP -MF $(DEPDIR)/cairo_test_suite-bug-bo-collins.Tpo -c -o cairo_test_suite-bug-bo-collins.o `test -f 'bug-bo-collins.c' || echo '$(srcdir)/'`bug-bo-collins.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cairo_test_suite-bug-bo-collins.Tpo $(DEPDIR)/cairo_test_suite-bug-bo-collins.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bug-bo-collins.c' object='cairo_test_suite-bug-bo-collins.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cairo_test_suite_CFLAGS) $(CFLAGS) -c -o cairo_test_suite-bug-bo-collins.o `test -f 'bug-bo-collins.c' || echo '$(srcdir)/'`bug-bo-collins.c + +cairo_test_suite-bug-bo-collins.obj: bug-bo-collins.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cairo_test_suite_CFLAGS) $(CFLAGS) -MT cairo_test_suite-bug-bo-collins.obj -MD -MP -MF $(DEPDIR)/cairo_test_suite-bug-bo-collins.Tpo -c -o cairo_test_suite-bug-bo-collins.obj `if test -f 'bug-bo-collins.c'; then $(CYGPATH_W) 'bug-bo-collins.c'; else $(CYGPATH_W) '$(srcdir)/bug-bo-collins.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cairo_test_suite-bug-bo-collins.Tpo $(DEPDIR)/cairo_test_suite-bug-bo-collins.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bug-bo-collins.c' object='cairo_test_suite-bug-bo-collins.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cairo_test_suite_CFLAGS) $(CFLAGS) -c -o cairo_test_suite-bug-bo-collins.obj `if test -f 'bug-bo-collins.c'; then $(CYGPATH_W) 'bug-bo-collins.c'; else $(CYGPATH_W) '$(srcdir)/bug-bo-collins.c'; fi` + cairo_test_suite-bug-bo-ricotz.o: bug-bo-ricotz.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cairo_test_suite_CFLAGS) $(CFLAGS) -MT cairo_test_suite-bug-bo-ricotz.o -MD -MP -MF $(DEPDIR)/cairo_test_suite-bug-bo-ricotz.Tpo -c -o cairo_test_suite-bug-bo-ricotz.o `test -f 'bug-bo-ricotz.c' || echo '$(srcdir)/'`bug-bo-ricotz.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cairo_test_suite-bug-bo-ricotz.Tpo $(DEPDIR)/cairo_test_suite-bug-bo-ricotz.Po diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/Makefile.sources cairo-1.12.3+git20120530.25317dbd/test/Makefile.sources --- cairo-1.12.3+git20120521.aed94a5b/test/Makefile.sources 2012-04-29 17:31:45.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/Makefile.sources 2012-05-24 06:37:16.000000000 +0000 @@ -25,6 +25,7 @@ bilevel-image.c \ bug-40410.c \ bug-bo-rectangular.c \ + bug-bo-collins.c \ bug-bo-ricotz.c \ bug-source-cu.c \ bug-extents.c \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/pdiff/Makefile.in cairo-1.12.3+git20120530.25317dbd/test/pdiff/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/test/pdiff/Makefile.in 2012-05-22 11:06:31.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/pdiff/Makefile.in 2012-05-31 07:31:35.000000000 +0000 @@ -384,9 +384,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/pdiff/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/pdiff/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/pdiff/Makefile + $(AUTOMAKE) --foreign test/pdiff/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/png.c cairo-1.12.3+git20120530.25317dbd/test/png.c --- cairo-1.12.3+git20120521.aed94a5b/test/png.c 2011-08-07 07:51:39.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/png.c 2012-05-27 08:23:45.000000000 +0000 @@ -57,6 +57,7 @@ case CAIRO_FORMAT_A8: return "a8"; case CAIRO_FORMAT_RGB16_565: return "rgb16"; case CAIRO_FORMAT_RGB24: return "rgb24"; + case CAIRO_FORMAT_RGB30: return "rgb30"; case CAIRO_FORMAT_ARGB32: return "argb32"; case CAIRO_FORMAT_INVALID: default: return "???"; diff -Nru cairo-1.12.3+git20120521.aed94a5b/test/record90.c cairo-1.12.3+git20120530.25317dbd/test/record90.c --- cairo-1.12.3+git20120521.aed94a5b/test/record90.c 2012-02-29 07:30:35.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/test/record90.c 2012-05-24 06:37:16.000000000 +0000 @@ -485,7 +485,7 @@ "Test strokes of self-intersecting paths", "record, stroke, trap", /* keywords */ NULL, /* requirements */ - 10, 20, + 20, 10, NULL, record_self_intersecting) CAIRO_TEST (record90_text_transform, "Test various applications of the font matrix", Binary files /tmp/2xOM3AoseI/cairo-1.12.3+git20120521.aed94a5b/test/reference/bug-bo-collins.ref.png and /tmp/cV9cC4I1DO/cairo-1.12.3+git20120530.25317dbd/test/reference/bug-bo-collins.ref.png differ Binary files /tmp/2xOM3AoseI/cairo-1.12.3+git20120521.aed94a5b/test/reference/record90-self-intersecting.argb32.ref.png and /tmp/cV9cC4I1DO/cairo-1.12.3+git20120530.25317dbd/test/reference/record90-self-intersecting.argb32.ref.png differ Binary files /tmp/2xOM3AoseI/cairo-1.12.3+git20120521.aed94a5b/test/reference/record90-self-intersecting.ref.png and /tmp/cV9cC4I1DO/cairo-1.12.3+git20120530.25317dbd/test/reference/record90-self-intersecting.ref.png differ Binary files /tmp/2xOM3AoseI/cairo-1.12.3+git20120521.aed94a5b/test/reference/record90-self-intersecting.rgb24.ref.png and /tmp/cV9cC4I1DO/cairo-1.12.3+git20120530.25317dbd/test/reference/record90-self-intersecting.rgb24.ref.png differ Binary files /tmp/2xOM3AoseI/cairo-1.12.3+git20120521.aed94a5b/test/reference/unbounded-operator.argb32.ref.png and /tmp/cV9cC4I1DO/cairo-1.12.3+git20120530.25317dbd/test/reference/unbounded-operator.argb32.ref.png differ Binary files /tmp/2xOM3AoseI/cairo-1.12.3+git20120521.aed94a5b/test/reference/unbounded-operator.rgb24.ref.png and /tmp/cV9cC4I1DO/cairo-1.12.3+git20120530.25317dbd/test/reference/unbounded-operator.rgb24.ref.png differ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-fdr/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-fdr/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-fdr/Makefile.in 2012-05-22 11:06:31.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-fdr/Makefile.in 2012-05-31 07:31:35.000000000 +0000 @@ -394,9 +394,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-fdr/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-fdr/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-fdr/Makefile + $(AUTOMAKE) --foreign util/cairo-fdr/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-gobject/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-gobject/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-gobject/Makefile.in 2012-05-22 11:06:31.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-gobject/Makefile.in 2012-05-31 07:31:35.000000000 +0000 @@ -402,9 +402,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-gobject/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-gobject/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-gobject/Makefile + $(AUTOMAKE) --foreign util/cairo-gobject/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-missing/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-missing/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-missing/Makefile.in 2012-05-22 11:06:31.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-missing/Makefile.in 2012-05-31 07:31:35.000000000 +0000 @@ -370,9 +370,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-missing/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-missing/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-missing/Makefile + $(AUTOMAKE) --foreign util/cairo-missing/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-script/examples/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-script/examples/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-script/examples/Makefile.in 2012-05-22 11:06:32.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-script/examples/Makefile.in 2012-05-31 07:31:36.000000000 +0000 @@ -331,9 +331,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-script/examples/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-script/examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-script/examples/Makefile + $(AUTOMAKE) --foreign util/cairo-script/examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-script/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-script/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-script/Makefile.in 2012-05-22 11:06:32.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-script/Makefile.in 2012-05-31 07:31:36.000000000 +0000 @@ -503,9 +503,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-script/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-script/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-script/Makefile + $(AUTOMAKE) --foreign util/cairo-script/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-sphinx/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-sphinx/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-sphinx/Makefile.in 2012-05-22 11:06:32.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-sphinx/Makefile.in 2012-05-31 07:31:36.000000000 +0000 @@ -421,9 +421,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-sphinx/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-sphinx/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-sphinx/Makefile + $(AUTOMAKE) --foreign util/cairo-sphinx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/cairo-trace/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/cairo-trace/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/cairo-trace/Makefile.in 2012-05-22 11:06:32.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/cairo-trace/Makefile.in 2012-05-31 07:31:36.000000000 +0000 @@ -420,9 +420,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/cairo-trace/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/cairo-trace/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/cairo-trace/Makefile + $(AUTOMAKE) --foreign util/cairo-trace/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff -Nru cairo-1.12.3+git20120521.aed94a5b/util/Makefile.in cairo-1.12.3+git20120530.25317dbd/util/Makefile.in --- cairo-1.12.3+git20120521.aed94a5b/util/Makefile.in 2012-05-22 11:06:31.000000000 +0000 +++ cairo-1.12.3+git20120530.25317dbd/util/Makefile.in 2012-05-31 07:31:35.000000000 +0000 @@ -507,9 +507,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu util/Makefile + $(AUTOMAKE) --foreign util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \