Commit graph

6922 commits

Author SHA1 Message Date
Chris Wilson
fe7410c6cd [test] Add a note to "Getting the elusive zero failures"
The test suite depends upon many external factors and in order to achieve
a pass, your system must match that upon which the reference images were
generated. Add a note to read test/README in case of failures so that the
casual user is not unduly alarmed by cairo reportedly failing.
2009-05-15 21:31:02 +01:00
Chris Wilson
2f962799a7 [test] Fix typos that excluded backend test sources 2009-05-15 21:31:02 +01:00
Chris Wilson
c25992479a [xlib] Use minimal depth for similar clones.
Damian Frank noted
[http://lists.cairographics.org/archives/cairo/2009-May/017095.html]
a performance problem with an older XServer with an
unaccelerated composite - similar problems will be seen with non-XRender
servers which will trigger extraneous fallbacks. The problem he found was
that painting an ARGB32 image onto an RGB24 destination window (using
SOURCE) was going via the RENDER protocol and not core. He was able to
demonstrate that this could be worked around by declaring the pixel data as
an RGB24 image. The issue is that the image is uploaded into a temporary
pixmap of matching depth (i.e. 32 bit for ARGB32 and 24 bit for RGB23
data), however the core protocol can only blit between Drawables of
matching depth - so without the work-around the Drawables are mismatched
and we either need to use RENDER or fallback.

This patch adds a content mask to _cairo_surface_clone_similar() to
provide the extra bit of information to the backends for when it is
possible for them to drop channels from the clone. This is used by the
xlib backend to only create a 24 bit source when blitting to a Window.
2009-05-15 21:31:02 +01:00
Karl Tomlinson
0238fe2caf [ft] Resolve mutual referencing problems with zombie faces
Bug 21706 -- zombie ft_font_face / ft_unscaled_font mutual
             referencing problems
[http://bugs.freedesktop.org/show_bug.cgi?id=21706]

There can be more than one zombie font_face belonging to an unscaled_font,
but only the first is destroyed.  This leaks the client's FT_Face
(and associated font data) as release of the FT_Face depends on release
of the font_face.

(The reason why Firefox ends up with two different font_faces for one
unscaled_font is that load_flags for faces with artificial oblique have
FT_LOAD_NO_BITMAP set.
https://bugzilla.mozilla.org/show_bug.cgi?id=486974)

Also it's possible for _cairo_ft_font_face_create to pull out a zombie
font_face from the unscaled_font, which would crash
_cairo_ft_font_face_scaled_font_create, as that expects non-null
font_face->unscaled (if !font-face->pattern).
2009-05-15 21:31:02 +01:00
Chris Wilson
d6f6ec9082 [ft] Restore the ability to lazily resolve patterns.
I broke the ability for the ft font backend to resolve patterns whilst
fixing the font creation to propagate the error status from fontconfig
(be27e8). By adjusting the sequence of error checks we do not confuse
the absence of a match with a fatal error and thereby restoring the
lazy pattern resolution whilst ensuring error propagation.
2009-05-15 21:31:01 +01:00
Jeff Muizelaar
a352fd4602 Only include <strings.h> for ffs() when we HAVE_FFS
This fixes breakage caused by 3d3d10a31e
2009-05-15 15:34:05 -04:00
Chris Wilson
088d2a6cc7 [doc] Update identifiers 2009-05-08 08:53:51 +01:00
Chris Wilson
d8fb6a03d3 [path] Define _BSD_SOURCE to enable hypot()
hypot() is only declared for BSD/SVID/XOPEN/C99 sources. Choose BSD as
we've used that elsewhere.
2009-05-08 08:53:51 +01:00
Chris Wilson
e38f85c5de [script] Pedantic violations
Fixup a few trivial errors with -pedantic.
2009-05-08 08:53:43 +01:00
Chris Wilson
0c00556990 [script] Missing include for INT32_MAX
Avoid depending upon stdint.h, or rather cut'n'pasting Cairo's portable
defines, by using INT_MAX and limits.h instead.
2009-05-08 08:52:32 +01:00
Chris Wilson
3d3d10a31e [skiplist] Missing include for ffs() 2009-05-08 08:52:27 +01:00
Chris Wilson
e5752865ab [cairo] Protect typeof against -ansi
s/typeof/__typeof__/ to allow the [gcc-specific] macro to continue to work
despite -ansi.
2009-05-08 08:52:19 +01:00
Chris Wilson
5f4f2ab01a [cairo] Remove stray semi-colon
Pedantic finds another victim.
2009-05-08 08:52:13 +01:00
Chris Wilson
d86ad461cf [cairo] Convert C99 comments to /* ... */
First victim of -pedantic...
2009-05-08 08:51:54 +01:00
Chris Wilson
695f648607 [cairo] Fix errors reported by check-doc
Identity a few new instances of CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED in
comments with %.
2009-05-07 15:14:14 +01:00
Chris Wilson
849bdee199 [check] Quieten output during checking headers-standalone
Remove the duplication of the compile line and enable shave to replace it
entirely with a "CHECK $header". This should make errors more obvious.
2009-05-07 15:14:14 +01:00
Chris Wilson
84fad4b11b [build] Fix gtk-doc interoperation with shave
Add --tag=CC to the libtool invocations.
2009-05-07 15:14:14 +01:00
Chris Wilson
fd72c56af8 [build] Report status of gtk-doc in summary 2009-05-07 15:14:13 +01:00
Behdad Esfahbod
428fb58a4c [user-font] Add CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED
This is useful for language bindings to signal that a method is not
implemented.
2009-05-06 20:31:04 -04:00
Behdad Esfahbod
f9573d03dd Err, make gtk-doc happy again 2009-05-06 20:31:04 -04:00
Chris Wilson
30735f790a [xlib] Use a similar content surface for cloning images
Simply request a surface with a similar content to the source image when
uploading pixel data. Failing to do so prevents using a 16-bit (or
otherwise non-standard pixman image format) window as a source - in fact
it will trigger an infinite recursion.
2009-05-05 21:38:18 +01:00
Chris Wilson
60e38d0530 [surface] Convert FORMAT_INVALID during snapshots
Currently the surface snapshotting attempts to clone the source using a
new surface of identical format. This will raise an error if the source is
an unusual xserver, for example one operating at 16bpp. The solution to
this is to create the surface using the content type rather than the
format (as elsewhere within the code base). However, we also wish to
preserve FORMAT_A1 (which is lost if we only choose the format based on
_cairo_format_from_content) as the various backends may be able to
trivially special case such bitmaps.
2009-05-05 21:21:28 +01:00
Chris Wilson
31f5a2e94d [png] Coerce FORMAT_INVALID to a known image format
It is possible for cairo_surface_write_to_png() to acquire a non-standard
image surface when, for example, we try to dump a low bit-depth XServer.
Handle this scenario by coercing the unknown image format to a standard
type via pixman.
2009-05-05 21:21:24 +01:00
Chris Wilson
c488b33644 [test] Create a new fallback surface to exercise 16-bit paths.
Add a variation of test-fallback-surface that forces the use of a 16-bit
pixman format code instead of the standard 32-bit types. This creates an
image surface akin to the fallbacks used with low bit-depth xservers.
2009-05-05 21:17:11 +01:00
Chris Wilson
1d609d6722 [image] Treat A1 image surfaces as BILEVEL_ALPHA
Categorise the transparency of FORMAT_A1 image surfaces as BILEVEL_ALPHA.
2009-05-05 21:17:05 +01:00
Chris Wilson
aac132a76a [image] Make _cairo_image_analayze_transparency() more format agnostic
Use the content in preference to the format to determine
CAIRO_IMAGE_IS_OPAQUE/CAIRO_IMAGE_HAS_ALPHA.
2009-05-05 21:17:05 +01:00
Chris Wilson
4be6de9fc6 [image] Return FORMAT_INVALID for an error surface.
The default error value should be CAIRO_FORMAT_INVALID [-1] not 0 (which
corresponds to CAIRO_FORMAT_ARGB32).
2009-05-05 21:17:05 +01:00
Chris Wilson
6675cf5587 [build] Add lcov-1.7 to known list 2009-05-05 21:17:04 +01:00
Chris Wilson
526fcdb7e6 [build] Enable shave support
shave transforms the messy output of autotools into a pretty (quiet!)
Kbuild-like one.

Lets see how controversial a simple change can be...
2009-05-05 21:16:55 +01:00
Chris Wilson
1ae2ddc1dd [memfault] Manually inject faults when using stack allocations
Ensure that no assumptions are made that a small allocation will succeed
by manually injecting faults when we may be simply allocating from an
embedded memory pool.

The main advantage in manual fault injection is improved code coverage -
from within the test suite most allocations are handled by the embedded
memory pools.
2009-04-23 09:22:51 +01:00
Chris Wilson
817589e196 [test] Call FcInit() manually.
Pre-initialise fontconfig whilst memfault is disabled to avoid a lot of
expensive, redundant testing of FcInit() throughout the test suite.
2009-04-20 10:21:24 +01:00
Chris Wilson
be27e844c8 [ft] Propagate status from font creation
Return the true error status whel
_cairo_ft_unscaled_font_create_internal(). This ensures that the original
error is not masked and we are able to report the error during fontconfig
pattern resolution.
2009-04-20 10:21:24 +01:00
Chris Wilson
d46c56f18c [ft] Check for pattern duplication failure.
Check the return of FcPatternDuplicate() for failure, and propagate the
error.
2009-04-20 10:21:23 +01:00
Chris Wilson
50302f156d [ft] Check (correctly!) for pattern duplication failure.
Check the return from FcPatternDuplicate() for allocation failure (and not
the original pattern)!
2009-04-20 10:21:23 +01:00
Chris Wilson
8bf109bd2a [pattern] Silence compiler with impossible case.
Assert that the pattern is one of the four known types, and return an
error so that the compiler knows that the local variable can not be used
uninitialised.
2009-04-20 10:21:23 +01:00
Chris Wilson
5a76c233bf [type3] Propagate error from font creation.
Perform an error check after creating a scaled-font to prevent operations
on a nil-object.
2009-04-16 09:34:03 +01:00
Chris Wilson
d46bd67c8b [type3] Add status checks.
Propagate error from the stream when creating the surface and add status
guards before writing to the potential nil object.
2009-04-16 09:34:03 +01:00
Chris Wilson
a6ffb69a54 [type3] Check error status before emit_image().
Be careful not to pass an error object down to emit_image() hook,
propagate the error instead. This relieves the burden of the error check
from the callee -- which was causing an assertion failure in the ps
backend.
2009-04-16 09:34:03 +01:00
Chris Wilson
21d1138da9 [scaled-font-subsets] Check for malloc failure.
Check that the utf8 string is successfully allocated before writing to it,
otherwise propagate the error status back to the callers.
2009-04-16 09:34:03 +01:00
Chris Wilson
0f0e2d7384 [pdf] Propagate failure from type3 glyph surface creation.
Add an early check that we successfully created the glyph surface.
2009-04-16 09:34:02 +01:00
Chris Wilson
1496c5cf51 [analysis] Use _cairo_region_init()
Avoid secondary allocations of the thin region wrappers during surface
creation by embedding them into the parent structure. This has the
satisfactory side-effect of not requiring status checks which current code
lacks.
2009-04-16 09:34:02 +01:00
Chris Wilson
ad83765a14 [xlib] Allocate bounded region on stack.
Eliminate the extremely short-lived and oft unnecessary heap allocation
of the region by first checking to see whether the clip exceeds the
surface bounds and only then intersect the clip with a local
stack-allocated region.
2009-04-16 09:34:02 +01:00
Chris Wilson
75b06b8bdb [pattern] Do not modify outparam on error path.
The pdf backend was crashing as a failed pattern copy stored an invalid
pointer with the resource group.
2009-04-16 09:34:02 +01:00
Chris Wilson
82cccb2672 [test] Handle memfaults during surface-finish-twice
Check and report memory allocation failures.
2009-04-16 09:34:02 +01:00
Chris Wilson
f12d52bfca [test] Use xmalloc() to evade memfault.
Do not use the simple malloc() as memfault will inject allocation failures
(unlike xmalloc() for which faults are excluded) - as this is unnecessary
inside the test harness and thus does not exercise any cairo code paths.
2009-04-16 09:34:02 +01:00
Chris Wilson
ca501d99bb [test] Disable signal handling under valgrind
Capturing and handling the signals prevents valgrind from providing
backtraces for fatal signals -- which is often more useful.
2009-04-16 09:34:01 +01:00
Jeff Muizelaar
f853972636 [win32] Fix building with libpng and zlib
Include zlib and libpng dependencies using something like '$(cairo_dir)/../zlib/zdll.lib'
instead of just 'zdll.lib'. Also, do similarly for the headers.
2009-04-07 14:50:25 -04:00
Adrian Johnson
1798fc6607 Fix the TrueType subsetting fix in 9b496af5c
Oops.
2009-04-05 11:17:02 +09:30
Adrian Johnson
fe97e815e8 Fix TrueType subsetting bug
Fix incorrect counting of arguments in composite glyphs
2009-04-05 01:09:32 +10:30
Adrian Johnson
9b496af5c2 Fix buffer size check in TrueType subsetting
Andrew Cowie reported a problem with the Charis SIL font being
embedded as a fallback font.

The buffer size check for composite glyphs was incorrect causing the
subsetting to fail for some fonts.
2009-04-05 00:44:02 +10:30