summaryrefslogtreecommitdiff
path: root/src/cairo-directfb-surface.c
AgeCommit message (Collapse)AuthorFilesLines
2015-10-17Fix some surfaces missed in b1192beaAdrian Johnson1-1/+2
2013-05-14directfb: Correctly chain up map-to-image/unmap to the image backendChris Wilson1-2/+2
Fixes the infinite recursion reported by jojo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17xlib: Implement SHM fallbacks and fast upload pathsChris Wilson1-1/+5
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-26surface: Make map_to_image return cairo_image_surface_t*Andrea Canciani1-6/+7
This makes it easier to check that the funciton is returning the correct type of surfaces.
2012-03-22directfb: Tweak, tweak, tweak.Chris Wilson1-72/+16
A couple of mistakes, such as inverting the logic as to when to flush damage back from the shadow, meant that nothing happened when drawing to the directfb surface. Again still only compile tested. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09directfb: Discard long broken code and return to basicsChris Wilson1-1659/+283
Rewrite the directfb backend as nothing more than a simpler image compositor onto a shadowfb that is flushed back to the dfb surface as required. Future refinements would be to add damage tracking, and to mix the useful directfb operations (such as solid fills and alpha blends). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09Replace the ad-hoc surface unwrappers with a function pointerChris Wilson1-0/+1
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-31Remove useless checks for NULL before freeingAndrea Canciani1-4/+2
This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - }
2011-07-29directfb: Unbreak compilationAndrea Canciani1-5/+4
The recent changes to the clip code caused build failure in directfb.
2011-07-26API: map-to-image and create-similar-imageChris Wilson1-1/+6
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>
2011-07-19build: Fix compilationAndrea Canciani1-0/+1
83bfd85a1378e61b8bdc3f554f5e07900311f61f and 2458120dee350cd1b49f999f64b17a895a4b6607 did not update some backends properly, breaking their compilation.
2011-07-15Implement cairo_backend_tChris Wilson1-0/+3
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>
2010-06-10surface: remove content argument from is_similarAndrea Canciani1-1/+1
The content argument was basically unuses. Xlib change extracted from ickle's wip/compositor branch.
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-15Use pixman_image_composite32()Benjamin Otte1-8/+8
Replace all occurences of pixman_image_composite()
2010-01-22Add cairo_device_tChris Wilson1-0/+2
The device is a generic method for accessing the underlying interface with the native graphics subsystem, typically the X connection or perhaps the GL context. By exposing a cairo_device_t on a surface and its various methods we enable finer control over interoperability with external interactions of the device by applications. The use case in mind is, for example, a multi-threaded gstreamer which needs to serialise its own direct access to the device along with Cairo's across many threads. Secondly, the cairo_device_t is a unifying API for the mismash of backend specific methods for controlling creation of surfaces with explicit devices and a convenient hook for debugging and introspection. The principal components of the API are the memory management of: cairo_device_reference(), cairo_device_finish() and cairo_device_destroy(); along with a pair of routines for serialising interaction: cairo_device_acquire() and cairo_device_release() and a method to flush any outstanding accesses: cairo_device_flush(). The device for a particular surface may be retrieved using: cairo_surface_get_device(). The device returned is owned by the surface.
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-10-16[surface] Don't AND in the desired content.Chris Wilson1-2/+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.
2009-08-06[directfb] Conditionally use DSPF_BGR555Chris Wilson1-0/+4
Appears that this token is more recent than some of my headers, so check for its presence before use.
2009-07-23Remove clip handling from generic surface layer.Chris Wilson1-240/+251
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 ▏
2009-07-14[directfb] Silence compiler warnings.Chris Wilson1-0/+15
Add extended blend mode to operator switch.
2009-06-02[pattern] Pass flags to _cairo_pattern_acquire_surface()Chris Wilson1-0/+1
Allow the caller to choose whether or not various conversions take place. The first flag is used to disable the expansion of reflected patterns into a repeating surface.
2009-05-15[xlib] Use minimal depth for similar clones.Chris Wilson1-0/+2
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.
2009-03-28[region] Remove underscores from _cairo_region_*Søren Sandmann1-2/+2
2009-03-28[region] Consistently use rectangles in the API of regionsSøren Sandmann Pedersen1-13/+13
Usually, rectangles are more useful than boxes, so regions should only expose rectangles in their public API. Specifically, _cairo_region_num_boxes becomes _cairo_region_num_rectangles _cairo_region_get_box becomes _cairo_region_get_rectangle Remove the cairo_box_int_t type
2009-02-15Delete _cairo_region_get_boxes() in favor of _cairo_region_get_box()Søren Sandmann1-12/+9
The _cairo_region_get_boxes() interface was difficult to use and often caused unnecessary memory allocation. With _cairo_region_get_box() it is possible to access the boxes of a region without allocating a big temporary array.
2009-02-02[directfb] Don't access the scaled_font->glyphs cache directlyChris Wilson1-10/+10
Not only does it no longer exist, but doing so bypassed the locking mechanisms and sanity checks! Spotted by Lance Hepler.
2008-12-11Merge branch '1.8'Jeff Muizelaar1-0/+1
2008-12-06[cairo-spans] Add a check/create_span_renderer backend methods.M Joonas Pihlaja1-0/+2
A surface will have the chance to use span rendering at cairo_fill() time by creating a renderer for a specific combination of pattern/dst/op before the path is scan converted. The protocol is to first call check_span_renderer() to see if the surface wants to render with spans and then later call create_span_renderer() to create the renderer for real once the extents of the path are known. No backends have an implementation yet.
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-21[directfb] Compile fix with debug enabled.Chris Wilson1-0/+1
Fix a trivial compile failure reported here: Bug 18322 - bug in _cairo_directfb_surface_release_source_image function (http://bugs.freedesktop.org/show_bug.cgi?id=18322)
2008-11-21[region] Use the caller supplied array for extracting boxes.Chris Wilson1-2/+4
Allow the user to pass in a pre-allocated array and use it if the number of boxes permits. This eliminates the frequent allocations during clipping by toolkits.
2008-11-02Add an extents argument to the high level surface backend functionsAdrian Johnson1-1/+2
Add a "cairo_rectangle_int_t *extents" argument to to the following backend functions: paint mask, stroke fill show_glyphs show_text_glyphs This will be used to pass the extents of each operation computed by the analysis surface to the backend. This is required for implementing EXTEND_PAD.
2008-10-30[pattern] Avoid needless copying of patterns.Chris Wilson1-19/+14
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.
2008-10-22Ensure that the scaled font is frozen for the lifetime of the scaled glyph.Chris Wilson1-2/+2
After discussing the scaled font locking with Behdad, it transpired that it is not sufficient for a font to be locked for the lifetime of a scaled glyph, but that the scaled font's glyph cache must be frozen for the glyph' lifetime. If the cache is not frozen, then there is a possibility that the glyph may be evicted before the reference goes out of scope i.e. the glyph becomes invalid whilst we are trying to use it. Since the freezing of the cache is the stronger barrier, we remove the locking/unlocking of the mutex from the backends and instead move the mutex acquisition into the freeze/thaw routines. Then update the rule on acquiring glyphs to enforce that the cache is frozen and review the usage of freeze/thaw by all the backends to ensure that the cache is frozen for the lifetime of the glyph.
2008-10-20[directfb] Unbounded operators are unsupported.Chris Wilson1-0/+10
Currently the emulation of Porter-Duff operators does not correctly handle the unbounded operators.
2008-10-20[directfb] Fallback for SATURATEChris Wilson1-0/+3
We're unable to satisfactorily emulate SATURATE using the src/dst blend modes, so fallback. (Might just be a bug in libdirectfb...)
2008-10-20[directfb] Perfom text fallback if emulating clip regions.Chris Wilson1-2/+12
Fallback if we have a clip that is not a simple region.
2008-10-20[directfb] When blitting check if we need the un-premultiplied color.Chris Wilson1-24/+51
When blitting whether we need to use the premultiplied color is dependent upon the destination surface capabilities.
2008-10-20[directfb] Apply clip to release_dest_image()Chris Wilson1-9/+14
We need to respect the current clip when copying the fallback image back to the target surface.
2008-10-20[directfb] Fix OBO in clip.Chris Wilson1-2/+2
DirectFB seems to use inclusive upper bounds.
2008-10-20[directfb] Force NEAREST.Chris Wilson1-0/+5
The current version of DirectFB does not support any filters, so set NEAREST on the source patterns so that we can fully optimize the pattern inside core.
2008-10-20[directfb] Track the empty clip rectangle.Chris Wilson1-1/+5
A region with no extents means everything should be clipped out, so we need an extra flag to disambiguate when we have 0 clip rectangles.
2008-10-20[directfb] Cap the maximum surface size to use for the font cache.Chris Wilson1-3/+7
Fallback if we need to create a cache larger than the maximum usable surface.
2008-10-20[directfb] Only use the pure BLIT for integer translations.Chris Wilson1-7/+23
If we have non-integer translation on a source pattern then we need to use STRECTHBLIT (the core takes care to optimize NEAREST patterns to integer translations so that this will only be used when interpolation is required).
2008-10-20[directfb] Tweak _categorize_operation().Chris Wilson1-12/+25
Explicitly list the extend modes that are supported/unsupported and immediately check for an unsupported operation.
2008-10-20[directfb] Support ROI cloning.Chris Wilson1-7/+4
Only clone the ROI in order to efficiently handle large sources.
2008-10-20[directfb] Rename backend structure.Chris Wilson1-13/+24
Use _cairo_directfb_surface_backend for consistency with other backends.
2008-10-20[directfb] Whitespace.Chris Wilson1-745/+733
Trim lots of trailing whitespace and fix up according to CODING_STYLE.
2008-10-20[directfb] Simplify return from _directfb_get_operator().Chris Wilson1-70/+68
Used only as a predicate, so simply return a boolean.