summaryrefslogtreecommitdiff
path: root/src/cairo-win32-printing-surface.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-15win32: Move to separate directoyChris Wilson1-1915/+0
I suspect I may split the win32 code into a few more files, so move it to its own directory to reduce the clutter. 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>
2012-01-19api: add cairo_surface_supports_mime_typeAdrian Johnson1-0/+16
to allow querying if a surface supports a particular mime type.
2011-09-26win32: Compile, but brokenChris Wilson1-10/+3
First step: just make it compile again but crash upon usage.
2011-09-12Introduce a new compositor architectureChris Wilson1-12/+7
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-09-02win32: Fix compilationAndrea Canciani1-0/+1
cairo-image-surface-private.h is needed in order to access cairo_image_surface_t fields. Fixes multiple build errors: error C2037: left of '...' specifies undefined struct/union '_cairo_image_surface'
2011-07-31Remove useless checks for NULL before freeingAndrea Canciani1-2/+1
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-27win32: ConstifyAndrea Canciani1-3/+3
Silences some compiler warnings.
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-19clip: Rudimentary support for clip-polygon extractionChris Wilson1-6/+6
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>
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>
2011-01-16doc: Fix some broken references and gtk-doc warningsMaarten Bosmans1-1/+1
The gtk-doc comments contain some typos and are missing some escaping.
2011-01-02pattern: Use double precision for gradient extreme objectsAndrea Canciani1-4/+4
Using double precision for gradient extreme objects ensures that they are preserved as specified when constructing the gradient pattern. Fixes huge-linear, huge-radial. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
2011-01-01mesh: Add mesh pattern type and enum valuesAdrian Johnson1-0/+3
Add the mesh pattern type and an error status to be used to report an incorrect construction of the pattern. Update the backends to make them ready to handle the new pattern type, even if it cannot be created yet.
2010-12-10path: Always interpret in forward directionAndrea Canciani1-1/+0
Path are always interpreted in forward direction, so the ability of interpreting in the opposite direction (which is very unlikely to be useful at all) can be removed.
2010-11-16win32-print: print as unicode where possibleAdrian Johnson1-61/+96
One of the problems identified in https://bugzilla.mozilla.org/show_bug.cgi?id=454532 is that there are some older printer drivers that do not work with ExtTextOut and the ETO_GLYPH_INDEX option. Fix this by where possible mapping glyph indices back to unicode and calling ExtTextOut without ETO_GLYPH_INDEX. Glyphs that can not be mapped back to unicode are printed with ETO_GLYPH_INDEX.
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-07-10Convert mime data length to use unsigned longChris Wilson1-5/+5
What we want to use is size_t, but we don't want the implied POSIX dependency. However, POSIX does say that size_t is an unsigned integer that is no longer than a long, so it would appear safe to use an unsigned long as a replacement. Safer at least than unsigned int.
2010-06-14win32: Fixed compile errors in Windows backend.Zoxc1-5/+4
2010-05-12win32-printing: compile fix.Chris Wilson1-1/+1
Missing arg for _cairo_recording_surface_replay_region().
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-25win32: Trivially fix the compile error with printing.Chris Wilson1-1/+1
_cairo_pattern_is_opaque() now takes the extents over which the operation is defined so that we make exclude the clear pixels that surround EXTEND_NONE surfaces when determining opacity. In order to take full advantage of this we need to start performing an extents query on the operation and pass that down to the analysis... This patch however is just the quick compile fix to pass a NULL and restore the old behaviour. Fixes (with previous commit): Bug 26197 - Cairo doesn't build on windows http://bugs.freedesktop.org/show_bug.cgi?id=26197
2010-01-22pattern: Add convenience patterns for stock coloursChris Wilson1-6/+2
By preallocating in our data segment a couple of solid patterns for the stock colours, it becomes more convenient when using those in surface operations, such as when clearing.
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-22Constify stroke style and matrices.Chris Wilson1-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.
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-22[meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja1-30/+30
The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
2009-09-22win32-printing: correct the use of the CAIRO_HAS_WIN32_FONT #ifdefAdrian Johnson1-1/+1
it was wrapping code required for non windows fonts.
2009-09-22win32-printing: fix meta surface pattern regression caused by bed2701eAdrian Johnson1-0/+2
2009-09-22win32-printing: Allow GDI CTM with scale < 1 to be setAdrian Johnson1-19/+71
To better support creating EMF files with the win32-printing surface, allow a GDI CTM with scale < 1 to be used. http://lists.cairographics.org/archives/cairo/2009-September/018110.html
2009-09-22Make win32 fonts work in EMF files created by win32-printingAdrian Johnson1-0/+37
2009-09-03[win32] Remove unused clone_similar()Chris Wilson1-1/+1
The win32 backend handles surface sources directly and never calls _cairo_pattern_acquire_surface() which is the only other possible user of clone_similar().
2009-08-29[win32] Compiler warningsChris Wilson1-12/+12
Innocuous warnings about the use of mismatching explicit casts (I'm really not convinced by the merits of this particular compiler warning, but it does cleanse the code slightly.)
2009-07-23Remove clip handling from generic surface layer.Chris Wilson1-105/+89
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-03Export meta-surfaceChris Wilson1-1/+1
The meta-surface is a vital tool to record a trace of drawing commands in-memory. As such it is used throughout cairo. The value of such a surface is immediately obvious and should be applicable for many applications. The first such case is by cairo-test-trace which wants to record the entire graph of drawing commands that affect a surface in the event of a failure.
2009-05-22[win32] Wrap win32-font usage with CAIRO_HAS_WIN32_FONTChris Wilson1-0/+4
Bug 19251: --enable-win32=yes and --enable-win32-font=no causes compilation failure [https://bugs.freedesktop.org/show_bug.cgi?id=19251] Wrap use of the win32 font backend within win32-printing-surface within CAIRO_HAS_WIN32_FONT ifdefs to prevent compilation failure if the user explicitly disables the win32 font backend.
2009-05-22[win32] TypoChris Wilson1-1/+1
Correct function name in error string.
2008-12-12[path] Mark points as const during _cairo_path_fixed_interpret()Chris Wilson1-5/+7
Use const to document the read-only nature of the arguments passed to the callbacks.
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-24Win32-print: Add PNG embedding supportAdrian Johnson1-27/+79
2008-11-23Move cairo-jpeg-info.c to cairo-image-info.cAdrian Johnson1-3/+3
Other image formats will be added to the same file.
2008-11-06win32-printing: Implement JPEG supportAdrian Johnson1-9/+82
2008-11-04[win32] Compile fix for extend-pad extents.Chris Wilson1-1/+2
Update the show_glyphs() prototype to include the extents argument.
2008-11-02Add an extents argument to the high level surface backend functionsAdrian Johnson1-4/+8
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-25/+26
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-08[win32] Restore fine-grained fallback support for printing.Chris Wilson1-0/+8
Missed updating win32 when implementing the new paginated API to query support for the fine-grained fallbacks. (Thanks to Adrian for spotting this oversight.)
2008-09-29[pattern] Remove the hack to support cloning surface patterns.Owen W. Taylor1-22/+19
Remove instances (abuses) of calling _cairo_pattern_acquire_surface() on a known-surface-pattern with a hack to say "give me the entire surface". If you know you just want the entire surface as an image surface, that can be done more simply. (Split from original patch on https://bugs.freedesktop.org/attachment.cgi?id=15703, by Chris Wilson - as usual all bugs are his.)
2008-08-10Win32-printing: Fix Type 1 font printing so fallback is not usedAdrian Johnson1-10/+53
Using glyph indices with Type 1 fonts on a printer DC does not work. Previously there was a temporary fix where Type 1 fonts were printed as filled paths. Now that _cairo_scaled_font_subsets_map_glyph() provides the reverse mapping of the glyph index fix this by converting the glyph indices back to the unicode values when printing Type 1 fonts.
2008-06-13Allocate the correct pattern type on the stack.Chris Wilson1-2/+3
Instead of allocating the union of all possible pattern types, just allocate the specific pattern as used by the function in order to trim the stack space consumption and flag potential misuse.
2008-06-07Fix win32-printing show_glyphs analysisAdrian Johnson1-13/+19