Commit graph

1182 commits

Author SHA1 Message Date
Carl Worth
e4476dda49 PDF: Move dash operator before path construction operators.
I don't recall anything about this in the PDF reference, (though I
also didn't look specifically for it), but without this acroread
is quite unhappy with cairo's PDF output when it includes dashing.
2006-05-23 13:41:00 -07:00
Carl Worth
59885c6a12 Clarify the documentation for cairo_set_dash
Note that dash length units are evaluated in the user space
at the time of the stroke operation, (not the user space at
the time of cairo_set_dash).
2006-05-23 12:13:20 -07:00
Carl Worth
68b41cfd06 PDF: Share path callbacks for fill and stroke. 2006-05-23 12:13:20 -07:00
Carl Worth
7e5bef2439 PDF: Rename pdf_stroke_t to pdf_path_into_t for future sharing with fill 2006-05-23 12:13:20 -07:00
Carl Worth
0755a619a1 SVG: Fix for line-width-scale
Use the same approach as the PDF backend: emit the pen matrix as the
SVG transform for the stroke, and compensate by first transforming all path
coordinates by the ctm_inverse.
2006-05-23 12:13:19 -07:00
Carl Worth
b1231e2ef3 Codify 1.0 behavior of cairo_set_line_width as a feature, not a bug.
Clarify the documentation of cairo_set_line_width to indicate that the
value will be interpreted within the user space at the time of the
stroke.

Also adjust the comments in test/line-width-scale as well as the
reference images for that test to match.
2006-05-23 12:13:19 -07:00
Carl Worth
0a1ec91977 Move prototype of cairo_debug_reset_static_data from uninstalled cairo-debug.h to cairo.h 2006-05-22 09:31:31 -07:00
Carl Worth
89384ae124 PDF: Squelch a couple of bogus "may be used uninitialized" warnings. 2006-05-18 21:48:38 -07:00
Vladimir Vukicevic
e2713057f8 Define kCGBitmapByteOrder32Host for when the SDK doesn't define it
(cherry picked from bd9b5d29e39f424e912184dcd0dc2610637d5fdf commit)
2006-05-18 21:44:23 -07:00
Vladimir Vukicevic
5bdcfd1413 Whitespace fix
(cherry picked from 0bb567a2f1807d83508e2d7598a8bd8f4d94208d commit)
2006-05-18 21:37:39 -07:00
Vladimir Vukicevic
e8069da97b CAIRO_SCALED_FONT_TYPE_* -> CAIRO_FONT_TYPE_*
Some of these were missed when CAIRO_SCALED_FONT_TYPE_* was renamed.
(cherry picked from 33dba4a690a5e4ec13ed294307b89cceac1ca696 commit)
2006-05-18 21:37:08 -07:00
Vladimir Vukicevic
9b84b3da58 [win32] GDI is nearly always faster than pixman; use it whenever possible
Remove local image check from fill_rectangles and fix check for whether
we can AlphaBlend or not (ARGB->ARGB AlphaBlend works fine)
(cherry picked from f099783b3e7f895a59d4d4a67a8534f1d21d44e1 commit)
2006-05-18 17:31:44 -07:00
Vladimir Vukicevic
2a89526edf [win32] Add GdiFlush() calls after DIB creation, as per MSDN docs
Also fixes some spacing/tab issues
(cherry picked from 123ca7c9f9d8984be5ed4fb42a2897508e8ff44a commit)
2006-05-18 17:31:21 -07:00
Stuart Parmenter
a9c42e8fc2 [win32] fix win32_show_glyphs glyph offsets
(cherry picked from 947a4a1bc6a0a0ee78c44b71fef32c924ebc9397 commit)
2006-05-18 17:31:05 -07:00
Stuart Parmenter
59a45f1c4a [win32] implement win32 show_glyphs
(cherry picked from 9c7d0cbde415d02b6e8298a02b3b62cf4513a59e commit)
2006-05-18 17:30:42 -07:00
Stuart Parmenter
a10bbecaf8 [win32] Allow for creating a font from a HFONT
(cherry picked from 677f6c84f9beae3afd375663fed0a440007ebca2 commit)
2006-05-18 17:29:18 -07:00
Vladimir Vukicevic
244c111fca [win32] Add SHADEBLENDCAPS and SB_NONE definitions for older SDKs
(cherry picked from 7a68b7d035b1c63076d6fa6c54d40944459d206d commit)
2006-05-18 17:27:30 -07:00
Vladimir Vukicevic
92a015ff8e [xlib] only do glyph extents computation if non-solid source.
xlib_show_glyphs was always calculating the glyph extents, even when it
didn't need to; this only does it when necessary.

Also adds an implementation of surface_flush() for xlib that just calls
XSync.
(cherry picked from 8770ac5b5cdba8007c4c6a6a980e6e06acf6aeb6 commit)
2006-05-18 17:14:01 -07:00
Vladimir Vukicevic
108431414f [xlib] implement _cairo_xlib_surface_show_glyphs
Avoid using the fallback paths as much as possible; implement real
show_glyphs, falling back for OPERATOR_SOURCE (due to Render bug), and all
unbounded operators (let the fallback code deal with fixup).  Also fall
back if we have a fallback mask clip set.

(cherry picked from 3225a4ec820fd4051dd893ffc4258b182bd62dca commit)
2006-05-18 17:12:32 -07:00
Carl Worth
3487191b22 xlib: Style cleanups for _cairo_xlib_surface_create_similar
Including style cleanups for _xrender_format_matches_content.

There's even a bug fix here as well. Previously, we would miss compatibility
if the existing xlib surface had a NULL visual, (even if it had a compatible
xrender_format). We now catch this case, and don't bother even trying to
store a visual into the resulting surface.
2006-05-18 15:36:43 -07:00
Carl Worth
a96bd2b4f9 xlib: Rename surface->format to surface->xrender_format to avoid confusion
With both XRenderPictFormat* and cairo_format_t values being manipulated in the same
functions, this really needed to be done.
2006-05-18 15:20:25 -07:00
Robert O'Callahan
ea05e02711 [xlib] Have create_similar try harder to create the right surface
I recently discovered that cairo_create_similar on a 16-bit xlib surface
creates a surface backed by a 24-bit pixmap. This results in absymal
performance --- I can actually watch a copy from the similar to the
original move down the screen, on my dual Xeon, NVidia vendor driver
machine. It also means xlib-based code like GTK themes can't render to
the surface because it doesn't match the screen depth.

The attached patch makes _cairo_xlib_surface_create_similar match the
characteristics of the input surface as closely as I know how, and fixes
my issues.
2006-05-18 14:25:23 -07:00
Carl Worth
05b1d2f9c5 PDF: Fix broken per-page sizes in PDF output.
This was first broken in:

	PDF: Fold (unused) cairo_pdf_document_t into cairo_pdf_surface_t
	f500cef19f

Thanks, git bisect!
2006-05-16 01:04:59 -07:00
Kristian Høgsberg
d70ade00fb Merge branch 'master' of git://git.freedesktop.org/git/cairo 2006-05-15 17:53:56 -04:00
Kristian Høgsberg
41d435418c Documentation fixes (cairo_font_create -> cairo_scaled_font_create). 2006-05-15 17:36:12 -04:00
Carl Worth
bf2ab0de92 PDF: Add Type3 font support to PDF output.
This uses the recently added cairo-scaled-font-subsets interface in a
style very similar to what the PS surface does.
2006-05-15 10:04:53 -07:00
Carl Worth
6f417fed51 PDF: Move Resources dictionary up from Page objects to Pages object.
This allows for more sharing of resource objects. It also avoids some
confusion in trying to set independent resources at a global and a
per-page level, (which doesn't work since the inheritance only works
for an entire resources object---it can only be overriden in its
entirety, not for subsets of the resources).
2006-05-15 10:00:18 -07:00
Carl Worth
049100fb87 PDF: Use consistent style for typedef struct and macro naming. 2006-05-15 09:52:57 -07:00
Carl Worth
45d0540c33 PS: Remove the fallback case from _cairo_ps_surface_show_glyphs
The only expected errors that would lead to this fallback are serious
problems such as out of memory. There's no reason to go to heroic
efforts to draw as much as possible in face of an error like that.

Prefer simpler code instead.
2006-05-15 09:41:36 -07:00
Carl Worth
cb32b41a4e PS: Fix arguments to setcachedevice
Since we are only ever displaying a single glyph at a time we don't
care about the width values passed to setcachedevice at all---we only
care about the bounding box.

That's what the code was trying to do before, but the arguments were
misaligned and we were instead passing bounding-box values for the
widths and hard-coding half of the bounding-box values as 0.
2006-05-15 09:39:16 -07:00
Carl Worth
e2c03d51da Change scaled_font_subsets_callback to have return type of void.
The return of status from this callback was misleading. The function
actually calling the callback was also a hash table callback function,
which itself is void---so any status value returned was being lost.

Instead, we now stash any errors that occur during the fallback into
surface->status.
2006-05-15 09:34:27 -07:00
Carl Worth
f500cef19f PDF: Fold (unused) cairo_pdf_document_t into cairo_pdf_surface_t 2006-05-12 14:56:11 -07:00
Carl Worth
d84a1cac1c PDF: Use cairo_pdf_resource_t more consistently.
Eliminate the named structure cairo_pdf_stream_t. This structure was
being dynamically allocated, passed around, and leaked when only an ID
was actually needed to be passed around.

Similarly, many other uses of PDF resources were passing bare unsigned
int types rather than the safer and more legible cairo_pdf_resource_t.
2006-05-12 13:31:12 -07:00
Carl Worth
1ba537be18 Fix memory leak in _cairo_scaled_font_subsets_foreach 2006-05-10 19:01:40 -07:00
Carl Worth
7bd3a037da Add documentation for the _cairo_scaled_font_subsets interface. 2006-05-10 18:52:36 -07:00
Carl Worth
7c137b7e2c SVG: Discard custom font subsetting in favor of sharing cairo-scaled-font-subsets 2006-05-10 15:14:10 -07:00
Carl Worth
f459c1f0de Tweak names to match those of cairo-scaled-font-subsets
Also, remove a now obsolete field from cairo_ps_surface_t
2006-05-10 15:12:53 -07:00
Carl Worth
8a209e6ad9 Fix cairo_output_stream_destroy to do nothing on nil stream objects. 2006-05-10 14:50:31 -07:00
Carl Worth
0544515279 Generalize font subsetting code in cairo-scaled-font-subsets for use by more than just PS backend 2006-05-10 14:47:28 -07:00
Carl Worth
906a17a6b1 Rename cairo-ps-font to cairo-scaled-font-subsets (file names only) 2006-05-10 14:40:32 -07:00
Carl Worth
f7f9bdc05b PS: Put functions in more logical order. 2006-05-09 14:40:37 -07:00
Carl Worth
f3703b1806 PS: Move type 3 support out into cairo-ps-font.c
This is in preparation for generalizing this code for sharing among
several backends.
2006-05-09 14:40:36 -07:00
Carl Worth
7ebdf4825d PS: Remove stale comment (the stuff TODO is done already) 2006-05-09 14:40:36 -07:00
Emmanuel Pacaud
7d0bcc3f1c SVG: Emit glyphs at the beginning of defs section. 2006-05-06 15:31:53 +02:00
Emmanuel Pacaud
1da2ca0f35 SVG: Implementation of glyph cache
This is an adaptation of Keith ps-type3 branch for SVG backend.
Main differences with ps stuff are font cache is a property of
document, and there's no need of subfonts.
2006-05-06 14:56:20 +02:00
Emmanuel Pacaud
d76701f465 Use CLEAR operator for initialisation of similar surface with a transparent color. 2006-05-05 16:47:06 +02:00
Emmanuel Pacaud
36fcaa76d6 SVG: Fix cairo_svg_surface_restrict_to_version.
surface parameter is actually a paginated surface.
Use the same logic as pdf backend.
2006-05-05 16:02:04 +02:00
Emmanuel Pacaud
6b40ba283b SVG: Remove special case for unclipped CLEAR and SOURCE in paint when
we're in analysis mode.

intersect_clip_path is not analyzed, so we can't know if we're clipped
when we're in analysis mode.
2006-05-05 12:59:29 +02:00
Emmanuel Pacaud
fb269aac08 SVG: Sets something sane in width and height if acquire source image fails.
In composite_image_pattern.
2006-05-05 11:10:02 +02:00
Carl Worth
b948683917 Flesh out the documentation for cairo_push_group, cairo_pop_group and friends 2006-05-04 22:43:22 -07:00