Age | Commit message (Collapse) | Author | Files | Lines |
|
Dependency introduced in 749ef6be4d11b95d666b0e5fe06df926b828d655
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Whilst it cannot handle self-intersecting strokes (which includes the
antialias region of neighbouring lines and joints), it is about 3x
faster to use than the more robust algorithm. As some backends delegate
the rendering, the quality may still be preserved and so they should be
responsible for choosing the appropriate method for generation of the
stroke geometry.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the pen is reduced to a single point, it is effectively invisible
when rasterised, so skip the stroke composition.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This new pixman API allows glyphs to be cached and composited in one
go, which reduces overhead compared to individual calls to
pixman_image_composite_region32().
Notes:
- There is an explicit call to _cairo_image_scaled_glyph_fini(). This
could instead be done with a private, but I chose not to do that
since we don't need to store any actual data; we only need
notification when the glyph dies.
- The slowdown in poppler-reseau is real and stable across runs. I'm
not too concerned about it because this benchmark is only one run
and so it is dominated by glyph cache setup costs and FreeType
rasterizing.
Performance results, image backend:
Speedups
firefox-talos-gfx 5571.55 -> 4265.57: 1.31x speedup
gnome-terminal-vim 1875.82 -> 1715.14: 1.09x speedup
evolution 1128.24 -> 1047.68: 1.08x speedup
xfce4-terminal-a1 1364.38 -> 1277.48: 1.07x speedup
Slowdowns
poppler-reseau 374.42 -> 394.29: 1.05x slowdown
Performance results, image16 backend:
Speedups
firefox-talos-gfx 5387.25 -> 4065.39: 1.33x speedup
gnome-terminal-vim 2116.66 -> 1962.79: 1.08x speedup
evolution 987.50 -> 924.27: 1.07x speedup
xfce4-terminal-a1 1856.85 -> 1748.25: 1.06x speedup
gvim 1484.07 -> 1398.75: 1.06x speedup
Slowdowns
poppler-reseau 371.37 -> 393.99: 1.06x slowdown
Also bump pixman requirement to 0.27.1.
|
|
If the font metrics appear broken, i.e. key values are being reported as
zero, skip approximating the bbox of the glyph string.
References: https://bugs.freedesktop.org/show_bug.cgi?id=50688
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The check for standalone headers requires that the
cairo-image-surface-inline.h include the cairo-surface-private.h
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In many places Cairo maps/unmaps surfaces to perform operations on the
raw image, but it doesn't care about the format being invalid. All of
these are appropriate users of _cairo_surface_map_to_image().
|
|
Cairo backends often need to map/unmap to a raster surface but they
don't care about the pixel format, as Pixman will be doing the format
handling.
Cairo users cannot know how to access the raw data if the format is
invalid.
The two different scenarios call for different guarantees on the
returned surface.
The private map/unmap functions also makes it possible to simply
return the status upon unmapping.
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This was pushed accidentally - apologies.
This reverts commit 752c3b69e008b7d219da8cc5c657cf995732d3b8.
|
|
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Reported-by: Christos Sotiriou <csotiriou@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Improves record*-text-transform.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Try and undo all the damage that has acrued over the years by plugging
into the compositor pipeline.
References: https://bugs.freedesktop.org/show_bug.cgi?id=42739
References: https://bugs.freedesktop.org/show_bug.cgi?id=42821
References: https://bugs.freedesktop.org/show_bug.cgi?id=33081
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
to allow querying if a surface supports a particular mime type.
|
|
And reuse it.
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
Trimming the composite extents may result in the clip being
reconstructed, but we the polygon continued to hold a reference into the
freed clip's array of boxes. So if we intend to reuse the polygon limits
after performing the clip we need to refresh them.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This adds a new GPU accelerated backend for Cairo based on the Cogl 3D
graphics API.
This backend aims to support Cairo in a way that translates as naturally
as possible to using a GPU, it does not strive to compete with the
anti-aliasing quality of the image backend if it can't be done
efficiently using the GPU - raw performance isn't the only metric of
concern, so is power usage.
As an overview of how the backend works:
- fills are handled by tessellating paths into triangles
- the backend has an extra fill_rectangle drawing operation so we have
a fast-path for drawing rectangles which are so common.
- strokes are also tessellated into triangles.
- stroke and fill tessellations are cached to avoid the cpu overhead
of tessellation and cost of upload given that its common for apps to
re-draw the same path multiple times. The tessellations can survive
translations and rotations increasing the probability that they can be
re-used.
- sources and masks are handled using multi-texturing.
- clipping is handled with a scissor and the stencil buffer which
we're careful to only update when they really change.
- linear gradients are rendered to a 1d texture using a triangle
strip + interpolating color attributes. All cairo extend modes
are handled by corresponding texture sampler wrap modes without
needing programmable fragment processing.
- antialiasing should be handled using Cogl's multisampling API
XXX: This is a work in progress!!
TODO:
- handle at least basic radial gradients (No need to handle full
pdf semantics, since css, svg and canvas only allow radial gradients
defined as one circle + a point that must lie within the first
circle.) - currently we fall back to pixman for radial gradients.
- support glyph rendering with a decent glyph cache design. The
current plan is a per scaled-font growable cache texture + a
scratch cache for one-shot/short-lived glyphs.
- decide how to handle npot textures when lacking hardware support.
Current plan is to add a transparent border to npot textures and use
CLAMP_TO_EDGE for the default EXTEND_NONE semantics. For anything else
we can allocate a shadow npot texture and scale the original to fit
that so we can map extend modes to texture sampler modes.
|
|
|
|
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. :)
|
|
There are some inkscape bugs reporting very slow rendering of inkscape
generated PDFs (inkscape uses cairo for PDF output). These bugs are
caused by cairo specifying a page sized bounding box in XObjects and
Patterns. PDF renderers usually use the BBox as the image size when
compositing. As PDFs generated from SVG tends to use a lot of XObjects
and Patterns this can lead to very long rendering times.
These three patches tighten up all the BBoxes in PDF output.
|
|
cairo_surface_map_to_image() and cairo_surface_unmap_image() are
called by cairo-surface-observer but they are not slim_hidden:
Checking .libs/libcairo.so for local PLT entries
00000000002e27a8 0000019d00000007 R_X86_64_JUMP_SLOT
000000000005df30 cairo_surface_unmap_image + 0
00000000002e2b90 0000026100000007 R_X86_64_JUMP_SLOT
000000000005f5c0 cairo_surface_map_to_image + 0
|
|
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>
|
|
Step 1 of enhancing the speed of the stroker is to segregate from the
rest of the complex code.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Fixes push-group-offset which reduces to a replay of a recording surface
inside a recording surface and forgot to offset the clip imposed by the
extents of the first recording surface into device space.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As handling joins/caps between line segments shorter than
half_line_width is tricky.
Rather than also fixing the bug in traps, remove that code. The plan is
to avoiding hitting the traps code, short-circuiting several steps along
the fast rectangular paths.
Fixes line-width-overlap.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
They are internal and used as such, but we still need to prevent them
from escaping into the public domain.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Still hopelessly broken. Requires compiling cairo to use static linking
and then still requires manual linkage to workaround libtool. Lots of
functionality is still absent - we need to either find analogues to some
Cairo operations or implement fallbacks - but it is sufficient to
investigate how Skia functions in direct comparison with Cairo for
tessellation/rasterisation.
Caveat emptor.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Printing PDFs with large monochrome or grayscale images would result
in the images being blown up to 24-bit color images. Some printers are
very slow to print huge color images.
|
|
This fixes multiple failures when checking if headers can be used
standalone.
|
|
Silences some compiler warnings.
|
|
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>
|
|
cut'n'paste before coffee.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This allows us to actually clip out the geometry before we record it, as
suggested by allowing the user to supply an extents... But it will be
advantageous in later patches for reducing the amount of work we need to
perform to replay.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Explicitly convert the clearing of the unbounded area.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
Add a font backend function, load_type1_data, for loading Type 1 font
data. Replace the FT code for loading the font with a call
load_type1_data.
|
|
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.
|
|
In order for custom context to automatically track when a pattern is
modify after being set on the context (and before it is used in an
operator), we need for there to be a callback when the pattern is
modified.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Allow a backend to completely reimplement the Cairo API as it wants. The
goal is to pass operations to the native backends such as Quartz,
Direct2D, Qt, Skia, OpenVG with no overhead. And to permit complete
logging contexts, and whatever else the imagination holds. Perhaps to
experiment with double-paths?
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|