Commit graph

283 commits

Author SHA1 Message Date
Andrea Canciani
3a504282ef build: Don't build cairo-sphinx when the tee surface is off
cairo-sphinx depends on cairo-tee, which is not always enabled.

Reported-by: James Cloos <cloos@jhcloos.com>
2011-06-16 15:11:24 +02:00
Chris Wilson
61fd10376f cairo-trace: Fix use of buf outside of scope
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37746
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-06 15:05:51 +01:00
Chris Wilson
e21b373c94 cairo-trace: Fix an obscure bug recording the fishtank
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-26 16:31:40 +01:00
Jesse Barnes
356c4ed9cc Expose 30bpp/10bpc support: CAIRO_FORMAT_RGB30
This is a common format used by framebuffers to drive 10bpc displays
and is often hardware accelerated by XRender with underlying support
from pixman's x2r10g10b10 format (which provides coercion paths for
fallbacks).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-01 09:00:14 +01:00
Andrea Canciani
ad458d816a trace: Always emit a function name for write-to-png-stream
By emitting an empty function name when it it impossible to perform
the lookup, we can get rid of the warning:

trace.c:3714: warning: unused variable ‘symbol’

Additionally, this makes the syntax (or, rather, the parameter count)
for write-to-png-stream the same on every configuration.
2011-03-18 17:54:54 +01:00
Chris Wilson
df1dd83880 trace: Fix hint_style/hint_metrics typo
Compiler warning saves the day!

trace.c: In function ‘_emit_font_options’:
trace.c:2973:20: warning: comparison between ‘cairo_hint_style_t’ and
‘enum _cairo_hint_metrics’

A genuine bug, thanks gcc!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-18 13:23:26 +00:00
Andrea Canciani
5f039f0f89 mesh: Rename cairo_pattern_mesh_* functions to cairo_mesh_pattern_*
This is consistent with the naming of most cairo types/functions
(example: cairo_foo_surface_*).

The substitution in the code has been performed using:

  sed -i 's/cairo_pattern_mesh_/cairo_mesh_pattern_/' <files>
2011-02-07 20:28:09 +01:00
Andrea Canciani
96426fdf01 script: Add support for mesh patterns
Extend CairoScript with operators based on the mesh pattern API.
2011-01-01 13:05:13 +01:00
Adrian Johnson
ed24deaa2e mesh: Add mesh pattern type and enum values
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.
2011-01-01 13:05:12 +01:00
Benjamin Otte
5a762edc28 build: Don't build cairo-fdr when the tee surface is off 2010-10-28 14:00:24 +02:00
Chris Wilson
8258532794 Reduce the cairo_device_type_t to only hold the used entries.
This should help clarify the documentation by not mentioning non-existent
devices and prevent any assumed coupling between surface-type values and
devices.
2010-09-06 13:11:22 +01:00
Benjamin Otte
3a8b8fcc2a gobject: Fix header defines 2010-09-01 21:14:40 +02:00
M Joonas Pihlaja
8fb91dc3f6 script: Fix script backend build.
The flight data recorders were missing an include
of cairo-tee.h ever since cairo-tee.h became an optional
backend.
2010-08-10 00:53:53 +03:00
Benjamin Otte
661f4859cd Add cairo-gobject library
This library is supposed to contain GType declarations for Cairo types.
It is also meant to support gobject-introspection binding creation.
2010-08-07 20:19:27 +02:00
M Joonas Pihlaja
1e7485f8e5 trace: Avoid stdbool.h C99ism.
There is no <stdbool.h> on old Solaris without invoking
c99 mode explicitly.
2010-07-12 00:50:13 +03:00
M Joonas Pihlaja
fca8977219 build: Rework pthread detection.
Use two levels of pthread support: a minimal level used to
build cairo itself, and a full level to build threaded apps
which want to use cairo.  The minimal level tries to use
pthread stubs from libc if possible, but falls back to the
full level if that's not possible.  We use CFLAGS=-D_REENTRANT
LIBS=-lpthread to find a real pthread library since that seems
to work on every unix-like test box we can get our hands on.
2010-07-11 21:40:26 +03:00
Chris Wilson
9b9952ab4f Convert mime data length to use unsigned long
What we want to use is size_t, but we don't want the implied POSIX
dependency. However, POSIX does say that size_t is an unsigned integer
that is no longer than a long, so it would appear safe to use an
unsigned long as a replacement. Safer at least than unsigned int.
2010-07-10 11:16:19 +01:00
Chris Wilson
2dc42af942 script: Update csi-exec to match new interface. 2010-05-27 17:53:30 +01:00
Benjamin Otte
e3b2212bc5 build: Fix pthread detection
Incorporate the pthread detection code from the autoconf archive. Should
fix build on obscure archs that pretend to be UNIXy - like Mac OS X
Tiger.

http://www.gnu.org/software/autoconf-archive/
http://www.gnu.org/software/autoconf-archive/ax_pthread.html
2010-05-13 15:17:27 +02:00
Chris Wilson
cbe8fd0794 script: Avoid the expensive of the redundant memset.
As we are about to immediately fill the entire image, allocate the
memory ourselves to avoid the redundant memset performed by pixman.
2010-05-12 20:54:49 +01:00
Chris Wilson
b9f7a4b526 script: Don't hash the entire image.
The reuse hit rate is very small, and most images are quickly
distinguished in the first few bytes... Though perhaps not for video as
in the swfdec-youtube case...
2010-05-12 20:54:49 +01:00
Chris Wilson
1bda2334b3 trace: And for the bonus round... Make it compile. 2010-05-11 13:51:38 +01:00
Chris Wilson
b23f3bd204 trace: Try wrapping FT_Open_Face()
We have to be careful to disambuigate an internal call by FreeType from
the application.
2010-05-11 13:46:44 +01:00
Chris Wilson
3940b0e91c subsurface: s/region/rectangle/
After a renewed discussion, it was pointed out that the API in Cairo was
not restrictive and by using doubles we would be consisted with the rest
of the API. Thus prompting the name change to

  cairo_surface_create_for_rectangle()

similar to cairo_rectangle().

And document the public API.
2010-04-30 10:16:06 +01:00
Chris Wilson
0f0d349a40 trace: Wrap cairo_surface_create_for_region() 2010-04-28 09:54:37 +01:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Chris Wilson
36e0a3d3a0 trace: Remove unused functions
trace.c:1154: warning: ‘_has_font_face_id’ defined but not used
trace.c:1196: warning: ‘_get_pattern_id’ defined but not used
trace.c:1870: warning: ‘_emit_font_face’ defined but not used
trace.c:1882: warning: ‘_emit_scaled_font’ defined but not used
2010-04-26 18:18:49 +01:00
Chris Wilson
3a2d9ffe03 trace: Check return value to suppress compiler warning
trace.c: In function ‘get_prog_name’:
trace.c:741: warning: ignoring return value of ‘fgets’, declared with
attribute warn_unused_result
2010-04-26 18:18:49 +01:00
Chris Wilson
37be183412 trace: Trivial compiler warning fix
trace.c:1665: warning: initialization from incompatible pointer type
2010-04-26 18:18:49 +01:00
Chris Wilson
3814855a64 script: Flush prior to modifying the image data. 2010-04-14 20:22:14 +01:00
Chris Wilson
00101fa716 configure: check -lrt for shm_open()
OS/X includes shm_open() in libc, and fails to link if -lrt is
specified. So perform the appropriate configure time magic.
2010-03-31 16:20:13 +01:00
Andrea Canciani
55ce0b7748 script: Fix script scanner endianness
The script interpreter was reading the length of compressed data as
an host-endian uint32_t, thus making cairo-script able to correctly
read traces that were produced on the same endianness as the one they
ran upon, but unsuitable for portabile cairo-scripts.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-31 16:13:05 +02:00
Andrea Canciani
4f617eaf77 trace: Fix trace endianness
Trace files were using host-endian to represent the length of
compressed data, making the trace format not portable.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-03-31 13:13:36 +02:00
Chris Wilson
7ab350378e Silence enumeration warnings following addition of RGB16_565 2010-03-30 18:31:34 +01:00
Chris Wilson
c8a8e57d6a script: Use a stack to push/pop recursed line numbers.
Still not entirely helpful in the event of recursive parsing without a
reference to the file as well as the line number in the event of an
exception.
2010-03-21 20:42:34 +00:00
Chris Wilson
4b4de940ee script: Remove the version check.
When compiling we can depend on whatever version of cairo we need, but
we should be wary of checking for runtime compatibility when building
standalone.
2010-03-21 20:41:18 +00:00
M Joonas Pihlaja
5b7f4bb241 api: Introduce CAIRO_FORMAT_INVALID formally in the API.
We were exposing the actual value of CAIRO_FORMAT_INVALID
through API functions already, so it makes sense to just
go ahead and put it in the cairo_format_t enum.
2010-03-01 01:21:31 +02:00
Chris Wilson
5d34902c0c script: Compile without mmap
Should fix:
  Bug 26509 - Cairo fails to compile without mmap
  http://bugs.freedesktop.org/show_bug.cgi?id=26509

As reported by Hib Eris, Cairo files to compile under a mingw32
cross-compiler as we use a structure only defined if HAVE_MMAP
unconditionally.
2010-02-10 12:10:16 +00:00
Chris Wilson
ab3dc7bb31 csi-replay: compile fix 2010-02-02 16:31:36 +00:00
Benjamin Otte
58980b4ad6 build: Remove glitz surface
glitz is unmaintained and the GL surface is far superior anyway.
2010-01-27 09:56:14 +01:00
Chris Wilson
3acd520c9d xml: Port to cairo_device_t 2010-01-22 23:01:50 +00:00
Chris Wilson
49ab86772a script: Port cairo_script_context_t to cairo_device_t
Use the unifying cairo_device_t for cairo_script_context_t and replace.
2010-01-22 23:01:50 +00:00
Chris Wilson
f617d5fc98 Add cairo_device_t
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.
2010-01-22 23:01:50 +00:00
Chris Wilson
bf7fb4e0e0 script: Handle cache allocation failure more gracefully
Instead of bailing out if we cannot store the glyph cache on the font,
simply do not store the glyph cache on the font...
2010-01-22 23:01:49 +00:00
Chris Wilson
2b312806f1 script: Free the correct pattern after failure.
The error path attempted to free the resolved pattern which it had just
discovered was NULL and not the locally allocated pattern...
2010-01-22 23:01:49 +00:00
Chris Wilson
bc2d0ad114 script: Permit surface operations on the context
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.
2010-01-22 23:01:49 +00:00
Chris Wilson
411c09eed7 perf: Enable a surface cache for perf-trace
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
2010-01-22 23:01:46 +00:00
Chris Wilson
8f69481722 gitignore: refresh
Add forgotten local targets to .gitignore
2010-01-22 22:30:43 +00:00
Chris Wilson
41a24d822a trace: Correctly encode octal values.
How embarrassing.
2010-01-07 11:58:01 +00:00
Andrea Canciani
21560b3ec6 [trace] Fix compilation when FreeType is disabled
cairo-trace needs some headers which are missing if freetype is
not enabled. Adding them explicitly fixes compilation.
2009-12-30 14:08:38 +01:00