Commit graph

9996 commits

Author SHA1 Message Date
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
Andrea Canciani
f96e78fa54 Silence some 'unused var' warnings 2011-11-09 13:56:50 +01:00
Andrea Canciani
d883775f69 xml: Fix backend structure
The xml backend structure was being initialized with the wrong
functions, resulting in multiple "initialization from incompatible
pointer type" warnings.
2011-11-09 13:49:45 +01:00
Andrea Canciani
26d5bb0ecc default-context: Fix 'make check'
'make check' reports:

Checking that .libs/libcairo.so has the same symbol list as cairo.def
1a2,3
> _cairo_default_context_fini
> _cairo_default_context_init

Checking .libs/libcairo.so for local PLT entries
0011a274  00025f07 R_386_JUMP_SLOT        00026350   _cairo_default_context_fini
0011a494  00027607 R_386_JUMP_SLOT        00026480   _cairo_default_context_init

Marking these functions as cairo_private fixes the problem.
2011-11-09 13:34:53 +01:00
Andrea Canciani
f5c00042b0 cogl: Fix 'make check'
'make check' reports:

./cairo-cogl-context.c: * cairo_path_fixed_t in user coordinates that we can use to create a
./cairo-cogl-context.c: * We use this hash to lookup a cairo_cogl_path_meta_t struct which
./cairo-cogl-context.c: * need to use the cairo_path_fixed_t api to describe a rectangle in terms of
./cairo-cogl-context.c: * passed the current cairo_t context we don't have a good way
Error: some type names in the docs are not prefixed by hash sign,
neither are the only token in the doc line followed by colon.
Fix this by searching for the following regexp in the above files:
    '^[^:]*:[/ ][*]\( .*[^#']\| \|^\)\<cairo[0-9a-z_]*_t\>\($\|[^:]$\|[^:].\)'

./cairo-cogl-context.c: * cairo_path_fixed_t in user coordinates that we can use to create a
./cairo-cogl-context.c: * We use this hash to lookup a cairo_cogl_path_meta_t struct which
./cairo-cogl-context.c: * need to use the cairo_path_fixed_t api to describe a rectangle in terms of
./cairo-cogl-context.c: * passed the current cairo_t context we don't have a good way
Error: some function names in the docs are not followed by parentheses.
Fix this by searching for the following regexp in the above files:
    '^[^:]*:[/ ][*]\(\|[  ].*\)\([^#']\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)'

Checking that source files #include "cairoint.h" first (or none)
cairo-cogl-context.c:#include "cairo-cogl-context-private.h"

These are fixed trivially by this patch.
2011-11-09 12:34:16 +01:00
Andrea Canciani
7688da2245 vg: Fix build
Add the missing includes, fix a typo and some changes in the
signatures of the backend functions.

The dest acquisition functions can be removed as they are not used
anymore in the new compositor architecture (this will probably cause
failures when fallbacks are tried because of unsupported operations).
2011-11-09 12:25:03 +01:00
Andrea Canciani
54c8a08f3e quartz-image: Fix build
Add missing headers and fix some minor things (typos, missing
arguments, changed function name).

Map and unmap now rely on the generic path.
2011-11-09 11:27:28 +01:00
Andrea Canciani
f9aa85f5fe stroke: Fix typos
The condition was comparing out with itself (always resulting in a
true result) instead of out and in.

Pointed out by Clang as "idempotent operation".
2011-11-02 13:13:32 +01:00
Chris Wilson
c64ec4e49c gl: Initialize spans on the context
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-02 11:00:40 +00:00
Chris Wilson
2a453ee7df Merge branch 'master' of git://cairographics.org/git/cairo 2011-10-27 19:00:58 +01:00
Carlos Garcia Campos
8ddecc08a5 xlib: Check pixman format before trying to create an image surface for it 2011-10-27 18:13:29 +02:00
Andrea Canciani
5c31566678 rectangle: Fix warning
In 545f3085.. the cairo_spline_add_point_func_t type was modified to
accept the tangent in the point, but cairo-rectangle.c was not updated
accordingly.

Fixes:

cairo-rectangle.c: In function '_cairo_box_add_curve_to':
cairo-rectangle.c:297:11: warning: passing argument 1 of
'_cairo_spline_bound' from incompatible pointer type
2011-10-26 15:10:59 +02:00
Ehsan Akhgari
26c9994393 Avoid defining inline when compling C++ on MSVC.
Cairo fails to build with VC11 because it tries to #define inline,
which is a keyword in C++. VC11's xkeycheck.h catches this with an #error.
https://bugzilla.mozilla.org/show_bug.cgi?id=694797
2011-10-17 10:48:50 -04:00
Martin Robinson
3813066f13 gl/msaa: Fix glScissor bounds
When scissoring the compositing extents for windows, flip
the y coordinate as windows use a projection matrix that
does the same.
2011-10-15 09:05:19 +01:00
Chris Wilson
cc3f06a58a Merge branch 'master' of git://cairographics.org/git/cairo 2011-10-15 08:59:35 +01:00
Chris Wilson
ba855a12e8 xlib-xp 2011-10-14 16:01:27 +01:00
Chris Wilson
10ebda8698 xlib: Reduce the composite traps operator for when the dest is clear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-14 13:23:02 +01:00
Chris Wilson
a8c3a22f2d gl/msaa: Markup the new symbols as private for PLT hiding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-14 13:20:09 +01:00
Taekyun Kim
e8dd13c8fa image: Maximum number of spans can be upto (extents->width + 1)
The range of span's x coordinate is between xmin and xmax. So we
have to allocate the span array with size of xmax - xmin + 1.
2011-10-14 13:20:09 +01:00
Martin Robinson
c25027f2a1 gl/msaa: Support for solid color strokes.
Add support for basic solid color strokes using the fixed path
stroke shaper. Currently components of the stroke overlap, but
that will be handled in the following patch.
2011-10-13 14:42:23 +01:00
Martin Robinson
32aa361c5e gl/msaa: Add clipping support
Adds basic clipping to the OpenGL MSAA compositor via the
depth and stencil buffers. Stenciling and depth bits are
stored in a renderbuffer.

Note that we only attach renderbuffers to surfaces created by ourselves
and not for foreign drawables (e.g. X Windows).
2011-10-13 14:42:23 +01:00
Martin Robinson
13d9d07ccd gl/msaa: Implement basic solid color fill
Introduce the very basic functionality of an MSAA compositor
for OpenGL. For this first patch only solid fills are supported.
2011-10-13 14:42:15 +01:00
Martin Robinson
9f85eb52d8 gl/msaa: Introduce an MSAA compositor for OpenGL
The MSAA compositor will composite OpenGL primitives directly and
anti-alias via the GPU.
2011-10-13 14:42:09 +01:00
Chris Wilson
7df2c113b1 ft: Add missing break to enable BGR subpixel rendering
Reported-by: Ingo Ruhnke <grumbel@gmx.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40456
Original-patch-by: Simon Elmir <nerd65536+freedesktop@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-13 13:06:31 +01:00
Uli Schlachter
9208df1630 test: Add text-antialias-subpixel-{,v}{bgr,rgb}
There were no tests for any subpixel order but rgb, so let's write something for
all four possibilities.

This is mostly copy&paste from test/text-antialias.c (and
text-antialias-subpixel-rgb does the same thing as text-antialias-subpixel).

Test for: https://bugs.freedesktop.org/show_bug.cgi?id=40456

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-13 13:40:20 +02:00
Chris Wilson
282cfff156 recording-surface: Initialize optimize-clears before use in snapshotting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 17:12:09 +01:00
Chris Wilson
f84f6ecaa4 gstate: Prevent leak of old clip when creating a group with translation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 17:09:12 +01:00
Chris Wilson
8f34fa033e spans: Refresh polygon limits after trimming the composite extents
Trimming the composite extents may result in the clip being
reconstructed, but we the polygon continued to hold a reference into the
freed clip's array of boxes. So if we intend to reuse the polygon limits
after performing the clip we need to refresh them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-12 17:04:16 +01:00