Commit graph

10314 commits

Author SHA1 Message Date
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
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
06ffa0199c README: Note that xcb is no longer experimental
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-27 21:25:07 +02: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
841b4057bc version: Post release bump to 1.12.1 2012-03-23 20:16:44 +00:00
Chris Wilson
a0bf6d25b5 version: bump for 1.12.0 release! 2012-03-23 19:33:07 +00: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
c5b8cfab87 test: Tweak the results summary
Fix up the rules for the new directory structure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-23 12:26:25 +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
Chris Wilson
c504dba5a7 damage: Fix memcpy size
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 20:09:52 +00:00
Chris Wilson
eafa127001 compositor: Add tracing for damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 20:09:52 +00:00
Chris Wilson
86a89a8c1d win32: Check for damage before blitting
During the surface flush, we reduce any pending damage and then blit. If
no damage had been accrued then the damage->region would be NULL leading
to a segfault.

Patch suggested by Szuromi Gábor.

Reported-by: Szuromi Gábor <kukkerman@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47605
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-20 19:16:36 +00:00
Chris Wilson
0a778d974f stroke: Adapt rectilinear stroker to handle separable non-unity scaling
Reported-by: Christos Sotiriou <csotiriou@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 20:02:50 +00:00
Henry (Yu) Song
1e4f385dec boilerplate/gl: set width and height to be at least 1 2012-03-19 11:01:47 +00:00
Dongyeon Kim
a473c03567 trace: Wrap GL surfaces 2012-03-19 10:36:08 +00:00
Chris Wilson
a3612610b1 gl: Manually invert images without MESA_pack_invert extension
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 10:36:08 +00:00
Kouhei Sutou
cc98926cde skia: add a missing header into archive 2012-03-19 10:28:56 +00:00
Chris Wilson
f5b5fad66e trace: Add breadcrumb for cairo_image_surface_get_data()
Just emit a marker for when cairo_image_surface_get_data() is called on
a surface so that we have a breadcrumb for when the pixels are first
exported. (Though note that pointer may be kept around and used much
later.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 11:58:51 +00:00
Henry (Yu) Song
efb2018309 scaled-font: Ignore empty glyphs when checking for potential overlap
A zero-sized box contains no pixels and so cannot overlap, but it does
still need to contribute to the extents.
2012-03-13 18:57:47 +00:00
Chuanbo Weng
91113a9e45 subsurface: Avoid potential crash when subsurface's size is less than 0
When cairo_surface_create_for_rectangle() is given non-integer parameters,
the subsurface's size may be negative(e.g x = 0.2, width = 0.7, the
final width will be -1). This illegal surface may cause crash somewhere
upon later use, and although the fractional subsurface is ill-defined,
we should never crash!
2012-03-13 11:19:23 +00:00
Chris Wilson
d67f02e23e spans-compositor: Only destroy the clip if we made the copy
The extents->clip may be replaced elsewhere and so we cannot assume that
simply because it changed from the stashed value, that it was us that
made that copy. So becareful to only free our copy.

Fixes a double-free of a clip after a complex fallback operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-13 11:16:39 +00:00