Commit graph

7655 commits

Author SHA1 Message Date
Chris Wilson
07ee9cfbf0 [image] Do assumption initial user data is cleared.
Benjamin Otte pointed out the error of my ways that a clear on a
cairo_image_surface_create_for_data() was not working. This is because I
modified the image surface to skip clears when it knows the target data
has been cleared. This flag must be reset when the user interacts with
the surface, such as providing the initial surface data.
2009-09-23 15:37:35 +01:00
Chris Wilson
9948b5180a [test] Revamp surface-source
Include a translucent region in the source that exercises the xlib bug
that I'm trying to fix. Hmm.
2009-09-22 18:20:03 +01:00
Chris Wilson
941d3693fa [test] Exercise push-group-color.
Hunting for a known bug in the xlib backend where it invalidly converts
an argb32 source to rgb24. However, this does not appear to be that bug,
but still a useful exercise nevertheless.
2009-09-22 15:46:56 +01:00
Chris Wilson
30f45ce5f7 [gl] Handle an absent visual.
If we cannot find the correct visual for the fbconfig, return an error
instead of crashing. The difference is subtle, granted.
2009-09-22 15:46:56 +01:00
Adrian Johnson
e74cb7fa3e win32-printing: correct the use of the CAIRO_HAS_WIN32_FONT #ifdef
it was wrapping code required for non windows fonts.
2009-09-22 22:44:34 +09:30
Adrian Johnson
3dd2cc8f6d win32-printing: fix meta surface pattern regression caused by bed2701e 2009-09-22 22:40:53 +09:30
Adrian Johnson
7658635c65 win32-printing: Allow GDI CTM with scale < 1 to be set
To better support creating EMF files with the win32-printing surface,
allow a GDI CTM with scale < 1 to be used.

http://lists.cairographics.org/archives/cairo/2009-September/018110.html
2009-09-22 22:36:20 +09:30
Adrian Johnson
19c0916703 Make win32 fonts work in EMF files created by win32-printing 2009-09-22 22:35:33 +09:30
Adrian Johnson
f01a54266d Fix compiler warnings in win32-surface 2009-09-22 22:34:56 +09:30
Adrian Johnson
23663e2078 Fix compiler error on cygwin 2009-09-22 22:34:21 +09:30
Adrian Johnson
7ecd413fab Add WINVER defines to cairo-mutex-impl-privaye.h
The WINVER defines should always be defined before including windows.h
2009-09-22 22:33:14 +09:30
Adrian Johnson
605ec22ab5 Use _WIN32 to check for win32 mutex
Commit 535bcaa1 moved pthread after win32 to fix mingw build
problems. However this breaks cygwin builds.

On cygwin HAVE_WINDOWS_H is defined but _WIN32 is not. This was
causing windows.h to be included which defines _WIN32. As a result the
win32 code in cairo-misc.c was being compiled but the win32 declaration
in cairint.h was not included.

Fix this by using _WIN32 to enable the win32 mutex functions since
_WIN32 is defined by mingw, visual C++, and winegcc, but not
cygwin. On cygwin, posix functions are preferred as it is a unix
emulation environment.
2009-09-22 22:17:27 +09:30
Chris Wilson
e00d062749 [xlib] Fix recent bug in unbounded trapezoids
Gah! I had believed that the dst extents and the clip were correct to
enable unbounded fixup for the unbounded trapezoids. I was wrong, so I
need to requery the trapezoid extents. As this information is already
known, I should update the interface to pass along all relevant
information.
2009-09-21 13:50:00 +01:00
Chris Wilson
378b1e73d9 [fallback] Special case single composite rectangle
Avoid the overhead of region-from-traps extraction for the very frequent
case of using a single (possibly clipped) rectangle with a pattern source.
2009-09-21 04:26:01 +01:00
Chris Wilson
35daf95db8 [xlib] Trim a few redundant steps when uploading glyphs
Cleanup the glyph coercion routines to avoid the temporary cairo_t (as
we can just cairo_surface_paint() directly).
2009-09-21 04:26:01 +01:00
Chris Wilson
9b7c5d9505 [xlib] Cleanse creation of similar surfaces.
Reduce two nearly identical routines to one.
2009-09-20 20:10:34 +01:00
Chris Wilson
878cef62b5 [xlib] Interim CAIRO_DEBUG variable to specify xrender level
Use CAIRO_DEBUG=xrender-version=x.y to override what the server reports.
Useful to test cairo's behaviour against older servers.
2009-09-20 19:59:21 +01:00
Jeff Muizelaar
531e804598 Add a description of how we compute the spline_error_squared. 2009-09-18 12:17:46 -04:00
Behdad Esfahbod
f433635240 Set LC_ALL=C instead of LANG=C 2009-09-16 15:50:34 -04:00
Sebastian Dröge
56c9b2de7a Use __uint128_t and __int128_t if available
GCC uses a peculiar name for a real 128-bit integer on x86-64.

Speedups, xlib on a gm45
========================
poppler        41246.56 -> 35102.82: 1.18x speedup
swfdec-youtube 12623.01 -> 11936.79: 1.06x speedup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-15 18:19:08 +01:00
Chris Wilson
ccf84a8883 [perf] Reorganise cairo-perf
In preparation to creating a new hub to control performance measuring
and reporting, move the current cairo-perf out of the way.
2009-09-15 18:19:08 +01:00
M Joonas Pihlaja
4152cd90e2 [autoconf] Comment on the SIZEOF_VOID__ -> SIZEOF_VOID_P workaround.
Explain where the weird SIZEOF_VOID__ comes from.
2009-09-14 14:29:01 +03:00
M Joonas Pihlaja
cd94bf8bf3 [trace] Look harder for the cairo-trace.so library.
On OpenBSD the convention is to not use symlinks from
unversioned library names to versioned library names.
This breaks cairo-trace because it looks for cairo-trace.so
explicitly, but on OpenBSD only cairo-trace.so.0.0 is
installed.

The right thing to do is probably to source the cairo-trace.la
file and look for a file name there somehow.  Instead this commit
just looks for a likely looking file or symlink in the install
directory.
2009-09-14 13:32:19 +03:00
M Joonas Pihlaja
a343c8c42d [trace] Don't use pthread_key_delete.
On OpenBSD libc doesn't provide pthread stubs like glibc on Linux
or newer libcs from FreeBSD.  However libX11 does provide a stubs
for a subset of the pthread functions (formerly in libXThrStub,
now moved into libX11 proper), but pthread_key_delete() is not
one of the stubbed ones.  So, on OpenBSD cairo's non-linking of
libpthread accidentally works as long as the xlib-surface is enabled,
which is nearly always the case.

This patch makes trace.c stand at the same precipice as cairo itself
by reverting to only a subset of the pthreads functions stubbed by
libX11.
2009-09-14 13:32:18 +03:00
M Joonas Pihlaja
cf0fed2191 [build] Check for dlsym in both libdl and libc.
The BSDs have dlsym() in libc rather than libdl.
2009-09-14 13:32:18 +03:00
M Joonas Pihlaja
1c7ac6c47a [build] Work around autoconf void* -> VOID__ name conversion bug.
The autoconf shipping with OpenBSD 4.5 converts sizeof(void*)
to SIZEOF_VOID__ rather than SIZEOF_VOID_P.  Work around that
by defining SIZEOF_VOID_P if required.
2009-09-14 13:32:18 +03:00
Chris Wilson
12470fd701 [configure] Setup GL CFLAGS before checking for GLX 2009-09-14 10:36:08 +01:00
Chris Wilson
9c2790ccc4 [build] Add a default message for when GLEW isn't built
And it appears I touched the build system again and autoregenerated the
feature headers.
2009-09-14 10:10:45 +01:00
Chris Wilson
6d4f3c40ef Add a private copy of GLEW
This appears to be the simplest mechanism to build libglew at the moment -
should a system copy be unavailable.  Fortunately libglew is now distributed
under a permissive licence.

If you want to pass 'make -C src check' you have to use the system copy,
or spend quite a bit of time cairo-fying libglew.
2009-09-14 09:26:02 +01:00
Chris Wilson
9ad26f74b0 [configure] Fallback to detect OpenGL headers
When not using mesa, we can not rely on a pkgconfig file, so just rely on
the presence of the OpenGL headers instead.
2009-09-13 23:16:57 +01:00
M Joonas Pihlaja
71c3b2888c [win32] Sync Makefile.win32.features.
Ooops.. wasn't sure if I should commit this or not.
2009-09-13 20:33:42 +03:00
M Joonas Pihlaja
ba21f21356 [trace] Don't trace internal cairo calls on Solaris.
On various configurations of Solaris cairo-trace likes to trace
internal calls to the API from within cairo and cairo-trace itself. On
Linux the slim_hidden_proto stuff avoids this by name mangling and
symbol alias magic, but on Solaris that doesn't work so we're left
with either no hidden symbols at all or using normal ELF hidden symbol
attributes, but neither of those prevent internal calls to cairo from
being traced of course.

This commit provides a per-thread entry/exit trace counter for use
when we can't use name mangling to hide internal API calls.  As a
side-effect it may hide actual client API calls from callback
functions called by cairo, but such use cases ought to be rare.
2009-09-13 20:33:33 +03:00
M Joonas Pihlaja
f5bcb2f36e [build] Enable building cairo-trace on Solaris.
Solaris supports LD_PRELOAD too!
2009-09-13 20:30:55 +03:00
M Joonas Pihlaja
ce8c842a70 [trace] Make cairo-trace and its symbol-lookup automatically configured.
The build shouldn't fail if we can't make our optional performance
tools.
2009-09-13 20:30:55 +03:00
M Joonas Pihlaja
2fb59a69f4 [trace] Don't rely on the constructor attribute to initialise the tracer.
Use pthread_once() at cairo API entry points to initialise the library
if required.  This side steps the issues with the __constructor__
attribute vs _init()/_fini() on Solaris and different tracer/tracee
runtimes which result in the constructors not being run in
cairo-trace.so.
2009-09-13 20:30:04 +03:00
M Joonas Pihlaja
18a441984b [trace] Don't try and propagate a void result.
The pattern

	return <function returning void>( ... );

is a gccism not supported by Sun Studio.
2009-09-13 20:27:41 +03:00
M Joonas Pihlaja
fee5c58c6c [trace] Avoid warnings from assigning a void pointer to a function pointer.
The Sun Studio compiler complains a *lot* when assigning the result
of dlsym to a function pointer.  Cast the result to the proper
type first.:w
2009-09-13 20:27:41 +03:00
Chris Wilson
19881012cb [image] Add pixel masks for BGRA formats
pixman introduced the BGRA pixel type not too long ago, and so we need to
update our pixman_format_code_t to cairo_format_masks_t translator.
2009-09-13 16:36:12 +01:00
Chris Wilson
f8a8f297f2 [trace] Stray trailing ';' in bswap macros 2009-09-13 10:58:59 +01:00
Chris Wilson
f851009ec7 [trace] Compile without lookup-symbol
And check compilation with --disable-symbol-lookup
2009-09-13 10:57:42 +01:00
Chris Wilson
6cb3ff9c19 [configure] --enable-symbol-lookup
There you go Joonas, I don't always ignore your suggestions! This is
simple patch to allow the user to disable symbol loops in case the
auto-detection fails on some obscure (perhaps OpenBSD) platform. Or in
case the user really wants to trim a few bytes from a library only used
during tracing!
2009-09-13 10:52:14 +01:00
Chris Wilson
556d064f4e [test] Typos in README from previous commit 2009-09-11 15:35:27 +01:00
Chris Wilson
43ecde2d22 [test] Add Debian packages for fonts
Mention which .deb provides the required fonts.
2009-09-11 15:15:22 +01:00
Chris Wilson
33be73dfb7 [xlib] Fix big-line.
Project lines that exceed the 16.16 limits onto the XFixedLine, as we know
that top/bottom must fit within the confines of the surface and so will be
less than 16 bits.

Sadly this is a run-on patch that also does:
1. Make FillTiled the default for new GCs.
2. Stores extend mode as opposed to repeat, and thereby cleaning up some
inconsistent code.
3. Remove the special casing for unbounded trapezoids, as it is redundant
with the polygon clipping.
4. Tidy the logic for deciding when to use the core protocol
(_categorize_composite_operation)
2009-09-11 14:59:58 +01:00
Chris Wilson
6960162c5e [xlib] Discard clip if larger than glyph extents
Implement cheap calculation of glyph extents to see whether we can discard
the clip region. This is effective around 50% of the time for firefox (and
makes the xtrace so much neater).
2009-09-11 14:56:17 +01:00
Chris Wilson
6e78409417 [test] Update big-line and remove XFAIL
Now that we use polygon clipping, output geometry should no longer exceed
the 2^16 limits imposed by pixman. For the image backend, we now use spans
for stroking and for the xlib backend we have to double check the range on
the output trapezoids. In short, cairo should pass this test.
2009-09-11 14:19:38 +01:00
Chris Wilson
b495e7eb2e [surface] Early return for (region IN white)
Fill a region using IN and a white source is a frequent reduction of a
complex clip (viz a path that covers the whole operation extents will be
reduced to a single rectangle), and we can simply discard the fill (as it
always has bounded semantics).
2009-09-10 19:25:14 +01:00
Chris Wilson
94aeae9b2e [clip] Simplify applying a box clip
If the clip path is a simple box, then for many operations it is entirely
representation by the alteration of extents and so we can skip a few steps
during reconstruction.
2009-09-10 19:11:36 +01:00
Chris Wilson
496e79b637 [xlib] Fix extraction of GC during XCloseDisplay()
Jeff Muizelaar reported a bug from his firefox builds that was causing a
double free during XCloseDisplay, and suggested it was related to
c0e01d9cd. Reviewing the cleanup, suggested that the cause may just be a
pair of missing parenthesis.
2009-09-10 17:36:46 +01:00
Chris Wilson
f34affaa1e [util] And reuse the same name repository name.
Completely confused by local caching of a broken cairo.modules by the
jhbuild client. ARGH!
2009-09-09 18:03:20 +01:00