summaryrefslogtreecommitdiff
path: root/src/cairo-xlib-screen.c
AgeCommit message (Collapse)AuthorFilesLines
2011-09-12Introduce a new compositor architectureChris Wilson1-17/+3
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. :)
2011-08-14xlib: Mark surfaces as finished when the Display is finished/destroyed/closed.Chris Wilson1-0/+10
Fixes xlib-surface-source with the recording-surface Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-21xcb,xlib: Cleanup GC cache handlingAndrea Canciani1-8/+8
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.
2011-06-16xlib: Fix build of xlib-xcbAndrea Canciani1-0/+4
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>
2010-10-21raster backends: Set round_glpyh_positions to ONUli Schlachter1-0/+1
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>
2010-06-28xlib: Compile without fontconfigChris Wilson1-19/+1
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.
2010-06-17ft,fc,xlib: LCD filtering patch.Nicolaus L Helper1-0/+28
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.
2010-05-06xlib: Remove reference counting for cairo_xlib_screen_tChris Wilson1-37/+10
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.
2010-05-06xlib: Convert visual array to a cairo_list_tChris Wilson1-53/+23
It's simpler and more memory efficient.
2010-05-06xlib: Remove screen->has_renderChris Wilson1-13/+4
Use the info from the display instead.
2010-05-06xlib: Remove obsolete comment, there is no race anymoreChris Wilson1-4/+0
The display lock is now held for the duration of the screen creation, so there is no race. Remove the false comment.
2010-04-27Update FSF addressAndrea Canciani1-1/+1
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
2010-04-23xlib: Fix screen device handlingBenjamin Otte1-7/+16
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.
2010-04-18xlib: Make display a cairo_device_tBenjamin Otte1-130/+31
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.
2010-01-29xlib: Compile fix for no fontconfigChris Wilson1-1/+2
2010-01-22Move _cairo_error() to a standalone headerChris Wilson1-0/+1
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.
2009-11-05xlib: Fix double freeAndrea Canciani1-0/+1
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.
2009-10-18[xlib] Fix compiler warningsBenjamin Otte1-4/+4
2009-10-15[atomic] Fallback to libatomic-ops-devChris Wilson1-7/+9
Use libatomic-ops-dev in preference to mutex-based atomics, if we do not have the builtin atomic intrinsics available.
2009-09-11[xlib] Fix big-line.Chris Wilson1-2/+4
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)
2009-09-10[xlib] Fix extraction of GC during XCloseDisplay()Chris Wilson1-1/+1
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.
2009-09-02[xlib] Eliminate GC clippingChris Wilson1-32/+18
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.
2009-09-01[xlib] Make xlib_display_t private and rename xlib_screen_info_tChris Wilson1-86/+69
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.
2009-06-19[xlib] Improve GC caching efficacyChris Wilson1-48/+152
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.
2009-03-17Support compiling without fontconfigBehdad Esfahbod1-13/+10
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.
2008-11-29Mark allocation failures as unlikely.Chris Wilson1-1/+1
Use the gcc likelihood annotation to indicate that allocation failures are extremely unlikely.
2008-11-29Mark if(status) as being unlikely.Chris Wilson1-2/+2
The error paths should be hit very rarely during normal operation, so mark them as being unlikely so gcc may emit better code.
2008-10-30[xlib] Only clear the GC clip mask as necessary.Chris Wilson1-2/+6
Avoid redundant calls to XSetClipMask() for clean GCs.
2008-10-30[xlib] Propagate real status from get_screen_info().Chris Wilson1-29/+37
Return the real error from _cairo_xlib_screen_info_get() in order to avoid having to create a fake NO_MEMORY error.
2008-10-30[xlib] Defer querying of font options until first useChris Wilson1-3/+25
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.
2008-09-25Remove all lcd_filter code.Carl Worth1-28/+0
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.
2008-09-18Make the lcd_filter API privateCarl Worth1-1/+1
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.
2008-09-02[xlib] Keep a pointer to the cairo_xlib_display_t on the surface.Chris Wilson1-10/+4
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.]
2008-08-18Tone down commentBehdad Esfahbod1-1/+1
2008-08-17[xlib] Return the integer from XGetDefault().Chris Wilson1-2/+1
If the default value does not match a fontconfig constant, actually return the parsed token.
2008-08-06Fix Ubuntu-specific issue with FC_LCD_NONE et alBehdad Esfahbod1-0/+3
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.
2008-08-05[cairo-xlib] Support to retrieve the LCD filter type from the Xrm databaseSylvain Pasche1-0/+28
2008-08-05[cairo-ft] Fontconfig defines for LCD constants when using Fontconfig < 2.6Sylvain Pasche1-0/+9
This adds define for compatibility when without the new lcd filtering constants (Fontconfig patch not yet applied, see bug 13566).
2008-06-10[cairo-xlib-screen] Protect fontconfig call with CAIRO_HAS_FT_FONTBehdad Esfahbod1-0/+2
2008-04-11[xlib] Clear the gc_needs_clip_reset after use.Chris Wilson1-0/+1
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.
2008-04-11[xlib] Clear the Visual cache upon display closure.Chris Wilson1-7/+9
Clear the Visual cache, similarly to flushing the GC cache, upon XCloseDisplay.
2008-04-11[xlib] Convert the Visual cache to use the screen mutex.Chris Wilson1-12/+13
Use the per-screen mutex, introduced for the GC cache, to lock access to the Visual cache (instead of the per-display mutex).
2008-04-11[xlib] Add locking around GC cache.Chris Wilson1-10/+21
The per-screen cached of most-recently freed GCs lacks suitable locking for it to be threadsafe.
2008-04-02[cairo-xlib] Handle malloc failures for cairo_xlib_visual_info_t.Chris Wilson1-16/+36
Tidy the error paths whilst handling visuals, in particular avoiding a couple of potential NULL deferences, missed status checks and fresh leaks.
2008-03-20Add support for 8-bit PseudoColor visualsCarl Worth1-0/+49
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.
2008-01-17[cairo-xlib] Remove the NULL safeguards.Chris Wilson1-6/+0
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.
2008-01-15[cairo-xlib] Fixup --disable-xlib-xrenderChris Wilson1-0/+1
Fixup the headers and boilerplate to compile and run correctly when configured with --disable-xlib-xrender.
2007-09-25[cairo-atomic] Rewrite reference counting using atomic ops.Chris Wilson1-5/+7
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.
2007-08-31[xlib] Make it compile without Xrender available at compile time (#12210)Behdad Esfahbod1-2/+0
2007-05-16[cairo-xlib-screen] Increase number of GC depths.Chris Wilson1-6/+8
Add support for depths 12 and 30, and a separate unknown.