summaryrefslogtreecommitdiff
path: root/src/cairo-surface-observer.c
Commit message (Collapse)AuthorAgeFilesLines
* doc: Include surface observer documentationKhaled Hosny2023-02-021-0/+9
| | | | Mostly empty, though.
* Use _cairo_malloc instead of mallocAdrian Johnson2018-05-071-3/+3
| | | | | | | | | | _cairo_malloc(0) always returns NULL, but has not been used consistently. This patch replaces many calls to malloc() with _cairo_malloc(). Fixes: fdo# 101547 CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Prevent observer surfaces from writing to stdoutEd Schouten2016-09-041-2/+0
| | | | | | | | | Invoking cairo_surface_mark_dirty () on an observer surface would cause it to print debugging output to stdout. Reviewed-by: Andrea Canciani <ranma42@gmail.com> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227
* Don't cull very thin lines on vector surfacesAdrian Johnson2015-10-171-1/+2
| | | | | | On vector surfaces, use a minimum line width when calculating extents. Bug 77298
* fix conflicting types for 'sync' on AIX, bug#89338Michael Haubenwallner2015-03-051-6/+6
|
* doc: Add missing sections and symbols for public docsBryce Harrington2014-03-131-0/+5
| | | | | | | | | This adds a number of items to the documentation for which code docs exist, and also adds sections for cairo-skia and cairo-surface-observer. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48784 Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
* xlib: Implement SHM fallbacks and fast upload pathsChris Wilson2012-08-171-4/+2
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* surface: Use the internal map/unmapAndrea Canciani2012-05-261-3/+3
| | | | | | In many places Cairo maps/unmaps surfaces to perform operations on the raw image, but it doesn't care about the format being invalid. All of these are appropriate users of _cairo_surface_map_to_image().
* surface: Make backend-specific map/unmap functions symmetricAndrea Canciani2012-05-261-10/+2
| | | | Map allocates a surface. Symmetrically, unmap should destroy it.
* surface: Make map_to_image return cairo_image_surface_t*Andrea Canciani2012-05-261-1/+1
| | | | | This makes it easier to check that the funciton is returning the correct type of surfaces.
* Split cairo-list into struct+inlinesChris Wilson2012-04-191-0/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Split cairo-surface-subsurface-private into struct+inlinesChris Wilson2012-04-191-1/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Split cairo-surface-observer-private into struct+inlinesChris Wilson2012-04-191-0/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Split cairo-combsort-privates into struct+inlinesChris Wilson2012-04-191-1/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: Silence gcc warningAndrea Canciani2012-02-111-1/+5
| | | | | | | | | | GCC complains that: cairo-surface-observer.c:289:26: warning: ignoring return value of 'cairo_device_acquire', declared with attribute warn_unused_result [-Wunused-result] Explain why it's safe to ignore it in a comment.
* observer: Return status when printing the observed dataAndrea Canciani2012-02-111-12/+12
| | | | | | | | | | Making cairo_surface_observer_print() and cairo_device_observer_print() return the status of the observer or of the stream makes it possible to correctly track what kind of error happens if the print is not successful. This makes the functions more consistent with existing API with a similar signature like cairo_surface_write_to_png_stream().
* Replace the ad-hoc surface unwrappers with a function pointerChris Wilson2012-02-091-0/+9
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Convert cairo_mime_surface_t to cairo_raster_source_pattern_tChris Wilson2011-11-251-1/+5
| | | | | | | | | | As discussed, overloading the cairo_surface_t semantics to include sources (i.e. read-only surfaces) was duplicating the definition of cairo_pattern_t. So rather than introduce a new surface type with pattern semantics, start along the thorny road of extensible pattern types. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: Fix typo and handle the condition of no script deviceChris Wilson2011-10-111-2/+2
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* script: compile withoutChris Wilson2011-09-261-1/+12
| | | | The surface observer gained a dependency on script, make it optional.
* Introduce a new compositor architectureChris Wilson2011-09-121-36/+191
| | | | | | | | | | | | | | | | | | Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
* observer: Fix build on sunccAndrea Canciani2011-09-041-1/+1
| | | | | | | Returning a void value is an error on suncc and causes a warning on msvc: cairo-surface-observer.c(1273) : warning C4098: '_cairo_surface_observer_release_source_image' : 'void' function returning a value
* win32: Fix linkingAndrea Canciani2011-09-021-1/+2
| | | | | | | round() is not available on win32 and causes the linking to fail with: cairo-surface-observer.obj : error LNK2019: unresolved external symbol round referenced in function percent
* time: Add cairo_time_t typeAndrea Canciani2011-09-021-95/+74
| | | | | | | | | | | | | Add the cairo_time_t type (currently based on cairo_uint64_t) and use it in cairo-observer and in the perf suite. Fixes the build on MacOS X (for the src/ subdir) and Win32, whch failed because they don't provide clock_gettime: cairo-surface-observer.c:629: error: implicit declaration of function 'clock_gettime' cairo-surface-observer.c:629: warning: nested extern declaration of 'clock_gettime' cairo-surface-observer.c:629: error: 'CLOCK_MONOTONIC' undeclared (first use in this function) ...
* observer: Add missing return codesChris Wilson2011-08-301-4/+4
| | | | | | Upon detecting the user error, supply an error code! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* api: Extend cairo_antialias_t to include performace/quality hintsChris Wilson2011-08-301-1/+4
| | | | | | | | | | | The existing API only described the method to be used for performing rasterisation and unlike other API provided no opportunity for the user to give a hint as to how to trade off performance against speed. So in order to no be overly prescriptive, we extend the NONE/GRAY/SUBPIXEL methods with FAST/GOOD/BEST hints and leave the backend to decide how best to achieve those goals. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* perf: Print a summary of each operation for a trace (using '-s')Chris Wilson2011-08-301-64/+155
| | | | | | | In order for this to be effective on small system we also need to disable the recording of the long traces which exhaust all memory... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observe: Provide the sum of the elapsed time of the individual operationsChris Wilson2011-08-231-6/+46
| | | | | | | | We can use the elapsed time of the indiividual operations to profile the synchronous throughput of a trace and eliminate all replay overhead. At the cost of running the trace synchronously of course. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: correct classification of aligned pathsChris Wilson2011-08-201-5/+4
| | | | | | | We were misclassifying rectilinear paths as aligned strokes, which is bogus until we analyse the offset path. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: bypass surface mid-layer and call into recording surface directlyChris Wilson2011-08-201-46/+69
| | | | | | | | As we want to record the exact command pass to us, we want to bypass any further optimisations that the surface mid-layer might perform before passing the operation to the recording surface. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: copy glyphs around call into backendChris Wilson2011-08-201-5/+14
| | | | | | | As the backend is allowed to modify the glyph array, we need to copy it for recoding. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* recording: optionally disable optimise away clearsChris Wilson2011-08-201-4/+21
| | | | | | | The observer wants to get an accurate recording of all operations, including clears. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: record all operations and their timingsChris Wilson2011-08-201-47/+260
| | | | | | | | The immediate use of this is to print out the slowest operation of each type in a replayable manner. A continuing demonstration of how we may analyse traces... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* obsever: include the operation timingsChris Wilson2011-08-181-122/+524
| | | | | | | | Seeing the relative amounts of time spent in each operation and the slowest one of each, gives further insight into the peculiarities of a trace. And hopefully point out areas of improvement. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: put a comma between array items when printingChris Wilson2011-08-181-2/+3
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: further classify general clipsChris Wilson2011-08-181-3/+8
| | | | | | | | A clip with only a single path or can be reduced to a single polygon are easier to handle than a clip containing a mixture of paths (typically ANTIALIAS_NONE vs ANTIALIAS_DEFAULT). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: only print out the non-zero clip typesChris Wilson2011-08-181-6/+9
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: only print out the non-zero path typesChris Wilson2011-08-181-7/+10
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* obverser: only print out the active patternsChris Wilson2011-08-181-13/+15
| | | | | | I prefer the reduced output as exemplified by the operator message. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: print path antialias modesChris Wilson2011-08-181-0/+16
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: print stroke caps/joins frequenciesChris Wilson2011-08-151-11/+54
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: print operator frequenciesChris Wilson2011-08-151-0/+67
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* observer: report number of solid patterns firstChris Wilson2011-08-151-2/+2
| | | | | | | As these tend to be the quickest, and putting them first keeps the reports are in an estimated fast->slow order. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Introduce cairo_surface_observer_t for performance analysisChris Wilson2011-08-141-0/+1009
Another logging passthrough surface that records the style of operations performed trying to categorise what is slow/fast/important. In combination with perf/cairo-analyse-trace it is very useful for understanding what a trace does. The next steps for this tool would be to identify the slow operations that the trace does. Baby steps. This should be generally useful in similar situations outside of perf/ and should be extensible to become an online performance probe. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>