summaryrefslogtreecommitdiff
path: root/src/cairo-os2-surface.c
AgeCommit message (Collapse)AuthorFilesLines
2012-03-10doc: fix a few typos found by codespellNis Martensen1-1/+1
Signed-off-by: Uli Schlachter <psychon@znc.in>
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-09-18os2-surface needs to include cairo-image-surface-private.hDave Yeo1-0/+1
src/cairo-os2-surface.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-18os2: Blindly update os2 to the new fallback compositorChris Wilson1-132/+63
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-26API: map-to-image and create-similar-imageChris Wilson1-1/+5
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-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-08-08os2: Restore surface type checking in the get_extents method.Rich Walsh1-1/+9
2010-08-08os2: Fix clipping to bounds when blitting pixels.Rich Walsh1-35/+27
The bounds checks on the rectangle to blit were done after converting target/source to inclusive/noninclusive coordinates rather than before, potentially causing an off-by-one in the sizes, since the same logic was applied to both inclusive and non-inclusive coordinates. This patch enforces bounds up front. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: Tweak an inline declaration.Rich Walsh1-1/+1
C99 and cairo prefers "static inline <return type>" rather than "static <return type> inline". Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: Consolidate error paths of cairo_os2_surface_create().Rich Walsh1-60/+60
Use a single code path to release the resources acquired for a surface that's been partially constructed, rather than have multiple error exits which each release the resources acquired so far. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: Document ownership of OS/2 objects passed to surfaces.Rich Walsh1-11/+12
Clarify the documentation for cairo_os2_surface_create() and cairo_os2_surface_set_hwnd() to note that the ownership of the presentation space and window respectively remains with the caller. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: Don't fake an Anchor Block when one isn't needed.Rich Walsh1-13/+3
The code was being tricky about passing in a HAB to DevOpenDC() even though one isn't needed at all under OS/2. Pass in NULL instead. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: Fix buffer allocator behaviour on arithmetic overflow.Rich Walsh1-31/+23
On arithmetic overflow the buffer allocator would attempt to allocate zero bytes instead of failing the allocation. Depending on the implementation of the underlying allocator being proxied, this may result in an allocation of a zero length buffer, causing all kinds of grief. This patch causes arithmetic overflows to explicitly fail the allocation. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: Fix blitting 24 bpp pixel data.Rich Walsh1-49/+67
There's a format mismatch between cairo's pixel formats and OS/2 24 bpp data: the individual pixels in OS/2 take only three bytes per pixel, but there needs to be padding between lines to make the start of a line always be aligned at a DWORD boundary. This patch fixes the format conversion code to include the required padding between rows. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html
2010-08-08os2: New API to create surfaces without a persistent HPS.Rich Walsh1-3/+139
It's not always necessary to create a presentation space (HPS) for surface tied to a window, as the user may have one already. This patch introduces three new functions to create a surface without an HPS and let the user manage an HPS associated with the surface. Thread "OS/2 surface fixes" on cairo-l: http://lists.cairographics.org/archives/cairo/2010-July/020343.html Mozilla Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=557159
2010-05-03os2: Fix get_extents() segfaulting.Dave Yeo1-1/+1
bed2701e1c89095878d549cbca8f22d84f3dda3c removed one line too much.
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-01-22Add cairo_device_tChris Wilson1-0/+1
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-07-23Remove clip handling from generic surface layer.Chris Wilson1-12/+2
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-03-17Support compiling without fontconfigBehdad Esfahbod1-2/+4
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.
2009-01-29[surface] add CAIRO_STATUS_INVALID_SIZEPaolo Bonzini1-4/+5
Adds an error code replacing CAIRO_STATUS_NO_MEMORY in one case where it is not really appropriate. CAIRO_STATUS_INVALID_SIZE is used by several backends that do not support image sizes beyond 2^15 pixels on each side. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-01-02[os2] Fix memory leak of surface on error pathChris Wilson1-0/+1
Of we fail to create the mutex, free the surface before returning the failure. Reported: http://bugs.freedesktop.org/show_bug.cgi?id=19208.
2008-12-20[toy-font-face] Move toy font face code in a file of its ownBehdad Esfahbod1-8/+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-13[os2] Fix includesBehdad Esfahbod1-5/+0
Patch from Dave Yeo to make cairo-os2.h include os2.h directly so the header is standalone.
2008-10-14[doc] Fix a few gtk-doc errors.Chris Wilson1-0/+2
gtk-doc insists on a non-empty long description, even for trivial functions that are fully described by their input arguments and return value. Grrr.
2008-09-20Make checks happy againBehdad Esfahbod1-2/+2
Minor syntax changes and improved check regexps.
2008-09-20Add cairo-system.c for platform system-specific codeBehdad Esfahbod1-0/+6
This is where DLL initialization/finalization should be done for example. Moved the one for win32. For OS/2 just left a comment as the code needs more work. This change simplifies building shared and static libraries in the win32 makefiles.
2008-07-25[OS/2] Fix buildPeter Weilbacher1-1/+1
2008-06-01Fix now-detected doc formatting issuesBehdad Esfahbod1-2/+2
2008-05-28[configure.in] Dont let a missing FcFini disable the freetype font backend!Behdad Esfahbod1-0/+2
2008-02-08[os2] fix typo in commentPeter Weilbacher1-1/+1
2008-02-08[os2] only call FcInit/Fini when compiled with FT font backendPeter Weilbacher1-1/+5
2008-02-07[os2] Improve documentationPeter Weilbacher1-0/+139
Move the API documentation for the OS/2 backend from the .h file to the .c file and use the correct format.
2008-01-16[cairo-surface] Introduce _cairo_surface_create_in_error().Chris Wilson1-13/+9
Unexport all the static error surfaces and use a function to select the appropriate error surface for the status.
2007-12-06[os2] add memory allocation wrappers for pixel buffersPeter Weilbacher1-27/+81
Add ability to use OS/2 APIs instead of C library functions to manage pixel buffer allocations. This is to work around heap fragmentation. This implements two wrapper functions which replace _cairo_alloc_abc and free and when compiled with OS2_USE_PLATFORM_ALLOC the OS/2 functions DosAllocMem and DosFreeMem will be used for allocation/deallocation. Also try to minimize the heap when shutting down the cairo library.
2007-10-04[cairo-error] Clean up all the warnings and missing _cairo_error() calls.Chris Wilson1-12/+12
Every time we assign or return a hard-coded error status wrap that value with a call to _cairo_error(). So the idiom becomes: status = _cairo_error (CAIRO_STATUS_NO_MEMORY); or return _cairo_error (CAIRO_STATUS_INVALID_DASH); This ensures that a breakpoint placed on _cairo_error() will trigger immediately cairo detects the error.
2007-07-18[fixpt] Replace cairo_rectangle_int16_t with cairo_rectangle_int_tVladimir Vukicevic1-5/+5
Mostly s/cairo_rectangle_int16_t/cairo_rectangle_int_t/, as well as definitions to pick cairo_rectangle_int_t.
2007-06-29[fix] Avoid int overflow when allocating large buffersVladimir Vukicevic1-4/+5
This patch introduces three macros: _cairo_malloc_ab, _cairo_malloc_abc, _cairo_malloc_ab_plus_c and replaces various calls to malloc(a*b), malloc(a*b*c), and malloc(a*b+c) with them. The macros return NULL if int overflow would occur during the allocation. See CODING_STYLE for more information.
2007-04-19Introduce CAIRO_MUTEX_FINALIZE as counter-part for CAIRO_MUTEX_INITIALIZEMathias Hasselmann1-3/+3
2007-04-17[OS2] Fix #include "cairo-mutex-list-private.h"Dave Yeo1-1/+1
2007-04-03[src] Make sure all source files #include "cairoint.h" as their first includeBehdad Esfahbod1-5/+6
This is necessary to avoid many portability problems as cairoint.h includes config.h. Without a test, we will regress again, hence add it. The inclusion idiom for cairo now is: #include "cairoint.h" #include "cairo-something.h" #include "cairo-anotherthing-private.h" #include <some-library.h> #include <other-library/other-file.h> Moreover, some standard headers files are included from cairoint.h and need not be included again.
2007-03-20Initialize mutexes at central location.Mathias Hasselmann1-42/+3
All mutex declarations have been moved to cairo-mutex-list.h. This should avoid breaking of less frequently tested backends, when mutexes are introduced or when existing mutexes are renamed. Instead of initializing mutexes on library startup, mutexes are lazily initialized within the few entry points of now by calling CAIRO_MUTEX_INITIALIZE(). Currently only the OS/2 backend takes care about releasing global mutexes. Therefore there is no counter part of that macro for finalizing all global mutexes yet - but as cairo-backend-os2.c shows such a function would be quite easy to implement.
2007-03-05Rename all mutex variables to start with an underscoreBehdad Esfahbod1-15/+15
since they are not static in some of the implementations (win32, ...)
2007-03-05[OS2] Add mutex initializer for cairo_font_face_mutexBehdad Esfahbod1-0/+6
2007-03-05[OS2] Remove unused mutex cairo_toy_font_face_hash_table_mutexBehdad Esfahbod1-6/+0
2007-01-04Fix for OS/2 display drivers that cannot handle 32bit output (feed them a ↵Peter Weilbacher1-10/+60
24bit buffer instead).
2006-09-15OS/2 backend filesPeter Weilbacher1-0/+1135