Commit graph

10620 commits

Author SHA1 Message Date
David Maxwell
599e78ea2e type1: lenIV support
http://lists.cairographics.org/archives/cairo/2012-October/023557.html
2012-10-07 16:22:28 +10:30
David Maxwell
cffbdf50ce type1: buildchar stack fix
http://lists.cairographics.org/archives/cairo/2012-October/023557.html
2012-10-07 16:22:13 +10:30
Chris Wilson
e29bb5f295 win32: Use the image surface below the fallback when unmapping an HDC
As for a native window, the surface does not have an image delegate
itself but instead installs a fallback surface during map_to_image. So
during unmap_image, we then need to unmap from the fallback surface
instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-06 18:53:41 +01:00
Uli Schlachter
0251f0951d xcb: Clear the result of create_similar_image
The documentation of cairo_surface_create_similar_image() states that the
image's contents are initially all 0. However, the implementation didn't live up
to the documentation.

This was found via the corresponding assert in
cairo_surface_create_similar_image().

There are some cairo-xcb-internal users of this function which cleared the image
right after creating it. Obviously, this isn't needed anymore.

Fixes: Nothing. The existing call in the testsuite to
cairo_surface_create_similar_image() doesn't hit this issue, since it creates a
too small image to hit the SHM-case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-06 15:00:51 +02:00
Chris Wilson
15ef4a3248 xlib/shm: Note the bug is an interaction between libXext and xorg
Søren thought it was bit harsh to lay the blame solely on xorg for it
crashing due to an unexpected input value, and that we should mention
libXext was also partly to blame for incorrectly setting the SEND_EVENT
bit in the ShmCompletionEvent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 19:46:41 +01:00
Chris Wilson
b1532f465e xlib/shm: Avoid using XSendEvent with old versions of Xorg
Søren Sandmann Pedersen pointed out that all versions of Xorg prior to
and including xorg-1.11.0 contained a bug that would cause them to crash
if they ever processed an event sent by XSendEvent. This was fixed in

commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date:   Wed Sep 14 09:58:34 2011 +0800

    Remove the SendEvent bit (0x80) before doing range checks on event type.

so make sure we do not use XSendEvent prior to that commit, which
fortuitously is quite easy as we only do so along the ShmPixmap path.

Reported-by: Søren Sandmann Pedersen <ssp@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 19:20:18 +01:00
Chris Wilson
dba46f4eab version: Post release bump to 1.12.5 2012-10-05 17:24:56 +01:00
Chris Wilson
117abd85ac 1.12.4 release 2012-10-05 16:44:00 +01:00
Chris Wilson
6c6a697610 win32: Compile fix for mismatched surface types
win32/cairo-win32-display-surface.c:472: error: structure has no member
named 'base'

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 14:55:28 +01:00
Chris Wilson
ccf694d060 xlib/shm: Discard SHM surfaces upon CloseDisplay
Fixes xlib-surface-source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 13:36:30 +01:00
Chris Wilson
8488ae022d test: Refresh reference images for slight alteration of curves 2012-10-05 13:29:06 +01:00
Chris Wilson
d6a0567684 stroke: Remove redundant code for computing culling extents
Same code repeated!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 17:38:21 +01:00
Chris Wilson
8020e0bc8c recording: Perform an explicit during snapshot
In order to avoid recursing upon our source mutex when doing a snapshot,
we can perform an explicit copy of the command array. This should also
be faster than performing a replay as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50443
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 17:08:06 +01:00
Chris Wilson
797441093a tor: Fudge the edge if it is projected into a point
If we generate an edge (through polygon-intersect) where its end-points
lie outside the line definition then it is possible for that line to be
degenerate under sample grid projection. Apply a fudge factor to prevent
explosions as otherwise we reject an edge whose height is not strictly
0.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54822
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 15:29:36 +01:00
Chris Wilson
cabb3c3bdf spans-compositor: Remove polygon limits after construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 12:21:00 +01:00
Chris Wilson
c05147b215 test: Refresh reference image for clip-disjoint-quad
Rather than using the traps reference for all target as this then
generates false negatives with the spans compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 11:41:58 +01:00
Chris Wilson
ef0b2e43ee composite-rectangles: Update unbounded (clip extents) after reducing clip
So that the composite-rectangles remains consistent with the reduced
clip in case the individual compositors try to optimise their rendering
strategies based on the reduced clip and the overall extents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 11:35:40 +01:00
Chris Wilson
36536d3eb8 spans-compositor: Use the tight clip-boxes for polygon construction
If we will be reducing the clip intersection to a single clip box check
during construction, it helps if we use the tight clip box.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 11:14:18 +01:00
Chris Wilson
7e856071a2 polygon-intersect: Exclude non-overlapping clip boxes from consideration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 11:13:23 +01:00
Chris Wilson
3969f2c687 test: Add clip-disjoint-quad
Exercises a bug in the polygon intersection code demonstrated by Søren
Sandmann.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27 09:58:50 +01:00
Uli Schlachter
9735d1d716 mark_dirty: Check surface status
This problem was introduced in commit "xlib: Implement SHM fallbacks and fast
upload paths". Before, cairo_surface_mark_dirty() directly called
cairo_surface_mark_dirty_rectangle() with special "magical arguments" and thus
didn't need any checks on the surface status.

Fixes: api-special-cases

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-25 11:58:18 +02:00
Uli Schlachter
2be125817a surface: Check reference count right before free
This makes sure that nothing took a reference during finishing and during
detaching user and mime-data.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-25 11:44:54 +02:00
Uli Schlachter
f2720e2ba1 xcb: Add a missing check for FillRectangles
Fixes: big-empty-box big-little-box operator operator-alpha
surface-pattern-operator unbounded-operator

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-25 11:39:42 +02:00
Uli Schlachter
b264ae76bd xcb: Check if traps are supported before using them
This code tried to optimize the clip away by intersecting the boxes with the
clip polygon. However, it also did so when the server didn't support traps.

Fixes: clip-stroke-unbounded clip-fill-nz-unbounded clip-fill-eo-unbounded
clip-fill clip-fill-rule a1-clip-fill-rule clip-group-shapes-circles
clip-intersect clip-nesting clip-operator clip-push-group clip-polygons
clip-shape clip-text clip-twice inverted-clip mask random-clip
rotate-clip-image-surface-paint trap-clip unantialiased-shapes

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-25 11:34:52 +02:00
Uli Schlachter
0ccbb83eb8 xcb: Check the right flag for FillRectangles
Fixes: operator-source

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-25 11:31:04 +02:00
Uli Schlachter
b33d83ad49 xcb: Verify extension support before sending
This commit adds lots of asserts. These asserts verify for each extension
request that we send that the server really supports this.

Sadly, this causes 28 assertion failures in the test suite with xcb-render-0.0.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-25 11:27:59 +02:00
Uli Schlachter
de31018bdd xcb: Switch to compositor architecture
This commit removes the hand-written code in cairo-xcb-surface.c and instead
makes use of cairo_compositor_t. Surprisingly, this doesn't break a single test
case. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-24 09:44:10 +02:00
Uli Schlachter
6300579a8b xcb: Remove unimplemented cairo compositor
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-24 09:44:10 +02:00
Uli Schlachter
8d86ea4dcb xcb: Fix a warn_unused_result warning
cairo-xcb-surface.c: In function '_drawable_changed':
cairo-xcb-surface.c:1434:39: warning: ignoring return value of '_cairo_surface_begin_modification', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-24 09:42:43 +02:00
Uli Schlachter
d6253dd531 Remove an unimplemented function declaration
This was added in commit 2458120dee.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-24 09:42:43 +02:00
Uli Schlachter
08e3f4614b Fix make check
The inline functions in cairo-backend-private.h tried to dereference a cairo_t,
which wasn't defined. Fix this by including cairo-private.h.

In cairo-mempool-private.h, size_t is used but stddef.h is not included.

Fixes:

  CHECK cairo-backend-private.h
In file included from headers-standalone-tmp.c:1:0:
./cairo-backend-private.h: In function ‘_cairo_backend_to_user’:
./cairo-backend-private.h:179:7: error: dereferencing pointer to incomplete type
./cairo-backend-private.h: In function ‘_cairo_backend_to_user_distance’:
./cairo-backend-private.h:185:7: error: dereferencing pointer to incomplete type
./cairo-backend-private.h: In function ‘_cairo_user_to_backend’:
./cairo-backend-private.h:191:7: error: dereferencing pointer to incomplete type
./cairo-backend-private.h: In function ‘_cairo_user_to_backend_distance’:
./cairo-backend-private.h:197:7: error: dereferencing pointer to incomplete type
  CHECK cairo-mempool-private.h
In file included from headers-standalone-tmp.c:1:0:
./cairo-mempool-private.h:61:5: error: unknown type name ‘size_t’
./cairo-mempool-private.h:62:5: error: unknown type name ‘size_t’
./cairo-mempool-private.h:68:8: error: unknown type name ‘size_t’
./cairo-mempool-private.h:73:44: error: unknown type name ‘size_t’

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-09-24 09:42:43 +02:00
Behdad Esfahbod
1054840d86 Fix malloc-stats for newer glibc 2012-09-22 15:59:36 -04:00
Behdad Esfahbod
38c6084758 [util/malloc-stats] Use tighter spacing. 2012-09-17 16:27:04 -04:00
Weng Xuetian
59248fb262 xlib: Reset fallback counter when discarding the fallback
References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
2012-09-13 22:57:45 +01:00
Chris Wilson
5c59d989f9 xlib: Destroy the fallback damage along with the fallback surface
Whenever we discard the fallback surface, we need to destroy the
associated damage tracking, so move this into the common discard
routine.

This should fix the issue when trying to flush the fallback before
the user modifies any foreign Drawables. The current code issued the
flush and then explicitly discard the fallback, but unless it was idle
at the time of the flush the associated damage would not have also been
destroyed. Asserts followed.

References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 22:54:18 +01:00
Chris Wilson
97282ef51a xlib: Do not call _cairo_xlib_surface_flush directly
Use the higher level layer to be sure we detach any snapshots and other
cached data that is invalidated along with the change of Drawable.

Pointed out by the eternally wise Uli Schlachter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 17:00:24 +01:00
Chris Wilson
69d97d97be xlib: Force the fallback flush before updating the external Drawable
_cairo_surface_begin_modification() performs an internal flush, for
which the xlib backend skips flushing the fallback surface as it will
continue to use it for the subsequent operation. In the case where we
are flushing prior to updating the Drawable, we need to perform an
external flush which will trigger the posting of the damage from the
fallback surface.

Reported-by: Weng Xuetian <wengxt@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 16:45:46 +01:00
Chris Wilson
6ee216000a xlib: Explicitly discard the fallback shm pixmap upon user modification
If the user changes the size of the underlying drawable, we much make
sure that we discard the current ShmPixmap in order to create a new
fallback pixmap of the correct size next time.

Reported-by: Weng Xuetian <wengxt@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 15:30:27 +01:00
Chris Wilson
e2c4bb9465 xlib: Fix regression in cairo_xlib_surface_set_drawable()
In commit 0bfd2acd35
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Aug 13 01:34:12 2012 +0100

    xlib: Implement SHM fallbacks and fast upload paths

I made the mistake of inverting the logic for
cairo_xlib_surface_set_drawable() causing it then to never update.

Thanks to Uli Schlachter for spotting my error.

References: https://bugs.freedesktop.org/show_bug.cgi?id=54657
Reported-by: Weng Xuetian <wengxt@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-13 12:40:49 +01:00
Chris Wilson
77330f6b84 xcb: Always flush the fallback damage to foreign drawables
We need to flush any fallback to a foreign drawable upon finish.
However, we must be careful not to attach the snapshot in that case or
else we end up with an expected reference. This is similar to the
treatment of xlib/shm in commit f864e2d70.

Reported-by: Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-11 18:24:33 +01:00
Andrea Canciani
93774ac034 test: Add degenerate closed path case to get-path-extents
This is a testcase to ensure that we do not regress
https://bugs.freedesktop.org/show_bug.cgi?id=54549 (which is already
fixed by b0c466e27a).
2012-09-10 23:16:08 +02:00
Chris Wilson
f34b87f6d7 path: Convert from backend coordinates back into user coordinates
Fixes regression from commit 83bfd85a13
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Apr 23 19:45:26 2010 +0100

    Implement cairo_backend_t

As there exists no public API to perform the operation we needed, and we
failed to create one, the constructed path failed to correctly remove
the device offset.

Fixes copy-path under device translation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54732
Reported-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-10 15:09:18 +01:00
Chris Wilson
df6780442f context: Add missing functions to transform between user and backend coordinates
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-10 15:09:15 +01:00
Chris Wilson
f864e2d70f xlib/shm: Explicitly release shm surface if we do not own the pixmap
In this case we want to prevent the short-circuiting of the flush of the
ShmPixmap that is ordinarily performed during finish().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-08 16:41:23 +01:00
Chris Wilson
558f0a5ab4 image: Check for an error surface before dereferencing the backend
As the surface->backend will be NULL in such an error surface, and we
may be legitimately doing boundary checks to reject the error surface.
The alternative would be to set an explicit error surface backend.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54664
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-08 15:12:58 +01:00
Chris Wilson
b0c466e27a path: Update last_move_point after move-to
Reported-and-tested-by: Jussi Kukkonen <jku@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54549
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-05 14:55:55 +01:00
Chris Wilson
83759e7d59 default-context: Convert the relative path segments into the backend coordinates
When transforming the incoming paths, the goal is to transform them from
user space onto the target coordinate system. Currently for relative
paths we used user_to_device_distance as we presumed that there was no
backend scale factor. However, Alex Larsson noticed that these then
broke when playing around with such a device transform...

Reported-by: Alexander Larsson <alexl@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-04 14:47:22 +01:00
Chris Wilson
c0b1b17818 xlib/shm: Masquerade as an ordinary ShmCompletionEvent
Needs a bit of extra work to create the extension event, but this leaves
the application with only a single spurious event to filter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 13:21:35 +01:00
Chris Wilson
be2973e405 bentley-ottmann: Cache the most recent edge colinearity check
We frequently compare neighbouring edges for their colinearity (in case
we can skip over them in the active list) so we can record the last
comparison and reuse the result next time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 11:59:46 +01:00
Chris Wilson
637659fb51 bentley-ottmann: hint that the insertion compare function should be inlined
Albeit it too large for gcc to automatically inline, it is only used
from within a single function. Hopefully gcc can optimise better with
the hint.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 11:16:32 +01:00