summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* image: Remove dubious "optimisations" for acquired source imagesChris Wilson2011-11-231-29/+0
| | | | | | | By this point we have already paid the penalty for acquiring the source image, so kiss. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* subsurface: Simplify acquire_source_imageChris Wilson2011-11-231-115/+21
| | | | | | | | Remove all of the special casing and simply extract the source. The time for special casing is to avoid calling the generic acquire in the first place, so kiss. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: Only unwrap a subsurface if the sample is fully containedChris Wilson2011-11-231-14/+16
| | | | | | | | | In order to handle out-of-bounds sampling of a subsurface target we need to first avoid incorrectly unwrapping it. Fixes crash in subsurface-outside-target Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* cairo_surface_observer_mode_t: Remove trailing comma.Murray Cumming2011-11-211-1/+1
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* polygon-intersection: Finish any edges upon intersectionChris Wilson2011-11-211-4/+9
| | | | | | | | | | In order to keep the bookkeeping in order, and so prevent a later assert, we need to clear any edges when swapping the active edge order upon an intersection event. The active edges are then reconstructed. Fixes evince http://www.horizonhobby.com/pdf/BLH3500-Manual_EN.pdf Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* xcb: Fix typoAndrea Canciani2011-11-181-1/+1
|
* perf: Compile fix, add the index to cairo_perf_report_load()Chris Wilson2011-11-182-2/+2
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* xcb: Handle SHM exhaustion gracefullyChris Wilson2011-11-181-4/+6
| | | | | | | Avoid the assertion failure of creating an error surface for an internal status by handling the expected UNSUPPORTED condition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Revert "xcb: Fix xcb-huge-image-shm"Chris Wilson2011-11-181-1/+1
| | | | | | | This reverts commit 3a94f4c7091ea6262007e7960e4cd915e17b33c0. We need to fallback to pushing large images over the wire if we exhaust the SHM space.
* xcb: Fix xcb-huge-image-shmUli Schlachter2011-11-151-1/+1
| | | | | | | | | | | | | | | | The test failed with the following message: cairo-surface.c:2265: _cairo_surface_create_in_error: Assertion `status < CAIRO_STATUS_LAST_STATUS' failed. _cairo_xcb_surface_create_shm_image() passed the error from _cairo_xcb_connection_allocate_shm_info() to _create_in_error(). Fix this by never returning CAIRO_INT_STATUS_UNSUPPORTED from _allocate_shm_info(). All other error cases in that function return CAIRO_STATUS_NO_MEMORY, too. Signed-off-by: Uli Schlachter <psychon@znc.in>
* xcb: Fix some invalid castsUli Schlachter2011-11-151-9/+11
| | | | | | | | | | | | | | | | | cairo-xcb was deciding which type to cast a surface to based on its "type" member. This is wrong, it should use "backend->type". This bug was hit via xlib-xcb. This was painting a subsurface of a xlib-xcb surface to an xcb surface. Because surface->type said "xlib", the code was trying to check if the xcb surface had a fallback. However, this was done on the subsurface. The end result was dereferencing a pointer to 0x28. This was noticed while looking into https://bugs.freedesktop.org/show_bug.cgi?id=42889 No test for this bug since I didn't manage to come up with one. Signed-off-by: Uli Schlachter <psychon@znc.in>
* test: Do not open files in non-existing dirsAndrea Canciani2011-11-121-18/+20
| | | | | | | | The output directory should be made before trying to open log files in it. Fixes the bug causing cairo-test-suite to log to stderr on the first run (i.e. when test/output does not exist).
* test: Use cairo_test_list_t for the main test listAndrea Canciani2011-11-122-20/+7
| | | | | | | | | | Instead of embedding the pointer in the test structure, consistently use the cairo_test_list_t structure for test lists. This cleans up the code as the reverse-list operation can be reused. Moreover this makes the code clearer, because each test list is now independent and has no way to know about other test lists.
* boilerplate: Fix svg extensionAndrea Canciani2011-11-121-4/+4
| | | | | | The svg backend produces .svg files. Using the appropriate extension allows the test suite to check the vector output in addition to the PNG images.
* Remove useless checks for NULL before freeingAndrea Canciani2011-11-123-50/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - }
* Use xstrdup instead of xmalloc when possibleAndrea Canciani2011-11-122-12/+4
| | | | Don't open code xstrdup, just use it.
* test: Reuse cairo_test_logv()Andrea Canciani2011-11-121-2/+1
| | | | | cairo_test_log() can be implemented on top of cairo_test_logv() to ensure that their behavior is consistent.
* boilerplate: Remove unused thread id parameterAndrea Canciani2011-11-1229-98/+9
| | | | | The thread id is not used anymore (it is always == 0), so it can be removed.
* test: Remove unused thread fieldAndrea Canciani2011-11-122-189/+123
| | | | | The multi-threaded test path does not exist anymore and the ctx->thread field is always 0, hence it can be removed.
* test: Remove dead codeAndrea Canciani2011-11-123-194/+0
| | | | This code is unused and can be removed.
* test: Re-enable pass-throughAndrea Canciani2011-11-122-14/+7
| | | | | The pass-through test was not updated to the current test conventions and was not enabled in the Makefiles.
* Improve the documentation of the flagsAndrea Canciani2011-11-125-26/+24
| | | | | Some utilities were providing incorrect or incomplete usage information.
* Sort option flagsAndrea Canciani2011-11-125-28/+28
| | | | | | | | Keep the option flags in alphabetical order. This makes it easier to check for collisions or missing handlers. Avoids an internal error when passing flags -c, -r or -v to cairo-analyse-trace.
* boilerplate: Provide close callback after opening any2ppm outputAndrea Canciani2011-11-112-4/+11
| | | | | | | | cairo_boilerplate_open_any2ppm() returns a FILE* obtined from popen() or fdopen(). It should hence be closed using pclose() or fclose() respectively. Fixes the crash on every script test on MacOS X.
* cairo-script: Don't ask for inlining of a cold-path functionAndrea Canciani2011-11-091-1/+1
| | | | | | | Silences a lot of warnings: inlining failed in call to 'scan_read.part.9': call is unlikely and code size would grow
* Silence some 'unused var' warningsAndrea Canciani2011-11-093-5/+1
|
* xml: Fix backend structureAndrea Canciani2011-11-091-26/+11
| | | | | | The xml backend structure was being initialized with the wrong functions, resulting in multiple "initialization from incompatible pointer type" warnings.
* default-context: Fix 'make check'Andrea Canciani2011-11-091-2/+2
| | | | | | | | | | | | | | | 'make check' reports: Checking that .libs/libcairo.so has the same symbol list as cairo.def 1a2,3 > _cairo_default_context_fini > _cairo_default_context_init Checking .libs/libcairo.so for local PLT entries 0011a274 00025f07 R_386_JUMP_SLOT 00026350 _cairo_default_context_fini 0011a494 00027607 R_386_JUMP_SLOT 00026480 _cairo_default_context_init Marking these functions as cairo_private fixes the problem.
* cogl: Fix 'make check'Andrea Canciani2011-11-091-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 'make check' reports: ./cairo-cogl-context.c: * cairo_path_fixed_t in user coordinates that we can use to create a ./cairo-cogl-context.c: * We use this hash to lookup a cairo_cogl_path_meta_t struct which ./cairo-cogl-context.c: * need to use the cairo_path_fixed_t api to describe a rectangle in terms of ./cairo-cogl-context.c: * passed the current cairo_t context we don't have a good way Error: some type names in the docs are not prefixed by hash sign, neither are the only token in the doc line followed by colon. Fix this by searching for the following regexp in the above files: '^[^:]*:[/ ][*]\( .*[^#']\| \|^\)\<cairo[0-9a-z_]*_t\>\($\|[^:]$\|[^:].\)' ./cairo-cogl-context.c: * cairo_path_fixed_t in user coordinates that we can use to create a ./cairo-cogl-context.c: * We use this hash to lookup a cairo_cogl_path_meta_t struct which ./cairo-cogl-context.c: * need to use the cairo_path_fixed_t api to describe a rectangle in terms of ./cairo-cogl-context.c: * passed the current cairo_t context we don't have a good way Error: some function names in the docs are not followed by parentheses. Fix this by searching for the following regexp in the above files: '^[^:]*:[/ ][*]\(\|[ ].*\)\([^#']\|^\)\<\(cairo_[][<>/0-9a-z_]*\>[^][<>(]\)' Checking that source files #include "cairoint.h" first (or none) cairo-cogl-context.c:#include "cairo-cogl-context-private.h" These are fixed trivially by this patch.
* vg: Fix buildAndrea Canciani2011-11-091-117/+34
| | | | | | | | | Add the missing includes, fix a typo and some changes in the signatures of the backend functions. The dest acquisition functions can be removed as they are not used anymore in the new compositor architecture (this will probably cause failures when fallbacks are tried because of unsupported operations).
* quartz-image: Fix buildAndrea Canciani2011-11-091-24/+32
| | | | | | | Add missing headers and fix some minor things (typos, missing arguments, changed function name). Map and unmap now rely on the generic path.
* stroke: Fix typosAndrea Canciani2011-11-022-4/+4
| | | | | | | The condition was comparing out with itself (always resulting in a true result) instead of out and in. Pointed out by Clang as "idempotent operation".
* gl: Initialize spans on the contextChris Wilson2011-11-021-2/+5
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Merge branch 'master' of git://cairographics.org/git/cairoChris Wilson2011-10-2733-50/+5246
|\
| * xlib: Check pixman format before trying to create an image surface for itCarlos Garcia Campos2011-10-271-6/+9
| |
| * rectangle: Fix warningAndrea Canciani2011-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | In 545f3085.. the cairo_spline_add_point_func_t type was modified to accept the tangent in the point, but cairo-rectangle.c was not updated accordingly. Fixes: cairo-rectangle.c: In function '_cairo_box_add_curve_to': cairo-rectangle.c:297:11: warning: passing argument 1 of '_cairo_spline_bound' from incompatible pointer type
| * Avoid defining inline when compling C++ on MSVC.Ehsan Akhgari2011-10-171-0/+2
| | | | | | | | | | | | Cairo fails to build with VC11 because it tries to #define inline, which is a keyword in C++. VC11's xkeycheck.h catches this with an #error. https://bugzilla.mozilla.org/show_bug.cgi?id=694797
| * gl/msaa: Fix glScissor boundsMartin Robinson2011-10-151-8/+12
| | | | | | | | | | | | When scissoring the compositing extents for windows, flip the y coordinate as windows use a projection matrix that does the same.
| * Merge branch 'master' of git://cairographics.org/git/cairoChris Wilson2011-10-1538-56/+1046
| |\
| * | backends: Adds a new Cogl based backendRobert Bragg2011-10-1127-16/+5141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new GPU accelerated backend for Cairo based on the Cogl 3D graphics API. This backend aims to support Cairo in a way that translates as naturally as possible to using a GPU, it does not strive to compete with the anti-aliasing quality of the image backend if it can't be done efficiently using the GPU - raw performance isn't the only metric of concern, so is power usage. As an overview of how the backend works: - fills are handled by tessellating paths into triangles - the backend has an extra fill_rectangle drawing operation so we have a fast-path for drawing rectangles which are so common. - strokes are also tessellated into triangles. - stroke and fill tessellations are cached to avoid the cpu overhead of tessellation and cost of upload given that its common for apps to re-draw the same path multiple times. The tessellations can survive translations and rotations increasing the probability that they can be re-used. - sources and masks are handled using multi-texturing. - clipping is handled with a scissor and the stencil buffer which we're careful to only update when they really change. - linear gradients are rendered to a 1d texture using a triangle strip + interpolating color attributes. All cairo extend modes are handled by corresponding texture sampler wrap modes without needing programmable fragment processing. - antialiasing should be handled using Cogl's multisampling API XXX: This is a work in progress!! TODO: - handle at least basic radial gradients (No need to handle full pdf semantics, since css, svg and canvas only allow radial gradients defined as one circle + a point that must lie within the first circle.) - currently we fall back to pixman for radial gradients. - support glyph rendering with a decent glyph cache design. The current plan is a per scaled-font growable cache texture + a scratch cache for one-shot/short-lived glyphs. - decide how to handle npot textures when lacking hardware support. Current plan is to add a transparent border to npot textures and use CLAMP_TO_EDGE for the default EXTEND_NONE semantics. For anything else we can allocate a shadow npot texture and scale the original to fit that so we can map extend modes to texture sampler modes.
| * | debug-trapsChris Wilson2011-10-112-0/+38
| | |
| * | perfChris Wilson2011-10-111-19/+42
| | |
* | | xlib-xpChris Wilson2011-10-142-7/+12
| |/ |/|
* | xlib: Reduce the composite traps operator for when the dest is clearChris Wilson2011-10-141-0/+6
| | | | | | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* | gl/msaa: Markup the new symbols as private for PLT hidingChris Wilson2011-10-141-2/+2
| | | | | | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* | image: Maximum number of spans can be upto (extents->width + 1)Taekyun Kim2011-10-141-2/+5
| | | | | | | | | | The range of span's x coordinate is between xmin and xmax. So we have to allocate the span array with size of xmax - xmin + 1.
* | gl/msaa: Support for solid color strokes.Martin Robinson2011-10-133-4/+151
| | | | | | | | | | | | Add support for basic solid color strokes using the fixed path stroke shaper. Currently components of the stroke overlap, but that will be handled in the following patch.
* | gl/msaa: Add clipping supportMartin Robinson2011-10-135-10/+139
| | | | | | | | | | | | | | | | | | Adds basic clipping to the OpenGL MSAA compositor via the depth and stencil buffers. Stenciling and depth bits are stored in a renderbuffer. Note that we only attach renderbuffers to surfaces created by ourselves and not for foreign drawables (e.g. X Windows).
* | gl/msaa: Implement basic solid color fillMartin Robinson2011-10-134-12/+274
| | | | | | | | | | Introduce the very basic functionality of an MSAA compositor for OpenGL. For this first patch only solid fills are supported.
* | gl/msaa: Introduce an MSAA compositor for OpenGLMartin Robinson2011-10-133-0/+114
| | | | | | | | | | The MSAA compositor will composite OpenGL primitives directly and anti-alias via the GPU.