Commit graph

9930 commits

Author SHA1 Message Date
Chris Wilson
3d51ec8a79 botor: Remove a couple of inlines to cleanup -Winline
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-10 15:22:37 +01:00
Chris Wilson
34f507a919 gl: Need to increment reference count when copying operands
Or else watch everything die with use-after-free of the cached
gradients.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-09 19:54:15 +01:00
Chris Wilson
a6c27b500b gl: Basic fixes to get cairo-gl running again
Let there be textures!

Unbreak the setup of surface operands after my lazy convertion to the
new compositor interface. This is still only the first step, but it gets
the essentials up and running again, enough to keep me happy whilst
sitting in the airport.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-09 19:54:15 +01:00
Chris Wilson
22c485017d gl: Declare coverage input for fragment shaders.
The most minor of oversights which prevented compilation of any spans
based compositors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-10-09 19:54:15 +01:00
Uli Schlachter
d825f6a263 clip_intersect_boxes: Fix memleak
There were two code path were we already had called
_cairo_boxes_init_for_array() on a local variable, but we tried to return
without going through _cairo_boxes_fini().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:39:25 +02:00
Uli Schlachter
dca4e6c2dd clip: Fix clip-double-free
If the call to _cairo_clip_set_all_clipped() right after this is hit,
clip->boxes was freed twice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:37:03 +02:00
Uli Schlachter
4092e90be5 test: Add clip-double-free
This test tries to exercise a double free bug in the clipping code.

My webkit-based browser recently crashed a lot. Here is the reason why.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:33:37 +02:00
Uli Schlachter
a419d00fbe flush: Detach mime data
Drawing directly to a surface has to be surrounded with cairo_surface_flush()
and cairo_surface_mark_dirty().

However, if the surface has mime data associated, this would hit the following
assert:

lt-cairo-test-suite: cairo-surface.c:1381: cairo_surface_mark_dirty_rectangle:
Assertion `! _cairo_surface_has_mime_data (surface)' failed.

This is now fixed by detaching all mime data in cairo_surface_flush().

Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41409

Fixes: create-from-png, create-from-png-stream

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:22:26 +02:00
Uli Schlachter
b9e5cd9572 create-from-png*: Test mark_dirty with mime data
This currently hits the following assertion:

lt-cairo-test-suite: cairo-surface.c:1381: cairo_surface_mark_dirty_rectangle:
Assertion `! _cairo_surface_has_mime_data (surface)' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41409

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-09 09:21:13 +02:00
Adrian Johnson
61fdaaf7e5 cff: fallback if seac style endchar is found
Bug 41548
2011-10-09 15:25:42 +10:30
Adrian Johnson
e2dca74edf cff: in CID fonts the CID is the glyph index
Need to use charset to map CID to GID.

Bug 41548
2011-10-09 14:58:13 +10:30
Uli Schlachter
5f3fd8c09c xlib: Fix compilation with --disable-xlib-xrender
The boilerplate code tries to set PolyModePrecise on the xlib device. However,
because xrender is disabled, cairo-xlib-xrender.h wasn't included and didn't
include the needed xrender headers for this define.

This define is copied from cairo-xlib-xrender-private.h

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-08 10:48:26 +02:00
Uli Schlachter
960ae5ab2e Make the new mime-surface-api succeed
When removing mime data, _cairo_user_data_array_set_data () is called with a
NULL argument. This leaves behind an entry with key == NULL in the user data
array. Skip those entries instead of dereferencing NULL.

(The NULL entry in the array let's us avoid moving data around and/or doing a
memory allocation later, so I guess it might be a good idea to keep that)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-04 21:00:23 +02:00
Uli Schlachter
38ce0850b8 test: Add mime-surface-api
This test checks if setting and unsetting mime data works correctly. E.g. this
verifies that we get the same pointer back which we passed in (=no copy made).

This test currently crashes in its last call to cairo_surface_get_mime_data().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-04 21:00:23 +02:00
Andrea Canciani
8664df767c quartz: Fix the 32-bits build on MacOSX 10.7
FMGetATSFontRefFromFont() is not public on Lion nor on 64-bits
Frameworks, but it seems to be available in the dynamic libs, hence we
can dlsym() it just like other private functions.

Works around the error:
cairo-quartz-font.c: In function 'cairo_quartz_font_face_create_for_atsu_font_id':
cairo-quartz-font.c:830: error: implicit declaration of function 'FMGetATSFontRefFromFont'

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39493
2011-10-01 09:24:08 -07:00
Chris Wilson
80fff70e6c test: Add clip-rectilinear
Exercise the clipping code with a rectilinear path (rather than a set of
boxes as per usual).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 16:31:06 +01:00
Chris Wilson
538fa0d6fb fill: Fix unantialiased rectilinear-fill-to-boxes
We were calling the antialias close function from the unantialiased
paths - a function that operates on a completely different structure to
the one passed in.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 15:58:14 +01:00
Chris Wilson
719bef0c90 image: Enable use of LERP_SRC for masked source composition
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 13:07:23 +01:00
Chris Wilson
2994b0c634 stroke: Use the tessellator to resolve overlapping strokes
If the stroke is too large, the strokes around the box overlap and we
fail to generate the canonical form of the boxes. So if we detect that
the boxes overlap, feed them through the tessellator to reduce them to
canonical form.

Fixes line-width-overlap.

Based on a patch by  Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-29 00:26:06 +01:00
Chris Wilson
30eac7b2c5 test: Add line-width-large-overlap
Exercise the case of stroking a box with a pen wider than the box
itself, a variation on line-width-overlap suggested by Paulo Zanoni.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-29 00:24:18 +01:00
Rob Bradford
82a7eac1de build: Specify the reference images as a directory for EXTRA_DIST
Rather than having the reference images individually listed in
test/Makefile.refs the whole directory can be included in the EXTRA_DIST
block.

This removes the need to have the check-ref-missing Makefile target.
2011-09-27 15:44:57 +01:00
Chris Wilson
add9a4092b trace: Emit an stack operation to create a pattern from an undefined surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-27 14:56:55 +01:00
Chris Wilson
b8ae60f619 test: Refresh reference images
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-26 14:55:03 +01:00
Chris Wilson
303893681f test/random-clips: Paint clip to highlight the issues
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-26 13:30:35 +01:00
Chris Wilson
9fe7022790 polygon-intersect: Remove surplus edge direction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-26 13:25:58 +01:00
Chris Wilson
1a1b39a9c3 script: compile without
The surface observer gained a dependency on script, make it optional.
2011-09-26 11:52:48 +01:00
Chris Wilson
bbacfc4e83 win32: Compile, but broken
First step: just make it compile again but crash upon usage.
2011-09-26 11:52:05 +01:00
Chris Wilson
4790bbf596 boilerplate: Skip testing of null surfaces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-26 11:51:27 +01:00
Chris Wilson
9c56df3904 test: Mark the record-select-font-face as XFAIL
The recording surface has no knowledge of the target surface when it
generates the scaled font and informs the client about the kerning and
metrics. This results in an unfortunate slight misalignment when
replaying the glyphs against the ideal case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 23:34:29 +01:00
Chris Wilson
70ac21f7bb test: Refresh rotated-clip reference 2011-09-23 23:32:37 +01:00
Chris Wilson
606e9e1c9e test: Refresh tighten-bounds reference image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 23:28:50 +01:00
Chris Wilson
d71ce5e0dd spans: Fix empty polygon unbounded fixup
There is a subtle flaw in the current querying of polygon extents; it
simply returns the limits and not the point extremeties and certainly
not the tessellation extents. Computing that is likely to take long than
rendering the polygon. This does mean that we need to also fixup the
extents prior to performing the empty unbounded fast path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 23:24:25 +01:00
Chris Wilson
9a366cff2c test: Redefine success for miter-precision
On review, that segment does exist and should not have been removed by
numerical errors!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 22:48:46 +01:00
Chris Wilson
2c34f028a7 test: Exercise scaling from an atlas through a subsurface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 13:37:51 +01:00
Chris Wilson
9b3b84976a test: refresh text-pattern reference 2011-09-23 13:20:32 +01:00
Chris Wilson
7e5e2dd5e1 test/create-from-png: Update to point to new reference/ images
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-23 13:20:14 +01:00
Uli Schlachter
f162f7ebb4 xcb: Fix device offsets with unmap_image()
The source and target x/y coordinates were swapped. No idea why this only now
caused a test suite failure, perhaps something recently started using SHM?

Fixes: map-bit-to-image, map-to-image-fill

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 22:26:09 +02:00
Uli Schlachter
880321ae9d xcb: Fix a "incompatible pointer" compiler warning
cairo-xcb-surface.c:790:2: warning: return from incompatible pointer type

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 22:24:58 +02:00
Uli Schlachter
aa16e3e666 xcb: Honor clips for defer clear
This bug was accidentally introduced in fd613cb9f9.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 21:18:57 +02:00
Uli Schlachter
87fdc4356f xcb: Don't try to fallback more than once
This fixes the following assert for pretty much every single xcb-fallback test:

cairo-xcb-surface.c:320: _get_image: Assertion `surface->fallback == ((void *)0)' failed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-22 20:46:24 +02:00
Adrian Johnson
d43f6d7459 test: make text-pattern draw with both opaque and translucent patterns
Poppler renders the translucent PDF output of this test correctly with
cairo 1.10.2 but fails with current git.
2011-09-22 23:41:35 +09:30
Adrian Johnson
b30b0c14cb test: Add stroke-pattern
Poppler renders the PDF output of this test correctly with cairo 1.10.2 but fails with current git.

Commenting out the cairo_translate makes the PDF output render correctly with current git.
2011-09-22 22:43:07 +09:30
Chris Wilson
0e95215c01 test/trace: Hack to dump out per-context images and traces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-21 11:19:04 +01:00
Chris Wilson
f8c4686310 image: don't offset by device transform for replay onto source surface
It is already captured by the pattern extents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-20 14:34:23 +01:00
Chris Wilson
5f0dcf610f image: clip the replay to the sample extents in device space
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-20 14:05:31 +01:00
Chris Wilson
da95bdfcd7 wrapper: transform the clip into device space
We need more than just mere translation!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-20 14:04:29 +01:00
Adrian Johnson
a810b012cf subsets: latin char map needs to belong to the font, not the subset 2011-09-20 00:03:33 +09:30
Chris Wilson
fd613cb9f9 xcb: track fallback damage
And only upload the parts of the image that are modified during the
fallback. I have to keep reminding myself that the goal is always to
reduce the amount of fallbacks required...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-19 15:23:57 +01:00
Uli Schlachter
36a1423045 xcb: Remove an unused variable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-18 20:07:35 +02:00
Uli Schlachter
cdd75ec407 xcb: Use a mask in _composite_boxes() when needed
This doesn't just need a clip without any path, it also needs pixel aligned
boxes.

This improves the result for unaligned boxes in tighten-bounds.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-18 20:07:35 +02:00