Commit graph

6583 commits

Author SHA1 Message Date
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
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
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
Adrian Johnson
038e499191 pdf: avoid unnecessary use of patterns in mask groups 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
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
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
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
Henry (Yu) Song
fba21ef2a4 gl: use font's antialias option to check whether it needs mask
There is need to loop over number of glyphs to check wether the glyph
image is a ARGB32 as the font's antialias option can be used for checking.
If antialias is SUBPIXEL or BEST, the glyph surface will be ARGB32,
otherwise it will be A8 format. Therefore we will only be using
component-alpha at SUBPIXEL (or better) font quality and only then need
a mask for multiple pass glyph composition.
2012-03-27 23:29:12 +01:00
Uli Schlachter
c4d1063e03 xcb/xlib: Add missing "Since: 1.12"
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-26 20:17:10 +02:00
Behdad Esfahbod
f5f8915df2 Fix another typo 2012-03-25 15:11:57 -04:00
Behdad Esfahbod
81c848c839 More typo fixes 2012-03-25 15:02:36 -04:00
Behdad Esfahbod
73cde7a0f6 Fix typos 2012-03-25 15:00:44 -04:00
Behdad Esfahbod
ede11b2954 Fix math in comments 2012-03-25 14:38:39 -04:00
Behdad Esfahbod
2721d05d69 Typo 2012-03-25 14:38:38 -04:00
Chris Wilson
9cb7586fb0 cairo: Add some missing doc entries for cairo_raster_source_pattern_t
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 18:09:19 +00:00
Chris Wilson
8416b40f43 win32: mark-dirty cannot assume the fallback has been discarded
Flushing only releases the fallback if we flush twice with no
intervening damage (the theory is to try and reduce readbacks). So it is
possible for a correctly behaving application to call mark-dirty and there
still be a fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 18:09:19 +00:00
Igor Oliveira
2121887030 gl: GL_UNPACK_ROW_LENGTH does not accept negative values
Use the slow fallback path if passed an image with a negative stride.

Fixes negative-stride-image.
2012-03-23 16:54:22 +00:00
Chris Wilson
60549f7a56 win32: Copy back the fallback damage to the right location
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 13:06:28 +00:00
Chris Wilson
8a65d8e2de image: Fix leak of white solid color for masked composition of CLEAR
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 00:34:45 +00:00
Henry Song
bc97bcf0ef gl: use direct mode for uploading gradient texture
The gradient is relatively small and any differences between upload
methods should be hidden by the caching. As it stands, using pbo with
the gradient fails with fglrx. As the workaround to use a simple
TexImage2D is inconsequential (may even be a minute win) and simplifies
the code, just do it.
2012-03-22 23:13:30 +00:00
Chris Wilson
02e3b6bc80 directfb: Tweak, tweak, tweak.
A couple of mistakes, such as inverting the logic as to when to flush
damage back from the shadow, meant that nothing happened when drawing to
the directfb surface.

Again still only compile tested.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 14:27:31 +00:00
Chris Wilson
be8a5f13b7 win32: Remove obsolete font rendering routines
These are now done by cairo-win32-gdi-compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 12:28:46 +00:00
Chris Wilson
28b3831223 win32: Hook up glyph creation again
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-22 12:28:46 +00:00
Chris Wilson
9bb5b02694 win32: Fix damage flushing
The damage wasn't being created on the right surface, so the damage to
the fallback image surface was not being tracked. Perform a little bit
of juggling so that we track dirty regions on the fallback surface itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 20:09:52 +00:00