summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* pattern: Remove unused _cairo_pattern_size functionAndrea Canciani2011-01-032-42/+0
| | | | | | 'git log -S_cairo_pattern_size' only finds the commit a856371bef496da0e84226f4fd2fc3cb72e955ac, in which this function was added, thus it looks like it has never been used.
* XCB: Make sure SHM memory isn't reused too earlyUli Schlachter2011-01-023-4/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit delays the return of a SHM area to the free pool. When _cairo_xcb_shm_info_destroy is called, it now adds the cairo_xcb_shm_info_t to a list of pending memory areas and sends a GetInputFocus request to the server. This cairo_xcb_shm_info_t is only really freed when the GetInputFocus request completes. To avoid unnecessarily waiting for the X server, we check via xcb_poll_for_reply for the reply which returns immediately if the reply isn't received yet. This commits fixes a race where the shared memory area is reused before the X server finished reading data from it. This does NOT fix races where cairo draws something new to the same cairo_xcb_shm_info_t while the X server still reads from it. However, there doesn't seem to exist any code currently where the shm info isn't immediately destroyed after it was used. This commit fixes the following tests for xcb-render-0.0 if SHM is enabled: joins mask mask-transformed-image push-group push-group-color radial-gradient radil-gradient-mask radial-gradient-mask-source radial-gradient-one-stop radial-gradient-source smask smask-mask smask-paint This also fixes mesh-pattern-transformed for all the xcb boilerplate "backends". Signed-off-by: Uli Schlachter <psychon@znc.in>
* Switch the order of two functions in the C fileUli Schlachter2011-01-021-34/+34
| | | | | | | | The following commit adds a call to _cairo_xcb_shm_info_destroy to some function in-between, but it also renames it and does some other changes to this. Thus, move this function first to make the diff easier to read. :) Signed-off-by: Uli Schlachter <psychon@znc.in>
* Remove an unused field from cairo_xcb_shm_info_tUli Schlachter2011-01-025-39/+33
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* matrix: Fix warnings about documentation by 'make check'Andrea Canciani2011-01-021-2/+2
| | | | | 'make check' complains about the syntax of the documentation: the space between the function name and the parenthesis is not allowed.
* pattern: Use double precision for gradient extreme objectsAndrea Canciani2011-01-0212-236/+205
| | | | | | | | | Using double precision for gradient extreme objects ensures that they are preserved as specified when constructing the gradient pattern. Fixes huge-linear, huge-radial. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
* pattern: Factor out pattern rescalingAndrea Canciani2011-01-025-209/+156
| | | | | | | | | | | | | The same code was duplicated (incorrectly and with some minor differences) in pattern, image, xlib and xcb. _cairo_gradient_pattern_max_val() abstracts that code in a function that can be used whenever a gradients extremes need to be rescaled to fit within a given range. Fixes huge-linear, huge-radial. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
* matrix: Cairo matrix to pixman transform/offset conversionAndrea Canciani2011-01-026-276/+357
| | | | | | | | | | | Xlib, XCB and image use the same code to convert a cairo_matrix_t to a backend-specific transform. The code did not handle correctly some matrices, thus a new function that performs the conversion in a more generic way was added and used in the backends instead of fixing the repeated code. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
* pattern: Make functions not used elsewhere staticAndrea Canciani2011-01-022-11/+2
| | | | | _cairo_pattern_init_linear() and _cairo_pattern_init_radial() are only called from within cairo-pattern.c
* pattern: Use cairo_color_stop_t when hashing gradient stopsAndrea Canciani2011-01-021-1/+1
| | | | | | Since 18b48a6ebc044c07f08bafd0abcb68c595c5746c the color of each gradient stop is stored in a cairo_color_stop_t, but _cairo_gradient_color_stops_hash() was not updated accordingly.
* pattern: Remove unused 'opaque' variableAndrea Canciani2011-01-021-3/+0
| | | | opaque is never read, thus it can be removed.
* script: Add support for mesh patternsAndrea Canciani2011-01-011-0/+85
| | | | Extend CairoScript with operators based on the mesh pattern API.
* pattern: Add public mesh pattern APIAdrian Johnson2011-01-013-1/+1069
| | | | | Add public funcions to create and define mesh patterns and getters to examine their definition.
* pdf,ps: Add native mesh pattern supportAdrian Johnson2011-01-015-3/+614
| | | | | | | | PS and PDF have native support for mesh patterns, but they have encode mesh points and colors in an appropriate binary stream. cairo_pdf_shading_* functions implement the encoding, which is the same for PDF and PS.
* Add mesh gradient rasterizerAndrea Canciani2011-01-015-0/+1035
| | | | | Add an implementation of a fast and reasonably accurate non-antialiased mesh gradient rasterizer.
* gstate: Disallow incomplete mesh gradient sourcesAndrea Canciani2011-01-011-12/+32
| | | | | | Mesh gradients are constructed using multiple commands, bracketed by explicit begin/end pairs. Using a mesh gradient inside a begin/end pair is not allowed.
* mesh: Add mesh pattern type and enum valuesAdrian Johnson2011-01-0115-3/+289
| | | | | | | | Add the mesh pattern type and an error status to be used to report an incorrect construction of the pattern. Update the backends to make them ready to handle the new pattern type, even if it cannot be created yet.
* Keep makefiles in alphabetical orderAndrea Canciani2011-01-011-2/+2
| | | | | Recording surfaces were at first called meta surfaces. When the name was changed, makefiles were not updated to keep alphabetical order.
* quartz: Use native PDF blend modesAndrea Canciani2011-01-011-101/+139
| | | | | Quartz supports PDF blend modes since 10.4 and exposes Porter-Duff compositing operators through the public API since 10.5.
* quartz: Don't dynamically load unused functionsAndrea Canciani2011-01-011-2/+0
| | | | Remove an unused variable.
* quartz: Clean up dynamically loaded functionsAndrea Canciani2011-01-011-48/+14
| | | | | | | | | README indicates MacOSX 10.4 as a requirement for quartz and we are directly using some functions that have been added to the public CoreGraphics API in 10.4. rop 10.3-specific workarounds and link to 10.4 API functions instead of loading them at runtime.
* Detach snapshots after flushing in cairo_surface_finish()Uli Schlachter2010-12-291-1/+2
| | | | | | | Flushing a surface can attach snapshots to it, thus we have to detach the snapshots after the flush, to make sure they aren't leaked. Signed-off-by: Uli Schlachter <psychon@znc.in>
* Verify that surfaces leak no snapshotsUli Schlachter2010-12-291-0/+6
| | | | | | | | | | Finished surfaces should own no snapshots, because finished surfaces can't be used as sources, thus their snapshots would never be used. When free'ing the surface in cairo_surface_destroy(), it should have no snapshots, or they will be leaked. Signed-off-by: Uli Schlachter <psychon@znc.in>
* gl: Enable PLT symbol hiding for dispatch entriesChris Wilson2010-12-251-3/+3
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* XCB: Stop taking the xcb socketUli Schlachter2010-12-259-1172/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the xcb backend use the auto-generated xcb API instead of hand-writing each request. This should also improve parallelism with non-cairo threads that use the same xcb connection. Big thanks to Andrea Canciani for taking a look at this and finding lots of good improvements (especially finding xcb_send_request was great). cairo-perf-trace and cairo-perf-diff-files between master (6732dbf2992891be4b1f08b14a5c449fd08b637c) and this change: $ ./cairo-perf-diff-files ../master_perf ../xcb_no_socket_perf old: master_perf new: xcb_no_socket_perf Speedups ======== xcb-rgba evolution-0 23558.86 (23558.86 0.00%) -> 19338.78 (19338.78 0.00%): 1.22x speedup ▎ xcb-rgba poppler-bug-12266-0 98.43 (98.43 0.00%) -> 82.36 (82.36 0.00%): 1.20x speedup ▎ xcb-rgba gnome-terminal-vim-0 5518.08 (5518.08 0.00%) -> 4905.92 (4905.92 0.00%): 1.12x speedup ▏ xcb-rgba gnome-terminal-20090601-0 45648.46 (45648.46 0.00%) -> 41231.25 (41231.25 0.00%): 1.11x speedup ▏ xcb-rgba evolution-20090607-0 71643.69 (71643.69 0.00%) -> 66314.95 (66314.95 0.00%): 1.08x speedup ▏ xcb-rgba poppler-0 3501.69 (3501.69 0.00%) -> 3322.26 (3322.26 0.00%): 1.05x speedup Slowdowns ========= xcb-rgba gnome-system-monitor-0 7500.01 (7500.01 0.00%) -> 7923.70 (7923.70 0.00%): 1.06x slowdown xcb-rgba swfdec-youtube-full-0 26409.89 (26409.89 0.00%) -> 28430.76 (28430.76 0.00%): 1.08x slowdown ▏ xcb-rgba gnome-system-monitor-20090821-0 34801.61 (34801.61 0.00%) -> 37891.14 (37891.14 0.00%): 1.09x slowdown Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Remove a wrong optimizationUli Schlachter2010-12-181-7/+0
| | | | | | | | | | | | | | Clear surfaces with an alpha channel are already replaced with a transparent color in gstate, so this code was never hit. Clear surfaces without an alpha channel, can be replaced with solid black only if the surface pattern has an extend other than CAIRO_EXTEND_NONE. Fixes the clear-source test for xcb. Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Andrea Canciani <ranma42@gmail.com>
* xcb: Work around wrong extent computation in the X serverUli Schlachter2010-12-181-0/+11
| | | | | | | | | | | | | | | The X server calculates the bounding box for traps and then allocates a temporary picture for this. When the X server calculates different values than cairo got in extents->bounded, unbounded operators will have wrong results. The X server only ever calculates bounds that are larger than the correct values. Fix this by explicitly clipping the drawing to the expected bounds. Fixes clip-fill-{eo,nz}-unbounded and clip-stroke-unbounded. Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Andrea Canciani <ranma42@gmail.com>
* gl: Fix #include's to pass 'make check'Andrea Canciani2010-12-173-1/+3
| | | | | | | | | 'make check' complains that: Checking that private header files #include "some cairo header" first (or none) cairo-gl-dispatch-private.h:#include <stddef.h> Checking that source files #include "cairoint.h" first (or none) cairo-gl-dispatch.c:#include "cairo-gl-private.h" cairo-gl-info.c:#include "cairo-gl-private.h"
* Avoid some unneeded 'is_clear = FALSE'Uli Schlachter2010-12-151-6/+12
| | | | | | | When a drawing operator doesn't actually have any effect, we don't have to set the surface's is_clear flag to FALSE. Signed-off-by: Uli Schlachter <psychon@znc.in>
* gl: Remove GLEW from the build system and the source treeAlexandros Frantzis2010-12-156-25924/+1
|
* gl: Replace GLEW by using the facilities provided by cairo-gl-infoAlexandros Frantzis2010-12-155-51/+34
|
* gl: Remove GL 1.x ARB shader implementationAlexandros Frantzis2010-12-151-187/+0
| | | | | Shaders for GL 1.x ARB are served by the same implementation as GL 2.x and therefore a dedicated ARB implementation is not needed any more.
* gl: Use the GL core 2.0 shader implementation for both GL 1.x ARB and GL 2.xAlexandros Frantzis2010-12-151-5/+4
| | | | | The GL core 2.0 shader implementation can be used by both GL 1.x and 2.x thanks to the dispatch table.
* gl: Use the dispatch table for calling ARB/EXT functionsAlexandros Frantzis2010-12-156-145/+195
| | | | | Use the dispatch table for calling GL functions that can have multiple name variants. Also, always use the core variant names for GL constants.
* gl: Add definitions for the core variant names of used GL constantsAlexandros Frantzis2010-12-153-0/+101
| | | | | This allows us to use the core variant of the needed GL constants regardless of the GL header version that is being used for compilation.
* gl: Embed the GL dispatch table in the cairo-gl context and initialize it.Alexandros Frantzis2010-12-154-0/+22
|
* gl: Add infrastructure for calling GL functions using a dispatch tableAlexandros Frantzis2010-12-154-0/+303
| | | | | | | Some GL functions can be called using different names depending on the GL version and available extensions (ARB, EXT). The dispatch table abstracts these differences and provides a uniform API for dealing with these functions.
* gl: Add functions to query GL version and extensionsAlexandros Frantzis2010-12-153-0/+81
|
* scaled-font: assert that we hold the scaled-font mutex when looking up glyphsChris Wilson2010-12-131-0/+2
| | | | | | | | Holding the mutex over glyph lookup not only prevents multi-threaded races between insertion and deletion that spell disaster for memory integrity, but also implies that the glyph cache is frozen. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* path: Silence warningsAndrea Canciani2010-12-131-1/+1
| | | | | | | | gcc complains that: cairo-path-fixed.c:400: warning: inlining failed in call to '_cairo_path_fixed_drop_line_to': call is unlikely and code size would grow
* ps,pdf: Deal with empty domain gradients.Andrea Canciani2010-12-132-6/+104
| | | | | | | | | | | | | | | If all the stops of the gradient have the same offset and the pattern's extend mode is EXTEND_PAD, then we cannot use the stops' domain as the interpolation parameter range because this would produce a gradient with the same start and end objects. Such ranges tickle bad behaviour in rasterisers. We replace the color function with an appropriate step function defined on [0 1]. Fixes radial-gradient-one-stop for pdf and ps3. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* ps: Unify gradient emitters and support all extend modes.Andrea Canciani2010-12-131-168/+88
| | | | | | | | | | | | | To draw repeated gradients in ps, which only supports none and pad extended gradients, we need an appropriate reparametrization of the gradients that will cover the whole clip region without needing repeats. This commit adds support for the drawing of reflect/repeat-extended radial gradients through native ps patterns, using pad-extension and no fallbacks. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* pdf: Unify gradient emitters and support all extend modes.Andrea Canciani2010-12-131-282/+132
| | | | | | | | | | | | | | | To draw repeated gradients in pdf, which only supports none and pad extended gradients, we need an appropriate reparametrization of the gradients that will cover the whole clip region without needing repeats. This commit adds support for the drawing of reflect/repeat-extended radial gradients through native pdf patterns using pad-extension and no fallbacks. This fixes https://bugs.freedesktop.org/show_bug.cgi?id=28870 Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* quartz: Unify gradient construction and fix radial gradients.Andrea Canciani2010-12-131-332/+68
| | | | | | | | | | | | Share code between linear and radial gradients, using _cairo_gradient_pattern_box_to_parameter() instead of open coding the parameter range computation. As a side effect this fixes parameter range computation for radial gradients, because the previous code assumed that the focal point was inside the circles. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* pattern: Add a function to interpolate gradient objects.Andrea Canciani2010-12-133-0/+42
| | | | | | | | This will be a common function used by the quartz, ps, and pdf backends when rewriting EXTEND_REFLECT/REPEAT gradients in terms of EXTEND_PAD gradients. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* pattern: Use pattern parameter range when analysing all gradients.Andrea Canciani2010-12-131-51/+44
| | | | | | | | | | This patch adds support for analysing the transparency of a radial gradient within some area of interest. Before the code would ignore the extents for radial gradients. Linear gradients now use _cairo_linear_pattern_box_to_parameter() allowing us to remove the superfluous _extents_to_linear_parameter(). Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* pattern: Compute a covering parameter range of a gradient for a box.Andrea Canciani2010-12-132-0/+470
| | | | | | | This makes it possible to compute the interpolation range needed to correctly draw a gradient so that it covers an area of interest. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* ps: Avoid unneeded fallbacks for gradients with opaque stops.Andrea Canciani2010-12-131-1/+7
| | | | | | | | | | _cairo_pattern_is_opaque() returns false for none-extended linear gradients and for radial gradients, but fallback is only needed if they have non-opaque stops. This can be tested using _cairo_pattern_alpha_range(), which only analyses the part of the pattern which is drawn. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* ps, pdf, pattern: Implement _cairo_pattern_alpha_range to analyse patterns.Andrea Canciani2010-12-134-22/+70
| | | | | | | | Both the ps and pdf backends are open coding analyses of the range of pattern alphas. This patch factors out a new function _cairo_pattern_alpha_range() to do that for them. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* pattern: Improve extents computation of radial gradients.Andrea Canciani2010-12-131-26/+24
| | | | | | | | | Use the tests for degeneracy and new radial gradient definition when computing pattern extents. Degenerate gradients are optimised away by cairo-gstate into solid or clear patterns, and the radial gradients semantics have changed to match PDF semantics. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>