Computing the exact bbox of the glyphs and whether they are overlapped
is expensive. However, we can often check whether they are visible just
by looking at the maximal extents of the fonts along with the bbox of
the positions; much cheaper.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Introduced recently in a30a7402f7,
==32234== Conditional jump or move depends on uninitialised value(s)
==32234== at 0x6BCA326: _cairo_surface_wrapper_needs_device_transform (cairo-surface-wrapper.c:549)
==32234== by 0x6BCB47D: _cairo_surface_wrapper_set_inverse_transform (cairo-surface-wrapper.c:579)
==32234== by 0x6BCB55A: _cairo_surface_wrapper_init (cairo-surface-wrapper.c:621)
==32234== by 0x6BB87A6: _cairo_recording_surface_replay_internal (cairo-recording-surface.c:854)
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>
In order to avoid the copy and transformation of the single rectangle,
we can simply pass it to pixman and create the region from it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
In the simple condition where the user is applying an opacity mask to a
misaligned rectangle, we can treat it as a series of simpler composites
by combining the opacity with the coverage of the box.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
백현기 reported a use-case where he was recording an entire web-page
onto the recording surface, in order to facilitate panning. In this
scenario, where there may be lots of similar surfaces within the
recording we generate thousands of unused snapshot-images bloating
memory usage and impairing performance.
Under the right conditions we can replay directly onto the destination
which not only bypasses the snapshots but also skips the following
resampling.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>