Commit graph

6944 commits

Author SHA1 Message Date
Chris Wilson
0b5e92e66b [script] Check hash value between comparing keys 2009-05-25 22:14:57 +01:00
Chris Wilson
a364f71194 [trace] Set output location using pwd
Record the current working directory and pass that along to cairo-trace so
that the trace output is local to the user and not the application. This
is vital if the application is called via a script that changes directory.
2009-05-25 22:14:56 +01:00
Chris Wilson
a76e09ea65 [trace] Missing newlines in error messages. 2009-05-25 22:14:56 +01:00
Chris Wilson
b7f199fde2 [pattern] Trim REPEAT source size when applicable.
Some backends are quite constrained with surface sizes and so trigger
fallbacks when asked to clone large images. To avoid this we attempt
to trim ROIs (as these are often limited to the destination image, and
so can be accommodated by the hardware). This patch allows trimming
REPEAT sources both horizontally and vertically independently.
2009-05-25 22:14:56 +01:00
Chris Wilson
e4efc80b8e [build] Make valgrind support user-configurable
As the number of places where we add valgrind client requests grows, it
becomes imperative that we should be able to disable them with a simple
configure time option.
2009-05-25 22:14:56 +01:00
Chris Wilson
d840deb57b [in-fill] Fix typo in on-vertex test.
Eeek! Comparing point->y against in_fill->x is a bad idea.
2009-05-25 22:14:56 +01:00
Chris Wilson
cfd484cd01 [test] Change test semantics to match new in-fill definition
The in-fill definition has changed to include queries on the edges and
vertices, so update the test case to match.
2009-05-25 22:14:41 +01:00
Chris Wilson
b71b019fe5 [in-fill] Treat on-edge queries as inside.
Jeff Muizelaar noted that the treatment of edges differed with firefox's
canvas definition, which considers a point on any edge as inside. The
current implementation has a similar definition to that of flash, for
which the top and right edges are outside. Arguably, firefox has the more
intuitive definition here...
2009-05-22 16:55:30 +01:00
Chris Wilson
efd0f0b292 [xlib] Handle too-large images gracefully.
Trigger a fallback to an image surface for massive patterns.
2009-05-22 16:41:58 +01:00
Chris Wilson
3c6838532a [surface] Early return if the backend cannot clone an image
If the backend cannot create a similar surface to hold the image, then
report back the failure before embarking upon an infinite recursion.
The UNSUPPORTED return should percolate up through the call stack and
trigger a fallback.
2009-05-22 16:41:57 +01:00
Chris Wilson
bf2c7356d4 [surface] Provide nil-surface for INVALID_SIZE
So that we can faithfully report back failure if the user tries to create
a surface larger than the backend can support.
2009-05-22 16:41:57 +01:00
Chris Wilson
6717f0d748 [win32] Wrap win32-font usage with CAIRO_HAS_WIN32_FONT
Bug 19251: --enable-win32=yes and --enable-win32-font=no causes
compilation failure
[https://bugs.freedesktop.org/show_bug.cgi?id=19251]

Wrap use of the win32 font backend within win32-printing-surface within
CAIRO_HAS_WIN32_FONT ifdefs to prevent compilation failure if the user
explicitly disables the win32 font backend.
2009-05-22 16:41:57 +01:00
Chris Wilson
c7d2b0de83 [win32] Typo
Correct function name in error string.
2009-05-22 16:41:57 +01:00
Adrian Johnson
6e87e354e4 Correct the comment for the index_to_ucs4 font backend function 2009-05-17 18:14:28 +09:30
Adrian Johnson
2a34992ccc Ensure win32 font index_to_ucs4() sets ucs4 to -1 if lookup fails 2009-05-17 18:12:39 +09:30
Adrian Johnson
4c8e5485a1 Fix win32 build breakage
that was caused by c25992479a
2009-05-17 18:05:42 +09:30
Chris Wilson
31596cf2b2 [debug] Check image contents using memcheck.
As an aide to tracking down the source of uninitialised reads, run
VALGRIND_CHECK_MEM_IS_DEFINED() over the contents of image surfaces at the
boundary between backends, e.g. upon setting a glyph image or acquiring
a source image.
2009-05-15 21:31:03 +01:00
Chris Wilson
791a6fa399 [memfault] Update macros to avoid namescape collision with memcheck
Basing the macro names of the memfault skin lead to a namespace
collision with memcheck. After updating the headers, update cairo's usage
to match.
2009-05-15 21:31:03 +01:00
Chris Wilson
c897f36a6b [test] Stress the ft from-face cache
Create a set of font faces using the same FT_Face to stress test the
handling of from-face fonts within the backend cache.
2009-05-15 21:31:03 +01:00
Chris Wilson
477df1f550 [test] Clear expected floating point exceptions
test/invalid-matrix deliberately feeds garbage into the API to test our
error detection. This causes FPE to be raised during the course of the
test - so they are deliberately disable for the duration. However, the
exceptions were not being cleared and so the FPE could be triggered on
the next floating point operation. This was being masked during make check,
by the fact that each test is run in its own forked process and was only
observed when multiple tests were run in foreground mode.
2009-05-15 21:31:03 +01:00
Chris Wilson
f47a93ef30 [test] Check text->path with user-fonts (twin)
Check behaviour of user-fonts, twin in particular, when using the text as
a path.
2009-05-15 21:31:02 +01:00
Chris Wilson
669e7ae5c9 [test] Relax APPROX_EQUALS condition
The bounding box of the text is rounded to the nearest pixel boundaries,
so therefore the test must accept a similar level of imprecision.
2009-05-15 21:31:02 +01:00
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