Commit graph

12264 commits

Author SHA1 Message Date
Jonathan Kew
b7d67433b7 Accept a leading sign character in _cairo_strtod. 2021-07-20 17:53:45 +01:00
Adrian Johnson
b6c89810f2 cff: Check subroutine number is valid before using as an array index
Fixes #413
2021-07-20 21:54:08 +09:30
Adrian Johnson
06f405c775 Merge branch 'cff-subset-leak' into 'master'
Fix memory leak in cairo_cff_font_read_cid_fontdict

See merge request cairo/cairo!192
2021-07-20 12:00:05 +00:00
Adrian Johnson
08f2fb6b25 Merge branch 'type1-subset-fixes' into 'master'
Fix some type1-subset array indexing bugs

Closes #13 and #452

See merge request cairo/cairo!201
2021-07-20 11:35:02 +00:00
Adrian Johnson
7c803ceb19 Merge branch 'recording-surface-tags' into 'master'
Add an extra PDF link test to pdf-tagged-text testcase

See merge request cairo/cairo!194
2021-07-20 11:14:09 +00:00
Adrian Johnson
a623906bf9 Fix some type1-subset array indexing bugs
Fixes #13
Fixes #452
2021-07-20 08:22:55 +09:30
Jonathan Kew
84192695f8 Fix use-after-free in pdf-features testcase. 2021-07-19 12:30:17 +01:00
Jonathan Kew
20ef4ec460 Add an example of a link within an empty clip to pdf-tagged-text testcase. 2021-07-19 12:28:14 +01:00
Adrian Johnson
99d5337918 Merge branch 'ps-docs' into 'master'
Update DSC documention

Closes #380

See merge request cairo/cairo!200
2021-07-18 11:40:27 +00:00
Adrian Johnson
cb0bfefba2 Update DSC documention
Fixes #380
2021-07-18 19:30:48 +09:30
Adrian Johnson
2ffc209485 Merge branch 'dont-drop-tags' into 'master'
Remove all gstate from _cairo_surface_tag

See merge request cairo/cairo!196
2021-07-18 09:33:05 +00:00
Adrian Johnson
e73b4c799e Fix PS test crash
When the tests run ghostscipt on ps2 files it crashes with:

  Error: /undefined in .setlanguagelevel
  Operand stack:
     2
  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
  Dictionary stack:
     --dict:732/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
  Current allocation mode is local
  GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1

The problem is the "-c 2 .setlanguagelevel -f" on the gs command line
to set ghostscript to language level 2. I'm not sure why this no longer works.

.setlanguagelevel is not mentioned any where in the gs custom operators listed in
https://www.ghostscript.com/doc/current/Language.htm

I assume this operator was meant for ghostscript internal use and
is no longer exposed in recent versions. Remove it from the test.
2021-07-18 18:13:10 +09:30
Adrian Johnson
26043a2db1 Fix crash 2021-07-18 18:13:10 +09:30
Adrian Johnson
81d7b2e3a4 test: add URL and "rect" attribute to pdf-tagged-text 2021-07-18 18:13:10 +09:30
Adrian Johnson
1c64d2635b Remove all gstate from _cairo_surface_tag
The gstate is not required and was causing some tag operations to be
ignored.
2021-07-18 18:13:10 +09:30
Adrian Johnson
ff2a95d6e5 Merge branch 'isxdigit' into 'master'
Create cairo version of isxdigit()

Closes #335

See merge request cairo/cairo!199
2021-07-18 07:31:16 +00:00
Adrian Johnson
30a0ae56d8 Create cairo version of isxdigit()
Fixes #335
2021-07-18 16:10:59 +09:30
Uli Schlachter
a6f7c20bef Merge branch 'windows-ci-fix' into 'master'
ci: add fallback_source_uri to work around ssl certificate issues on windows runners

See merge request cairo/cairo!198
2021-07-18 05:34:40 +00:00
Tim-Philipp Müller
b2a1525113 ci: add fallback_source_uri to work around ssl certificate issues on windows runners
Has to be fixed properly, possibly by regenerating the image, but
for now this might do the job.
2021-07-17 23:58:44 +01:00
Emmanuele Bassi
0eff09a1e3 Merge branch 'fix-fontconfig-subproject' into 'master'
Fix fontconfig subproject

See merge request cairo/cairo!193
2021-07-01 12:01:14 +00:00
Matthias Clasen
13660ff925 Fix fontconfig subproject
fontconfig has changed its default git branch from
master to main, and deleted the master branch. This
breaks GTK ci on MacOs, where we use build cairo and
use its fontconfig subproject.
2021-07-01 06:55:59 -04:00
Uli Schlachter
fc1d6caa8c Fix memory leak in cairo_cff_font_read_cid_fontdict
The function cairo_cff_font_read_cid_fontdict() has a local variable
"cairo_array_t index". This array is first filled with data from the
font with cff_index_read(). Later in this function, each resulting entry
is given to cff_dict_read(). Nothing else is done with the array.

Thus, nothing can keep a reference to "index" and thus this array has to
be finalised at the end of the function to avoid a memory leak.

This commit does that by falling through to the call to cff_index_fini()
that is already there in the error case. This function checks for each
element if its ->is_copy is true and then frees the data. However,
cff_index_read() only creates elements with ->is_copy = FALSE, thus this
does not do anything. At the end, this calls _cairo_array_fini() which
frees the array's memory.

Fixes the following memory leak according to valgrind:

 24 bytes in 1 blocks are definitely lost in loss record 173 of 490
    at 0x48386AF: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x483ADE7: realloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x4A5ECC3: _cairo_array_grow_by (cairo-array.c:115)
    by 0x4A5EEEE: _cairo_array_allocate (cairo-array.c:317)
    by 0x4A5EE95: _cairo_array_append_multiple (cairo-array.c:288)
    by 0x4A5EE6B: _cairo_array_append (cairo-array.c:265)
    by 0x4AFB12E: cff_index_read (cairo-cff-subset.c:438)
    by 0x4AFC280: cairo_cff_font_read_cid_fontdict (cairo-cff-subset.c:1022)
    by 0x4AFCD42: cairo_cff_font_read_top_dict (cairo-cff-subset.c:1232)
    by 0x4AFD145: cairo_cff_font_read_font (cairo-cff-subset.c:1351)
    by 0x4AFFDC0: cairo_cff_font_generate (cairo-cff-subset.c:2583)
    by 0x4B00D71: _cairo_cff_subset_init (cairo-cff-subset.c:2975)

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30650
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-26 14:03:34 +02:00
Tim-Philipp Müller
716d144cbd Merge branch 'fix-meson-build' into 'master'
Fix the meson build

See merge request cairo/cairo!190
2021-06-18 13:09:54 +00:00
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
dd1f8f00df Merge branch 'extra-test-steps' into 'master'
CI: Split test execution into per-backend jobs

See merge request cairo/cairo!188
2021-06-17 14:25:54 +00:00
Uli Schlachter
43a48fb6a5 Merge branch 'more-meson' into 'master'
Add more of the auto-foo build to meson

See merge request cairo/cairo!183
2021-06-17 14:25:16 +00:00
Uli Schlachter
987bbdd7bd Always run tests with an X11 server
This allows tests xcb-surface-source and xlib-surface-source to run.
Somehow I thought this would be more complicated...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-04 16:11:18 +02:00
Uli Schlachter
430168cc8f CI: Split test execution into per-backend jobs
This creates one job per cairo backend that is tested on CI. That
backend is then tested in its own job.

One motivation is that this will hopefully be faster, because tests are
run in parallel. Another motivation is that this lets us get around the
one hour time limit per job.

A downside is that the inter-backend tests are not run in CI. For
example, xlib-surface-source requires a working X11 server. I am not
providing that X11 server here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-04 09:08:41 +02:00
Uli Schlachter
07d6012185 Merge branch 'expected-failure-line-separated' into 'master'
Move test failure lists into separate files with one test name per line

See merge request cairo/cairo!187
2021-06-03 23:52:43 +00:00
Uli Schlachter
39db60e957 Merge branch 'build-without-zlib' into 'master'
meson: Use more dependency objects & fix build without zlib

Closes #475

See merge request cairo/cairo!184
2021-06-03 15:26:07 +00:00
Uli Schlachter
47c70d53e4 Switch to line-separated test failure lists
Having comma separated lists of test names that we expect to fail leads
to really unreadable and useless diffs. Thus, this commit changes these
lists to be separated by newlines. This change was generated with:

  ( cd .gitlab-ci ; for x in * ; do tr ',' '\n' < $x > .$x ; mv .$x $x ; done )

The code in .gitlab-ci.yml is changed to use tr again to transfer these
lists back so that everything still works.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-03 17:19:17 +02:00
Uli Schlachter
9c9883cac0 Rename a file
Because shell variables cannot contain &, this character was replaced
with an underscore in the shell variable. However, we can have this
character just fine in the file name. Thus, this commits renames a file
to actually include the proper name of the boilerplate target, which is
xcb-window&.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-03 17:13:57 +02:00
Uli Schlachter
04697b33af Move test failure lists into separate files
Before this commit, .gitlab-ci.yml is way too large, because it contains
the list with all the expected test failure. This commit moves those
lists to extra files.

The files were generated with a shell one-liner:

  grep CAIRO_TEST_IGNORE .gitlab-ci.yml | while read line ; do
  backend=$(echo $line | cut -f 3 -d ' ' | cut -f1 -d= | sed -e
  's/CAIRO_TEST_IGNORE_//;s/_/-/g') ; content=$(echo $line | cut -f2-
  -d=) ; echo $backend ; echo $content >
  .gitlab-ci/ignore-${backend}.txt ; done

The changes to .gitlab-ci.yml were also generated with some shell
scripting that generates a sed argument:

  grep CAIRO_TEST_IGNORE .gitlab-ci.yml | while read line ; do
  backend=$(echo $line | cut -f 3 -d ' ' | cut -f1 -d= ) ; file=$(echo
  $backend | sed -e 's/CAIRO_TEST_IGNORE_//;s/_/-/g') ; printf
  "/$backend/s#=.*#=\$(cat .gitlab-ci/ignore-${file}.txt)#;"; done ;
  echo

The above can then be applied via (but of course adding ' around it and
I also left out the final ;):

  sed -i -e [the output of the above] .gitlab-ci.yml

Just for completeness, [the output of the above] is:

  /CAIRO_TEST_IGNORE_pdf_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-pdf-argb32.txt)#;/CAIRO_TEST_IGNORE_pdf_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-pdf-rgb24.txt)#;/CAIRO_TEST_IGNORE_script_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-script-argb32.txt)#;/CAIRO_TEST_IGNORE_image_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-image-argb32.txt)#;/CAIRO_TEST_IGNORE_image_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-image-rgb24.txt)#;/CAIRO_TEST_IGNORE_image16_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-image16-rgb24.txt)#;/CAIRO_TEST_IGNORE_recording_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-recording-argb32.txt)#;/CAIRO_TEST_IGNORE_recording_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-recording-rgb24.txt)#;/CAIRO_TEST_IGNORE_svg11_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-svg11-argb32.txt)#;/CAIRO_TEST_IGNORE_svg11_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-svg11-rgb24.txt)#;/CAIRO_TEST_IGNORE_xcb_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-argb32.txt)#;/CAIRO_TEST_IGNORE_xcb_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-rgb24.txt)#;/CAIRO_TEST_IGNORE_xcb_window_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-window-rgb24.txt)#;/CAIRO_TEST_IGNORE_xcb_window__rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-window--rgb24.txt)#;/CAIRO_TEST_IGNORE_xcb_render_0_0_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-render-0-0-argb32.txt)#;/CAIRO_TEST_IGNORE_xcb_render_0_0_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-render-0-0-rgb24.txt)#;/CAIRO_TEST_IGNORE_xcb_fallback_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xcb-fallback-rgb24.txt)#;/CAIRO_TEST_IGNORE_xlib_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-xlib-argb32.txt)#;/CAIRO_TEST_IGNORE_xlib_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xlib-rgb24.txt)#;/CAIRO_TEST_IGNORE_xlib_window_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xlib-window-rgb24.txt)#;/CAIRO_TEST_IGNORE_xlib_render_0_0_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xlib-render-0-0-rgb24.txt)#;/CAIRO_TEST_IGNORE_xlib_fallback_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-xlib-fallback-rgb24.txt)#;/CAIRO_TEST_IGNORE_quartz_argb32/s#=.*#=$(cat
  .gitlab-ci/ignore-quartz-argb32.txt)#;/CAIRO_TEST_IGNORE_quartz_rgb24/s#=.*#=$(cat
  .gitlab-ci/ignore-quartz-rgb24.txt)#;

(All line breaks are only added for readability and are not part of the
one-liners)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-06-03 17:09:08 +02:00
Uli Schlachter
2edcb1ac23 Merge branch 'jfkthame-master-patch-75366' into 'master'
[pdf-interchange] Write trees even if only LINK tags are present

Closes #487

See merge request cairo/cairo!185
2021-06-02 10:24:33 +00:00
Uli Schlachter
267d0e1c98 Merge branch 'issue_488' into 'master'
Allow empty postscript name when using a CFF font in pdf

Closes #488

See merge request cairo/cairo!186
2021-06-02 10:23:26 +00:00
Uli Schlachter
5ae89cf30e Merge branch 'svg-backend-work' into 'master'
Work on the SVG backend

Closes #361, #431, #78, #4, poppler/poppler#761, poppler/poppler#619, #107, poppler/poppler#268, #73, and #478

See merge request cairo/cairo!152
2021-05-30 10:38:09 +00:00
afdw
9ab52c9131 Merge branch 'master' into 'svg-backend-work'
# Conflicts:
#   .gitlab-ci.yml
#   test/Makefile.sources
#   test/meson.build
2021-05-29 18:32:53 +02:00
Anton Danilkin
ec2cf9ac35 Ignore build instead of builddir 2021-05-29 18:13:30 +02:00
Anton Danilkin
1e27ca7d45 Remove unused _cairo_hash_table_size 2021-05-29 18:04:45 +02:00
Calixte Denizet
a5b5679610 Allow empty postscript name when using a CFF font in pdf
- it aims to fix issue #488.
2021-05-26 19:21:08 +02:00
Jonathan Kew
60d7ff988b [pdf-interchange] Write trees even if only LINK tags are present
This avoids the PDF ending up with invalid xref entries for objects that were "reserved"
but then never output.

Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/487.
2021-05-24 16:31:47 +00:00
Uli Schlachter
1e34651420 Fix meson build without zlib
Trying to build with meson with -Dzlib=disabled failed with the
following error message:

cairo/test/meson.build:599:2: ERROR: Unknown variable
"libcairoscript_dep".

This commit fixes that problem by adding a not-found dependency if
cairo-script is not built.

Additionally, follow-up problems are fixed:

- any2ppm.c still tried to include cairo-script-interpreter.h, which was
  not found
- Building cairo-test-trace was attempted, but that also failed because
  of missing script support.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/475
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-22 08:16:47 +02:00
Uli Schlachter
1981fb6dfb meson: Use more dependency objects
For example, to depend on cairo-script, inccairoscript was added to
"include_directories:" and libcairoscript was added to "link_with:".
This commit instead uses the libcairoscript_dep dependency everywhere.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-22 07:59:52 +02:00
Uli Schlachter
63f0d62684 Merge branch 'meson-defines' into 'master'
meson: Move CAIRO_HAS_INTERPRETER to config.h

See merge request cairo/cairo!174
2021-05-21 15:36:44 +00:00
Uli Schlachter
936e5ce8ee Merge branch 'xcb-free-xid-cache' into 'master'
xcb: Remove free XID cache

Closes #434

See merge request cairo/cairo!175
2021-05-21 15:35:59 +00:00
Uli Schlachter
91225d4dd7 Merge branch 'SVG-doc-scanner' into 'master'
#483

See merge request cairo/cairo!182
2021-05-20 15:43:16 +00:00
Uli Schlachter
9fcc7fb0bf Merge branch 'doc-scanner' into 'master'
Issue #482

See merge request cairo/cairo!181
2021-05-20 15:41:56 +00: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
Uli Schlachter
1c5b4716f7 meson: Add shell script tests
There are a couple of shell scripts in src/ that run various tests. This
commit adds them to the meson build.

The one exception is check-def.sh, which I couldn't get to work and thus
only add it commented out.

check-headers.sh and check-plt.sh required some tweaking to get them to
work. check-plt.sh will print an error when run since the file
'.libs/lib*.so' does not exist, but it will still run its check
correctly.
2021-05-14 17:08:02 +02:00
Glash Gnome
7bf3a780ba #483
Fix Enum_member_description
2021-05-13 23:21:26 +00:00