Commit graph

1765 commits

Author SHA1 Message Date
Behdad Esfahbod
dcdcb7ac2a Fix leak in rectilinear stroking code
The code was not cleaning up after itself when rejecting a path as
rectilinear.
2007-03-01 18:36:16 -05:00
Behdad Esfahbod
7de96a1faa [xlib] Drop XrmFinalize() stuff. That didn't ever exist in any public X server 2007-03-01 18:00:23 -05:00
Behdad Esfahbod
c9ddb86e67 [paginated] Also increase page number in copy_page 2007-03-01 13:51:29 -05:00
Adrian Johnson
dc0043383b PDF: Ensure ToUnicode CMap name is unique
and remove an unused printf argument.
2007-03-01 23:39:10 +10:30
Behdad Esfahbod
d0fe666a6a Revert the solid-pattern cache
This reverts the following commits:

	2715f20981
	67e3b3c53b

See this thread for an analysis of the problems it caused:

	http://lists.freedesktop.org/archives/cairo/2007-February/009825.html

In short, a single cache for all backends doesn't work, as one thread
using any backend can cause an unused xlib pattern to be evicted from
the cache, and trigger an xlib call while the display is being used
from another thread.  Xlib is not prepared for this.
2007-02-28 14:58:57 -05:00
Behdad Esfahbod
efe8c82738 [paginated] Also do an automatic show page if nothing ever drawn
That is, we always emit at least one page of output.  Otherwise our
PS/PDF/SVG files would be corrupt, and output with zero pages does
not make much sense.
2007-02-28 14:19:18 -05:00
Behdad Esfahbod
07d61af809 [paginated] Automatically issue a final cairo_show_page()
This means, PS/PDF/SVG do not need the final cairo_show_page() anymore.
If there is any drawing in the page, a cairo_show_page() is done
automatically.
2007-02-28 13:46:27 -05:00
Behdad Esfahbod
ef53465a03 Slim-hidden cairo_scale() 2007-02-27 20:18:16 -05:00
Behdad Esfahbod
ed75e24898 Implement cairo_get_scaled_font() 2007-02-27 20:09:46 -05:00
Behdad Esfahbod
d64b194a45 [quartz] Remove comment syntax that is recognized by gtkdoc from regular comments 2007-02-27 20:03:26 -05:00
Behdad Esfahbod
65ab63cb8d [cairo.c] Reorder some function implementations for clarity 2007-02-27 19:45:10 -05:00
Behdad Esfahbod
ed933a199c [cairo.h] Reorder function prototypes a bit for clarity 2007-02-27 19:43:18 -05:00
Behdad Esfahbod
e2ce27db30 [PS/PDF] Fix xstep/ystep values for CAIRO_EXTEND_NONE
This fixes the fallback-resolution test, as well as the two of
surface-pattern-scale-up and surface-pattern-scale-down.
2007-02-27 18:47:47 -05:00
Behdad Esfahbod
7185c00e15 [PS] Add note about possible need for fix. 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
38b590d8b7 [SVG] Fix warnings 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
69edcd4623 [SVG] Rename a local variable for clarity 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
11b3f43e92 [TODO] Add various TODO items 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
289ac33fa2 [PS] Fix surface patterns with transforms
Previously we were generating an image object with the desired
transform and then a pattern with only a translation.  This means,
the pattern was alwasys axis-aligned.  Obviously this does not
work correctly with repeated rotated patterns.

We now use an identity matrix for the image and put all the
pattern transformation (well, it's inverse) into the pattern.
This fixes the issue nicely.

The surface-pattern test is still failing even with a reference
image, because the gs rendering of the normal case and the
device-offset=25 case are different and both have seams.
2007-02-23 17:26:43 -05:00
Behdad Esfahbod
7c39276366 [PS/PDF] Accept CAIRO_EXTEND_REFLECT surface patterns natively
With the hack in _cairo_pattern_acquire_surface to return a 2x2
surface for reflected patterns, we can now accept REFLECT surface
patterns natively in all backends.  SVG was already doing that.
The PDF case needed some changes to go through
_cairo_pattern_acquire_surface.  A similar change to the recent
change in SVG.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
63c011bb6b [surface] Copy device_transform_inverse in _cairo_surface_clone_similar 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
3516d8092b [SVG] Use _cairo_pattern_acquire_surface instead of _cairo_surface_acquire_source_image
This change is required for the upcoming hack to support
CAIRO_EXTEND_REFLECT.  In short, the idea is that the surface returned
by _cairo_pattern_acquire_surface may look different from the one
returned by _cairo_surface_acquire_source_image, to support some pattern
modes not supported by the backends directly.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
8d812ae9a6 [cairo-pattern] Correctly delegate device_transform so tests pass again 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
7cbfb9556d [cairo-pattern] Fall back on cairo_surface_create_similar in _cairo_pattern_acquire_surface_for_surface
This was needed for SVG backend because it does not implement clone_similar.
However, I'm worried about possible infinite recursion here.  Not sure what
to do.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
5562050bcf Support CAIRO_EXTEND_REFLECT on surface patterns
We do this through a hack, that is, we make
_cairo_pattern_acquire_surface to return a surface that has four
copies of the original surface painted such that this image can
be simply repeated to get the effect of reflecting the original
surface.

This fixes the formerly XFAIL test extend-reflect.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
81935bb131 [PS] Update surface_pattern_supported() from PDF
The PS backend was accepting all surface patterns, just to ASSERT_NOT_REACHED
later if extend type of the pattern was PAD or REFLECT.  That didn't make
sense and was causing crash for PAD (surprisingly not for REFLECT.  Not sure
why).  So now it rejects those types of surface patterns, just like the PDF
surface does.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
4e30919f30 [cairo-surface] Do not err on CAIRO_EXTEND_PAD and CAIRO_EXTEND_REFLECT
for surface patterns.

Right before releasing cairo 1.2, Carl and I decided to return error on
CAIRO_EXTEND_PAD and CAIRO_EXTEND_REFLECT for surface patterns, as they
are not implemented and one was causing crashes.  Well, that was probably
the worst decision we could make (other than ignoring the problem).  A
much better decision would have been to make them act like
CAIRO_EXTEND_NONE and CAIRO_EXTEND_REPEAT respectively.  Anyway, remove
the error paths.
2007-02-23 17:26:42 -05:00
Vladimir Vukicevic
5a72aac598 [core] put back REF_COUNT_INVALID to be -1, fix finish
Previous commit broke cairo_surface_finish, since it was checking for
ref_count == CAIRO_REF_COUNT_INVALID and bailing.  But, that condition
was reached from destroy, so finish was bailing out early.
2007-02-23 14:24:04 -08:00
Vladimir Vukicevic
cf73118522 [core] Add user_data and reference count getters to all objects
user_data setters/getters were added to public refcounted objects
that were missing them (cairo_t, pattern, scaled_font).  Also,
a refcount getter (cairo_*_get_reference_count) was added to all
public refcounted objects.
2007-02-23 13:05:23 -08:00
Behdad Esfahbod
67e3b3c53b [xlib/xcb] Check for same_screen in is_compatible
Two drawables can be used in an X and Render operation only if they share
the same screen.  Previously we were only checking for the same display
in is_compatible.  Check for the same screen now.
2007-02-23 11:15:04 -05:00
Adrian Johnson
a1e5b91588 Subsetting: Add check for malloc() error 2007-02-23 22:55:29 +10:30
Adrian Johnson
27312591fe Win32: Fix _cairo_win32_scaled_font_map_glyphs_to_unicode return type 2007-02-23 22:14:42 +10:30
Behdad Esfahbod
3b168e4551 [FreeType] Truely return unhinted advance width if metrics hinting is off
David Turner said:
The returned 26.6 advance is always rounded, even with FT_LOAD_NO_HINTING.
You can however retrieve the linearly scaled value as a 16.16 fixed float
number through face->glyph->linearHoriAdvance. This works even with hinted
glyphs.
2007-02-22 23:14:58 -05:00
Emmanuel Pacaud
1bc1f8ef46 Set overflow to visible for symbols.
It makes viewers implementing correctly the SVG specification show texts.
2007-02-21 23:23:32 +01:00
Behdad Esfahbod
b54174e917 [PS] Fix rotated image pattern emission by correcting setting the bbox
The bug was that the bounding box of the image was computed by transforming
the vector (width,height) and then using 0,0,width,height as the bounding box.
This is obviously wrong.  We use _cairo_matrix_transform_bounding_box() now.
This fixes the XFAIL test rotate-image-surface-paint.
2007-02-21 13:43:08 -05:00
Vladimir Vukicevic
363b1a40b5 [quartz] Remove (disabled) support for rendering via AGL/CGGL 2007-02-20 16:18:27 -08:00
Vladimir Vukicevic
e4a1410514 [quartz] Rename public function parameter from surf -> surface 2007-02-20 16:16:18 -08:00
Vladimir Vukicevic
be451cd83d [quartz] rename NQUARTZ -> QUARTZ in defines 2007-02-20 12:54:03 -08:00
Vladimir Vukicevic
4c201723ce [quartz] Rename nquartz to quartz 2007-02-20 12:15:35 -08:00
Adrian Johnson
641f0919d5 PDF/PS: Don't embed multiple copies of the same font
cairo-scaled-font-subsets stores two sets of subsets -
scaled and unscaled. The first time each glyph is mapped,
_cairo_scaled_glyph_lookup() is called to determine if
the glyph is bitmap or outline. Outline glyphs are put
in the unscaled subsets. Bitmap glyphs are put in the
scaled subsets. The unscaled subsets hash table keyed is
the scaled_font->font_face to ensure only one font for
each font face is created. The scaled subsets hash
table is keyed by scaled_font.

_cairo_scaled_font_subsets_create() now takes two arguments
to specify the maximum size of the scaled and unscaled subsets.
If the unscaled max size is set to 0 all glyphs are mapped
to scaled subsets.

A separate foreach function is provided for scaled and unscaled
subsets. The PDF and PS backends iterate over the unscaled
subsets to emit CFF, TrueType, and Type1 fonts. The scaled
subsets are iterated to emit Type3 bitmap fonts.
2007-02-21 00:32:07 +10:30
Behdad Esfahbod
f65c33edbe [win32] Make win32-surface compile without win32-font
Hacking on the win32 code, thanks to winelib.  Yay!
2007-02-20 01:01:39 -05:00
Behdad Esfahbod
8133530ae5 [configure] Improve win32 detection
We now test for windows.h availability to automatically enable win32
backends.  This nicely enables compiling cairo against libwine by just
setting CC=winegcc LD=winegcc during configure.  This currently only
generates static libs though.
2007-02-20 01:01:34 -05:00
Jeff Smith
0fcd6cfe0e Clean up some inconsistent spacing in the stroking code 2007-02-19 16:06:57 -05:00
Jeff Smith
89010db3ad Add or reword several comments in the stroking code 2007-02-19 16:06:57 -05:00
Jeff Smith
adb573d0ba Minor changes to shorten the stroking code 2007-02-19 16:06:57 -05:00
Jeff Muizelaar
fb29fddd40 Rename tmp to step_length because that is what it actually is. 2007-02-19 16:06:57 -05:00
Jeff Muizelaar
afd5f92195 Fix several issues with dashed stroking code, particularly 'leaky-dash'
Adds some state, 'dash_starts_on', to keep track of whether a dashed path
starts with dash_on or not. This fixes the 'leaky-dash' bug (#4863) and
some other degenerate cases. The new version is, in my opinion,
considerably cleaner and more understandable than the old code.

Finally, the rewrite changes the behaviour of dashing to add degenerate
caps around corners that start at the same place as a dash begins. This
matches the behaviour seen in acroread.

This rewrite is based on an initial rewrite done by Jeff Smith.
2007-02-19 16:06:57 -05:00
Jeff Muizelaar
78ae474d96 Rename has_sub_path to has_initial_sub_path
has_initial_sub_path more accurately describes the condition we want to
track. This flag is used to indicate when an initial sub_path needs capping
but has no associated slope and thus no associated faces.
2007-02-19 16:06:56 -05:00
Jeff Muizelaar
9f3fb4f753 Add a comment about the point choice when capping degenerate paths 2007-02-19 16:06:56 -05:00
Jeff Smith
a1a4d6966e Modify how _cairo_stroker_add_caps handles zero-length sub-paths
For zero-length sub-paths, _cairo_stroker_add_caps sets up a dummy face,
then lets later parts of the function add the caps.
2007-02-19 16:06:56 -05:00
Jeff Smith
849a9ef81b Change type of cairo_stroker_t's dash_on from int to cairo_bool_t 2007-02-19 16:06:56 -05:00