| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
To stop gtk-doc from listing them as undocumented.
|
|
|
|
| |
as it is used by FT as well as user fonts.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is _cairo_recording_surface_replay_and_create_regions()
stores the cairo_recording_region_type_t in the same structure as the
recording commands. This does not work well when the recording surface
is used as source by multiple surfaces
Fix this by moving the cairo_recording_region_type_t into a separate
struct cairo_recording_regions_array_t. This struct is stored in a
list that allows multiple create regions results to be store in the
surface.
The new function _cairo_recording_surface_region_array_attach() is
used to create a new cairo_recording_regions_array_t, attach it to the
recording surface and return a unique region id.
The _cairo_recording_surface_replay_and_create_regions() and
_cairo_recording_surface_replay_region() functions use this region id
to identify the cairo_recording_regions_array_t.
To handle nested recording surfaces, when replaying a recording, the
region id is passed to the target as an extra parameter in the surface
pattern. The wrapper surface makes a temporary copy of the pattern to
ensure the snapshot pattern in the recording surface is not modified.
cairo_recording_regions_array_t has a reference count so the target
can hold on to the cairo_recording_regions_array_t after the paginated
surface has called _cairo_recording_surface_region_array_remove().
|
| |
|
| |
|
|
|
|
|
|
| |
For the various APIs that take or return
RGBA colors, make it explicit that they are
unpremultiplied.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
On 64-bit windows, long is 32-bit. When compiling there are a large
number of warnings about mismatched sizes when casting long to/from a
pointer.
Use the (u)intptr_t type for any integer that will have a pointer stored
in it. Use a (u)intptr_t cast when integers are stored in pointers to
silence warnings.
Fixes #263
|
|
|
|
|
|
|
| |
Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint`
Follow up of 12cb59be7da
Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
|
|
|
|
|
| |
Commit 38806bc3 already disabled the backend from use, now drop the
code.
|
|
|
|
|
|
|
|
|
|
| |
_cairo_malloc(0) always returns NULL, but has not been used
consistently. This patch replaces many calls to malloc() with
_cairo_malloc().
Fixes: fdo# 101547
CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
| |
|
|
|
|
|
|
|
| |
"This function returns the type a pattern." is obviously missing 'of',
but this can be stated more succinctly with active voice.
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
|
|
|
|
|
|
|
| |
"can be get" is incorrect grammar; "can be gotten" would be better, but
active voice is best.
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some debugging functions wrote to stdout, which is inconsistent with
the other debugging functions of the same groups.
Instead they should write to the debugging file that they are given as
input.
Reviewed-by: Andrea Canciani <ranma42@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227
|
| |
|
|
|
|
|
|
|
|
| |
In this bug a Type 3 font contains a dash glyph. The dash glyph
consists of an 82x2 image. The image height, when scaled to user space,
is < 1 resuling in the drawing operation for the image being culled.
https://bugs.freedesktop.org/show_bug.cgi?id=94615
|
| |
|
|
|
|
|
|
| |
Modify PDF surface to allow surface extents to have negative x, y.
When emitting recording surfaces, set the surface extents to the
recording extents.
|
|
|
|
|
|
|
| |
While this fixed a real bug, in testing this patch was found to fail a
number of tests and thus needs further work.
This reverts commit e7acf4b6dc6666c2a2c54fb08e9ad6f01a1d415f.
|
|
|
|
|
|
|
|
|
| |
Marking stack-allocated objects as no-access creates false positives,
which distract from finding real memory errors.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52548
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
That is if the difference between the origin and the end is bigger than
.5 round up regardless of the coordinates.
Round the difference of the floats instead of rounding the floats then
diff them.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84396
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
| |
$ ./check-doc-syntax.sh
Checking documentation for incorrect syntax
./cairo-pattern.c (3342): ERROR: Will invalid doc id (should be 'cairo_...:')
The proposed changes fixes the warning about the documentation style used in cairo.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./check-doc-syntax.sh
Checking documentation for incorrect syntax
./cairo-pattern.c (3346): ERROR: Will bad line: ' */'
./cairo-pattern.c (3346): ERROR: Will documentation comment not closed with **/
./cairo-pattern.c (3422): ERROR: _cairo_pattern_sampled_area invalid doc id (should be 'cairo_...:')
The warnings are about the documentation style used in cairo
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
|
|
|
|
|
| |
Fixes failure in make release-check due by check-preprocessor-syntax.sh
due to requirement that cairoint.h be the first include for source files.
|
|
|
|
|
|
|
|
|
|
|
|
| |
New implementations of _cairo_pattern_sampled_area and _cairo_pattern_get_extents
which produce a more accurate bounding box. These do not depend on side-effects
of analyze_filter, can handle different horizontal and vertical scales, filters
wider than 1 for down-scaling, and compute a somewhat tighter bounding box
in most cases.
I removed the pad output of _cairo_pattern_analyze_filter as it is unused.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
|
|
|
|
|
|
|
|
| |
The analysis to deterimine if the GOOD filter can be replaced with
the BILINEAR filter is moved to this function so it can be used
by backends other than the image backend.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
|
|
|
|
|
| |
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(changed to use determinant funciton and remove debug printf)
Modifies _cairo_matrix_has_unity_scale to return true for 90 degree rotations
by allowing error caused by inaccuracy in trig functions.
This fails after 14 additions of M_PI_2 to itself as a float argument to
cairo_rotate, but the failure is in the detection of the integer translate,
not in the trig components. I believe this is due to the matrix inversion,
which may need similar rounding.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
| |
Replaces documentation of the form "range 0 to 1 less than the number"
with "ranges from 0 to n-1 where n is the number", which is idiomatic
mathematical writing and less ambiguous.
Signed-off-by: jimmyfrasche <soapboxcicero@gmail.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When creating a transformed pattern we must apply the device
transform *before* the transform set on the pattern itself, otherwise
e.g. its translation will not be affected by the device scale.
We also fix up the device_transform related handling in
_cairo_default_context_pop_group(). With a device scale we can
no longer just use the device_transform_inverse to unset the
device offset for the extents, so we make that a simple translate
instead.
We also remove some weird code that tries to handle the device
transform but seems unnecessary (maybe a workaround for applying
the device transform in the wrong order?). With that code removed
things work fine, but with it things get translated wrongly when
there is a scale.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to prevent a race between concurrent destroy and use in another
thread, we need to acquire a reference to the snapshot->target under a
mutex. Whilst we hold that reference, it prevents the internal destroy
mechanism from freeing the memory we are using (if we have a pointer to
the original surface) and the client drops their final reference.
Oh boy, talk about opening a can of worms...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
| |
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
| |
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
| |
It had caused pdf bbox sizes to regress to page size bboxes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()
|
|
|
|
|
| |
This makes the documentations comments more consistent and fixes many
reports of 'invalid doc id'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
Using the programlisting tag is not appropriate everywhere. Use the
screen tag where the formatting shall be preserved and the text is no
code listing.
Also add whitespace to prevent gtk-doc from inserting paragraph breaks.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
| |
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
|
| |
The pattern creation function call in the example code has one _mesh too
much. This hopefully fixes the mesh mismatch mess :)
Signed-off-by: Nis Martensen <nis.martensen@web.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
|
|
|
|
|
| |
In the example code, the mesh pattern variable was named "mesh" and
"pattern". Just use "pattern".
Signed-off-by: Andrea Canciani <ranma42@gmail.com>
|
|
|
|
| |
And reuse it.
|
|
|
|
|
| |
No matter what the sampling extents are, infinite color-only sources
are opaque.
|
|
|
|
|
|
| |
Stop confusing gtk-doc with this private function.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
|
|
| |
As discussed, overloading the cairo_surface_t semantics to include
sources (i.e. read-only surfaces) was duplicating the definition of
cairo_pattern_t. So rather than introduce a new surface type with
pattern semantics, start along the thorny road of extensible pattern
types.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
|
|
|
|
|
|
|
|
|
|
|
| |
There are some inkscape bugs reporting very slow rendering of inkscape
generated PDFs (inkscape uses cairo for PDF output). These bugs are
caused by cairo specifying a page sized bounding box in XObjects and
Patterns. PDF renderers usually use the BBox as the image size when
compositing. As PDFs generated from SVG tends to use a lot of XObjects
and Patterns this can lead to very long rendering times.
These three patches tighten up all the BBoxes in PDF output.
|
|
|
|
| |
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|