Commit graph

10023 commits

Author SHA1 Message Date
Keith Packard
d5c7d2e2f4 cairo-xcb: gtk-doc doesn't like _ in parameter names
Any function documented with gtk-doc must not have _ in any parameter
names, or at least that's what I've found. This patch simply renames
parameters as needed to make things work.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:50 +00:00
Chris Wilson
a6def3874c gl: Even repeating subsurfaces need to be cloned
As we can't reuse the existing surface definition for a repetition of
the subsurface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:29:51 +00:00
Chris Wilson
f308ba7a44 subsurface: Replace any existing snapshot
Only allow one owner to keep their snapshot on the subsurface, and
so automatically replace any previous snapshot.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:25:38 +00:00
Chris Wilson
03be2019cd gl: And enable subsurface caching of the clones
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:21:18 +00:00
Chris Wilson
5f6d3fe40b gl: Temporarily clone a subsurface as required
When the sample extents exceed the subsurface bounds we need to clone
the subsurface into a regular surface in order to correctly handle the
CAIRO_EXTEND_NONE extend mode (i.e prevent sampling out-of-bounds).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:17:24 +00:00
Chris Wilson
4713562eda trace: Remove the warning about the unstable format
We're stuck with the PostScript style for this generation now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:50:21 +00:00
Chris Wilson
f5f303f10d script: Prefer polymorphorism for mesh path construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:48:50 +00:00
Chris Wilson
8844d50308 Convert cairo_mime_surface_t to cairo_raster_source_pattern_t
As discussed, overloading the cairo_surface_t semantics to include
sources (i.e. read-only surfaces) was duplicating the definition of
cairo_pattern_t. So rather than introduce a new surface type with
pattern semantics, start along the thorny road of extensible pattern
types.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:35:42 +00:00
Chris Wilson
2c4f6bbfbc gl: Prevent the traps compositor from exploding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
5e4a0bd892 gl: Embed a operand into the surface for pass-through
The traps compositor expects to be able to pass either in a surface or a
source to its composite functions, so make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
4cf001244a gl: Avoid cleaning up an uninitialised composite upon UNSUPPORTED
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
5edb3a29b9 gl: Fallback for complex subsurfaces
In the process we need to supply the sampled area and operation extents
into the operands.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
12b8f94161 gl: Correctly offset sub-image uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
e280e67b86 gl: Update glyphs to use cairo_gl_source_t
It was being passed into the function but then interpreted as a
cairo_pattern_t. Fix it!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 21:20:21 +00:00
Martin Robinson
d99ebe9862 gl: Properly prepare the source when compositing glyphs with a mask.
After the architecture rewrite, glyph compositing via a mask was
disabled. This change reinstates that.
2011-11-23 20:49:37 +00:00
Martin Robinson
33c59030b5 gl: Fix offset for non-texture surface patterns
Instead of drawing only a portion of the image into the intermediate
texture, draw the entire image and adjust the translation matrix to
compensate.
2011-11-23 20:49:30 +00:00
Martin Robinson
c94c3eede0 gl/msaa: Fix scissor bounds
Scissor bounds should depend on both the height and y coordinate
of the bounding box. Also remove _cairo_gl_y_flip() since we were
the last caller.
2011-11-23 20:49:16 +00:00
Andrea Canciani
e3ec127e39 subsurface: Fix 'make check'
2fb4a0e119 made the
_cairo_surface_subsurface_set_snapshot available with default
visibility.

'make check' correctly points out that it should be marked as private.
2011-11-23 20:17:56 +01:00
Chris Wilson
6a2b754ec9 xlib: Eliminate redundant copies of subsurfaces
If the sample is wholly contained within the subsurface of the original,
we can simply use the original with an offset; thereby only copying the
data if we are sampling outside the subsurface bounds.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 18:40:02 +00:00
Chris Wilson
49d3a6a95e xlib: Cache the subsurface Picture
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 17:36:16 +00:00
Chris Wilson
763d98071e surface: Bump reference count around finish
In order to handle reference cycles during finish (through snapshots) we
need to bump the reference on the surface first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 17:35:39 +00:00
Chris Wilson
2fb4a0e119 subsurface: Support caching for cloned subsurfaces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 17:35:30 +00:00
Chris Wilson
894d8c8bf7 xlib: Handle subsurfaces correctly
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 15:40:15 +00:00
Chris Wilson
e217677ce6 xlib: ADD only reduces to SOURCE for alpha-only targets
Fixes operator.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:57:35 +00:00
Chris Wilson
44a868b552 subsurface: And remove the dead code for releasing complex source
Following the previous commit, we only allocate a simple image when
acquiring the source so we only need to unreference it upon release.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:28:27 +00:00
Chris Wilson
1fe16f75b1 image: Remove dubious "optimisations" for acquired source images
By this point we have already paid the penalty for acquiring the source
image, so kiss.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:19:22 +00:00
Chris Wilson
c52129feb4 subsurface: Simplify acquire_source_image
Remove all of the special casing and simply extract the source. The time
for special casing is to avoid calling the generic acquire in the first
place, so kiss.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:19:22 +00:00
Chris Wilson
73dc2c4e27 image: Only unwrap a subsurface if the sample is fully contained
In order to handle out-of-bounds sampling of a subsurface target we need
to first avoid incorrectly unwrapping it.

Fixes crash in subsurface-outside-target

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:14:39 +00:00
Murray Cumming
8d989d2b2d cairo_surface_observer_mode_t: Remove trailing comma.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-21 20:53:51 +01:00
Chris Wilson
56746110fe polygon-intersection: Finish any edges upon intersection
In order to keep the bookkeeping in order, and so prevent a later
assert, we need to clear any edges when swapping the active edge order
upon an intersection event. The active edges are then reconstructed.

Fixes evince http://www.horizonhobby.com/pdf/BLH3500-Manual_EN.pdf

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-21 16:57:42 +00:00
Andrea Canciani
adb5eb6f69 xcb: Fix typo 2011-11-18 12:23:02 +01:00
Chris Wilson
9ecc3aafca perf: Compile fix, add the index to cairo_perf_report_load()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-18 10:04:12 +00:00
Chris Wilson
2283ab9698 xcb: Handle SHM exhaustion gracefully
Avoid the assertion failure of creating an error surface for an internal
status by handling the expected UNSUPPORTED condition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-18 10:01:55 +00:00
Chris Wilson
c8dca5dad6 Revert "xcb: Fix xcb-huge-image-shm"
This reverts commit 3a94f4c709.

We need to fallback to pushing large images over the wire if we exhaust
the SHM space.
2011-11-18 09:59:34 +00:00
Uli Schlachter
3a94f4c709 xcb: Fix xcb-huge-image-shm
The test failed with the following message:

cairo-surface.c:2265: _cairo_surface_create_in_error: Assertion `status <
CAIRO_STATUS_LAST_STATUS' failed.

_cairo_xcb_surface_create_shm_image() passed the error from
_cairo_xcb_connection_allocate_shm_info() to _create_in_error().

Fix this by never returning CAIRO_INT_STATUS_UNSUPPORTED from
_allocate_shm_info(). All other error cases in that function return
CAIRO_STATUS_NO_MEMORY, too.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-15 19:46:46 +01:00
Uli Schlachter
edc238b40f xcb: Fix some invalid casts
cairo-xcb was deciding which type to cast a surface to based on its "type"
member. This is wrong, it should use "backend->type".

This bug was hit via xlib-xcb. This was painting a subsurface of a xlib-xcb
surface to an xcb surface. Because surface->type said "xlib", the code was
trying to check if the xcb surface had a fallback. However, this was done on the
subsurface. The end result was dereferencing a pointer to 0x28.

This was noticed while looking into
https://bugs.freedesktop.org/show_bug.cgi?id=42889

No test for this bug since I didn't manage to come up with one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-11-15 19:19:44 +01:00
Andrea Canciani
1501c86536 test: Do not open files in non-existing dirs
The output directory should be made before trying to open log files in
it.

Fixes the bug causing cairo-test-suite to log to stderr on the first
run (i.e. when test/output does not exist).
2011-11-12 20:49:08 +01:00
Andrea Canciani
603ea229b5 test: Use cairo_test_list_t for the main test list
Instead of embedding the pointer in the test structure, consistently
use the cairo_test_list_t structure for test lists.

This cleans up the code as the reverse-list operation can be reused.

Moreover this makes the code clearer, because each test list is now
independent and has no way to know about other test lists.
2011-11-12 20:49:08 +01:00
Andrea Canciani
abced5b882 boilerplate: Fix svg extension
The svg backend produces .svg files. Using the appropriate extension
allows the test suite to check the vector output in addition to the
PNG images.
2011-11-12 20:49:08 +01:00
Andrea Canciani
de6a1e68fe Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic patch:

// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }
2011-11-12 20:49:08 +01:00
Andrea Canciani
c65d4e35dc Use xstrdup instead of xmalloc when possible
Don't open code xstrdup, just use it.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6dfb12c7d7 test: Reuse cairo_test_logv()
cairo_test_log() can be implemented on top of cairo_test_logv() to
ensure that their behavior is consistent.
2011-11-12 20:49:08 +01:00
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
b07b242220 test: Remove unused thread field
The multi-threaded test path does not exist anymore and the ctx->thread
field is always 0, hence it can be removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6ef9779a6f test: Remove dead code
This code is unused and can be removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
97b219a5e7 test: Re-enable pass-through
The pass-through test was not updated to the current test conventions
and was not enabled in the Makefiles.
2011-11-12 20:49:08 +01:00
Andrea Canciani
c8b5d270f6 Improve the documentation of the flags
Some utilities were providing incorrect or incomplete usage
information.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6a0ba30303 Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.

Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
2011-11-12 20:49:08 +01:00
Andrea Canciani
0e18cc6d27 boilerplate: Provide close callback after opening any2ppm output
cairo_boilerplate_open_any2ppm() returns a FILE* obtined from popen()
or fdopen(). It should hence be closed using pclose() or fclose()
respectively.

Fixes the crash on every script test on MacOS X.
2011-11-11 15:30:50 +01:00
Andrea Canciani
90b2fd34fb cairo-script: Don't ask for inlining of a cold-path function
Silences a lot of warnings:

inlining failed in call to 'scan_read.part.9': call is unlikely and
code size would grow
2011-11-09 14:17:10 +01:00