b132fae5e8 introduced the usage of two
new pixman formats. This requires pixman 0.22, but makes it possible
to fix some TODO's left behind in gl and vg.
This is basically the same fix as e6c3efdd65. However, this was lost in
b132fae5e8 and thus had to be fixed again.
Fixes: clip-fill-eo-unbounded clip-fill-nz-unbounded
Signed-off-by: Uli Schlachter <psychon@znc.in>
Device mutexes guarantee the consistency between multiple threads,
hence GC cache does not rely anymore on atomic operations.
This makes it possible to avoid bit twiddling and to use a simple
array.
As we do not control the geometry used for the individual glyphs, we
must always send a clip-region so that X can trim the glyph
appropriately. However, in order to avoid sending unnecessary data we
only do so if the clip extents is less than the ink extents of the
glyphs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This adds checks for NULL pointers, devices in an error state and devices which
aren't owned by the right backend.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We now remember the original flags before any call to
cairo_xcb_device_debug_cap_xshm_version() or
cairo_xcb_device_debug_cap_xrender_version() was done and re-set these flags on
any new call to these functions. This makes it possible to raise e.g. the used
RENDER version again.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Every xcb surface had its own copy of the flags from the time that it was
created. This means that, if you want to make use of
cairo_xcb_device_debug_cap_xrender_version() and
cairo_xcb_device_debug_cap_xshm_version(), you first had to create a dummy xcb
surface, use that to get access to the cairo_device_t so that you can use these
functions and only then create your real surface, because the change only
affected new surfaces.
This commit changes everything to use the connection's flag and removes the
per-surface flags. This avoids the dummy surfaces completely.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Adrian Johnson found that I had broken show_page() and pinpointed the
cause to being that cairo_show_page() was being called on the recording
surface and not the pagination surface after my overhaul for
cairo_backend_t. In fact, the problem was far more severe as the mistake
caused the created context to point to the wrong surface entirely,
bypassing the surface proxy.
What is desired is for the proxy's target surface to choose what manner
of context is should use, but for all calls into the surface backend to
go through the proxy surface.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This avoids fallback when using poppler cairo for printing PDFs with
CFF fonts.
The current CFF subsetting only works with Opentype/CFF fonts. CFF
fonts inside PDF files are usually embedded as a bare CFF font without
the Opentype wrapper.
Making the CFF subset work with bare CFF fonts requires doing a bit of
extra work to extract the fontname, font bbox, and glyph widths from
the CFF data instead of using the Opentype tables.
Another 10% off fishbowl for both snb and pnv.
[Note this exposes the bugs in the polygon clipper; naive *and* broken.]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
A demonstration of step 2, improves performance for selected benchmarks
on selected GPUs by up to 30%.
firefox-fishbowl on snb {i5-2520m): 42s -> 29s.
firefox-talos-gfx on snb: 7.6 -> 5.2s.
firefox-fishbowl on pnv (n450): 380 -> 360s.
Whist this looks like it is getting close to as good as we can achieve,
we are constrained by both our API and Xrender and fishbowl is about 50%
slower than peak performance (on snb).
And it fixes the older performance regression in firefox-planet-gnome.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This was introduced in b132fae5e8.
Fixes warnings of the following kind:
cairo-xlib-xcb-surface.c:261:5: warning: initialization from incompatible
pointer type
cairo-xlib-xcb-surface.c:261:5: warning: (near initialization for
'_cairo_xlib_xcb_surface_backend.paint')
Signed-off-by: Uli Schlachter <psychon@znc.in>
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
b8f43617a9 regressed the generation of
Makefiles. automake 1.10 fails when executed during ./autogen.sh:
automake: cairo_test_suite_OBJECTS should not be defined
test/Makefile.am:76: while processing program `cairo-test-suite'
Remove the dependency on getting the number of glyphs in the font from
FT. The number of glyphs is instead obtained by counting the
charstrings.
Some fixed size malloced data is replaced with cairo_array_t so they
can be populated before we know the number of glyphs.
Remove cairo_type1_font_subset_get_glyph_names_and_widths().
The glyph names are read from the font file instead of via FT. The
charstrings are parsed to extract the glyph widths.
A new font backend function, index_to_glyph_name, has been added for
obtaining the glyph name for a given glyph index. This function is
supplied with the array of glyph names and a glyph index and is
required to return the array index of the glyph name corresponding to
the glyph index.
The reason for passing in the array of glyph names is that:
1) On windows there is no API for accessing glyph names so we will
use knowledge of how the glyphs in a Type 1 font are numbered to
perform name lookup.
2) We can also use knowledge of how FT assigns the glyph numbers in a
Type 1 font to optimize the name lookup.
A benchmark to test how close we get to reducing paint+clip to an ordinary
fill, and to check correctness.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When the xlib-xcb backend created a new cairo_device_t for a Display*, it called
XAddExtension to get a callback on XCloseDisplay(). However, when the last
surface using this device is destroyed, this extension isn't unregistered
because there is no API for this.
I noticed that gvim was quite slow after a while with xlib-xcb. The reason is
that xlib has a linked list of registered extensions that it has to walk through
for various callbacks. Since xlib-xcb caused lots of "dead" extension, this got
quite slow when there were about 20k entries in this list.
The fix is to make sure that the cairo_device_t isn't finished/destroyed when
the last surface using it is destroyed. For this, we keep an internal reference
which is only dropped when the device is finished. This happens when someone
explicitly calls cairo_device_finish or when our XCloseDisplay hook runs.
The same thing is done by cairo-xlib. I didn't port this over to xlib-xcb
because at that time I didn't understand why it was needed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
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>
Not sure what the right results are, so refs will come later. The output
looks superficially right, but the *code* is known to be buggy...
(And hopefully this has captured a few of those bugs.)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>