summaryrefslogtreecommitdiff
path: root/src/cairo-surface-fallback-private.h
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a new compositor architectureChris Wilson2011-09-121-78/+34
| | | | | | | | | | | | | | | | | | 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. :)
* clip: Rudimentary support for clip-polygon extractionChris Wilson2011-07-191-7/+7
| | | | | | | 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>
* Update FSF addressAndrea Canciani2010-04-271-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
* Constify stroke style and matrices.Chris Wilson2010-01-221-3/+3
| | | | | | As a simple step to ensure that we do not inadvertently modify (or at least generate compiler warns if we try) user data, mark the incoming style and matrices as constant.
* [surface] Don't AND in the desired content.Chris Wilson2009-10-161-1/+0
| | | | | | | | | | Gah, that was a horrible mistake. It was a flawed hack to create Pixmaps of the correct depth when cloning patterns for blitting to the xlib backend. However, it had the nasty side-effect of discarding alpha when targeting Window surfaces. The correct solution is to simply correct the Pixmap of the desired depth and render a matching pattern onto the surface - i.e. a reversal the current acquire -> clone. See the forthcoming revised xcb backend on how I should have done it originally.
* Remove clip handling from generic surface layer.Chris Wilson2009-07-231-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling clip as part of the surface state, as opposed to being part of the operation state, is cumbersome and a hindrance to providing true proxy surface support. For example, the clip must be copied from the surface onto the fallback image, but this was forgotten causing undue hassle in each backend. Another example is the contortion the meta surface endures to ensure the clip is correctly recorded. By contrast passing the clip along with the operation is quite simple and enables us to write generic handlers for providing surface wrappers. (And in the future, we should be able to write more esoteric wrappers, e.g. automatic 2x FSAA, trivially.) In brief, instead of the surface automatically applying the clip before calling the backend, the backend can call into a generic helper to apply clipping. For raster surfaces, clip regions are handled automatically as part of the composite interface. For vector surfaces, a clip helper is introduced to replay and callback into an intersect_clip_path() function as necessary. Whilst this is not primarily a performance related change (the change should just move the computation of the clip from the moment it is applied by the user to the moment it is required by the backend), it is important to track any potential regression: ppc: Speedups ======== image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup ▌ image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup ▎ image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup ▏ image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup ▏ Slowdowns ========= image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown ▏
* [xlib] Use minimal depth for similar clones.Chris Wilson2009-05-151-0/+1
| | | | | | | | | | | | | | | | | | | | | Damian Frank noted [http://lists.cairographics.org/archives/cairo/2009-May/017095.html] a performance problem with an older XServer with an unaccelerated composite - similar problems will be seen with non-XRender servers which will trigger extraneous fallbacks. The problem he found was that painting an ARGB32 image onto an RGB24 destination window (using SOURCE) was going via the RENDER protocol and not core. He was able to demonstrate that this could be worked around by declaring the pixel data as an RGB24 image. The issue is that the image is uploaded into a temporary pixmap of matching depth (i.e. 32 bit for ARGB32 and 24 bit for RGB23 data), however the core protocol can only blit between Drawables of matching depth - so without the work-around the Drawables are mismatched and we either need to use RENDER or fallback. This patch adds a content mask to _cairo_surface_clone_similar() to provide the extra bit of information to the backends for when it is possible for them to drop channels from the clone. This is used by the xlib backend to only create a 24 bit source when blitting to a Window.
* [pattern] Avoid needless copying of patterns.Chris Wilson2008-10-301-22/+23
| | | | | | | Only copy the pattern if we need to modify it, e.g. preserve a copy in a snapshot or a soft-mask, or to modify the matrix. Otherwise we can continue to use the original pattern and mark it as const in order to generate compiler warnings if we do attempt to write to it.
* clone_similar(): s/device_offset/clone_offset/Chris Wilson2008-09-271-2/+2
| | | | | | A little bit of sleep and reflection suggested that the use of device_offset_[xy] was confusing and clone_offset_[xy] more consistent with the function naming.
* Allow cloning sub-regions of similar surfaces.Chris Wilson2008-09-271-0/+2
| | | | | | | | | | | | | | | | | | | Previously the rule for clone_similar() was that the returned surface had exactly the same size as the original, but only the contents within the region of interest needed to be copied. This caused failures for very large images in the xlib-backend (see test/large-source). The obvious solution to allow cloning only the region of interest seemed to be to simply set the device offset on the cloned surface. However, this fails as a) nothing respects the device offset on the surface at that layer in the compositing stack and b) possibly returning references to the original source surface provides further confusion by mixing in another source of device offset. The second method was to add extra out parameters so that the device offset could be returned separately and, for example, mixed into the pattern matrix. Not as elegant, a couple of extra warts to the interface, but it works - one less XFAIL...
* Revert "[cairo-gstate] Avoid copying untransformed glyphs."Chris Wilson2007-08-311-1/+1
| | | | | | | | This reverts commit 919bea6dbb32746f11781cd3a94eb44f5c4a32e6. Sadly as Behdad points out some backends do modify the glyph array and, for example cairo-xlib-surface, hide this from the compiler with some evil casts.
* [cairo-gstate] Avoid copying untransformed glyphs.Chris Wilson2007-08-311-1/+1
| | | | | | | | Skip the memory duplication of the incoming glyphs if we do not need to transform them into the backend coordinate system. As a consequence we need to constify the glyphs passed to the backend functions.
* Implement fallback for clone_similarVladimir Vukicevic2007-08-281-0/+10
|
* [fixpt] Replace cairo_rectangle_int16_t with cairo_rectangle_int_tVladimir Vukicevic2007-07-181-1/+1
| | | | | Mostly s/cairo_rectangle_int16_t/cairo_rectangle_int_t/, as well as definitions to pick cairo_rectangle_int_t.
* Add/remove const to cairo_glyph_t* arguments consistentlyBehdad Esfahbod2006-12-111-1/+1
| | | | | | | | | | | | | | The rule is: cairo_glyph_t* is always passed as const for measurement purposes. This was not reflected in our public api previously. Fixed Showing glyphs used to have cairo_glyph_t* always as const. With this changed, it is only const on cairo_t and cairo_gstate_t operations. cairo_surface_t, cairo_scaled_font_t, and individual backends receive cairo_glyph_t* as non-const. The desired semantics is that they may modify the contents of the array as long as they do not return CAIRO_STATUS_UNSUPPORTED. This makes it possible to avoid copying the glyph array again and again, and edit it in-place. Backends are in fact free to use the array as a generic buffer as they see fit.
* Fix bogus cairo_rectangle_fixed_t to be cairo_rectangle_int16_t.Carl Worth2006-06-061-1/+1
| | | | | | This rectangle has regular integer values, not fixed-point values. So the old name was horribly wrong and misleading, (and yes I think it was even I that had suggested it).
* Rename cairo_rectangle_t to cairo_rectangle_fixed_t.Robert O'Callahan2006-05-041-3/+3
| | | | | | This is in preparation for a later function addition for extracting clip rectangles from a cairo_t, (which will add a public cairo_rectangle_t).
* Begin moving fallback code out of cairo-surface.c and into ↵Carl Worth2005-12-191-0/+119
cairo-surface-fallback.c.