Commit graph

10347 commits

Author SHA1 Message Date
Javier Jardón
40d6c580cd configure.ac: Do not generate template files when building docs
It's not needed as all the api documentation is inline
2012-04-14 15:06:24 +01:00
Javier Jardón
7b25b2eb4b autogen.sh: User autoreconf instead custom script 2012-04-14 15:04:19 +01:00
Javier Jardón
aa90a8f84f configure.ac: generate xz tarballs by default 2012-04-14 15:04:06 +01:00
Javier Jardón
3616a5f992 configure.ac: Update autotools configuration
Do not use autoconf deprecated macros
Use new libtool syntax
honor aclocal flags
2012-04-14 15:02:10 +01:00
Chris Wilson
93d42e82a4 Revert accidental push of ps debugging API.
This reverts commits
   6ad8c96fd8,
   a3f97d1d2e,
   25abe58298

I should know better by now than to push without checking for outstanding
changes.
2012-04-14 14:54:07 +01:00
Marcus Meissner
d486ea30f1 configure: Conditionally include -flto
As some systems fail to create working binaries with when linked with
lto, perform a check during configure.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39114
2012-04-14 14:48:32 +01:00
Chris Wilson
25abe58298 pdf (debug API): Export the ability to force fallbacks
We need to occasionally force fallbacks whilst testing the PDF
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 12:22:17 +01:00
Chris Wilson
a3f97d1d2e ps (debug API): Export the ability to force fallbacks
We need to occasionally force fallbacks whilst testing the PostScript
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 12:22:15 +01:00
Chris Wilson
6ad8c96fd8 ps (API): Export the ability to set the creation date of the surface
A PostScript surface embeds a CreationDate comment into its document
description pre-amble. Normally this is set to the time the surface is
written out, except we set this to a constant value in the boilerplate
for the purposes of mimicking a reference file. It may also be useful
for external applications, so make it a public export.

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-12 12:21:22 +01:00
Nis Martensen
bf5adaf394 doc: add returns statement to cairo_surface_supports_mime_type
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-12 10:23:28 +02:00
Nis Martensen
a6a5b1fd0b doc: no separate cairo-xcb-xrender section
There is already a cairo-xcb section and there are no symbols that
should be documented in an extra -xrender section. It is not mentioned
in cairo-sections.txt either. So simply delete it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-12 10:23:27 +02:00
Nis Martensen
c04f5a353f add unused symbols to sections doc
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-12 10:23:26 +02:00
Uli Schlachter
07fc63676d xlib: Disable fallback compositor with xlib-xcb
When xlib-xcb is enabled, this is just dead code which is never used. Thus, this
shouldn't hurt. However, this does include cairo-xlib-private.h. Shouldn't be a
problem? Well, that header contains static inline functions which some compiler
on Solaris will emit even when they are unused.

This brings us to the real problem: That static inline function refers to a
function which isn't compiled with xlib-xcb and thus linking fails with
undefined symbols.

This can be reproduced with GCC by adding a call to
_cairo_xlib_screen_put_gc(NULL, NULL, 0, 0); to
_cairo_xlib_fallback_compositor_get.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48489
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-11 21:37:55 +02:00
Gilles Espinasse
09de481ce5 Cosmetic configure fix
'how to allow undefined symbols in shared libraries' test should use CAIRO_CC_TRY_FLAG_SILENT or configure display is a bit out of order like this

checking how to allow undefined symbols in shared libraries used by test suite... checking whether gcc supports -Wl,--allow-shlib-undefined... yes
-Wl,--allow-shlib-undefined

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-10 17:46:13 +02:00
Adrian Johnson
c7b86ab97b any2ppm: fix missing enumeration warning 2012-04-10 22:34:05 +09:30
Maarten Bosmans
b74e8ebd50 Add _cairo_win32_print_gdi_error to boilerplate code
This function is not exported in libcairo, so can't be used from the
library.
2012-04-10 12:09:02 +01:00
Maarten Bosmans
0bb3e0769a test: Only use alarm() when SIGALRM is also defined
On some platforms (mingw) the alarm() configure check succeeds, but the
alarm function doesn't actually work.
2012-04-10 12:08:24 +01:00
Maarten Bosmans
9fcbe25c2d Protect code using dlfcn.h with CAIRO_HAS_DLSYM 2012-04-10 12:07:49 +01:00
Maarten Bosmans
3f32419257 test: Give some functions in any2ppm a prefix
The function name _write is too generic and can clash with already
defined functions.
2012-04-10 12:07:34 +01:00
Adrian Johnson
038e499191 pdf: avoid unnecessary use of patterns in mask groups 2012-04-09 21:27:08 +09:30
Adrian Johnson
2007f0ecce test: disable subsurface tests with vector backends
due to a subsurface snapshot bug causing recursion in the pdf backend.
2012-04-09 21:27:08 +09:30
Chris Wilson
7cb5053c06 analysis: Apply the integer translation to the bbox as well
The bbox is used to compute the ink extents (and so the pattern extents
of a recording surface) and if given an integer translation we failed to
transform the bbox into the target space.

Fixes mask (pdf).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-09 12:49:20 +01:00
Chris Wilson
de61681574 build: Disable -Wset-but-unused-variable
This is too noisy in the current build, and masking more important
warnings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-09 12:47:34 +01:00
Chris Wilson
113ec6bf0c traps: Clip the trapezoid extents against the clip extents
Just in case the clip polygon turns out to be much larger than the
operation extents (silly us for not reducing it correctly) and lead to
catastrophe, such as:

Program received signal SIGSEGV, Segmentation fault.
pixman_fill_sse2 (bits=<optimized out>, stride=4, bpp=8, x=0, y=0,
width=3, height=-34811, data=0) at pixman-sse2.c:3369
3369		    *(uint16_t *)d = data;

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 18:02:05 +01:00
Chris Wilson
6f28f0b33c stroke: Fix misuse of half_line_x for vertical caps on dashes
A typo using half_line_x instead of half_line_y when emitting dashed
segments of the rectilinear stroke.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-08 11:30:56 +01:00
Adrian Johnson
8657ca10e3 fix _cairo_pattern_get_ink_extents to work with snapshot recording surfaces
It had caused pdf bbox sizes to regress to page size bboxes.
2012-04-06 21:24:22 +09:30
Adrian Johnson
8886220b50 type1-subset: if font name is prefixed with a subset tag, strip it off 2012-04-06 09:45:56 +09:30
Adrian Johnson
a6d955fcc4 fix indentation in cairo_type1_font_subset_parse_charstring 2012-04-06 09:23:50 +09:30
Adrian Johnson
70b2856ed3 type1-subset: use fallback font if glyph widths are calculated
Bug 48349 has a pdf file with a Type 1 font where the glyph widths are
of the form:

34 9302 19 div hsbw
2012-04-06 09:13:35 +09:30
Adrian Johnson
7a262fd398 fix bug in _cairo_image_analyze_color 2012-04-04 19:53:09 +09:30
Henry (Yu) Song
cc247c346b gl: Remove an unused variable 2012-04-02 14:39:54 -07:00
Uli Schlachter
c77112c546 xcb: Fix SHM in _get_image()
Commit 2283ab9 introduced a logic error. Instead of falling back to the non-SHM
path when getting the image via SHM failed, we now did the fallback when getting
the image via SHM worked (which means that the SHM operation was a waste of
time).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-02 21:02:24 +02:00
Kalev Lember
d18542b735 win32: Avoid redefining ssize_t
... if it's already defined by system headers. mingw-w64 includes a
ssize_t definition, so we'll have to make sure not to redefine it in
that case.
2012-03-29 21:13:21 +01:00
Henry (Yu) Song
a965b0f95f gl: fix y-axis origin when map_to_image() for non texture GL surface
We need to fix y-axis origin when map a GL surface to image surface for
non-texture GL surface.

Test cases: extended-blend-alpha-mask, extended-blend-mask.
Although the image outputs is not right, but the image on the first grid
(upper-left corner) is correct comparing to image output.
2012-03-29 15:06:11 +01:00
Chris Wilson
af6e084dd7 cairoint: Mark PDF surface as requiring the deflate stream output
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-29 14:48:24 +01:00
Chris Wilson
169cc39dff test: update two reference images highlighted to be wrong due to source extents
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-29 11:58:35 +01:00
Andrea Canciani
f0e40af05b doc: Silence last 'missing Since field' errors
Some APIs are public but not yet supported, hence they might chenge
without notice. State their "Since" status as "to be determined".
2012-03-29 11:03:19 +02:00
Andrea Canciani
5174c585de doc: Silence warnings about 'Since' field in private functions
A 'Since' field on non-public functions is not very meaningful,
because their signature, implementation and semantic is subject to
change without any visibility outside of cairo.
2012-03-29 11:03:19 +02:00
Andrea Canciani
dc1f5f1b00 doc: Add since documentation for enumeration values 2012-03-29 11:03:19 +02:00
Andrea Canciani
2470065edf doc: Fix some wrong versions
The script from the previous commit reported that some 'Since' fields
indicate incorrect versions.
2012-03-29 11:03:18 +02:00
Andrea Canciani
1d3d64469f doc: Add "since" tag to documentation
The following Python script was used to compute "Since: 1.X" tags,
based on the first version where a symbol became officially supported.

This script requires a concatenation of the the cairo public headers
for the officially supported beckends to be available as
"../../includes/1.X.0.h".

from sys import argv
import re

syms = {}

def stripcomments(text):
    def replacer(match):
        s = match.group(0)
        if s.startswith('/'):
            return ""
        else:
            return s
    pattern = re.compile(
        r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
        re.DOTALL | re.MULTILINE
    )
    return re.sub(pattern, replacer, text)

for minor in range(12,-2,-2):
    version = "1.%d" % minor
    names = re.split('([A-Za-z0-9_]+)', stripcomments(open("../../includes/%s.0.h" % version).read()))
    for s in names: syms[s] = version

for filename in argv[1:]:
    is_public = False
    lines = open(filename, "r").read().split("\n")
    newlines = []
    for i in range(len(lines)):
        if lines[i] == "/**":
            last_sym = lines[i+1][2:].strip().replace(":", "")
            is_public = last_sym.lower().startswith("cairo")
        elif is_public and lines[i] == " **/":
            if last_sym in syms:
                v = syms[last_sym]
                if re.search("Since", newlines[-1]): newlines = newlines[:-1]
                if newlines[-1].strip() != "*": newlines.append(" *")
                newlines.append(" * Since: %s" % v)
            else:
                print "%s (%d): Cannot determine the version in which '%s' was introduced" % (filename, i, last_sym)
        newlines.append(lines[i])

    out = open(filename, "w")
    out.write("\n".join(newlines))
    out.close()
2012-03-29 11:03:18 +02:00
Andrea Canciani
79740139e0 doc: Do not use the '@' prefix on some tags
Make the 'Since' and 'Returns' tags consistent by removing the '@'
prefix.

Fixes some "missing 'Since' field" warnings.
2012-03-29 11:03:18 +02:00
Andrea Canciani
bbafcb3de8 doc: Make the documentation name match the function name
Fixes the 'symbol not found' errors caused by mismatches between the
documentation name and the name in the code.
2012-03-29 11:03:18 +02:00
Andrea Canciani
7f635e4ead doc: Make doc ids more consistent my always putting ':' after them
This makes the documentations comments more consistent and fixes many
reports of 'invalid doc id'.
2012-03-29 11:03:18 +02:00
Andrea Canciani
eaac0fa87e doc: Manually fix remaining warnings about symmetry
The Python script is unable to fix all of the warnings, because some
point to comments that are not actually documentation.

Fixes the remaining 'documentation comment not closed with **/'
warnings.
2012-03-29 11:03:18 +02:00
Andrea Canciani
f717341ab9 doc: Make documentation comments symmetric
Documentation comments should always start with "/**" and end with
"**/". This is not required by gtk-doc, but it makes the
documentations formatting more consistent and simplifies the checking
of documentation comments.

The following Python script tries to enforce this.

from sys import argv
from sre import search

for filename in argv[1:]:
    in_doc = False
    lines = open(filename, "r").read().split("\n")
    for i in range(len(lines)):
        ls = lines[i].strip()
        if ls == "/**":
            in_doc = True
        elif in_doc and ls == "*/":
            lines[i] = " **/"
        if ls.endswith("*/"):
            in_doc = False

    out = open(filename, "w")
    out.write("\n".join(lines))
    out.close()

This fixes most 'documentation comment not closed with **/' warnings
by check-doc-syntax.awk.
2012-03-29 11:03:18 +02:00
Andrea Canciani
c0fc24c889 doc: Make informational comments syntactically different from docs
This avoids confusion with the documentation comments and fixes some
malformed docs reports.
2012-03-29 11:03:18 +02:00
Andrea Canciani
71123cffe0 doc: Add script to enforce stricter validation of documentation comments 2012-03-29 11:03:18 +02:00
Chris Wilson
d304f0e57b composite-rectangles: Trim extents for SOURCE and CLEAR to the mask
The SOURCE and CLEAR are the odd pair in Cairo's range of operators that
are bound by the shape/mask, but are unbound by the source. This
regularly leads to bugs as only track the bound/unbound rectangles and
confuse the meaning when bound only by the mask.

What is required is that the unbound extents in this case is only
trimmed by the mask (the bounded extents are still the intersection of
all).

Fixes bug-source-cu

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-29 00:51:46 +01:00
Chris Wilson
5b3d878c82 test: Add test case for tracking source operator extents 2012-03-29 00:51:46 +01:00