If we try to sort a zero length array, we access invalid memory.
However, for a zero length command array, we can trivially compute the
number of visible indices, 0.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If we have more rows than the max_count in any column, we end up
stretching the histogram vertically, which makes it harder to read.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If running ./cairo-perf-print in a terminal, query the terminal size and
rescale the histogram to use the maximum available space.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If you call ./cairo-perf-print --histogram results.txt, it will then
print a histogram of the results, one per test. Ideally, you should see
a skewed distribution (with a negative skew representing that most results
run in optimal time), but random sampling errors (scheduling,
throttling, general inefficiency etc) will push it more towards a normal
distribution.
For example,
| x |
| x xx |
| x xx |
| x xx |
| xxxx |
| xxxx x |
| x xxxxxx |
| x xxxxxx |
| xxxxxxxxx |
| xxxxxxxxx |
| xxxxxxxxx |
| xxxxxxxxxxxx |
| xxxxxxxxxxxx |
| xxxxxxxxxxxx |
| xxxxxxxxxxxxxx |
|x xxxxxxxxxxxxxx |
|x x xxxxxxxxxxxxxxx |
|x x xxxxxxxxxxxxxxx |
|x x xxxxxxxxxxxxxxxxx |
|xxx x xxxxxxxxxxxxxxxxxxx |
|xxx xxxxxxxxxxxxxxxxxxxxxxxxx |
|xxxxxx xxxx x x x x xxx xx xxxxx xxx x xxx x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
.------------------------------------------------------------------------------.
xlib firefox-fishtank 8298.44 1.53% (829/946)
Starts off reasonably, but quickly deteriorates as the integrated CPU/GPU
overheats and is forced to throttle.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
We were wantonly mixing unsigned/signed integers for our index and
counters, leading to compiler warnings. Be bold, and use unsigned
consistently.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Triggers the following warning during build:
sample.c:61:1: warning: ‘horizontal’ defined but not used
[-Wunused-function]
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
In particular fixing up a couple of corner cases in emitting the right
instructions for scaled-fonts and patterns.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>
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>
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.
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.
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.
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.
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>
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>
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
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
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>
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>
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>
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>
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>
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>
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>
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.
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.
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.
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.