Age | Commit message (Collapse) | Author | Files | Lines |
|
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. :)
|
|
Fixes xlib-surface-source with the recording-surface
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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.
|
|
45665c0d48396af7bd653d546115a5f36cfa9ae1 breaks the build of
cairo-xlib-xcb because it does not disable the compilation of
cairo-xlib implementation files when cairo-xlib-xcb is enable. This
results in collisions when linking.
Reported-by: James Cloos <cloos@jhcloos.com>
|
|
This fixes "text-rotate" in the test suite for the image backend and
"overlapping-glyphs" for the xcb backend.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Create a cairo-fontconfig-private.h where we can add the missing defines
in a common location rather than in the body of the code.
|
|
This adds internal API to retrieve the LCD filtering parameters from
fontconfig, or as set on the Screen, and feed them to FreeType when
rendering the glyph.
References:
Bug 10301 - LCD filtering patch
https://bugs.freedesktop.org/show_bug.cgi?id=10301
Tested-by: Brandon Wright <bearoso@gmail.com>
Forward-ported-by: Robert Hooker <sarvatt@gmail.cm>
ickle: The API is clearly not ready for public consumption, the enum are
poorly named, however this stands by itself as enabling system wide
properties.
|
|
The screen is owned by the cairo_xlib_display_t device, so we can
simplify and close the refleak by removing the surplus reference
counting.
|
|
It's simpler and more memory efficient.
|
|
Use the info from the display instead.
|
|
The display lock is now held for the duration of the screen creation, so
there is no race. Remove the false comment.
|
|
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
|
|
Add a _cairo_xlib_device_create() function that could easily be exported
as a replacement for _cairo_xlib_display_get(). This function returns a
cairo_device_t instead of a cairo_xlib_display_t because the display
isn't acquired.
|
|
The code now uses the locking of the cairo_device_t instead of its own
mutexes.
The code was modified so that cairo_surface_t does no longer reference
the display directly. Instead, it calls _cairo_xlib_display_acquire().
If a function assumes an already acquired display, it now requires the
caller to provide a cairo_xlib_display_t parameter. Functions that do
not require an acquired display will not require the display parameter
or they will take the cairo_device_t instead.
|
|
|
|
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
|
|
Both _cairo_xlib_call_close_display_hooks and _cairo_xlib_screen_destroy
invoke _cairo_xlib_screen_close_display, which frees all the cached
GCs, but (if HAS_ATOMIC_OPS is undefined) doesn't mark them as freed,
thus freeing them agin upon the second invocation.
|
|
|
|
Use libatomic-ops-dev in preference to mutex-based atomics, if we do not
have the builtin atomic intrinsics available.
|
|
Project lines that exceed the 16.16 limits onto the XFixedLine, as we know
that top/bottom must fit within the confines of the surface and so will be
less than 16 bits.
Sadly this is a run-on patch that also does:
1. Make FillTiled the default for new GCs.
2. Stores extend mode as opposed to repeat, and thereby cleaning up some
inconsistent code.
3. Remove the special casing for unbounded trapezoids, as it is redundant
with the polygon clipping.
4. Tidy the logic for deciding when to use the core protocol
(_categorize_composite_operation)
|
|
Jeff Muizelaar reported a bug from his firefox builds that was causing a
double free during XCloseDisplay, and suggested it was related to
c0e01d9cd. Reviewing the cleanup, suggested that the cause may just be a
pair of missing parenthesis.
|
|
Eradicate the use of clipping with GC. By never using clipping, we never
have to worry about retrieving a dirty clip from the GC cache.
|
|
The issue Joonas was trying to solve was the unwanted inclusion of
the inlines via cairo-freelist-private.h. Unwittingly he included
cairoint.h from cairo-xlib-private.h instead, a far more heinous crime as
that causes the boilerplate to try to use the hidden, private symbols.
Instead we resolve this issue by making the cairo_xlib_display_t structure
private to cairo-xlib-display.c and provide functions to manipulate the
abstract data type. Whilst in the vicinity, we rename
cairo_xlib_screen_info_t to cairo_xlib_screen_t for consistency and
cleanliness.
|
|
Shrink the overall size of the per-screen GC cache, but allow multiple GCs
per depth, as it quite common to need up to two temporary GCs along some
drawing paths. Decrease the number of GCs we obtain in total by returning
clean (i.e. a GC without a clip set) back to the screen pool after use.
Compensate for the increased number of put/get by performing the query
using atomic operations where available. So overall we see a dramatic
reduction on the numbers of XCreateGC and XFreeGC, of even greater benefit
for RENDER-less servers.
|
|
Adds a new, fake, fontconfig font backend. Fontconfig can be disabled
using --disable-fc, in which case the toy text API wont find fonts and
the internal font will always be used.
Also defines the feature macro CAIRO_HAS_FC_FONT. The two fontconfig-specific
functions in cairo-ft.h depend on that macro now.
|
|
Use the gcc likelihood annotation to indicate that allocation failures are
extremely unlikely.
|
|
The error paths should be hit very rarely during normal operation, so mark
them as being unlikely so gcc may emit better code.
|
|
Avoid redundant calls to XSetClipMask() for clean GCs.
|
|
Return the real error from _cairo_xlib_screen_info_get() in order to avoid
having to create a fake NO_MEMORY error.
|
|
Constructing the font options cause the initialisation of Xlc and invoke
several round-trips to the X server, significantly delaying the creation
of the first surface. By deferring that operation until the first use of
fonts then we avoid that overhead for very simple applications (like the
test suite) and should improve start-up latency for larger application.
|
|
We reverted the public API for setting lcd_filter font options
back in 1b42bc8033bc , but we had left the implementation which
would examine fontconfig and Xft properties for the option, and
which would call into freetype for subpixel glyph rasterization.
However, I recently realized, (and the test suite had been trying
to tell me for a while), that this approach would cause a
regression for users who were previously using sub-pixel text,
but without sub-pixel rendering built directly into freetype.
That's not acceptable, so all the code is coming out for now.
|
|
During the cairo summit it was decided that this API is to freetype-
specific to be in the general cairo interface for now. This will
likely come back again soon as a cairo_ft-specific interface.
|
|
Cleanup the code somewhat by passing cairo_xlib_display_t around
internally as opposed to a Display and then having to lookup the
corresponding cairo_xlib_display_t each time.
[To get a cairo_xlib_display_t from a Display is a list traversal under
mutex (though the element we're looking for is most likely at the start),
but to get the Display is just a lockless pointer dereference.]
|
|
|
|
If the default value does not match a fontconfig constant, actually return
the parsed token.
|
|
No idea if Ubuntu will ever learn not to modify public API of
common libraries without any clue of what kind of problems they
create by doing that. They could very well define
FC_UBUNTU_LCD_FILTER if they wanted to, but no, they defined
FC_LCD_FILTER as if it's an upstream thing. It wasn't.
|
|
|
|
This adds define for compatibility when without the new lcd filtering
constants (Fontconfig patch not yet applied, see bug 13566).
|
|
|
|
If you think this commit is reminiscent of
40558cb15e5f7276a29847b00c9dae08b9d9380e, you would be right as it fixes
exactly the same bug I made then and reintroduced in dc714106e156cb7901.
So quoting 40558cb:
After consuming the GC we need to unset the clip reset flag, so that
if we try and get a new GC without first putting a fresh one we do not
try to call XSetClipMask on a NULL GC.
|
|
Clear the Visual cache, similarly to flushing the GC cache, upon
XCloseDisplay.
|
|
Use the per-screen mutex, introduced for the GC cache, to lock access to
the Visual cache (instead of the per-display mutex).
|
|
The per-screen cached of most-recently freed GCs lacks suitable locking
for it to be threadsafe.
|
|
Tidy the error paths whilst handling visuals, in particular avoiding a
couple of potential NULL deferences, missed status checks and fresh
leaks.
|
|
This support involves allocating a 16-bit grayscale ramp as well
as a 5x5x5 RGB color cube. Afterwards, the 256 colors are queried
and an array is generated mapping from r3g3b3 colors to the closest
available color. Both the queried colors and the reverse mapping
are stored in a new visual-specific cairo_xlib_visual_info_t
structure which hangs off of the cairo_xlib_screen_info_t.
Both the color-cube allocation and the distance metric could be
improved by someone sufficiently motivated, (for example, allocating
and matching in a perceptually linear color space rather than just
in RGB space). Also, making this work well in the face of a changing
color map, or in the case of GrayScale, StaticGray, or DirectColor
visuals are left entirely as exercises for the reader. StaticColor
support should be fine as is, but is entirely untested.
|
|
No need to guarding against the pointer being NULL on internal functions
as no path can call the function will a NULL pointer and no path should
ever try, which in any case it would be better to crash immediately.
|
|
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
|
|
Introduce an opaque cairo_reference_count_t and define operations on it
in terms of atomic ops. Update all users of reference counters to use
the new opaque type.
|
|
|
|
Add support for depths 12 and 30, and a separate unknown.
|