Commit graph

5312 commits

Author SHA1 Message Date
Behdad Esfahbod
9827dae570 [user-font] Fix fontmap locking
After consulting with Keith Packard we came up with a farily simple
solution.  Documented in the code.
2008-05-25 00:42:28 -04:00
Behdad Esfahbod
96f7178226 [user-font] Lock the font mutex such that user doesn't accidentally use it yet 2008-05-24 23:28:15 -04:00
Behdad Esfahbod
8dc1e6d945 One more typo fix 2008-05-24 22:13:01 -04:00
Behdad Esfahbod
8ff0fa112d Fix typos 2008-05-24 22:11:41 -04:00
Behdad Esfahbod
a3d9918428 [user-font] Note possible locking issue 2008-05-24 20:51:43 -04:00
Behdad Esfahbod
4c1c9d33b1 [user-font] Release fontmap lock around user callback
This makes the user-font-proxy to work now.
2008-05-24 20:48:38 -04:00
Behdad Esfahbod
127c4b8e64 [src/cairo-scaled-font] Only take fontmap mutex if touching it 2008-05-24 20:48:07 -04:00
Behdad Esfahbod
a715671c6f [test/user-font-proxy] New test using fonts inside a user-font
PDF fails and needs some fixes in the PDF surface instead of a new
ref image IMO.
2008-05-24 20:34:41 -04:00
Behdad Esfahbod
c914377f35 Add public API cairo_scaled_font_get_scale_matrix() 2008-05-24 20:33:15 -04:00
Behdad Esfahbod
90d62a0d33 [src] Make make check pass 2008-05-24 20:31:24 -04:00
Jeff Muizelaar
9cc147a142 Avoid deadlock when clearing caches
cairo_surface_destroy and _cairo_scaled_font_fini will call destroy closures
which may call functions that attempt to acquire the mutex resulting in a
deadlock. We fix this by releasing the lock for the call to
cairo_surface_destroy or _cairo_scaled_font_fini.
2008-05-24 20:18:43 -04:00
Behdad Esfahbod
4957a78947 [test/surface-finish-twice.c] Adapt to recent change that multiple finish is ok 2008-05-24 15:16:44 -04:00
Behdad Esfahbod
a30209402c [cairo-gstate] Drop glyphs out of surface boundaries in show_glyphs() 2008-05-24 14:57:56 -04:00
Behdad Esfahbod
1b5e2144fb [cairo-scaled-font] Implement _cairo_scaled_font_get_max_scale() 2008-05-24 14:57:31 -04:00
Behdad Esfahbod
479936ecea [cairoint] Sort prototypes 2008-05-24 14:57:06 -04:00
Behdad Esfahbod
e638e7652f [cairo-xlib] Fix bug introduced in yesterday's code shuffling. Oops. 2008-05-24 14:25:13 -04:00
Behdad Esfahbod
31c68e708f [cairo-surface] Minor code reshuffling 2008-05-24 13:17:31 -04:00
Behdad Esfahbod
c20072c881 [cairo-xlib] Upon seeing glyphs with large position, just let fallback handle
This now fixes the large-font test for xlib again.
2008-05-23 20:57:21 -04:00
Behdad Esfahbod
e55252bd3b [cairo-xlib] Shift range of allowed glyph positions
From -1024..15359, to -4096..122887.  This still does not fix the
large-font test as that uses a 10000 font.  Working on a proper fix
for glyph dropping now.
2008-05-23 20:46:36 -04:00
Behdad Esfahbod
74818d2b00 [cairo-xlib] Some code reshuffling, in preparation for a fix 2008-05-23 20:43:08 -04:00
Behdad Esfahbod
d947ee0ef6 [test/large-font] Make the font REALLY LARGE
10000 that is.  xlib fails now again.  Not because of glyph size issues.
Because we skip rendering any glyphs with positions not in range -1024..15359.
Working on a fix.
2008-05-23 20:41:26 -04:00
Behdad Esfahbod
db1b18232b [cairo-xlib] Fix max-request size calculations
First, XMaxRequestSize returns number of 4-byte words.  So multiply by 4 is
needed in all uses.  Next, XRenderAddGlyphs uses BIG-REQUEST extension if
available, so when checking for glyph size overflow, we should use
XExtendedMaxRequestSize() first.

Also use the right format when calculating glyph size.

These changes combined, push the biggest font size that can be uploaded to the
server from under 200 to about 5000.

See bug #4339 for history.
2008-05-23 20:03:49 -04:00
Behdad Esfahbod
cf473f4a75 [cairo-xlib] Fix show_glyphs when failing to upload a glyph
Originally reported here:
http://lists.cairographics.org/archives/cairo/2008-May/014032.html
and analyized later in the thread.

Change (font and surface) backend show_glyphs() API to take a
int *remaining_glyphs argument.  It's used to communicate to the caller,
by way of setting remaining_glyphs and returning INT_STATUS_UNSUPPORTED,
that some of the glyphs were shown but not the others.  The xlib backend
now correctly uses this to handle failure to upload a glyph to the server.
So the large-font test passes now.

An alternative approach could be to add some public value for glyphs
indices that are not shown.  -1 perhaps (the xlib backend already uses
that value internally).  Then instead of remaining_glyphs, a backend
could simply set glyph indices of glyphs shown to that -1 value.
2008-05-23 20:03:49 -04:00
Behdad Esfahbod
e66e198ab0 [cairo-xlib] Remove unused variable 2008-05-23 17:11:43 -04:00
Carl Worth
1ccfc4afd5 Revert "BUGGY: Add surface_backend->acquire_source_image_transformed"
This reverts commit ddcd6781a2.

This was an experimental commit that was intended to be on a side
branch but accidentally got committed and pushed to master. Sorry
for the noise.
2008-05-23 08:14:00 -07:00
Carl Worth
b957beb0df Add large-font test to exercise a cairo-xlib bug.
The original bug report is here:

	corrupt glyph positions with large font
	https://bugzilla.redhat.com/show_bug.cgi?id=448104
2008-05-23 08:05:18 -07:00
Carl Worth
ddcd6781a2 BUGGY: Add surface_backend->acquire_source_image_transformed
This is an initial attempt at addressing the recently noticed
fallback-resolution bug. It isn't working correctly yet.

I'm just committing so that behdad can see what I'm up to.
2008-05-21 12:06:37 -07:00
Carl Worth
8efb103600 Extend fallback-resolution test to expose bug with groups
Groups appear to always be rendered with a fallback resolution of
72.0 ppi rather than the desired fallback resolution.
2008-05-21 10:23:37 -07:00
Behdad Esfahbod
26eeb1c7ee [cairo-surface] Allow flush and finish calls after surface is finished
Flushing and finishing a surface after it has already been finished is a
very well-defined operation: no-op.  Allow and document that.
2008-05-16 21:59:45 -04:00
Behdad Esfahbod
168447cc2b [user-font] Use opaque colors such that PS backend gets tested
Also update ref images.  All backends pass now.
2008-05-15 20:09:17 -04:00
Behdad Esfahbod
556b16d6a2 [cairo-traps] Fix overflow in traps_path code
This was causing the user-font test failure in type1 subsetting
code as the type1 code creates a font at size 1000.
2008-05-15 20:03:05 -04:00
Behdad Esfahbod
b355ac7a9f [cairo-fixed] Implement _cairo_fixed_mul_div()
Computes a*b/c where a,b,c are cairo_fixed_t.
2008-05-15 20:02:33 -04:00
Behdad Esfahbod
84606a900f [cairo-surface] Fix compiler warnings
by adding new status value to switch.
2008-05-15 19:41:49 -04:00
Behdad Esfahbod
142ba30604 [test/Makefile.am] Add 'make run' target
It runs tests under a tool specified tool.  For example:

	make run TOOL=gdb TESTS=user-font TARGETS=pdf
2008-05-15 19:27:17 -04:00
Behdad Esfahbod
537ffa7628 [cairo-xlib-surface.c] Fix memmove bug
This was introduced in b7272e9e8e
2008-05-15 18:47:24 -04:00
Behdad Esfahbod
4dd4d96fb1 [cairo-surface] Add cairo_surface_get_fallback_resolution() 2008-05-15 17:20:30 -04:00
Behdad Esfahbod
2321b91cba [cairo-pattern] Make a free() call conditional
to emphasize that the pointer may be NULL
2008-05-15 16:38:56 -04:00
Behdad Esfahbod
62652ecab7 [test/user-font] Another minor tweak to the font 2008-05-15 13:28:03 -04:00
Behdad Esfahbod
df9deb1853 [user-font] Set correct device-offset for rotated text
Part of patch from Peter Clifton
2008-05-15 13:13:30 -04:00
Behdad Esfahbod
16fe67ea19 [cairo-path-fixed] Implement full-matrix _cairo_path_fixed_transform()
Based on patch from Peter Clifton.
2008-05-13 16:10:28 -04:00
Behdad Esfahbod
f68fb2c747 [test/user-font] Add some more glyphs
The glyph for 'z' now reveals a bug in PDF type1 code.
2008-05-13 14:07:42 -04:00
Behdad Esfahbod
569cc30411 [user-font] Normalize the space we compute extents in
This way we wouldn't suffer from the limited precision of cairo_fixed_t.
Bug reported by Peter Clifton on mailing list.
2008-05-10 14:58:11 +02:00
Behdad Esfahbod
f1a0e9df0e [user-font] Round glyph origin position 2008-05-10 13:49:23 +02:00
Behdad Esfahbod
17f21ea307 [cairo-user-font] Implement user fonts 2008-05-10 01:21:45 +02:00
Behdad Esfahbod
9f2971440b [doc] Remove cairo-quartz-image-surface from docs
Docs only include stable API.
2008-05-10 01:21:44 +02:00
Behdad Esfahbod
74eea0f297 [cairo-quartz-image-surface] Remove one abuse of out-of-memory status
Vlad, you need to stop throwing random OOM errors...
2008-05-10 01:21:44 +02:00
Behdad Esfahbod
dca892c83e Fix gtk-doc warnings 2008-05-10 01:21:44 +02:00
Behdad Esfahbod
1246ff8aec [cairo-test] Implement cairo_test_log_path() to dump a cairo_path_t to logs
Dumping paths is so hard in C.  Shouldn't be.  At least not when debugging...
2008-05-09 23:21:14 +02:00
Behdad Esfahbod
dc33760fcb [cairo-scaled-font] In _cairo_scaled_glyph_lookup, better handle UNSUPPORTED
If we ask for a glyph info piece and the backend doesn't provide it,
we should return UNSUPPORTED, even if the backend returned SUCCESS
(perhaps because the backend doesn't know about that particular piece
of glyph info).
2008-05-09 23:20:53 +02:00
Behdad Esfahbod
a63dc13377 [cairo-scaled-font] Add a meta-surface member to scaled glyphs
No one currently uses it.
2008-05-09 15:56:35 +02:00