summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* xml: Port to cairo_device_tChris Wilson2010-01-221-3/+4
|
* script: Port cairo_script_context_t to cairo_device_tChris Wilson2010-01-225-25/+25
| | | | Use the unifying cairo_device_t for cairo_script_context_t and replace.
* Add cairo_device_tChris Wilson2010-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device is a generic method for accessing the underlying interface with the native graphics subsystem, typically the X connection or perhaps the GL context. By exposing a cairo_device_t on a surface and its various methods we enable finer control over interoperability with external interactions of the device by applications. The use case in mind is, for example, a multi-threaded gstreamer which needs to serialise its own direct access to the device along with Cairo's across many threads. Secondly, the cairo_device_t is a unifying API for the mismash of backend specific methods for controlling creation of surfaces with explicit devices and a convenient hook for debugging and introspection. The principal components of the API are the memory management of: cairo_device_reference(), cairo_device_finish() and cairo_device_destroy(); along with a pair of routines for serialising interaction: cairo_device_acquire() and cairo_device_release() and a method to flush any outstanding accesses: cairo_device_flush(). The device for a particular surface may be retrieved using: cairo_surface_get_device(). The device returned is owned by the surface.
* script: Handle cache allocation failure more gracefullyChris Wilson2010-01-221-41/+33
| | | | | Instead of bailing out if we cannot store the glyph cache on the font, simply do not store the glyph cache on the font...
* script: Free the correct pattern after failure.Chris Wilson2010-01-221-1/+1
| | | | | The error path attempted to free the resolved pattern which it had just discovered was NULL and not the locally allocated pattern...
* script: Permit surface operations on the contextChris Wilson2010-01-221-3/+11
| | | | | | | | | | By implicitly reference the target of the context instead, i.e. this reduces the use of: /target get (example.png) write-to-png pop as a common idiom where the context is kept on the stack and the surface forgotten.
* perf: Enable a surface cache for perf-traceChris Wilson2010-01-223-3/+16
| | | | | | | | | | | | | | | | | | | | Real applications that control their Drawable externally to Cairo are 'disadvantaged' by cairo-perf-trace when it creates a similar surface for each new instance of the same Drawable. The difficulty in maintaining one perf surface for every application surface is that the traces do not track lifetimes for the application surfaces, so we would just accumulate stale surfaces. The surface cache takes a different approach and returns the same surface for each active Drawable, and maintains a hold-over of the MRU 16 surfaces. This achieves 60-80% hit rate with firefox, which is probably as good as can be expected. Obviously for double-buffered applications we only every draw to freshly created surfaces (and Gtk+ bypasses cairo to do the final copy -- the ideal application would just use a push-group for double buffering, in which case we would capture and replay the entire expose event). To enable use of the surface cache whilst replaying use -c: ./cairo-perf-trace -c firefox-talos-gfx
* gitignore: refreshChris Wilson2010-01-222-0/+3
| | | | Add forgotten local targets to .gitignore
* trace: Correctly encode octal values.Chris Wilson2010-01-071-7/+14
| | | | How embarrassing.
* [trace] Fix compilation when FreeType is disabledAndrea Canciani2009-12-301-0/+3
| | | | | cairo-trace needs some headers which are missing if freetype is not enabled. Adding them explicitly fixes compilation.
* [dirty] Add more missing surface dirtying notifications.M Joonas Pihlaja2009-11-291-0/+2
| | | | | | Now that the image surface actually cares about cairo_surface_mark_dirty() we're hitting cases where we've forgotten to mark surfaces dirty.
* Fix compilation on MacOS XAndrea Canciani2009-11-093-13/+17
| | | | | | Enable "ld_preload" (DYLD_INSERT_LIBRARIES + DYLD_FORCE_FLAT_NAMESPACE) and build cairo-trace as a library instead of a module to make it work also on MacOS X.
* sphinx: Add required pthread libsBenjamin Otte2009-11-021-2/+2
| | | | Try again, this time for real hopefully.
* sphinx: Add required pthread libsChris Wilson2009-11-021-2/+3
| | | | | Switching to pthread-stubs broke the build for sphinx on unbroken platforms [those that do not unnecessarily link against -lpthreads].
* [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja2009-10-224-30/+30
| | | | | | | The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
* [build] Link against pthread-stubsChris Wilson2009-10-151-1/+1
| | | | | | Avoid pulling in the real pthread library if the application is single threaded and not using pthreads, by linking against pthread-stubs instead.
* [API] Make _cairo_meta_surface_replay() private againBenjamin Otte2009-09-301-22/+0
| | | | | | | Replaying a meta surface can be achieved by using it as a source for a cairo_paint() so exporting a separate API is unnecesary and confusing. So after consulting Chris and Carl, we decided to remove the function again.
* [autoconf] Comment on the SIZEOF_VOID__ -> SIZEOF_VOID_P workaround.M Joonas Pihlaja2009-09-141-0/+2
| | | | Explain where the weird SIZEOF_VOID__ comes from.
* [trace] Look harder for the cairo-trace.so library.M Joonas Pihlaja2009-09-141-1/+16
| | | | | | | | | | | | | On OpenBSD the convention is to not use symlinks from unversioned library names to versioned library names. This breaks cairo-trace because it looks for cairo-trace.so explicitly, but on OpenBSD only cairo-trace.so.0.0 is installed. The right thing to do is probably to source the cairo-trace.la file and look for a file name there somehow. Instead this commit just looks for a likely looking file or symlink in the install directory.
* [trace] Don't use pthread_key_delete.M Joonas Pihlaja2009-09-141-1/+0
| | | | | | | | | | | | | | On OpenBSD libc doesn't provide pthread stubs like glibc on Linux or newer libcs from FreeBSD. However libX11 does provide a stubs for a subset of the pthread functions (formerly in libXThrStub, now moved into libX11 proper), but pthread_key_delete() is not one of the stubbed ones. So, on OpenBSD cairo's non-linking of libpthread accidentally works as long as the xlib-surface is enabled, which is nearly always the case. This patch makes trace.c stand at the same precipice as cairo itself by reverting to only a subset of the pthreads functions stubbed by libX11.
* [build] Check for dlsym in both libdl and libc.M Joonas Pihlaja2009-09-141-1/+5
| | | | The BSDs have dlsym() in libc rather than libdl.
* [build] Work around autoconf void* -> VOID__ name conversion bug.M Joonas Pihlaja2009-09-141-0/+4
| | | | | | The autoconf shipping with OpenBSD 4.5 converts sizeof(void*) to SIZEOF_VOID__ rather than SIZEOF_VOID_P. Work around that by defining SIZEOF_VOID_P if required.
* [build] Add a default message for when GLEW isn't builtChris Wilson2009-09-141-0/+1
| | | | | And it appears I touched the build system again and autoregenerated the feature headers.
* Add a private copy of GLEWChris Wilson2009-09-141-1/+9
| | | | | | | | | This appears to be the simplest mechanism to build libglew at the moment - should a system copy be unavailable. Fortunately libglew is now distributed under a permissive licence. If you want to pass 'make -C src check' you have to use the system copy, or spend quite a bit of time cairo-fying libglew.
* [trace] Don't trace internal cairo calls on Solaris.M Joonas Pihlaja2009-09-131-138/+327
| | | | | | | | | | | | | | | On various configurations of Solaris cairo-trace likes to trace internal calls to the API from within cairo and cairo-trace itself. On Linux the slim_hidden_proto stuff avoids this by name mangling and symbol alias magic, but on Solaris that doesn't work so we're left with either no hidden symbols at all or using normal ELF hidden symbol attributes, but neither of those prevent internal calls to cairo from being traced of course. This commit provides a per-thread entry/exit trace counter for use when we can't use name mangling to hide internal API calls. As a side-effect it may hide actual client API calls from callback functions called by cairo, but such use cases ought to be rare.
* [trace] Don't rely on the constructor attribute to initialise the tracer.M Joonas Pihlaja2009-09-131-2/+174
| | | | | | | | Use pthread_once() at cairo API entry points to initialise the library if required. This side steps the issues with the __constructor__ attribute vs _init()/_fini() on Solaris and different tracer/tracee runtimes which result in the constructors not being run in cairo-trace.so.
* [trace] Don't try and propagate a void result.M Joonas Pihlaja2009-09-131-66/+70
| | | | | | | | The pattern return <function returning void>( ... ); is a gccism not supported by Sun Studio.
* [trace] Avoid warnings from assigning a void pointer to a function pointer.M Joonas Pihlaja2009-09-131-2/+2
| | | | | | The Sun Studio compiler complains a *lot* when assigning the result of dlsym to a function pointer. Cast the result to the proper type first.:w
* [trace] Stray trailing ';' in bswap macrosChris Wilson2009-09-131-2/+2
|
* [trace] Compile without lookup-symbolChris Wilson2009-09-131-1/+5
| | | | And check compilation with --disable-symbol-lookup
* [configure] --enable-symbol-lookupChris Wilson2009-09-131-5/+9
| | | | | | | | There you go Joonas, I don't always ignore your suggestions! This is simple patch to allow the user to disable symbol loops in case the auto-detection fails on some obscure (perhaps OpenBSD) platform. Or in case the user really wants to trim a few bytes from a library only used during tracing!
* [util] And reuse the same name repository name.Chris Wilson2009-09-091-2/+2
| | | | | Completely confused by local caching of a broken cairo.modules by the jhbuild client. ARGH!
* [util] And back to a unique repo name for cairo.modulesChris Wilson2009-09-091-2/+2
| | | | Gah, further experiments into the unknown and the unclear.
* [util] And restore the repository tag.Chris Wilson2009-09-091-0/+2
| | | | jbhuild requires a local definition.
* [util] Inherit the repository from xorg.modulesChris Wilson2009-09-091-3/+1
| | | | | Experiment with inheriting the repository from xorg.module, in order to avoid having two entries for the same server.
* [build] Improve handling of missing test apparatusChris Wilson2009-09-081-2/+2
| | | | | Improve detection, reporting and disabling of test backends when we lack the required libraries and utilities.
* [configure] Add option to disable trace.Chris Wilson2009-09-051-1/+1
| | | | | | | | Some environments may be broken beyond our capabilities to detect, or maybe the user is just insane and doesn't want to build my nice shiny cairo-trace. Whatever, give them the option to choose: $ ./configure --disable-trace
* [script] Always create a fallback fontChris Wilson2009-09-021-19/+27
| | | | | | | In order to get a baseline for win32 performance testing, always create a font so that the trace can be replayed. Not ideal, but I feel this the pragmatic solution for judging the performance differentials before I can work out a better solution for loading typ42 fonts.
* [script] Attempt to select a font if ! CAIRO_HAS_FT_FONTChris Wilson2009-09-021-0/+106
| | | | | | | In order to enable replay of traces on machines that do not use FreeType as the native font system, we need to convert a type42 font into something similar. Currently the fallback is just to select a font with the same name - this ignores weight and slant, and many other details.
* [trace] Check for __builtin_return_address explicitly.M Joonas Pihlaja2009-09-021-1/+1
| | | | | | Some other compilers such as clang and icc support the __builtin_return_address() intrinsic as well, so we don't need to check for __GNUC__ >= 3 only.
* [trace] Replace an open coded test for matrix identity.M Joonas Pihlaja2009-09-021-4/+1
| | | | | The code has a _matrix_is_identity() function we can use instead of open coding the same test.
* [trace] Don't crash on unknown enums values.M Joonas Pihlaja2009-09-021-141/+172
| | | | | | | | | If the tracer encounters an unknown enum value it ought not to crash. Theis patch replaces the idiom of looking up a name for an enumerated value directly from a table by a switch statement. As a bonus we get warnings from the compiler when the enums are updated in cairo.
* [trace] Check for object stack underflow.M Joonas Pihlaja2009-09-021-2/+24
| | | | | | | If the tracer's object stack underflows we want to know about is as soon as possible. This patch adds checks against the stack overflowing and aborts the program with an object stack dump if it does.
* [trace] Get the tracee program name from the environment.M Joonas Pihlaja2009-09-022-13/+21
| | | | | | Support non-Linux systems which don't have a /proc/self/cmdline by transferring the application name given to cairo-trace via an environment variable CAIRO_TRACE_PROG_NAME.
* [tee] Rename 'append' to 'add' and add symmetric 'remove'Chris Wilson2009-09-012-2/+2
|
* [trace] Use HAVE_FLOCKFILE/FUNLOCKFILE since configure test for them.M Joonas Pihlaja2009-08-311-0/+4
| | | | | The trace source was using the flockfile() and funlockfile() functions directly.
* [script] Implement invertChris Wilson2009-08-291-1/+25
| | | | Flesh out matrix inversion.
* Rename cairo-script static func to avoid MinGW conflictDamian Frank2009-08-291-2/+2
| | | | | | cairo-script-operators.c's _dup function was colliding with one defined in io.h by MinGW (gcc 4.3.0 package). I renamed it to _duplicate.
* [script] Conditionalise the buildChris Wilson2009-08-292-3/+10
| | | | Allow the interpreter to be disabled if we can not satisfy its dependencies.
* [script] Support running on cairo-1.8Chris Wilson2009-08-291-3/+15
| | | | | Pre 1.9 the application had to pass a resolved font to cairo -- so do so in the interpreter if the cairo version is less than 1.9