Commit graph

425 commits

Author SHA1 Message Date
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
Maarten Lankhorst
87c1c19197 cairo-trace: Simplify bigendian case in emit_image.
All the cases are the same, except len is different.
Use the already calculated len parameter to handle all
cases except RGB24 the same.

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

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

Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
2018-10-16 10:03:20 -07: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
Bryce Harrington
9d2e3646fa script-surface: Check for invalid ids (CID #1159557, 1159558)
If the bitmap's min is non-zero, _bitmap_next_id() could break out of
its loop early, before initializing the prev variable.  prev would then
be dereferenced without a null ptr check.  This condition should never
occur in practice, so add an assert() to assure it doesn't.

Same issue is present in trace.c.

Coverity IDs: #1159557, #1159558
Reviewed-By: Uli Schlachter <psychon@znc.in>
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2018-06-13 15:21:50 -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
suzuki toshiya
33a348d698 csi-trace does not show help
csi-trace does not show help string correctly, due to a bug in its
command line argument parsing.  strcmp returns 0 when there is an exact
match, which means it requires an inverted test.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2018-04-02 11:55:19 -07:00
Adrian Johnson
4ae7f411c8 util/font-view: fix build error 2017-10-21 20:05:56 +10:30
Adrian Johnson
9ffbf63d37 fix warning: inlining failed in call to '_csi_stack_push' 2017-10-21 13:08:39 +10:30
Guillermo Rodriguez
5ac7b3652d script: Fix misleading indentation warning.
Spotted by David Kastrup <dak@gnu.org>.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2017-08-21 16:05:16 -07:00
Adrian Johnson
55f8c6d9f4 fix compiler warnings 2016-10-04 12:00:30 +10:30
Behdad Esfahbod
0aad04a88b Bug 29319 - Modules are built as versioned shared objects
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29319
2016-09-02 15:54:01 -07:00
Adrian Johnson
747cab741c Add CAIRO_STATUS_WIN32_GDI_ERROR for GDI errors 2016-03-26 22:18:05 +10:30
Adrian Johnson
cdd5c92ced Add CAIRO_STATUS_FREETYPE_ERROR for errors returned by libfreetype 2016-03-26 21:45:59 +10:30
Adrian Johnson
8f6790123e Adding missing error status to utils 2016-03-26 19:06:03 +10:30
Bryce Harrington
b4a922f62d cairo-script: Rename struct member to avoid name collision on AIX
On AIX, the token jmpbuf is a pre-processor macro.
cairo-script-scanner.c includes a private struct with a member named
jmpbuf which gets renamed to __jmpbuf when AIX's sys/context.h has been
included.

While judicious ordering of includes might kludge around this problem
(by causing all references to .jmpbuf to become .__jmpbuf), it's better
to simply select a new name for the struct member that won't suffer the
collision.

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

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 12:38:59 -07:00
Bryce Harrington
714a77e3f1 cairo-script: Prefer cairo from local tree
Use quoted includes rather than bracketed, to prefer linking to the
in-tree cairo in preference to the system cairo.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 12:38:55 -07:00
Bryce Harrington
3ed581149f cairo-script: Cleanup boilerplate header for consistency
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 12:38:51 -07:00
Bryce Harrington
d31e2418d6 cairo-script: Add missing copyright and boilerplate
Chris wrote all of the cairo script stuff.  I'm making a guess about the
copyright date.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-18 12:38:47 -07:00
Bryce Harrington
a3b6afabf6 cairo-script: Always include config.h first thing
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-18 12:38:43 -07:00
Bryce Harrington
b9ada81995 cairo-script: Improve buffer length check
Quells the following warning:

cairo-script-scanner.c: In function ‘_translate_string’:
cairo-script-scanner.c:1623:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
      if (buf_len <= 8 + 2*string->len) {
                  ^
2015-06-04 14:24:31 -07:00
Bryce Harrington
c0458b4560 csi-trace: Add --version and --help args to utility 2015-03-06 23:35:34 -08:00
Michael Haubenwallner
f72bd7c757 skip MAP_NORESERVE when unsupported
Fixes a compilation on AIX ('MAP_NORESERVE' undeclared)

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89340
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-05 14:48:28 -08:00
Emanuele Aina
cca8b1960b cairo-trace: Fix duplicated surface push on similar-image
The current code results in trace lines with the source surface being
pushed on the stack two times instead of one:

s1 s1 //ARGB32 48 48 similar-image % s2

Instead of:

s1 //ARGB32 48 48 similar-image % s2

This greatly confuses later commands when the script was replayed,
causing traces for trivial GTK3 programs to be unplayable, usually
yielding the following error:
"invalid value (typically too big) for the size of the input (surface, pattern, etc.)"

Drop the duplicated entry from the trace line printed by the
cairo_surface_create_similar_image() override.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73580
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
2015-01-20 18:14:52 +01:00
Bryce Harrington
42320793aa sphinx: Add ickle's explanation of what sphinx does 2014-09-24 12:12:47 -07:00
Behdad Esfahbod
f4dbba26d4 [cairo-trace] Work around fontconfig :charset= parse format change
As dicussed on the mailing list.
2014-07-14 15:55:12 -04:00
Behdad Esfahbod
312553af29 [trace] Don't print FC_CHARSET, FC_LANG, and FC_CAPABILITY
There are many more that can go, but these take the most bytes.
FC_CHARSET needs to go specially because I recently changed
its format in fontconfig.  Ouch!
2014-07-11 11:07:25 -04:00
Sylvestre Ledru
da9ef97372 Remove some useless declarations found by scan-build, the LLVM/clang static analyzer
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-06 10:14:53 -07:00
Ravi Nanjundappa
52b137bc3e test and util: maintain consistency in the usage of ARRAY_LENGTH macro
ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h,
test's cairo-test.h and in some internal header files of util's
directory.So to maintain consistency ARRAY_SIZE is replaced with
ARRAY_LENGTH macro.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-30 13:01:35 -07:00
Bryce Harrington
39b7d5138e cairo-script: Compare status with CSI enums
CSI_STATUS_SUCCESS is defined as equivalent to CAIRO_STATUS_SUCCESS.
We should prefer the former when comparing against csi_status_t
variables, else we'll get a warning:

cairo-script-interpreter.c:637:23: warning: comparison between
‘csi_status_t’ and ‘enum _cairo_status’ [-Wenum-compare]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:26:02 -08:00
Bryce Harrington
18d66c88a2 cairo-script: Error if asked to decompress with missing compression lib
This quells the following warning:

warning: enumeration value ‘LZO’ not handled in switch [-Wswitch-enum]

The LZO enum value is defined and used elsewhere, even if lzo support
isn't available.

This situation might arise if cairo scripts were generated on one system
with lzo, and then replayed on a system without it.  For now simply
error out if this occurs.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:25:57 -08:00
Bryce Harrington
1ce452db4c cairo-trace: Stringify CAIRO_STATUS_JBIG2_GLOBAL_MISSING
This error enum was added last September when JBIG2 support was added.
Support it as well in the tracing code.  This fixes this warning:

trace.c:1544:5: warning: enumeration value
‘CAIRO_STATUS_JBIG2_GLOBAL_MISSING’ not handled in switch [-Wswitch]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:25:53 -08:00
Bryce Harrington
56a195a765 Fix SSIZE_T definition problem when making with MSYS on Windows7
Patch provided by Martin Schlemmer <Martin.Schlemmer@nwu.ac.za> on the
mailing list.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2013-10-31 20:34:15 -07:00
Chris Wilson
c1ac8db7e6 trace: Fix operand emission
Recent updates (in the past couple of years) to firefox have exposed
numerous bugs in the way we emit the operands. A few off-by-ones,
missing surfaces and outright bugs all of which are intermixed into
producing a corrupt stack.

Reported-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-27 16:37:24 +01:00
Chris Wilson
0266cb821f script: Add support for replaying device-scale
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 16:13:56 +01:00
Chris Wilson
a4164142f2 trace: Record set-device-scale
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 16:12:26 +01:00
Chris Wilson
17dc312221 trace: Improve operand emission
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>
2013-06-05 22:34:52 +01:00
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
Chris Wilson
768b81b78e script: Set decompression length prior to calling decompressors
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59224
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-14 03:27:11 +00:00
Chris Wilson
e1307da861 script: Simply exchange source/dest images for _set_source_image
But note we can only do the exchange if they do indeed match and
there are no other references (the objects are only on the stack).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +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
45a4b42a36 script: Recompress strings using LZO whilst binding traces
Try using the lighter-weight LZO decompressor in an effort to speed up
replays (at the cost of making the bound traces slightly larger).
Presuming that with the slight increase in file size (from -1% to +10%),
the file data remains in the readahead buffer cache, replays see a
performance improvement of between 5-10%.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 21:10:35 +00:00
Chris Wilson
8cd604e18a gobject: Fix my typo s/TEST/TEXT/ in the previous commit
Again reported by Kouhei Sutou, who I am grateful for his deligence.
2013-01-04 14:03:40 +00:00
Kouhei Sutou
a4f221498c gobject: Fix "text_cluster_flags_get_type" typo
The macro missed the text from the name, rendering it useless.
2013-01-04 12:18:29 +00:00
Kouhei Sutou
ecc8c28b24 gobject: Add the correct macro name for the hint-metrics type
s/CAIRO_GOBJECT_TYPE_HNT_METRICS/CAIRO_GOBJECT_TYPE_HINT_METRICS/

However, as we have already released the broken headers, we need to
preserve that mistake in case applications are already using. Since it
is just a #define, there is little associated cost with carrying both
the incorrect spelling and the corrected define.
2013-01-03 15:07:18 +00:00
Chris Wilson
153b11612f script: Fix map-to-image/unmap stack manipulations
The idiom (and expectation) for surface operators is that it leaves the
surface on the stack for the next operation. Also we need to hold onto a
surface reference for objects put onto the stack, yet for the
map-to-image return we did not own one.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:57:29 +00:00
Chris Wilson
dfbf80a57d trace: Do not forcibly add surfaces to the dictionary
Adjust the stack manipulation to avoid moving an unknown surface to
the dictionary.

Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:36:59 +00:00
Chris Wilson
376d39121c trace: Fix operand emission for map-to-image and unmap-image
Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-27 12:25:56 +00:00
Chris Wilson
5844dead01 util/show-polygon: Show the limited range of each edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:37:58 +00:00