Commit graph

10360 commits

Author SHA1 Message Date
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
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