summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-07-14Excise xcb-drmHEADmasterChris Wilson13-410/+0
The experiment was at best a pyrrhic victory. Whilst it did show that you could successfully subvert cairo_xcb_surface_t and provide the rendering locally faster (than the xlib driver at that time), any performance benefits were lost in the synchronisation overheads and server-side buffer allocation. Once cairo-gl is mature, we need to look at how we can overcome these to improve client-side rendering In the meantime, cairo-xcb is no longer my playground for experimentation and is shaping up to become a stable backend... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-14Excise DRM-XrChris Wilson7-2491/+0
I've since incorporated (nearly) all the features from cairo-drm into xf86-video-intel, making this experiment defunct. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-13scaled-font: Key the cache on the orignal font_faceChris Wilson1-2/+2
We check the incoming scaled font using the original font fce, so we need to also store it in the cache using the same face, and not the resolved font_face (which will remain the same unless the fontconfig configuration is updated). Hides the quadratic behaviour of font retrieval in recent cairo-traces. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-13ft-font: If the pattern is already resolved, use it immediatelyChris Wilson1-13/+23
This skips an relatively expensive search for the a good match if the pattern already contains a face or a filename. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-13test: Test a1 clipping semanticsChris Wilson7-1/+181
If I've written the tests correctly, these should produce identical images as the a1 rasterisation tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-13png: Fix support of depth-30 imagesChris Wilson1-8/+8
Rename the variable depth to bpc to prevent future confusion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-09Handle CAIRO_STATUS_DEVICE_FINISHED in switchesUli Schlachter6-0/+8
Fixes all warnings that looked like this: warning: enumeration value 'CAIRO_STATUS_DEVICE_FINISHED' not handled in switch Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-09xcb: Don't use xcb surfaces as snapshotsUli Schlachter1-28/+0
Eventually someone might try to paint to the xcb surface again. However, _cairo_surface_begin_modification doesn't like that: cairo-surface.c:385: _cairo_surface_begin_modification: Assertion `surface->snapshot_of == ((void *)0)' failed. There was only a single place in the xcb backend where a cairo_xcb_surface_t could be used as a snapshot, so the _cairo_surface_has_snapshot that checked for such a surface can be removed, too. This does *not* remove all snapshots from the xcb backend, but all the remaining snapshots are instances of cairo_xcb_picture_t. These surfaces are only ever created internally and thus can't be modified by users directly. Fixes: xcb-snapshot-assert Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-09Add a test case that asserts on xcbUli Schlachter3-0/+68
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-09xcb: Track cairo_xcb_picture_t surfacesUli Schlachter3-0/+19
When e.g. using an image surface as the source for a xcb surface, a cairo_xcb_picture_t is created and attached to that image surface as a snapshot. This contains the Picture that was created on the X11 server. However, as soon as the cairo_xcb_picture_t's cairo_xcb_screen_t is finished and destroyed, this picture can't be used anymore. This commit now makes sure all these Pictures are freed when the screen is finished. This was found because my X server's memory usage grew quite large. Every time the app was done drawing, it destroyed its last surface which also destroyed the last reference to the cairo_xcb_screen_t. This meant that the existing Picture snapshots couldn't be used anymore, but they were still kept around and used up memory until there wasn't any free memory left. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-09xcb: Move cairo_xcb_picture_t to cairo-xcb-private.hUli Schlachter2-19/+20
The next commit will make cairo-xcb-screen.c use this struct and add new members. Splitting off the move into its own commits makes that easier to understand. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-09xlib-xcb: Register a XCloseDisplay hookUli Schlachter1-3/+142
This commits makes the xlib-xcb backend produce its own cairo_device_t. This per-Display* device is used to manage the registration of a XCloseDisplay hook via XAddExtension/XESetCloseDisplay in the same way that the xlib backend does this. The device is necessary to see if we already registered an extension. This fixes weird errors when running cairo-test-suite with -a -s. They were caused because the backend didn't see the XCloseDisplay and the next XOpenDisplay happened to create a xcb_connection_t with the same address as the last display. This caused the xcb backend to assume lots of wrongness. This commit makes use of _cairo_xlib_display_mutex which is otherwise compiled in but not used anywhere when xlib-xcb is enabled. Patch v2: Fixed the xcb_device == NULL case and made sure the xcb_device is only finished on XCloseDisplay, not when all xlib-xcb surfaces are destroyed. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-08device: Fix documentation of device typesAndrea Canciani1-8/+9
The documentation of device types incorrectly talks about surfaces and lacks the new INVALID type.
2011-07-08device: Define the CAIRO_DEVICE_TYPE_INVALID device typeAndrea Canciani2-2/+4
Define a new device type to indicate that the device is not valid. The -1 value is along the same line as CAIRO_FORMAT_INVALID (and is likely to have the same issues).
2011-07-08device: Add CAIRO_STATUS_DEVICE_FINISHEDAndrea Canciani3-2/+5
Instead of abusing CAIRO_STATUS_SURFACE_FINISHED to indicate the use of a finished device, define and use the new error status CAIRO_STATUS_DEVICE_FINISHED.
2011-07-08gstate: Remove useless codeAndrea Canciani1-11/+1
gstate->source has been initialized as the static black pattern, so its status is success.
2011-07-08color: Remove unused functionsAndrea Canciani3-24/+5
_cairo_color_init() and _cairo_color_init_rgb() are basically unused (except in some experimantal code, which is trivial to fix).
2011-07-08pattern: Implement _rgb functions as wrappers over _rgba functionsAndrea Canciani2-28/+4
cairo_pattern_create_rgb() and cairo_pattern_add_color_stop_rgb() implement the same logic as cairo_pattern_create_rgba() and cairo_pattern_add_color_stop_rgba() with an alpha == 1.0. Instead of duplicating the code, they can simply call into the more general functions.
2011-07-05Make error contexts staticAndrea Canciani2-84/+65
Dynamically creating error contexts requires locking and failure handling. The code logic can be simplified by statically defining all the possible error contexts.
2011-07-05Clean up context_pool upon static data resetAndrea Canciani1-0/+2
In commit f46ba56d5b8c54be5f0379aca204c0ce05d0f58a the static context stash was replaced by a dynamic freed pool, which needs to be cleared upon resets. Fixes: cairo.c:181: warning: ‘context_pool’ defined but not used Reported-by: Uli Schlachter <psychon@znc.in>
2011-07-05Remove conditional compilation of freed-poolsAndrea Canciani4-10/+5
Conditional compilation was needed to avoid warnings: cairo-clip.c:51: warning: ‘clip_path_pool’ defined but not used cairo.c:181: warning: ‘context_pool’ defined but not used They can be avoided by making sure that _freed_pool_reset(ptr) actually consumes its argument. This has the pleasant side-effect that forgetting to properly reset a freed-pool now results in a warning if atomic ops are disabled/not available.
2011-07-03Xlib: Fix boilerplate to work with xlib-xcbUli Schlachter1-0/+6
Xlib boilerplate includes cairo-xlib-surface-private.h, so that it can cast the xlib cairo_surface_t to cairo_xlib_surface_t and then mess with some internals of that struct. However, xlib-xcb doesn't use that struct and thus this results in random memory corruption. "Luckily", all the fields that this messes with don't corrupt any fields in cairo_xlib_xcb_surface_t, but instead this writes past the end of the buffer that was returned from malloc. This commit just adds an #if to disable this code section since I have no idea what a proper fix would be. This means that the xlib-fallback backend doesn't actually test any fallbacks with xlib-xcb, however it never did so anyway. If you have any idea how to fix xlib-fallback with xlib-xcb, please speak up. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-02xlib-xcb: Don't call directly into the xcb backendUli Schlachter1-15/+18
Instead, this now uses the surface wrapper functions for this job. These functions make sure that e.g. snapshots are detached and that is_clear is reset correctly. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-02xlib-xcb: Fix some use-after-freeUli Schlachter1-0/+17
Also, this now sets surface->xcb to NULL after the dereference. Segfaults are way more prominent anyway. :-) All the backend callbacks shouldn't need any checks since the public entry point already checks for finished surfaces. Only the public functions in xlib-xcb need to do checks for finished surfaces. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-02xcb: Remove an unused function argumentUli Schlachter1-10/+8
Since commit f1d313e0, the 'force' argument to _copy_to_picture() isn't used anymore. Said commit should have removed it. Whoops. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-01xlib-xcb: Fix cairo_surface_flush()Uli Schlachter1-1/+3
This function called directly into the xcb's surface flush function. This means that snapshots for that surface weren't detached since that's normally done in cairo_surface_flush() before calling into the backend. Fix this by using surface_flush() instead of calling into the backend directly. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=31931 Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-01xlib-xcb: Verify we really have an xcb surfaceUli Schlachter1-0/+24
If the X11 server doesn't have the RENDER extension, the xcb backend falls back to the image backend in some cases (e.g. create_similar). xlib-xcb didn't handle this properly which means it used the result like a xcb surface. Found while debugging https://bugs.freedesktop.org/show_bug.cgi?id=31931, firefox died from a BadDrawable error when it tried to use the (bogous) result from cairo_xlib_surface_get_drawable(). Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-01xlib-xcb: Fix api-special-cases testUli Schlachter1-0/+14
The functions cairo_xlib_surface_set_size and cairo_xlib_surface_set_drawable didn't set the expected error when called with a finished surface. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-01xlib-xcb: Use slim_hidden_proto correctlyUli Schlachter2-0/+8
There are debug functions for setting the precision on a xlib device, so xlib-xcb must redirect that to the xcb backend, too. However this means that these public functions now are also called internally, thus we have to make them go through the slim_hidden_* macros. This commit fixes the following error from "make check": Checking .libs/libcairo.so for local PLT entries 00000000002bb6d8 000001e300000007 R_X86_64_JUMP_SLOT 000000000006d8a0 cairo_xcb_device_debug_set_precision + 0 00000000002bb750 0000025e00000007 R_X86_64_JUMP_SLOT 000000000006d8b0 cairo_xcb_device_debug_get_precision + 0 FAIL: check-plt.sh Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-27Include pixman.h in cairo-xlib-private.hSøren Sandmann Pedersen1-0/+2
Otherwise "make cairo-perf-trace" fails. Reported by Matt Turner on IRC.
2011-06-25xlib: Create an exact match for the image surface if possible using XrenderChris Wilson3-38/+211
In order to defer the pixel conversion till as late in the pipeline as possible, we want to try and preserve the pixman image format whilst uploading the pixel data. To do this, we want to create an XRender surface with a matching PictFormat to the source image. Then we need to make sure we take the quick path through _draw_image_surface for none and direct conversions. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25Do not open-code freed-poolAndrea Canciani2-97/+12
Reuse the freed-pool system to reduce allocation pressure of context creation/destruction. As a side effect, this removes the use of ffs() on Win32, cleaning up some MSVC-specific code and fixing a mingw-related build issue. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=30277
2011-06-25test: Fix check-ref-missingAndrea Canciani1-1/+1
ce3806510f8a20621f3daf7bd1afb18811fa1e92 changed the format of Makefile.refs, breaking the check-ref-missing target. Ignoring any line not containing a .png file fixes check-ref-missing and makes it more robust.
2011-06-25test: Add a Makefile.refs generatorChris Wilson3-2/+17
Generates the lexicographical Makefile.refs based on the *.ref.png and *.xfail.png checked into git. This might be nice to automate as a Makefile target. But for now play safe and do the updates manually. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25test: Merge text-antialias-*Andrea Canciani4-159/+37
The test-antialias-* tests perform the same operation with just a different antialias flag. Sharing the code ensures that they are kept in sync and permits adding new flags combinations easily. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14268
2011-06-25win32: Fallback upon PDF blend operatorsAndrea Canciani1-3/+21
GDI does not support PDF blend modes, so they are implemented by falling back. Fixes extended-blend-solid, extended-blend-solid-alpha. Bug pointed out by Peter Frentrup <peter_frentrup@gmx.de> in http://lists.cairographics.org/archives/cairo/2011-April/021908.html
2011-06-25test: Add extended-blend-solid testsAndrea Canciani10-154/+138
Unify extended-blend* tests and add a solid pattern version, which crashes on the win32 backend. Bug pointed out by Peter Frentrup <peter_frentrup@gmx.de> in http://lists.cairographics.org/archives/cairo/2011-April/021908.html
2011-06-25test: Ignore \r when parsing test log filesAndrea Canciani1-2/+2
This fixes the log parsing on win32.
2011-06-25test: Make parsing of log files more solidAndrea Canciani1-1/+3
The old code considered every even "word" as a key and every odd "word" as a value when parsing a test log file. All of the keys end with ':', so restrict with this requirement.
2011-06-25clip: Fix boxes extents computation in intersect_with_boxesAndrea Canciani1-12/+14
The extents of the boxes were being computed by taking into account just the first box instead of all of them. Based on a patch by James Cloos. Fixes clip-disjoint, clip-stroke-unbounded, clip-fill-nz-unbounded, clip-fill-eo-unbounded, clip-fill, clip-stroke, trap-clip. See https://bugs.freedesktop.org/show_bug.cgi?id=38641 Reviewed-by: James Cloos <cloos@jhcloos.com> Tested-by: James Cloos <cloos@jhcloos.com>
2011-06-25Fix typosNis Martensen3-5/+5
Reported in http://lists.cairographics.org/archives/cairo/2011-May/021921.html
2011-06-25test: Fix typoAndrea Canciani1-1/+1
scrdir -> srcdir
2011-06-25test: Improve check-ref-missingAndrea Canciani3-1381/+1367
On linux it is impossible to check the missing references because of argument length constraints: make: execvp: /bin/bash: Argument list too long Using a temporary file instead of variable expansion makes it possible to work around this. Makefile.refs is now required to be in lexicographical order, which avoids ordering problems and the risk of duplicated entries (like clipped-surface.ref.png).
2011-06-24xcb: Use defines instead of magic numbersUli Schlachter3-4/+5
render.h gives us nice descriptive names for the precise/imprecise poly modes. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24xcb: Initialize the new precision fieldsUli Schlachter2-0/+2
In 63bdae27a83, new fields were added to cairo_xcb_connection_t and cairo_xcb_surface_t. The same change was done in the xlib backend. However, in the xlib backend these new fields were properly initialized. This was forgotten in the xcb backend. Hopefully-Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38482 Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24xcb: Prettify some codeUli Schlachter1-1/+3
Instead of having each case do the same thing, this code will now fall through to the default case. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24xcb: Don't hardcode the RENDER version numberUli Schlachter1-1/+1
This now uses the macros XCB_RENDER_{MAJOR,MINOR}_VERSION which xcb defines. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24xcb,xlib,surface: Check for too small sizesUli Schlachter3-6/+14
This adds checks for negative sizes in cairo_surface_create_similar() and for non-positive sizes in all public surface-creation functions in the xcb and xlib backends. X11 doesn't allow 0 as width/height, so if anyone claims to have a drawable of that size, he can't be right. However, cairo allows such sizes which is why create_similar doesn't reject 0. Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-06-24perf: Fix build on win32Andrea Canciani13-133/+363
The performance tools build system for Win32 hasn't been maintained for some time. The makefiles are now structured as in other directories (Makefile.sources used by both Makefile.am and Makefile.win32) and some additional code hides os-specific parts.
2011-06-24perf: Ensure M_SQRT2 is definedAndrea Canciani1-0/+1
pythagoras-tree uses M_SQRT2, which on Win32 is defined by math.h if and only if _USE_MATH_DEFINES is defined.