If we fail to resolve a particular pattern, try removing a few features
from the pattern and see if we can resolve that fallback and continue on
with the trace with a close approximation.
This is then behaves very similar as if the pattern requested a specific
font that was not available on the system and so was substituted.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Just emit a marker for when cairo_image_surface_get_data() is called on
a surface so that we have a breadcrumb for when the pixels are first
exported. (Though note that pointer may be kept around and used much
later.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
We were calling the antialias close function from the unantialiased
paths - a function that operates on a completely different structure to
the one passed in.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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. :)
The cairo-missing library provides the functions which are needed in
order to correctly compile cairo (or its utilities) and which were not
found during configuration.
Fixes the build on MacOS X Lion, which failed because of collisons
between the cairo internal getline and strndup and those in libc:
cairo-analyse-trace.c:282: error: static declaration of ‘getline’ follows non-static declaration
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
cairo-analyse-trace.c:307: error: static declaration of ‘strndup’ follows non-static declaration
...
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>
In step 1 of speeding up stroking, we introduce contours as a means for
tracking the connected edges around the stroke. By keeping track of
these chains, we can analyse the edges as we proceed and eliminate
redundant vertices speeding up rasterisation.
Coincidentally fixes line-width-tolerance (looks like a combination of
using spline tangent vectors and tolerance).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The mime surface is a user-callback surface designed for interfacing
cairo with an opaque data source. For instance, in a web browser, the
incoming page may be laid out and rendered to a recording surface before
all the image data has finished being downloaded. In this circumstance
we need to pass a place holder to cairo and to supply the image data
later upon demand.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We clear past the end of the row so that we don't trigger valgrind
warning leaving harmless uninitialised bits inside the input image.
However, for RGB24 the input rowlen is 3*width, whereas we write 4*width
of data, so we need to take account of that and ensure we clear beyond
the end of the written data, not the read data.
Fixes reading of RGB24 input.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
It is convenient if the user can simply enable the use of the commented
write-to-png operation just by removing the preceding '%'. However, to
do so we need to make sure that the line is stack-neutral and so need to
pop the surface that we place onto the stack after writing the png.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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);
- }
Currently we only emit the format, but if you want to later convert
the images to a normal surface for replay it is handy to have the
content.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A common requirement is the fast upload of pixel data. In order to
allocate the most appropriate image buffer, we need knowledge of the
destination. The most obvious example is that we could use a
shared-memory region for the image to avoid the transfer cost of
uploading the pixels to the X server. Similarly, gl, win32, quartz...
The other side of the equation is that for manual modification of a
remote surface, it would be more efficient if we can create a similar
image to reduce the transfer costs. This strategy is already followed
for the destination fallbacks and this merely exposes the same
capability for the application fallbacks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
During replay we want to handle recording surfaces specially, and not
redirect the creation of those to the target surface. This is similar to
the need to keep image surfaces as images during replay.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
cairo-xcb's acquire_source_image implementation will attach the image it returns
as a snapshot to the xcb surface. cairo_surface_mark_dirty_rectangle asserts
that the surface doesn't have any snapshots attached. cairo-trace will emit the
surface to the trace when it was marked dirty by drawing it to an image surface.
The combination of these three things caused a failed assertion when cairo-trace
was used on something which uses xcb/Xlib and which uses mark_dirty.
I found this with firefox and xlib-xcb.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Fixes all warnings that looked like this:
warning: enumeration value 'CAIRO_STATUS_DEVICE_FINISHED' not handled in switch
Signed-off-by: Uli Schlachter <psychon@znc.in>
Restructure the Makefiles in .sources, .am and .win32 to enable
building cairo-script-interpreter on Win32.
Some minor changes are needed to compile on MSVC:
- include stdint.h to define INT_MAX-like macros
- redefine "inline"
- avoid deprecated functions (snprintf, replaced by _snprintf)
- define _USE_MATH_DEFINES so that math.h defines M_PI, M_SQRT2 and
M_LN2
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>
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.
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>
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>