summaryrefslogtreecommitdiff
path: root/boilerplate
Commit message (Collapse)AuthorAgeFilesLines
* [quartz]Conditionally Use Main Display ColorSpace instead of ↵John Ralls2023-02-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | kCGColorSpaceDefaultRGB. The default RGB colorspace must be converted to the GPU's colorspace using CGColorTransformConvertUsingCMSConverter. Profiling has shown this function to consume as much as 48% of a redraw cycle in gdk-quartz. There seems to be no named colorspace that matches the one stored on the display, so we use the one associated with the main display. This has some risks for users with multiple monitors but in testing with my own two-monitor setup, one of which is HDR and the other not, the colorspace was the same for both. This is applied to quartz surfaces created with cairo_quartz_surface_create(); surfaces created with cairo_quartz_surface_create_for_cg_context will inherit the colorspace from the context. In order to generate PNGs that look right I've converted the existing debugging functions for writing a quartz surface to png into private functions and wired cairo-boilerplate-quartz to use them. Using the generic cairo routine produced washed-out PNGs. Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/330
* Drop cairo-glEmmanuele Bassi2023-01-274-892/+0
| | | | | | | | | The GL support in Cairo has always been a prototype, and nothing happened in the past 10+ years to make it work as it was meant to. GL support is not enabled by any downstream packagers of Cairo, so nobody should notice its absence.
* Defining Windows version macros in meson.buildFujii Hironori2023-01-131-8/+0
| | | | | | | | | 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.
* Remove autotools buildAdrian Johnson2023-01-084-467/+0
|
* Replace use of ctype functions with internal version where only ASCII chars ↵Adrian Johnson2022-04-091-2/+2
| | | | | | | | | 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.
* Drop cairo-vg surfaceEmmanuele Bassi2022-02-254-376/+0
| | | | | OpenVG is a failed experiment from 10 years ago, and nobody has been using the cairo-vg surface in pretty much the same amount of time.
* Remove cairo-directfbEmmanuele Bassi2022-02-254-247/+0
| | | | | Nobody cares about DirectFB any more, not even the people that registered and maintained the DirectFB domain.
* tanis: Remove cairo-coglEmmanuele Bassi2022-02-254-229/+0
| | | | Cogl's upstream is unmaintained, and has been for the past 6 years.
* Remove cairo-drmEmmanuele Bassi2022-02-254-134/+0
| | | | | The DRM backend has always been a science experiment, but now it hasn't been built in more than 10 years, and it's completely broken.
* Drop OS/2 supportEmmanuele Bassi2022-02-251-10/+0
| | | | | | | OS/2 support was last built in Cairo 1.12, which was released 10 years ago. Additionally, OS/2 is not supported by Meson.
* Remove boilerplate for the Skia surfaceEmmanuele Bassi2022-02-252-56/+0
| | | | The Skia surface is not there any more.
* Remove BeOS supportEmmanuele Bassi2022-02-254-395/+3
| | | | | | | | Nobody cares about BeOS in 2022, and it cannot be built with Meson anyway. Removing the BeOS backend also allows us to drop the dependency on a C++ compiler and simplify the Autotools build considerably by removing all the extra CXX targets.
* Remove Qt surfaceEmmanuele Bassi2022-02-254-128/+0
| | | | | It's disabled by default, and unsupported as it depends on Qt4, which has been EOL since 2015.
* Fix some MinGW warningsAdrian Johnson2021-09-021-1/+6
| | | | | | | | | | | | | | | | | The FT change is because my MinGW build is using a more recent version of FT. Remove the disabled _cairo_win32_scaled_font_text_to_glyphs() code to fix the defined but not used warning. _cairo_win32_scaled_font_text_to_glyphs() was diabled in d9408041aa with the comment: "Currently disable the win32-font text_to_glyphs(), until that one is updated. Or better yet, remove it and implement ucs4_to_index(). It's the toy font API afterall." _cairo_win32_scaled_font_ucs4_to_index() was added in d1c619bc7d.
* boilerplate: Use _cairo_malloc instead of mallocBryce Harrington2021-07-236-9/+15
| | | | | | | | | This changes most instances of malloc() calls to use Cairo's safer _cairo_malloc(). The malloc() call in the implementation of boilerplate's xmalloc() is not changed since it already includes a size=0 check. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
* Fix PS test crashAdrian Johnson2021-07-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'build-without-zlib' into 'master'Uli Schlachter2021-06-031-3/+7
|\ | | | | | | | | | | | | meson: Use more dependency objects & fix build without zlib Closes #475 See merge request cairo/cairo!184
| * meson: Use more dependency objectsUli Schlachter2021-05-221-3/+7
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' into 'svg-backend-work'afdw2021-05-293-6/+0
|\ \ | |/ | | | | | | | | | | # Conflicts: # .gitlab-ci.yml # test/Makefile.sources # test/meson.build
| * Drop the conditional inclusion of config.hEmmanuele Bassi2021-05-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Remove stray _GNU_SOURCE definitionsEmmanuele Bassi2021-05-011-2/+0
| | | | | | | | | | | | 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().
| * meson: Define HAVE_CONFIG_H as a project flagEmmanuele Bassi2021-05-011-2/+0
| | | | | | | | | | | | | | | | Precisely what Autotools does, instead of adding it as per-target C argument. Once we remove HAVE_CONFIG_H checks in every source file, we'll be able to drop it.
* | Introduce CAIRO_BOILERPLATE_OPEN_NO_DAEMON and ↵Anton Danilkin2021-05-031-2/+10
| | | | | | | | CAIRO_BOILERPLATE_DO_NOT_CRASH_ON_ANY2PPM_ERROR
* | Add support for CAIRO_CONTENT_COLORAnton Danilkin2021-05-011-11/+13
| |
* | Move cairo_svg_surface_t to cairo-svg-surface.cAnton Danilkin2021-04-111-6/+2
| |
* | Remove SVG 1.2 and CAIRO_CONTENT_COLOR SVG boilerplate targetsAnton Danilkin2021-04-111-57/+0
|/
* meson: use encoding=utf-8 when reading/writing files in helper scriptTim-Philipp Müller2021-02-231-2/+2
| | | | | | | | | | | | | Fixes errors such as Traceback (most recent call last): File "C:\Users\...\cairo\test\make-cairo-test-constructors.py", line 19, in <module> for l in f.readlines(): File "c:\python39\lib\encodings\cp1253.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 6694: character maps to <undefined> on non-English-language Windows locales/installations.
* meson: only build cairo-boilerplate and cairo-missing helper libs if neededTim-Philipp Müller2021-01-151-0/+2
| | | | | Used by tests and the sphinx utility, which may or may not be built, and if they're not built we don't need to build those libs either.
* boilerplate-xcb: Avoid leaks on successUli Schlachter2020-12-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of the following two leaks reported by valgrind when successfully running a test with CAIRO_TEST_TARGET=xcb: 8,000 bytes in 2 blocks are definitely lost in loss record 9 of 10 at 0x483877F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4B7E135: read_packet (xcb_in.c:259) by 0x4B7E135: _xcb_in_read (xcb_in.c:1031) by 0x4B7BF8E: _xcb_conn_wait (xcb_conn.c:516) by 0x4B7D6AE: wait_for_reply (xcb_in.c:516) by 0x4B7D8C8: xcb_request_check (xcb_in.c:745) by 0x18D747: _cairo_boilerplate_xcb_create_surface (cairo-boilerplate-xcb.c:310) by 0x12906F: cairo_test_for_target (cairo-test.c:819) by 0x12AAB5: _cairo_test_context_run_for_target (cairo-test.c:1555) by 0x126921: _cairo_test_runner_draw (cairo-test-runner.c:250) by 0x126921: main (cairo-test-runner.c:932) 8,000 bytes in 2 blocks are definitely lost in loss record 10 of 10 at 0x483877F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4B7E135: read_packet (xcb_in.c:259) by 0x4B7E135: _xcb_in_read (xcb_in.c:1031) by 0x4B7BF8E: _xcb_conn_wait (xcb_conn.c:516) by 0x4B7D6AE: wait_for_reply (xcb_in.c:516) by 0x4B7D7C0: xcb_wait_for_reply (xcb_in.c:546) by 0x18D45D: find_depth (cairo-boilerplate-xcb.c:154) by 0x18D45D: _cairo_boilerplate_xcb_create_render_0_0 (cairo-boilerplate-xcb.c:621) by 0x12906F: cairo_test_for_target (cairo-test.c:819) by 0x12AAB5: _cairo_test_context_run_for_target (cairo-test.c:1555) by 0x126921: _cairo_test_runner_draw (cairo-test-runner.c:250) by 0x126921: main (cairo-test-runner.c:932) Signed-off-by: Uli Schlachter <psychon@znc.in>
* boilerplate-xcb: Avoid leaks on errorUli Schlachter2020-12-051-1/+7
| | | | | | | | | | | | | | | | | | | | | Before this commit, running the test suite against a non-existing display under valgrind resulted in: $ ( cd test; DISPLAY=:2 CAIRO_TEST_TARGET=xcb valgrind --leak-check=full .libs/cairo-test-suite -f random-clip ) [...] ==47359== 64 bytes in 2 blocks are definitely lost in loss record 1 of 7 ==47359== at 0x483AB65: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==47359== by 0x18A272: cairo_boilerplate_xcalloc (cairo-boilerplate-system.c:65) ==47359== by 0x18D652: _cairo_boilerplate_xcb_create_surface (cairo-boilerplate-xcb.c:269) ==47359== by 0x12906F: cairo_test_for_target (cairo-test.c:819) ==47359== by 0x12AAB5: _cairo_test_context_run_for_target (cairo-test.c:1555) ==47359== by 0x126921: _cairo_test_runner_draw (cairo-test-runner.c:250) ==47359== by 0x126921: main (cairo-test-runner.c:932) This commit fixes that by freeing the allocated memory in the error path. Signed-off-by: Uli Schlachter <psychon@znc.in>
* Fix testing in the full mode for PDF, PS and SVG backendsAnton Danilkin2020-11-134-48/+103
| | | | | | Fix how offset, scale and transparency are handled. Also do the same change in the "win32-printing" backend as it has a copy of the code from PDS, PS and SVG backends.
* build: Fix various compiler warningsGeorge Matsumura2020-11-072-5/+2
| | | | | | This fixes a few compiler warnings that were encountered with gcc 9.3.0. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* Retire dummy cairo-version.h header to fix meson subproject buildTim-Philipp Müller2020-09-293-15/+0
| | | | | | | | | | | | | | 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
* cogl: Add new path cacheGeorge Matsumura2020-08-251-6/+6
| | | | | | | | | | | | This redesigns the path cache so that it does not mess with the context functions, thereby hopefully making it much more resilient to changes in the rest of cairo that change the way the default context works. It is also much simpler, and it is anticipated that it will be more maintainable. Performance in contrast to the old cache design speeds up most traces in cairo-perf-trace, and slows down only a lesser few by <20%. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Fix reference counting bugsGeorge Matsumura2020-08-251-2/+17
| | | | Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Ensure onscreen framebuffers have an alpha component if requiredGeorge Matsumura2020-08-251-1/+19
| | | | | | | Prior to this change, cogl often queried GLX so that it returned a framebuffer that could not support an alpha component. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Move framebuffer creation functionality out of boilerplateGeorge Matsumura2020-08-251-45/+18
| | | | | | | | | | In order to be more consistent with backends such as gl, support for creating a surface from content, width, and height parameters was moved into the backend itself. The option to pass cairo-cogl a framebuffer to create a texture from still exists, just now it is not the only option. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Fix very small surfaces in boilerplateGeorge Matsumura2020-08-251-0/+10
| | | | | | | | | Prior to this change, the boilerplate code crashed when given surface dimensions less than 1. This fixes such behaviour by rounding the dimensions up to 1, which is also done by the boilerplate code for several other backends. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Move context, device, and surface members to most fitting placesGeorge Matsumura2020-08-251-7/+3
| | | | | | | | | | | | | | | The buffer stack was moved from the surface to the device, as mapped buffers are shared across all surfaces using the device and more than one surface may be doing so. Stemming from this, if a surface tries to map a buffer without first unmapping one that has been mapped by another surface, it will trigger an error. The parent backend functions were moved from the device to the context, as it is possible that the context creation function could be passed a non-cogl device. Prior to this change, many of the subsurface tests segfaulted. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Account for new representations of framebuffer typesGeorge Matsumura2020-08-251-30/+5
| | | | | | | | With the new cogl API, casting the framebuffer into offscreen and onscreen types with the provided macros is a deprecated behavior. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Correct behavior of boilerplate surface finishing functionsGeorge Matsumura2020-08-251-6/+23
| | | | | | | Without this, a buffer-swapping function only usable on onscreen framebuffers would have been used on offscreen framebuffers. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* cogl: Use new separate functions for offscreen and onscreen framebuffersGeorge Matsumura2020-08-251-16/+23
| | | | | | | The old boilerplate code no longer worked due to the deprecation of functions for swapping the buffers that it used. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* Add meson build definitionsMathieu Duponchelle2020-07-313-0/+83
| | | | | | | Co-Authored by: Nirbheek Chauhan <nirbheek@centricular.com> lb90 <luca.bacci982@gmail.com> Tim-Philipp Müller <tim@centricular.com>
* Misc. typosluz.paz2019-01-311-1/+1
| | | | | | | Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint` Follow up of 12cb59be7da Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
* Disable skia from configureBryce Harrington2018-04-021-12/+0
| | | | | | | | | | | | | | | | | | | | | Implement suggestion by Adrian Johnson to comment out skia in configure.ac to avoid presenting it as an option to users. This was discussed on the Cairo mailing list in September 2017. Skia is not API stable and is not available in packaged+versioned forms, resulting in it being a continually moving target. I.e. it's pretty much always unusably out of date. The last update to the skia backend was in 2014, and had not been updated very regularly prior to that. We'll simply disable it for now. If no one complains by the next Cairo snapshot release, we'll assume no one is needing it and will drop the code entirely. Meanwhile, if anyone does need it, it can be uncommented and used. (The changes to the win32 build config appear to be automatically generated as a result of disabling the feature in configure. I'm committing them to avoid confusion.)
* image: prevent invalid ptr access for > 4GB imagesAdrian Johnson2017-11-071-1/+3
| | | | | | | | | | | | Image data is often accessed using: image->data + y * image->stride On 64-bit achitectures if the image data is > 4GB, this computation will overflow since both y and stride are 32-bit types. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98165 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* pdf: set default create dateAdrian Johnson2017-10-241-0/+1
|
* gl: Add support for OpenGL ES 3.0Bryce Harrington2017-09-132-8/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the OpenGL ES support to extend it to version 3.0. A number of new features are available in glesv3 including creation of multi-sampled renderbuffers. These renderbuffers can be blitted to single sample textures (but not the other way around). Other features such as PBO for image uploading, are left as followon work. For this preliminary implementation, glesv3 backends always create renderbuffers, which can be set as single sample or multisample. The renderbuffer's content is blitted to the texture only when used as a source or a mask. Images uploaded to a texture stay there until the surface is used as a rendering target, at which point its painted to the renderbuffer. This patch is heavily based off of Henry Song's initial GLESv3 patch 6f7f3795 from his cairogles fork of Cairo, and incorporates subsequent fixes and pertinent refactorings from his trunk and review feedback from Uli. This implements the *functional* support for glesv3, excluding the various optimization work to utilize its features. Rendering and performance should not be expected to improve notably from pure glesv2. As the GL backend for Cairo remains "experimental", these changes should likewise be considered as such. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
* win32: gcc 5.4 build fixAdrian Johnson2016-06-211-0/+3
|
* gitignore: Ignore .trs (test results)Bryce Harrington2015-07-311-0/+1
|