Commit graph

10845 commits

Author SHA1 Message Date
Chris Wilson
a2d8524973 test: Expand testing of caps for fine strokes 2013-06-04 11:52:26 +01:00
Chris Wilson
85c2a0d76a xlib: Unlike the visual when destroying it
Otherwise we leave dangling pointers in the visual list, leading to
memory corruption when using low bitdepth servers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-03 13:56:00 +01:00
Chris Wilson
41bef0fc38 traps: Ensure that we correctly clip when using multiple clip boxes
We need to be more careful when trying to discard a clip to be sure that
it is truly not required. In particular, we need to not throw a way a
clip region when it has more than one box intersecting the mask.

Reported-by: Alexander Larsson
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=697357
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-30 21:05:23 +01:00
Chris Wilson
631bf29925 directfb: Correctly chain up map-to-image/unmap to the image backend
Fixes the infinite recursion reported by jojo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 11:36:27 +01:00
Martin Robinson
728e58e60f gles: Switch default framebuffer destinations properly
Make _cairo_gl_context_bind_framebuffer handle different types of GLES
surfaces properly Since, the multisampling setting of a surface never changes
in for GLES, so the first thing we do when setting the destination is to
ignore the requested multisampling setting. This simplifies all
following logic.
2013-05-13 15:24:55 -07:00
Martin Robinson
1704292e49 gl: Fix compiler warnings in the GL backend 2013-05-07 12:01:17 -07:00
Martin Robinson
e83943ec9a gl: Bind the default framebuffer before calling gl{Read|Draw}Buffer
Fix more fallout from separating framebuffer binding from setting the
destination. In some cases it is sufficient to call
glDrawBuffer/glReadBuffer before binding the framebuffer, but the
masking-filling-stroking test of cairo-gl-smoke-tests fails if the order
is incorrect.
2013-05-06 10:56:26 -07:00
Martin Robinson
32bd6aa46d gl: Update transformation when surface size changes
In my previous commit I mistakenly removed the transformation matrix
update when cairo_gl_surface_set_size is called. This change restores
it.
2013-04-26 15:22:48 -07:00
Martin Robinson
8da704ca7c gl: Separate framebuffer bind from destination selection
Disentangle the action of binding the framebuffer from setting the
destination. This straightens up the code a bit and avoids some redundant
operations (such as reacquiring the context) when simply switching from
the multi-sample framebuffer to the single-sample framebuffer and vice
versa.
2013-04-26 15:03:46 -07:00
egag
793f8223d4 xlib: Aquire display before using it in DEBUG message. 2013-04-25 09:03:02 +01:00
Henry Song
498421bec9 gl/msaa: Resolve multisampling on surface flush
When flushing a surface, we must resolve multisampling for desktop GL.
This allows use of the original surface texture in any following raw GL
operations. This fixes accelerated canvas with WebKitGTK+ using the MSAA
compositor.
2013-04-17 10:27:58 -07:00
Chris Wilson
2dd2c826a5 png: Avoid marking the surface as in error after a png warning
It turns out that libpng will continue to load an image after throwing a
warning, and that libpng16 now throws warnings for images that libpng15
and earlier loaded without error. As we were happily loading those
images into cairo surfaces before, we are therefore being overzealous
in throwing an error now - so just squelch the warning.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-16 11:07:03 +01:00
Chris Wilson
a64ce09715 xlib: Trim uploads for surfaces extended by PAD
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-06 09:09:23 +01:00
Chris Wilson
04b9d5d9b1 xlib: Wrap errors generating sources in an error surface
Once upon a time the wrapping was provided by the caller, but the
current requirement is that the error is propagated back as an error
surface.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=63196
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-06 09:07:24 +01:00
Martin Robinson
f6efecdfef boilerplate/gl: Disable thread awareness
This dramatically speeds up testing on NVidia and actually makes it
possible to run traces within a reasonable amount of time.

cairo-perf-trace results for:
NVIDIA Corporation GeForce GTS 250/PCIe/SSE2 3.3.0 NVIDIA 310.14

Before:
test              min(s)  median(s) stddev. count
gvim              30.924  31.251    0.72%   5/6
firefox-fishbowl  168.751 201.017   12.46%  8/8
(exited early)

After:
test              min(s)  median(s) stddev. count
gvim              1.294   1.325     1.79%   6/6
firefox-fishbowl  18.540  19.104    1.54%   6/6
2013-04-04 12:04:50 -07:00
Martin Robinson
b00b9e82ab boilerplate: Add a mode for running threaded perf tests
This is useful because the GL backend runs much faster on some drivers
when thread awareness is disabled.
2013-04-04 12:04:50 -07:00
Marc-André Lureau
e66e9ac12e win32: fix corrupted drawing
Fix src bitmap coordinates, which origin is bottom-left. This is
apparently a bug in StretchDIBits(), according to some comments on
MSDN API documentation.

The backend used to have this coordinate change in the past:

            if (!StretchDIBits (dst->dc,
                                /* dst x,y,w,h */
                                dst_r.x, dst_r.y + dst_r.height - 1,
                                dst_r.width, - (int) dst_r.height,
                                /* src x,y,w,h */
                                src_r.x, src_extents.height - src_r.y + 1,
                                src_r.width, - (int) src_r.height,
                                src_image->data,
                                &bi,
                                DIB_RGB_COLORS,
                                SRCCOPY))

https://bugs.freedesktop.org/show_bug.cgi?id=61876
2013-04-02 08:39:05 +01:00
Chris Wilson
0446fae26d perf: Iteratively prune outliers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-02 08:39:05 +01:00
Michael Hutchinson
fdec6b3759 quartz: Don't release memory we don't own
This was causing crashes due to double frees.

https://bugs.freedesktop.org/show_bug.cgi?id=62885

Signed-off-by: Benjamin Otte <otte@redhat.com>
2013-03-29 02:40:13 +01:00
Adrian Johnson
9e0748e223 pdf: fix typo in bbox check
http://lists.cairographics.org/archives/cairo/2013-March/024186.html
2013-03-27 08:08:32 +10:30
Nicola Fontana
59ccc3d72e gobject: Add wrapper around cairo_matrix_t
Reviewed-By: Benjamin Otte <otte@redhat.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-23 19:47:54 +01:00
Uli Schlachter
be5eabb66a xcb: Clear temporary replay image in recording playback
This gets rid of random noise that we got from the X11 server due to
uninitialized memory.

Fixes: pdf-surface-source, ps-surface-source, svg-surface-source

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-22 18:19:00 +01:00
Uli Schlachter
41ef69a98c Fix "make check" standalone header check
This fixes the following error:

./cairo-fixed-private.h: In function ‘_slow_segment_intersection’:
./cairo-fixed-private.h:374:9: error: ‘FALSE’ undeclared (first use in this function)
./cairo-fixed-private.h:374:9: note: each undeclared identifier is reported only once for each function it appears in
./cairo-fixed-private.h:386:12: error: ‘TRUE’ undeclared (first use in this function)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-22 14:14:29 +01:00
Uli Schlachter
b7c06fff1f boilerplate: rename xcb-render-0.0 to xcb-render-0_0
The test suite uses dots to separate the backend name from the content type.
Thus, the backend name must not contain any dots.

The xlib backend already calls its RENDER 0.0 target xlib-render-0_0 for this
reason. This commit makes the xcb backend match this.

Reported-by: Darxus <darxus@chaosreigns.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-22 14:04:44 +01:00
Uli Schlachter
caf50c07e2 test: Fix handling of dots in CAIRO_TEST_TARGET
Before this, the following happened:

  $ CAIRO_TEST_TARGET=image,xcb-render-0.0 make test
  Cannot find target 'image'.
  Known targets: image, [...]

The reason for this is that _cairo_boilerplate_target_matches_name() doesn't get
a null-terminated string, but instead has a pointer to the end of the string.
However, strpbrk() expects a null-terminated argument and thus could return a
result which points past the end of the input.

This commit fixes exactly this.

Reported-by: Darxus <darxus@chaosreigns.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-22 14:02:09 +01:00
Behdad Esfahbod
13bd8d09b4 [ft] I meant fabs(), not abs() 2013-03-21 16:49:02 -04:00
Henry Song
ed6a293e3d gl: Fix typo in gles2 shader cache lookup
When comparing shader cache entries, it's important that we actually
compare the variable type hash.
2013-03-20 08:40:58 -07:00
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