Commit graph

420 commits

Author SHA1 Message Date
Fujii Hironori
8520ef5221 Defining Windows version macros in meson.build
WINVER and _WIN32_WINNT macros were defined in each source files and
headers that were including <windows.h>. However, because DirectWrite
requires new Windows API, some files included <windows.h> without the
version macros. This inconsistency sometimes caused troubles.

Define the version macros in meson.build.
2023-01-13 05:47:03 +09:00
Adrian Johnson
efe303d9db Remove autotools build 2023-01-08 22:27:47 +10:30
Luca Bacci
392b2b02f7 perf: fix compilation on Win32 2022-10-28 12:44:45 +02:00
Adrian Johnson
5b18aeffbb Replace use of ctype functions with internal version where only ASCII chars are used
In !309 Taylor R Campbell found a number of instances of ctype
incorrectly passed a signed char. In many cases, where only ASCII
characters are used, the code should have been using the cairo version
of the ctype function to avoid locale issues.
2022-04-09 22:08:57 +09:30
Emmanuele Bassi
64db153c43 Drop OS/2 support
OS/2 support was last built in Cairo 1.12, which was released 10 years
ago.

Additionally, OS/2 is not supported by Meson.
2022-02-25 01:44:57 +00:00
Adrian Johnson
78d267ee7a Fix some warnings 2021-08-22 12:07:36 +09:30
Adrian Johnson
8d14a20a00 Fix some win32 compile warnings 2021-07-25 11:02:55 +09:30
Uli Schlachter
edac5f66a0 Fix the meson build
I merged two MRs and broke the build:

- One MR added perf/ to the meson build
- The second MR changed lots of meson code to just dependency objects
  instead of just "messing" with include directories and library objects

The result was that perf/meson.build now referred to include objects and
library objects that no longer exist.

Fix this by also using dependency objects in perf/.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-17 17:03:10 +02:00
Uli Schlachter
339671c787 meson: Add perf/ directory
This adds the code under perf/ to meson. The only testing I did was "it
builds for me". I do not have gtk+2 installed and so I did not even try
whether that thing builds. Besides that, I mostly tried to stay close to
the autofoo build.
2021-05-15 10:53:08 +02:00
Emmanuele Bassi
bd13841257 Drop the conditional inclusion of config.h
We *always* generate this file, and we depend on its existence.

The idea behind HAVE_CONFIG_H was being able to include random files
from different projects, back in a time where "libraries" were literally
just random files instead of actual shared objects.

Since we're not in the '80s any more, and our build system(s) define
HAVE_CONFIG_H *and* generate the config.h header file, we don't need a
conditional guard around its inclusion.
2021-05-01 17:05:29 +01:00
Emmanuele Bassi
bfd1602db9 Remove stray _GNU_SOURCE definitions
We define _GNU_SOURCE globally in both the Autotools build, through the
use of the AC_USE_SYSTEM_EXTENSIONS macro; and in the Meson build, with
add_project_arguments().
2021-05-01 16:58:15 +01:00
Tim-Philipp Müller
4ea2991a40 Retire dummy cairo-version.h header to fix meson subproject build
It was originally added to make bisecting easier,
but has outlived its usefuleness now.

Going forward we'll have just a single cairo-version.h
header file, the one with the real version numbers.

This is needed to fix the case where cairo is being
built as a Meson subproject, but also simplifies
things in general.

Fixes #421
2020-09-29 15:50:53 +00:00
luz.paz
6d93bddbd6 Misc. typos
Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint`
Follow up of 12cb59be7d

Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
2019-01-31 17:37:15 -08:00
Maarten Lankhorst
a34cb719cd Add support for RGBA128F and RGB96F formats.
IGT wants to add support for planes with a bit depth >10, which
requires a higher precision format than we have currently.

I'm using RGBA as format, because of its existence in OpenGL.
With the new formats we can directly convert our bytes to half float,
or multiply a colro vector with a matrix to go to the Y'CbCr colorspace.

This requires pixman 0.36.0, so bump the version requirement.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
2019-01-07 19:10:44 -08:00
Paul Menzel
1c9201721d Use HTTPS URLs for freedesktop.org domains
Run the command below suggested by geirha in ##sed@irc.freenode.net.

    git grep -l 'http://.*freedesktop.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}freedesktop\.org\)|https\1|g'

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
2018-10-16 10:03:07 -07:00
Unknown
12cb59be7d Cairo trivial typos
Found using `codespell -q 3 -I cairo-whitelist.txt`
whereby whitelist contained:
```
amin
iff
lod
writen
```

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02 17:46:58 -07:00
Michael Haubenwallner
94d30d7160 perf: fix include order for AIX, bug#89354 2015-03-05 17:03:18 -08:00
Michael Haubenwallner
15c427bc77 perf/micro: fix include order for AIX, bug#89354 2015-03-05 17:02:23 -08:00
Michael Haubenwallner
e9a615a2f9 define _GETDELIM for getline() on AIX
On AIX 6.1, getdelim() and getline() are not provided by default,
causing a gcc compilation error.  With _GETDELIM defined, AIX's stdio.h
header provides definitions for these routines.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89356
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-05 16:57:09 -08:00
Bryce Harrington
2c5af590dd Refactor ARRAY_LENGTH macro definitions in test code 2014-11-20 12:22:06 -08:00
Ravi Nanjundappa
f8e0ecb5af test: Selective execution of Cairo tests based on FORMAT option
Added a new command line option FORMAT which can take rgb and/or rgba
values which enables the execution of tests only for the given FORMAT
For ex:
(1). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba,rgb
This command runs the zero-alpha test for both ps2 and image backends
with argb32 and rgb24 content formats.
(2). CAIRO_TESTS="zero-alpha" make test TARGETS=ps2,image FORMAT=rgba
This command runs the zero-alpha test for both ps2 and image backends
with argb32 content format and so on.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-14 16:09:20 -07:00
Ravi Nanjundappa
0e0004a971 perf: Refactor some macros to cairo-perf.h
This commit covers one of the left out modifications from
"commit cd11a4ff0421fd293279b202be800550890574bb" by Bryce.
It removes the duplicate macro definition in cairo-perf-diff-files.c
which by default includes the cairo-perf.h having MAX macro defnition.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-04-22 09:51:45 -07:00
Bryce Harrington
cd11a4ff04 perf: Refactor some common macros to cairo-perf.h
These macros are standard in src's cairoint.h and test's cairo-test.h
internal header files, so for consistency do the same thing with perf's
cairo-perf.h.

Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-04-18 10:09:10 -07:00
Bryce Harrington
a346e40ed3 perf: Guarantee path width is non-negative
This quells the following warning:

  perf/micro/hatching.c:39:5: warning: cannot optimize loop, the
  loop counter may overflow

Width and height aren't going to be negative so enforce it so that the
compiler can do whatever optimization it wants to do.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-25 12:13:10 -08:00
Bryce W. Harrington
e438071e9d perf: Move macro-benchmark documentation to cairo-traces
The macro benchmarks were moved to a separate repository some time ago,
but the perf README still refers to these tests as if they were still
present, which may lead to some confusion.  Instead, consolodate the
macro benchmark documentation with the macro benchmarks, and focus this
README on just the (still in tree) micro-benchmarks.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-08-11 16:37:02 +02:00
Chris Wilson
686ebd4a89 cairo-perf-print: Do not free the uninitialised histogram
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-21 16:59:25 +01:00
Chris Wilson
c51b850bd8 perf: Remove a debug artifact
Remove the intentional #error for non-UNIX path used to remind me to fix
up configure.ac.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 14:11:45 +01:00
Chris Wilson
2c097e6e6b perf: Avoid vertically stretching the histogram
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>
2013-06-11 11:57:04 +01:00
Chris Wilson
b9f0ef4496 perf: Rescale the histogram for the terminal
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>
2013-06-11 11:47:24 +01:00
Chris Wilson
9a12c2e023 perf: Rudimentary histogram printing for cairo-perf-print
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>
2013-06-11 11:30:43 +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
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
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
3c18bae20e perf; Do not allow the backends to optimize away the clear before sync
The importance of writing to the scratch surface before retrieving an
image is that it makes that the write lands in the server queue, as well
as the GetImage, in order to serialise the timer against all the
operations.

Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-28 10:06:47 +00:00
Chris Wilson
146da77d85 script: Attempt to decompress images in place
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +00:00
Chris Wilson
9558cb62c6 perf/chart: Contract the default output filenames
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 18:51:54 +00:00
Chris Wilson
fbd4864995 perf/chart: Show the geometric average as an extra column
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 18:30:48 +00:00
Chris Wilson
70c2125e2c perf/chart: Render a solid bar if the column is too narrow for the gradient
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-12 18:14:59 +01:00
Nis Martensen
77da76ac6c doc: fix a few typos found by codespell
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Andrea Canciani
58f79a85b0 perf: Don't use a boolean value as integer
Although in this case the boolean values are guaranteed to be 1/0,
using them as true/false (in an if condition) seems much saner than
using them to limit the number of iterations on a for loop.

Fixes:

cairo-perf-micro.c:221:5: warning: cannot optimize possibly infinite
loops [-Wunsafe-loop-optimizations]
2012-02-20 12:32:54 +01:00
Chris Wilson
42ad7a2385 perf/chart: Make the columns transculent so that the label behind is visible
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:43 +00:00
Chris Wilson
23ca558a05 perf/chart: Show values next to the column if too small to fit inside
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:43 +00:00
Chris Wilson
56a835eb9d perf/chart: Tweak labels on right not to fall off the edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:43 +00:00
Chris Wilson
9ecc3aafca perf: Compile fix, add the index to cairo_perf_report_load()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-18 10:04:12 +00:00
Andrea Canciani
c65d4e35dc Use xstrdup instead of xmalloc when possible
Don't open code xstrdup, just use it.
2011-11-12 20:49:08 +01:00
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
c8b5d270f6 Improve the documentation of the flags
Some utilities were providing incorrect or incomplete usage
information.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6a0ba30303 Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.

Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
2011-11-12 20:49:08 +01:00
Andrea Canciani
f96e78fa54 Silence some 'unused var' warnings 2011-11-09 13:56:50 +01:00
Chris Wilson
2cb4eb53fe perf 2011-10-11 09:05:44 +01:00