Commit graph

811 commits

Author SHA1 Message Date
Carl Worth
71e9372bbd Fix text disappearing after space (bug #6617)
What happened here is that when fixing bug #5734 we cahnged the
glyph image cache lookup to never return a NULL pointer, but to
instead return a 0x0 image surface. We didn't also update code
that was looking for a NULL pointer here, and as such we were
calling XRenderAddGlyphs with a 0x0 image which apparently
tickles a bug in some X servers.
2006-07-26 13:04:25 -07:00
Behdad Esfahbod
d3ff5228a2 WIN32: Define SHADEBLENDCAPS and SB_NONE if they are not defined. (from Tor Lillqvist) 2006-03-15 14:02:14 -05:00
Carl Worth
ba5b30117b Remove unused RCS $Id:$ tags.
(cherry picked from f2245a7932 commit)
2006-03-15 11:53:59 -05:00
Vladimir Vukicevic
9acc981e44 Win32: Handle BitBlt in get_image failure and AlphaBlend not being supported
If the BitBlt in get_image fails, we pretty much can't do anything -- so
fill the destination with white and hope for the best.  This enables
somewhat accurate printing of complex operations.  Also, check the
destination device caps before calling AlphaBlend; return UNSUPPORTED if
the destination DC can't do AlphaBlend.
(cherry picked from 9831de538e347a624af5b0ca38242b198b64bd45 commit)
(cherry picked from 1a14419126 commit)
2006-03-15 11:53:43 -05:00
Vladimir Vukicevic
ec4b006c16 Win32: Set surface format based on device caps
If the DC is a display DC, inspect its depth and set out local format
appropriately.  If it's not a display DC, assume RGB24.
(cherry picked from 6dd0a70d271f93df95f4bcaff5073b9bf90cecb6 commit)
(cherry picked from 2d784815ff commit)
2006-03-15 11:53:30 -05:00
Vladimir Vukicevic
d7b280a3ad Win32: Fix up src coords before calling AlphaBlend/BitBlt to avoid invalid calls
Fixes up src coords and width/height before calling AlphaBlend/BitBlt; it's
an error to try to use a region that extents outside of the source surface
as a source DC.

Doesn't repair the extra region relative to the operator -- e.g. regions
outside of an ARGB source surface with SOURCE operator should be cleared
to fully transparent black in the destination.
(cherry picked from bc19c5b64b0e38e9d20045907d7b47d79f6afc60 commit)
(cherry picked from 68ed40b6da commit)
2006-03-15 11:53:14 -05:00
Vladimir Vukicevic
b07f042861 Win32: Rework clip and extents handling
- Save extents at surface creation and always return these
- Simplify clipping paths
(cherry picked from a67722b3d7280e6c2375778c2d46556cca261bfc commit)
(cherry picked from 7ce09732a978749a4da814feb77f50161dc42c91 commit)
(cherry picked from e0f4eecb91 commit)
2006-03-15 11:49:56 -05:00
Behdad Esfahbod
5cbf914770 Misc compilation fixes (C++-style comments, M_PI decls, etc.)
(cherry picked from d0cc56b9a24fa59febc15ac5de073da0e785e1cc commit)
(cherry picked from a6a054abe45287eb950c294e20366594313138f5 commit)
(cherry picked from f6b4fabaf5 commit)
2006-03-15 11:49:37 -05:00
Behdad Esfahbod
e78c945b61 Check font_face->status and return a nil scaled font if it is in an error state. (Thanks to Christian Biesinger and sunmoon1997 who pointed this out as part of bug #4674)
Cherry-picked from head's cairo-scaled-font.c
2006-03-15 11:32:41 -05:00
Behdad Esfahbod
af0cbe2aed Allow _get_bitmap_surface to work for 0x0 glyphs, (fix for bug #5734).
Patch from: Behdad Esfahbod <freedesktop@behdad.org>
Reviewed by: Carl Worth <cworth@cworth.org>
(cherry picked from 0152bd3a56 commit)
2006-03-15 10:15:47 -05:00
Carl Worth
440bb68ef2 _clip_and_composite_trapezoids: Avoid NULL pointer dereference due to OOM.
This closes bug #6197:

	Null pointer dereference on OOM in _clip_and_composite_trapezoids()
	https://bugs.freedesktop.org/show_bug.cgi?id=6197
(cherry picked from 6f0d8eedc5 commit)
2006-03-13 12:30:00 -08:00
Carl Worth
5e399f8778 cairo-clip: Fix memory leak during OOM handling.
This closes bug #6196:

	Memory leak in _cairo_clip_intersect_path (src/cairo-clip.c)
	https://bugs.freedesktop.org/show_bug.cgi?id=6196
(cherry picked from 79075b2cb1 commit)
2006-03-13 12:20:55 -08:00
Carl Worth
13b919f126 cairo-output-stream: Don't dereference a NULL pointer due to OOM.
This close bug #6176:

	Null pointer dereference on OOM in _cairo_output_stream_create_for_file()
	https://bugs.freedesktop.org/show_bug.cgi?id=6176
(cherry picked from c780f4a562 commit)
2006-03-13 12:07:20 -08:00
Carl Worth
46646cf2b1 cairo_show_glyphs: Do nothing if num_glyphs == 0
(cherry picked from 1cffb39ff0 commit)
2006-03-08 08:19:02 -08:00
Christian Biesinger
30d4aa8631 Use C-style comments rather than C++-style in C files 2006-03-04 15:43:15 +01:00
Carl Worth
7d498ca912 _cairo_xlib_surface_show_glyphs: Break up rendering into chunks to fit
into X max request length protocol limits.

This fixes bug #5528:

	_XError from XRenderCompositeText8
	https://bugs.freedesktop.org/show_bug.cgi?id=5528
2006-03-03 11:13:36 -08:00
Frederic Crozat
d8d8694ac4 Fix usage of freetype to match Xft and follow David Turner's recommendations.
Change a little the logic in hinting to follow the same
logic as Xft and doesn't try to mix FT_LOAD_TARGET which should not be
mixed (based on David Turner comments)
2006-02-23 17:09:47 -08:00
Frederic Crozat
65c32ae36f Fix for sub-pixel BGR and vRGB 2006-02-23 16:44:44 -08:00
Carl Worth
886bc4ddb0 Rename .cvsignore to .gitignore. Add *~ and *.o.
(cherry picked from d88c19071f commit)
2006-02-21 13:53:57 -08:00
Tor Lillqvist
d08cabcb4c Intersect clip region with target surface so we don't waste time and memory.
Reviewed by: cworth
2005-10-12 15:06:44 +00:00
Tor Lillqvist
e1c07e99b9 Apply proper transform to generated paths. 2005-10-10 11:33:18 +00:00
Carl Worth
4ac391f861 Add missing initialization for ximage.xoffset. 2005-10-06 11:34:46 +00:00
Carl Worth
cff8f83148 Add missing initialization for _global_image_glyph_cache_mutex (Vladimir Vukicevic <vladimirv@gmail.com>). 2005-10-03 21:59:01 +00:00
Bertram Felgenhauer
d290a19263 simplify id initialisation of last patch
reviewed by: keithp
2005-09-29 20:03:15 +00:00
Bertram Felgenhauer
7e5bdaeb62 Using a pointer comparison as the fallback total order was wrong - these pointers are not stable. So we introduce our own total order instead.
reviewed by: cworth
2005-09-29 17:28:54 +00:00
Tor Lillqvist
9b27a73020 Use _cairo_utf8_to_utf16 for character conversion. 2005-09-28 10:37:40 +00:00
Tor Lillqvist
0cb8ee21b5 Bug #4612, reviewed by cworth.
Add cast so that sign conversion doesn't alter comparison.
2005-09-28 10:27:39 +00:00
Tor Lillqvist
b8a08fbea6 Bug #4602, reviewed by cworth.
Avoid creating size-0 bitmap, which fails.
2005-09-27 13:25:06 +00:00
Carl Worth
4b1fca82a8 Note that bug #4409 (Dashes are missing initial caps) is now fixed.
Move face-flipping from inside _cairo_stroker_add_caps to new _cairo_stroker_add_leading_cap variant of _cairo_stoker_add_cap.
Change to call _cairo_stroker_add_leading_cap or _cairo_stroker_add_trailing_cap as appropriate.
Remove dash-caps-joins from the XFAIL list and add reference image.
2005-09-27 12:51:00 +00:00
Carl Worth
8b4d49921d Backported from HEAD:
Portability improvements for win32 thanks to Hans Breuer <hans@breuer.org>:
Defined sized-integer types when under the influence of _MSC_VER and without stdint.h.
Use #error which is more portable than #warning, (and more indicative of where we want to be before the next release).
2005-09-26 15:48:06 +00:00
Tor Lillqvist
975bfe3730 If GetGlyphOutlineW() fails, set metrics to zero. (#3927, Hans Breuer) (Don't print error message, as this might occur frequently with a misconfigured Pango 1.10.0.) 2005-09-26 09:09:37 +00:00
Tor Lillqvist
80b2fae5f1 Set LOGFONT::lfHeight negative. A negative lfHeight means "em height" which is what we want, and matches how other toolkits interpret font sizes on Win32. (Positive lfHeight means "cell height".) (#4593) 2005-09-26 09:05:14 +00:00
Tor Lillqvist
4974affc3f Pass scratch space instead of NULL for image_extra to acquire/release_dest_image. 2005-09-20 08:23:20 +00:00
Carl Worth
e54787b78d Avoid attempting to create a size-0 Pixmap, (to prevent the associated X error). This actually showed up when the clip region is empty. Thanks to Radek Doulík for the bug report.
Remove clip-all from the XFAIL list since it works now.
2005-09-19 17:27:22 +00:00
Carl Worth
e39b239171 Originally: 2005-09-19 Hans Breuer <hans@breuer.org>
src/cairoint.h : win32 specific definitions for CAIRO_MUTEX_DECLARE, CAIRO_MUTEX_LOCK etc. [not based on win32 mutex but critical sections]
src/cairo-win32-surface.c : add DllMain() to do global, single-threaded 'mutex' (de)initialization. No ifdefs needed, some variables would simply not be used when the respective backend would not be compiled in.
2005-09-19 14:28:39 +00:00
Carl Worth
4ea8d8544e Tested by: John Ellson Closes bug #4408 https://bugs.freedesktop.org/show_bug.cgi?id=4408
Add support for dashed splines. (The antialiasing quality isn't perfect, but at least the curves are dashed now).
2005-09-16 10:25:40 +00:00
Carl Worth
a85f9916a9 Expand locking to include all modification of cairo_scaled_font and related objects. 2005-09-13 15:41:16 +00:00
Carl Worth
36f4bb9837 Expand locking to encapsulate any modification to the reference count of a scaled font, rather than just modifcations of the scaled_font_map, since scaled fonts are shared between threads. 2005-09-13 12:28:00 +00:00
Carl Worth
ec413ca3a4 Fix for bug #4401 as reported by Tim Mooney:
Don't bother checking for sincos function.
Don't use sincos function since it is apparently buggy on some platforms, (Tru64 at least).
2005-09-12 11:11:48 +00:00
Owen Taylor
d521fa3a75 Handle displays which don't match the local endianness by byteswapping on GetImage/PutImage. (#4321, reported by Sjoerd Simons) 2005-08-31 15:09:43 +00:00
Owen Taylor
44d6afc8a8 Liberalize the ServerVendor check so that we can handle the Mandriva vendor string. (#4298, Frederic Crozat) 2005-08-30 10:50:27 +00:00
Owen Taylor
a4418a63d7 Use a 8xN rather than a 1xN strip for a vertical gradient. This is much more tolerant of slow compositing code, and is worth some extra expense computing the gradient. (#4263, found in test case from Richard Stellingwerff) 2005-08-30 10:42:17 +00:00
Owen Taylor
96342fe7be Make the check for rectangular trapezoids simpler and more accurate. (#4220, found using test case from Richard Stellingwerff)
reviewed by: cworth
2005-08-27 18:54:03 +00:00
Owen Taylor
30e3d538df Make the vendor string check for XFree86 more liberal, to deal with older versions of gentoo that modified it in a different way. (#4231, fix from Billy Biggs) 2005-08-27 18:49:06 +00:00
Owen Taylor
a6acc962f7 Undef MIN/MAX before defining them in case some system header happens to define them. (#4196, Christian Biesinger) 2005-08-27 18:46:34 +00:00
Owen Taylor
3c53414cf3 Fix docs not to talk about %NULL returns. #4271, Duncan Coutts. 2005-08-27 18:40:46 +00:00
Tor Lillqvist
bd510d8b4b Drop PDF and PS backend and FT font API from Win32 DLL entry points for now. 2005-08-24 07:56:45 +00:00
Billy Biggs
985d8571d2 Fix some minor typos in the doc. 2005-08-24 06:09:11 +00:00
Keith Packard
235838d49f Use new device_x_scale/device_y_scale surface fields to set the device coordinate space to the nominal pixels.
Treat more alpha values as translucent (up to 0.999)
Fix emit_image to actually use a temporary image when necessary.
Change PS coordinate space to match cairo (top-down), adjust PS output to use new space.
Find more cases where PS output was not supported and fall back to image surface.
reviewed by: cworth
2005-08-24 01:47:13 +00:00
Keith Packard
5198e71eaf _cairo_surface_show_glyphs may return UNSUPPORTED in which case a call to scaled_font->backend->show_glyphs is needed.
reviewed by: cworth
2005-08-24 01:42:19 +00:00