summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-02-05cairo-version: fix docs buildHEADmasterRyan Lortie1-0/+1
We do some evil things in this doc comment by closing a <para> tag further up. Make sure we reopen it at the end so that gtk-doc's attempt to close it again doesn't result in an imbalance.
2014-01-31cairo-script: Compare status with CSI enumsBryce Harrington1-0/+699
CSI_STATUS_SUCCESS is defined as equivalent to CAIRO_STATUS_SUCCESS. We should prefer the former when comparing against csi_status_t variables, else we'll get a warning: cairo-script-interpreter.c:637:23: warning: comparison between ‘csi_status_t’ and ‘enum _cairo_status’ [-Wenum-compare] Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31cairo-script: Error if asked to decompress with missing compression libBryce Harrington2-12/+12
This quells the following warning: warning: enumeration value ‘LZO’ not handled in switch [-Wswitch-enum] The LZO enum value is defined and used elsewhere, even if lzo support isn't available. This situation might arise if cairo scripts were generated on one system with lzo, and then replayed on a system without it. For now simply error out if this occurs. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31cairo-trace: Stringify CAIRO_STATUS_JBIG2_GLOBAL_MISSINGBryce Harrington1-0/+1
This error enum was added last September when JBIG2 support was added. Support it as well in the tracing code. This fixes this warning: trace.c:1544:5: warning: enumeration value ‘CAIRO_STATUS_JBIG2_GLOBAL_MISSING’ not handled in switch [-Wswitch] Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31test: Drop unused path variable in two recently added testsBryce Harrington2-4/+0
Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31test: Handle error in fgets call in ps-eps testBryce Harrington1-1/+5
Most likely this is just a theoretical problem since we just checked feof, but this quells the following warning: ps-eps.c:216:8: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31test: Replace deprecated rsvg_init() in any2ppm testBryce Harrington2-2/+1
As of libsvg 2.35 calling g_type_init() is sufficient. Signed-off-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-27Preserve current-point in copy_path()/append_path() sequenceBehdad Esfahbod1-0/+3
Fixes path-currentpoint test.
2014-01-27[tests] Add path-currentpointBehdad Esfahbod2-0/+90
Checks whether copy_path()/append_path() preserves current-point. Currently failing.
2014-01-19cairo svg: Use \n instead of /n in bitmap fontsUli Schlachter1-1/+1
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-01-11type1: strip space from end of font nameAdrian Johnson1-0/+3
2014-01-11ps: add font DSC commentsAdrian Johnson1-9/+25
2014-01-11ps: cairo_set_page_size does not need to be in eps outputAdrian Johnson1-32/+36
2014-01-11ps: use setpagedevice to set page sizeAdrian Johnson1-1/+39
https://bugs.freedesktop.org/show_bug.cgi?id=73452
2014-01-10font: Generate PDFs with correct font namesMarek Kasik5-6/+1691
Escape PostScript names of loaded fonts. These can not contain white spaces and delimiter characters when saving them to a PostScript file or a PDF file.
2014-01-08ps: fix imagemask with pattern source failure on some printersAdrian Johnson1-2/+2
When /PaintProc is invoked the pattern dict is pushed onto the stack. Ensure this dict is removed. https://bugs.freedesktop.org/show_bug.cgi?id=69485
2014-01-03ps: remove duplicate /Interpolate from image dictionaryAdrian Johnson1-2/+0
http://lists.freedesktop.org/archives/poppler/2014-January/010748.html
2013-12-26Add test for paint with alpha and clipping bugAdrian Johnson3-0/+63
Add test case for https://bugs.freedesktop.org/show_bug.cgi?id=68382 Something has regressed in the recording surface. All the recording surface based backends lose the alpha from the paint_With_alpha.
2013-12-26pdf: fix rectangle stroke with non rectilinear penAdrian Johnson1-1/+3
2013-12-26Add test for rectangle path optimization with non rectilinear penAdrian Johnson3-0/+52
This fails on pdf/ps.
2013-12-16Check for XRenderSolidFill()Behdad Esfahbod2-1/+1174
2013-12-07pdf/ps: avoid outputting excess decimal places in matricesAdrian Johnson5-49/+2591
Sometimes as a result of rounding errors in matrix transformations the matrices in ps/pdf output look like: 0.000000000000000061 1 1 -0.000000000000000061 0 842 cm This patch rounds to zero matrix elements that are very small compared to other elements in the same matrix.
2013-11-16Correct usage of CAIRO_STACK_ARRAY_LENGTHUli Schlachter3-4/+4
This macro wants the array type as its argument and calls sizeof() on it internally. Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-11-13gl: Fix one off issue in context cleanupHenry Song1-1/+1
ctx->vertex_shaders is only CAIRO_GL_VAR_TYPE_MAX large, so we should abort the loop before the index is equal to CAIRO_GL_VAR_TYPE_MAX. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2013-10-31Fix SSIZE_T definition problem when making with MSYS on Windows7Bryce Harrington1-1/+1
Patch provided by Martin Schlemmer <Martin.Schlemmer@nwu.ac.za> on the mailing list. Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-10-31cairo_create(): Add finished surface checkKouhei Sutou1-0/+2
Without this change, the following program crashes: #include <cairo.h> #include <cairo-svg.h> int main(int argc, char **argv) { cairo_t *cr; cairo_surface_t *finished_surface; finished_surface = cairo_svg_surface_create ("/tmp/xxx.svg", 1.0, 1.0); cairo_surface_finish (finished_surface); cr = cairo_create (finished_surface); cairo_destroy (cr); cairo_surface_destroy (finished_surface); return 0; } Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-10-31Fixes stroke-clipped, i.c. of a dashed strokeegag1-1/+1
Similar to 1f4d05b55c96347aa4240190fda27f951b00c539 'Fix calling '_cairo_spline_intersect' for in-bounds checking of splines' Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-10-22_cairo_color_double_to_short(): Use standard rounding algorithmSøren Sandmann Pedersen7-0/+193
The _cairo_color_double_to_short() function converts a double precision floating point value in the range of [0.0, 1.0] to a uint16_t integer by dividing the [0.0, 1.0] range into 65536 equal-sized intervals and then associating each interval with an integer. Under the assumption that an integer i corresponds to the real value i / 65535.0 this algorithm introduces more error than necessary as can be seen from the following picture showing the analogous transformation for two-bit integers: +-----------+-----------+-----------+-----------+ 0b00 | 0b01 | 0b10 | 0b11 +-----------+-----------+-----------+-----------+ which shows that some floating point values are not converted to the integer that would minimize the error in value that that integer corresponds to. Instead, this patch uses standard rounding, which makes the diagram look like this: +-------+---------------+---------------+-------+ 0b00 | 0b01 | 0b10 | 0b11 +-------+---------------+---------------+-------+ It's clear that if the values corresponding to the given integers are fixed, then it's not possible to decrease the resulting error by moving any of the interval boundaries. See this thread for more information: http://lists.freedesktop.org/archives/cairo/2013-October/024691.html Reference images updated: pthread-similar.ref.png record-paint-alpha.ref.png record90-paint-alpha.argb32.ref record90-paint-alpha.rgb24.ref.png xcb-huge-image-shm.ref.png xcb-huge-subimage.ref.png All of these have only one-step differences to the old images.
2013-10-11type1-subset: don't rename glyphs used by seac operatorAdrian Johnson1-6/+7
Bug 70364
2013-10-06win32: Reorder font declarations to be in natural orderChris Wilson1-47/+43
Reported-by: John Emmas <johne53@tiscali.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03cairo-xlib: Fix out of bounds array access in format cacheUli Schlachter1-1/+1
The cairo-xlib backend maintains a mapping form cairo_format_t to xrender formats. This is done via an array. The size of this array is CAIRO_FORMAT_RGB16_565 + 1 which evaluates to 5. However, CAIRO_FORMAT_RGB30 has the numeric value 5, too. Thus, using this value as an index into the array would actually read the following force_precision field from cairo_xlib_display_t. This could be triggered by passing CAIRO_FORMAT_RGB30 to _cairo_xlib_display_get_xrender_format(). From a quick look, I didn't find any code which would allow doing this, but neither did I find anything allowing CAIRO_FORMAT_RGB16_565, so it's better to handle this correctly than assert()ing for this to never happen. Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-03Revert "[xlib] Fast-path the likely case of retrieving a known xrender_format"Uli Schlachter1-6/+0
This reverts commit 09a2b2ed3189fe12483cbd673c24ceddc2c20f3f. Back in 2009, _cairo_xlib_display_get_xrender_format() had to acquire a lock to do its job. The above commit added a fast-path which avoided the lock in most cases. However, in 2010 commit f74ad37e66bbdcc4d727ed6d931dde870d84c2f4 modified the locking in the cairo-xlib backend and now this function never takes any locks. Thus, the fast-path that was added a year earlier now just does the same thing that the regular code does and the list of cached formats was checked twice. Reverting the earlier commit fixes this. Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-03README: Don't mention XFAIL_TESTS anymoreUli Schlachter1-10/+9
The variable XFAIL_TESTS is not used anymore since commit e90073f7ddc. Instead, we now have special reference images that show the wrong output and the test suite fails a test if it does not match the expected, wrong output. Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-03Remove XFAIL_TESTS from Makefile.amUli Schlachter10-73/+702
The variable XFAIL_TESTS is not used anymore since commit e90073f7ddc. The description for the known failures are moved into the respective tests as comments. The following descriptions were dropped: - surface-pattern-big: Didn't really explain the failure - big-line: Test isn't failing any more - self-intersecting: Only XFAIL on quartz, but description doesn't match this The following tests don't have a xfail reference image and seem to fail just because of not having a reference image at all (I kept their description for now): big-trap, long-lines, self-copy-overlap Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-29pdf: stencil masks may be opaqueAdrian Johnson1-4/+7
2013-09-29pdf: Support stencil masks with jpeg/jpx/jbig2 embeddingAdrian Johnson1-73/+131
2013-09-29pdf: combine source and mask images into single imageAdrian Johnson2-121/+347
Since PDF stores the alpha component of images in a separate stream which can have a different resolution and encoding to the color components we can optimize the case where the source and mask are both images. If the source and mask are both images with the same extents and the source is opaque, combine the images into a single PDF image (ie the source is written the the image stream and the mask is written to the smask stream).
2013-09-27trace: Fix operand emissionChris Wilson1-50/+182
Recent updates (in the past couple of years) to firefox have exposed numerous bugs in the way we emit the operands. A few off-by-ones, missing surfaces and outright bugs all of which are intermixed into producing a corrupt stack. Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27fill_reduces_to_source(): Handle failure of color_to_pixel()Uli Schlachter1-2/+1
The function color_to_pixel() can fail for unsupported pixman image formats, but fill_reduces_to_source() ignored this possibility. Fix this by using the return value of color_to_pixel(): Fixes the following compiler warnings: cairo-image-compositor.c: In function 'fill_boxes': cairo-image-compositor.c:349:15: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized] cairo-image-compositor.c: In function 'fill_rectangles': cairo-image-compositor.c:304:18: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-26test: Drop unnecessary math.h includeBryce Harrington1-1/+0
Commit 0ac81988 refactored away fmin; nothing else from math.h is needed.
2013-09-17font: Push the last reference dec into the backend->destroy() callbackChris Wilson7-29/+575
In order to close a race between locking the backend and resurrecting a font via the cache, we need to keep the font face alive until after we take the backend lock. Once we have that lock, we can drop our reference and test if that was the last. Otherwise we must abort the destroy(). This fixes the double-free exposed by multithreaded applications trying to create and destroy the same font concurrently. Reported-by: Weeble <clockworksaint@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69470 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-17test/pixman-downscale: Open-code fmin()Chris Wilson1-1/+1
fmin() requires a bump to either _XOPEN_SOURCE_ >= 600 (POSIX 2004) or c99 - which is a needless dependency for a single simple routine. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-16xcb: Remove useless error handlingUli Schlachter4-44/+22
All the *_reply() functions in XCB return a pointer to their result and as last argument they get a xcb_generic_error_t** where pointers to errors are stored, if any occurs. However, a request can either fail or succeed. This means that if the returned result is a NULL pointer, then an error occurred and the other way around: If the error pointer is set to non-NULL, then the function must have returned NULL. Thus, all the code, which just checks if an error occurred and which does not care about the exact error code, does not need to get the error pointer at all. In this case, xcb will free() the error internally. While doing this, I noticed that _cairo_xcb_connection_get_image() always succeeds and thus its return value can be replaced with the GetImage result. Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16test/multi-page: Fix use-after-freeUli Schlachter1-2/+2
Commit f9dcd07d22a5269 changed the way the file name is allocated and introduced a use-after-free in doing so. Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16image: Handle PIXMAN_a8r8g8b8_sRGB in switchUli Schlachter1-0/+3
Fixes the following compiler warning: cairo-image-surface.c: In function '_cairo_format_from_pixman_format': cairo-image-surface.c:93: warning: enumeration value 'PIXMAN_a8r8g8b8_sRGB' not handled in switch Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58726 Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16check-doc-syntax: Don't hardcode path to awkUli Schlachter2-3/+1
Instead of expecting awk in /usr/bin, this commit changes the code to call awk through a shell so that $PATH is searched. Since this awk script shouldn't really be called manually, this is done by removing the shebang from the awk script, marking it non-executable and fixing up the caller. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67674 Reviewed-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16cairo-gobject: Require at least glib 2.14Uli Schlachter1-1/+1
cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions were added in glib 2.14 and thus cairo needs at least this version for its gobject helper functions. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239 Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-15test: update mime-data to test jbig2 mime typesAdrian Johnson11-0/+241
2013-09-15pdf: support JBIG2 mime dataAdrian Johnson12-2/+952
JBIG2 images may have shared global data that is stored in a separate stream in PDF. The CAIRO_MIME_TYPE_JBIG2 mime type is for the JBIG2 data for each image. All images that use global data must also set CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID to a unique identifier. One of the images must also set CAIRO_MIME_TYPE_JBIG2_GLOBAL to the global data. The global data will be shared by all JBIG2 images with the same CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID.
2013-09-13ps: fix embedding of mime dataAdrian Johnson1-6/+10