Commit graph

10381 commits

Author SHA1 Message Date
Chris Wilson
7eb33099d3 snapshot: Perform the cow under a mutex
In order to prevent a race between concurrent destroy and use in another
thread, we need to acquire a reference to the snapshot->target under a
mutex. Whilst we hold that reference, it prevents the internal destroy
mechanism from freeing the memory we are using (if we have a pointer to
the original surface) and the client drops their final reference.

Oh boy, talk about opening a can of worms...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-27 14:10:50 +01:00
Chris Wilson
455b4de1fc image: Allow a snapshot to steal the original memory upon finish
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-27 11:41:41 +01:00
Chris Wilson
957a9cc619 image: Fix typo in _blit_spans()
The height is 'h' not 'y'!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-26 08:54:39 +01:00
Chris Wilson
fe428fc7f0 xlib: Fix inline conversion for TrueColor PutImage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 20:56:20 +01:00
Chris Wilson
9e81c5b737 xlib: Allow applications to create 0x0 surfaces
Although 0x0 is not a legimate surface size, we do allow applications
the flexibility to reset the size before drawing. As we previously never
checked the size against minimum legal constraints, applications expect
to be able to create seemingly illegal surfaces, and so we must continue
to provide backwards compatibility.

Many thanks to Pauli Nieminen for trawling through the protocol traces,
diving into the depths of libreoffice and identifying the regression.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=49118 (presentation
mode in loimpress is blank).

Reported-by: Eric Valette <eric.valette@free.fr>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 20:51:20 +01:00
Jeff Mahoney
f736cd1443 pdf: Fix wrong allocation in _cairo_pdf_surface_add_source_surface
_cairo_pdf_surface_add_source_surface allocates unique_id with
size unique_id_length but then copies surface_key.unique_id_length into it.

This causes e.g. evince to crash predictably while trying to print with:
*** buffer overflow detected ***: evince terminated

We should be using surface_key.unique_id_length instead.

Reported-by: Dominique Leuenberger <dominique-freedesktop.org@leuenberger.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49089
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-04-23 22:13:57 +01:00
Alexandros Frantzis
e6a04c2f67 gl: Fix creation of gradient ramps for GLESv2
glTexImage2D is not allowed to perform an implicit format conversion
with GLESv2, so fixup the internal format to match the incoming pixel
format.
2012-04-23 20:21:40 +01:00
Dimiter Stanev
1ca8c049ca win32: compilation fix for recent private/inline header separation 2012-04-23 19:10:44 +01:00
Adrian Johnson
abedc6b46a ps: support all image types
If the image is not rgb24/argb32/a8/a1, create a new image with the
same CAIRO_CONTENT and paint image to the new image.
2012-04-23 13:22:16 +09:30
Adrian Johnson
33f9e433ee pdf: support all image types
If the image is not rgb24/argb32/a8/a1, create a new image with the
same CAIRO_CONTENT and paint image to the new image.
2012-04-23 13:21:52 +09:30
Chris Wilson
c0b523eb65 stroke(boxes): Convert the dash step back into device units before incrementing
Reported-by: Carlos Garcia Campos <carlosgc@gnome.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-21 10:18:26 +01:00
Chris Wilson
99f3fea6d9 gl: Uses the inline clip function, so update its include
Fixes build from 0770dda52b.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 17:53:11 +01:00
Chris Wilson
0046967224 dash: Increment dash_remain by the next segment to reduce accumulation errors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 16:12:55 +01:00
Chris Wilson
5e39a8098b dash: Use a epsilon compare for stepping the dash
Due to rounding errors that may creep in comparing against 0.0 is
dangerous and may result in an infinite loop whilst generating dashes
that consumes all memory.

Reported-and-tested-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 15:48:01 +01:00
Chris Wilson
57cfdfd979 Split cairo-list into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 13:17:29 +01:00
Chris Wilson
df62accbda Split cairo-surface-subsurface-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 13:17:29 +01:00
Chris Wilson
590202dbfb Split cairo-error-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 13:17:29 +01:00
Chris Wilson
2e7d60e0a2 Split cairo-pattern-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:55:44 +01:00
Chris Wilson
306117ea7c Split cairo-recording-surface-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:51:03 +01:00
Chris Wilson
8653c2692e Split cairo-recording-surface-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:46:34 +01:00
Chris Wilson
3266f936de Split cairo-surface-snapshot-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:41:20 +01:00
Chris Wilson
356c7cb2e3 Split cairo-surface-observer-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:35:20 +01:00
Chris Wilson
f3623cf022 Split cairo-surface-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:27:44 +01:00
Chris Wilson
6736d0bf00 Split cairo-contour-privates into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:25:42 +01:00
Chris Wilson
afa180935b Split cairo-combsort-privates into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:22:07 +01:00
Chris Wilson
0770dda52b Split cairo-clip-privates into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:19:19 +01:00
Chris Wilson
e9c9e28cd1 Split cairo-box-privates into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:16:53 +01:00
Chris Wilson
f830268b95 boxes: Remove unused inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 12:14:26 +01:00
Chris Wilson
9417fec04a image: Split inline SRC composition
Currently we construct a mask for the entire line and try to process it
in one call to pixman (two without the LERP operator). An alternative
approach is split the row into separate composite operations for the
clear (which we can skip), fully opaque and partial spans.

As the source operator is typically mostly opaque or clear, this is a
good win as we are able to utilise more fast paths. In the worst case,
it degrades to the old method of constructing a whole mask for a row.
It may reduce performance for having to process lots of spans though
(this is where the pixman spans interface should help). However, such
geometry is rare and typically handled elsewhere.

And the existing code has a bug where it was clearing the destination
for clear regions of the mask outside of the spans.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-19 10:51:39 +01:00
Chris Wilson
70fc52cb80 stroke(boxes): Apply user scale factors to dash segments
Fixes tests/rectilinear-dash-scale*

Reported-by: Guillaume Ayoub <xovni@wanadoo.fr>
Reported-by: Carlos Garcia Campos <carlosgc@gnome.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48818
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-18 15:29:00 +01:00
Chris Wilson
5ff32f70c1 test: Add rectilinear-dash-scale
Exercise rectilinear dashes under a non-uniform scale factors.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48818
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-18 15:29:00 +01:00
Nis Martensen
4f125a1bd0 typo 2012-04-16 22:11:36 +02:00
Nis Martensen
905a88bf51 doc: add missing chapters
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-16 21:55:18 +02:00
Nis Martensen
80d1e68bb3 doc: do not use / in section title
The Title: field is used to determine the file name of the generated
html. Due to the slash a subdirectory is created and all relative links
in the generated file are broken.

Use a hyphen instead.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-16 21:55:18 +02:00
Javier Jardón
40d6c580cd configure.ac: Do not generate template files when building docs
It's not needed as all the api documentation is inline
2012-04-14 15:06:24 +01:00
Javier Jardón
7b25b2eb4b autogen.sh: User autoreconf instead custom script 2012-04-14 15:04:19 +01:00
Javier Jardón
aa90a8f84f configure.ac: generate xz tarballs by default 2012-04-14 15:04:06 +01:00
Javier Jardón
3616a5f992 configure.ac: Update autotools configuration
Do not use autoconf deprecated macros
Use new libtool syntax
honor aclocal flags
2012-04-14 15:02:10 +01:00
Chris Wilson
93d42e82a4 Revert accidental push of ps debugging API.
This reverts commits
   6ad8c96fd8,
   a3f97d1d2e,
   25abe58298

I should know better by now than to push without checking for outstanding
changes.
2012-04-14 14:54:07 +01:00
Marcus Meissner
d486ea30f1 configure: Conditionally include -flto
As some systems fail to create working binaries with when linked with
lto, perform a check during configure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39114
2012-04-14 14:48:32 +01:00
Chris Wilson
25abe58298 pdf (debug API): Export the ability to force fallbacks
We need to occasionally force fallbacks whilst testing the PDF
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 12:22:17 +01:00
Chris Wilson
a3f97d1d2e ps (debug API): Export the ability to force fallbacks
We need to occasionally force fallbacks whilst testing the PostScript
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 12:22:15 +01:00
Chris Wilson
6ad8c96fd8 ps (API): Export the ability to set the creation date of the surface
A PostScript surface embeds a CreationDate comment into its document
description pre-amble. Normally this is set to the time the surface is
written out, except we set this to a constant value in the boilerplate
for the purposes of mimicking a reference file. It may also be useful
for external applications, so make it a public export.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 12:21:22 +01:00
Nis Martensen
bf5adaf394 doc: add returns statement to cairo_surface_supports_mime_type
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-12 10:23:28 +02:00
Nis Martensen
a6a5b1fd0b doc: no separate cairo-xcb-xrender section
There is already a cairo-xcb section and there are no symbols that
should be documented in an extra -xrender section. It is not mentioned
in cairo-sections.txt either. So simply delete it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-12 10:23:27 +02:00
Nis Martensen
c04f5a353f add unused symbols to sections doc
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-12 10:23:26 +02:00
Uli Schlachter
07fc63676d xlib: Disable fallback compositor with xlib-xcb
When xlib-xcb is enabled, this is just dead code which is never used. Thus, this
shouldn't hurt. However, this does include cairo-xlib-private.h. Shouldn't be a
problem? Well, that header contains static inline functions which some compiler
on Solaris will emit even when they are unused.

This brings us to the real problem: That static inline function refers to a
function which isn't compiled with xlib-xcb and thus linking fails with
undefined symbols.

This can be reproduced with GCC by adding a call to
_cairo_xlib_screen_put_gc(NULL, NULL, 0, 0); to
_cairo_xlib_fallback_compositor_get.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48489
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-11 21:37:55 +02:00
Gilles Espinasse
09de481ce5 Cosmetic configure fix
'how to allow undefined symbols in shared libraries' test should use CAIRO_CC_TRY_FLAG_SILENT or configure display is a bit out of order like this

checking how to allow undefined symbols in shared libraries used by test suite... checking whether gcc supports -Wl,--allow-shlib-undefined... yes
-Wl,--allow-shlib-undefined

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-10 17:46:13 +02:00
Adrian Johnson
c7b86ab97b any2ppm: fix missing enumeration warning 2012-04-10 22:34:05 +09:30
Maarten Bosmans
b74e8ebd50 Add _cairo_win32_print_gdi_error to boilerplate code
This function is not exported in libcairo, so can't be used from the
library.
2012-04-10 12:09:02 +01:00