Commit graph

10818 commits

Author SHA1 Message Date
Behdad Esfahbod
ff233fd706 [test] Set font size
Previously this test was working because we were not scaling bitmap
fonts.  We do now, so adjust test.
2013-03-18 14:18:13 -04:00
Matt Sealey
be347acd5a gitignore: negate gitignore for static pkgconfig files
Commit 781f253 adds a rule cairo-*.*.* to .gitignore in the root dir.
Unfortunately this matches several src/cairo-*.pc.in files in the
src directory.

The build system requires these files to be present, but the rule is
allowing them to be ignored. For example, when extracting a cgit
snapshot tarball and checking it into another git repository, these
files get left behind. Any accidental changes to these files will go
unnoticed by a 'git status' (possibly creating bad installs) and
any intentional changes could not be committed (git commit -a will
miss them, and every one will need to be forced). This is not really
desirable.

We don't want to unignore *.pc.in here since there are many, many
autogenerated files with this name, and the cairo-*.*.* rule is in
general quite useful and doesn't warrant modification (although it
could be made a little more specific), so we just make these 4 files
a special case and negate the match with full filenames in src/.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-18 14:02:02 +01:00
Matthew Fischer
0e999edff8 Adding a simple usage statement to cairo-perf-chart
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-18 13:59:37 +01:00
Uli Schlachter
592f594423 test: Fix CAIRO_REF_DIR
Ever since the test output was moved from test/ to test/output/, using
CAIRO_REF_DIR to make the test suite succeed no longer works. The test suite was
looking for the wrong file names.

This patch makes this work again. However, I am not sure that this really is the
correct fix. It just seems to work. :-)

Reported-by: Darxus <darxus@chaosreigns.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-15 16:56:42 +01:00
Marek Kasik
c141615a7f cff-subset: Fix allocation of width arrays
fd_default_width and fd_nominal_width
are arrays of doubles not arrays of ints.
2013-03-15 14:01:53 +00:00
Chris Wilson
01a8bf01c6 mempool: Reduce an assert into an error return for get_buddy()
If we ask for a buddy that is outside of our allocation that is an
error that should not happen with a power-of-two allocated zone...
However, since it has been seen in the wild, we can safely return that
there is no buddy rather than die in a too-late assert.

Reported-by: Anton Eliasson <devel@antoneliasson.se>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-15 09:11:28 +00:00
Martin Robinson
2c2dccf5a4 stroke: Use round-joins near inflection points of splines
Similar to b7bd5ae4f3, but applied to the
fallback stroke shaper.
2013-03-14 10:32:43 -07:00
Martin Robinson
aadece05fb stroke: Fix large line widths for fallback stroke shaper
Fix the test case line-width-tolerance for the fallback stroke shaper.
Instead of drawing quads between spline points, draw triangle based on
the actual spline edges. This roughly follows the approach of the
tristrip and polygonal shapers.
2013-03-14 10:32:43 -07:00
Martin Robinson
c60e23feb1 path: Fix a bug in line intersection
Before the intersection code was not taking into account that both
quotients are required to be in the range (0,1) for the segments to
intersect or handling the case of negative numerators and denominators.
2013-03-14 09:44:35 -07:00
Martin Robinson
5ee136b2c0 gl: Setup operands when the vertex size changes
Previously _cairo_gl_composite_setup_vbo was overwriting the old context
vertex_size, while _cairo_gl_context_setup_operand was relying on it to
determine if the vertex size changed. Instead of a fragile ordering of
statements, pass whether the vertex size changed as an argument to enforce
the calling order via method parameters.
2013-03-08 16:00:34 -08:00
Chris Wilson
f50ced2e7b gl: Fix typo s/bool/cairo_bool_t/
One quickly gets used to having stdbool.h available.
2013-03-08 14:25:26 +00:00
Henry Song
524e6fd3e8 gl: Export query for EGLContext and EGLDisplay from device
Similar to glx, add query for the EGLContext and EGLDisplay to egl-based
cairo devices.
2013-03-08 11:43:39 +00:00
Behdad Esfahbod
a8f1b456db [FT] Prefer downscaling bitmap glyphs to upscaling
Say, you have bitmap strikes for sizes 50ppem and 100ppem.
To render at 60ppem, it's much better to downscale the 100ppem
bitmap than upscale 50ppem one.  Prefer downscaling.
2013-03-08 06:22:59 -05:00
Jana Saout
4f00d2344c pdf: Fix crash
Bug 61451
2013-03-01 20:10:28 +10:30
Chris Wilson
7658eced9a xlib: Fix invocation of XRenderFindFormat()
The 'count' parameter is an indication to libXrender of the number of
matches to skip before reporting (rather than a limit on the number to
report). As we only want the first match, always pass 0.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-24 17:07:54 +00:00
Adrian Johnson
446a3dc5c0 pdf: add missing 'endobj' to shading dict
https://bugs.launchpad.net/ubuntu/+source/libcairo/+bug/1051939
2013-02-19 20:59:16 +10:30
Chris Wilson
e7e1ac235f image: Compare against the true size of the embedded buffer
When querying whether the run is small enough to fit inside the
pre-allocated temporary buffer, we need to avoid comparing against
sizeof(buf) as buf is a variable length array and so sizeof() is
meaningless.

Reported-by: Edward Zimmermann <Edward.Zimmermann@cib.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-19 09:54:24 +00:00
Chris Wilson
fb1abbc4bc win32: Free the fallback upon finish
Zozó Teki pointed out that we leak the fallback surface upon finish in
case it was active at the time as the preceding flush would only clear
the damage and not decouple the fallback surface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-15 14:08:11 +00:00
Henry Song
41e646e019 gl: disable GL_DITHER
GL_DITHER is enabled by default by spec. Leaving GL_DITHER enabled
causes color pixel mismatch on some drivers by comparing uploading then
readPixels and original image.
2013-02-15 12:00:38 +00:00
Chris Wilson
02b467a287 test: Exercise replaying a recording surface through a flip matrix 2013-02-12 10:46:42 +00:00
Chris Wilson
a09b7c7927 path: Fix bbox computation for negative scale factors
The fast path for transforming a path by a simple scale factor, forgot
to fix up the orientation of the box if that scale factor was negative.

Reported-by: Edward Zimmermann <Edward.Zimmermann@cib.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-12 10:27:58 +00:00
Chris Wilson
be1561dade recording: Avoid indirection through indices array if not reduced
If we don't discard any elements, then the index array is simply a 1:1
mapping of the element array, and we may as well bypass it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-12 10:24:08 +00:00
Chris Wilson
14237f1143 spans: Mark the surface as cleared in preparing for recording surface playback
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-12 10:11:12 +00:00
Chris Wilson
7f3cca458a Post release version bump to 1.12.15 2013-02-10 14:18:47 +00:00
Chris Wilson
0dac37c414 1.12.14 release 2013-02-10 13:38:28 +00:00
Chris Wilson
93ddc3a283 tests: Update reference images after adjustments to polygon line clipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-10 13:13:31 +00:00
Chris Wilson
d4651676e1 win32: Clear the similar-image before returning to the user
Our userspace API mandates that surfaces created for the user are
cleared before they are returned. Make it so for the win32 similar image
constructor.

Reported-by: Michael Henning <drawoc@darkrefraction.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60519
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-08 22:17:13 +00:00
Chris Wilson
2d7ac9e737 xlib: Only apply the dst offset to the glyph strings once
The elts offset is a delta from the previous glyph coordinate. So by
subtracting the dst origin everytime, we were accumulating a glyph
position error. Instead we just want to offset the starting coordinate
and then always use relative positions.

Reported-by: Theo Veenker <T.J.G.Veenker@uu.nl>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-08 15:20:41 +00:00
Chris Wilson
ea16302e45 polygon: Avoid computing the unused intersection coordinates
If we only ignore the result of the computed boundary intersection,
because the edge is inside that boundary, then we can simply forgo the
calculation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-08 13:22:01 +00:00
Chris Wilson
8cfbdf2f02 polygon: Only rely on the computed boundary intersections for crossing edges
If we need to extrapolate the edge to the boundary, then we run the risk
of an overflow for an immaterial result. So if the edge does not cross
the boundary, we can simply use the corresponding end-point and not emit
the boundary segment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60489
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-08 13:13:30 +00:00
Chris Wilson
607a15db5d gl: Mark up _cairo_gl_composite_set_operator* as private
Add the cairo_private markup to hide the PLT entries and to keep make
check happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-07 21:40:30 +00:00
Ravi Nanjundappa
562cc8227f gl/spans: Handle SOURCE operations with opaque sources.
SOURCE operations with an opaque are equivalent to OVER.
This can prevent us from falling back in certain cases.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-07 13:25:33 -08:00
Chris Wilson
4b6b28b5e8 win32: Fix is_win98()
Since the translation into a separate function, its condition was
reversed: that is almost everybody thought they were on a win98 machine
and so had no working AlphaBlend().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-07 10:02:31 +00:00
Chris Wilson
4b54c09c05 image: Substitute OVER spans for SOURCE with an opaque pattern
Based on an idea from Ravi Nanjundappa

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-07 10:02:31 +00:00
Martin Robinson
400ea9c290 gl/msaa: Properly fall back when using CLEAR operator
There are some situations that the MSAA compositor doesn't support using
the CLEAR operator. We should properly fall back in those cases.
2013-02-06 12:53:14 -08:00
Adrian Johnson
7bee1962f6 type1-subset: in latin subsets replace glyph names with standard names
When using WinAnsiEncoding in PDF the glyphs are keyed by glyph
name. We need to ensure the correct names are used and can't assume
the glyph names in the font are correct.

Bug 60248
2013-02-05 21:57:52 +10:30
Henry Song
4cb181d985 gl: do not force flush everytime uploading a glyph image to glyph cache
In normal cases, we want to flush pending operations reading from the
texture before modifying its contents.  However during uploading of
glyphs into the glyph cache, we repeatedly modify the texture as we
construct the vbo (whilst referencing it for that operation). We track
unused areas in the glyph cache so that if we run out of space, we can
explicitly flush the pending glyphs and start afresh and avoid having to
flush the operation in common case.
2013-02-04 10:49:37 +00:00
Chris Wilson
260c16331a gl: Include the vertex ident in the shader cache hash
As we may specialise the vertex program depending upon details of the
fragment shader, and may have more than one program for the same
combination of fragment sources, we need to include the vertex tag in
the cache entry.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-04 10:49:36 +00:00
Chris Wilson
05ad89f912 gl: Replace manual vertex transformation with VS computation of texcoords
Not only is our point transformation code is quite slow (well at least
compared to a real GPU), but by deriving the texture coordinates from
the vertex position we can elide the multiple arrays that we need to
construct and pass to GL - improving performance by eliminating CPU
overhead from needless transforms and data shovelling.

However, not all vertex emission is suitable. For instance, for glyphs
we need to emit discontiguous texture coordinates for each glyph, but
span generation is suitable - which fortuitously also has the largest
vertex density and so benefits the most.

The only real concern is for hardware without true vertex shader support
(e.g. i915) but there we are already invoking the VS to transform the
vertex into the viewport. We would need to eliminate that transform as
well as manually compute the texture coordinates in order to eliminate
the vertex recomputation pass.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-04 09:57:53 +00:00
Chris Wilson
d15a71f128 qt: Update for fallback compositor
We now need to explicitly manage fallbacks and to provide an
implementation for map-to-image/unmap-image.
2013-02-03 12:51:13 +00:00
Chris Wilson
10110d58ce surface: Prevent reads from the user-data arrays during teardown
In a similar fashion to the previous commit, we also need to be wary of
users simply trying to read from a potentially freed user-data array.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-02 09:00:45 +00:00
Chris Wilson
18cff63e3d surface: Prevent writes to the user-data arrays during teardown
As we cleanup the user-data arrays, we call the user provided destroy
notifier callbacks. These callbacks are at liberty to write back into
the parent surface, and in particular try to write into the arrays that
we have just freed. This causes hard to control and fairly unpredictable
use-after-frees in the client, so lets just rule out the dangerous
behaviour.

References:https://bugzilla.mozilla.org/show_bug.cgi?id=722975
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-02 08:55:37 +00:00
Chris Wilson
c391093f40 image: Add a convenience function for creating an image from another's data
The GL backend would like to extract a rectangle from another surface
and convert it to a different pixel format. The
_cairo_image_surface_create_from_image() does that by returning a new
image that has the contents of the specified rectangle in the source

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-02-01 16:36:03 +00:00
Chris Wilson
15830fdb10 NEWS: fix a couple of typos
Reported-by: Thierry Vignaud
2013-01-31 18:50:39 +00:00
Chris Wilson
28dbafd564 Post release version bump to 1.12.13 2013-01-31 16:23:24 +00:00
Chris Wilson
a201a1169f 1.12.12 release 2013-01-31 15:24:33 +00:00
Chris Wilson
350f9fb536 test: Refresh refs for aa noise following reduction of the 2-stage compositing
A side effect of

commit c986a7310b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jan 24 08:55:54 2013 +0000

    image: Enable inplace compositing with opacities for general routines

is that we should in theory be reducing the rounding errors when
compositing coverage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 15:15:03 +00:00
Chris Wilson
22b7fae036 image: Add a reference for the clone's parent image
We use the parent as a flag during map-to-image/umap-image that the
resultant image came from a fallback rather than as direct call
to the backend's map_to_image(). Whilst we use it as a simple flag,
we need to make sure the parent surface obeys the reference counting
semantics and is consistent for all callers.

Unlike other users of the parent pointer, there is no resource sharing
between the two surfaces.

Reported-by: Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 14:19:53 +00:00
Chris Wilson
ec58fde294 perf: Synchronize before stopping the timers
Fixes a regression from

commit 2855ff4666
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Wed Aug 31 16:42:03 2011 +0200

    perf: Reuse cairo-time

which dropped the essential call to synchronize when refactoring the
code.

Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-31 14:06:48 +00:00
Chris Wilson
2560c0b657 xlib/shm: More clarification of seqno required
Everytime I read the predicate wrong, but hopefully, this time I have it
right!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 23:51:44 +00:00