summaryrefslogtreecommitdiff
path: root/boilerplate/cairo-boilerplate-pdf.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix testing in the full mode for PDF, PS and SVG backendsAnton Danilkin2020-11-131-12/+21
| | | | | | 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.
* pdf: set default create dateAdrian Johnson2017-10-241-0/+1
|
* Refactor ARRAY_LENGTH macro definitions in test codeBryce Harrington2014-11-201-2/+0
|
* Revert accidental push of ps debugging API.Chris Wilson2012-04-141-6/+13
| | | | | | | | | | This reverts commits 6ad8c96fd81e06cea6ada4a83e7c5614f150f914, a3f97d1d2e77a0fee4ca03d5dc9968952a440561, 25abe582982caeb07d1e0af4acca53bb110a33bf I should know better by now than to push without checking for outstanding changes.
* pdf (debug API): Export the ability to force fallbacksChris Wilson2012-04-121-13/+6
| | | | | | | | | We need to occasionally force fallbacks whilst testing the PDF output, so export a debug interface to do so in order to avoid poking around inside cairo internals. References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* boilerplate: Remove unused thread id parameterAndrea Canciani2011-11-121-1/+0
| | | | | The thread id is not used anymore (it is always == 0), so it can be removed.
* On OS/2, WIFSIGNALED and WTERMSIG are prototyped in sys/wait.hDave Yeo2011-09-181-0/+4
| | | | | | | | | | boilerplate/cairo-boilerplate-pdf.c | 4 ++++ boilerplate/cairo-boilerplate-ps.c | 4 ++++ boilerplate/cairo-boilerplate-svg.c | 4 ++++ build/configure.ac.system | 2 +- 4 files changed, 13 insertions(+), 1 deletions(-) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* test: Fix compilation on win32Andrea Canciani2011-06-141-3/+6
| | | | | | | The Microsoft C Compiler does not accept empty-initialized arrays: cairo-boilerplate-win32-printing.c(373) : error C2059: syntax error : '}' cairo-boilerplate-win32-printing.c(374) : warning C4034: sizeof returns 0
* boilerplate: Introduce create_similar hookChris Wilson2011-06-021-0/+2
| | | | | | | | | | | | | | A deficiency of cairo-perf-trace is that it currently always uses similar surfaces for new surface which are kindly cleared by Cairo. This does not accurately reflect the captured trace and introduces large bandwidth overheads that distort the profiles. So we introduce a new boilerplate hook so that the targets can create a surface without incurring additional overheads. [Fixes the broken partial commit of bf1b08d066e.] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Boilerplate: Set fallback resolution using force_fallbacks functionAdrian Johnson2010-11-281-1/+5
| | | | cairo_set_fallback_resolution() does not work when testing rgb24 surfaces
* boilerplate: Add a describe vfuncBenjamin Otte2010-07-031-2/+2
| | | | | | | | | This function is supposed to describe the backend in use. The describe function is optional - and therefore initialized as NULL everywhere. Note: It is well known that the xlib backend uses X. What is not known is what version the server supports or what graphics card it is running on. That is the information the describe vfunc is supposed to provide.
* whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.M Joonas Pihlaja2010-06-241-11/+13
| | | | | Ran a script to align the formal parameters of functions and collapse spaces to tabs in code.
* boilerplate: don't compile pdf test code when pdf is not testedBenjamin Otte2010-05-021-0/+3
| | | | Avoids gcc warnings when libpoppler version isn't good enough.
* boilerplate: Ensure that the recording surfaces are finished.Chris Wilson2010-04-301-1/+4
| | | | | Be paranoid and explicitly call finish to cleanup self-referential leaks when using paginated/recording surfaces.
* boilerplate: Create an image16 targetChris Wilson2010-03-271-2/+2
| | | | | | In order to exercise the newly restored r5g6g5 support, we need to create an appropriate surface and feed it through the test and performance suites.
* configure: Globally define AC_GNU_SOURCEChris Wilson2010-01-221-0/+4
| | | | | | We were using _GNU_SOURCE throughout the codebase, so simply define it once during configure. This is the easiest method to enable recursive mutexes using pthreads, as required in a pending patch.
* [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja2009-10-221-3/+3
| | | | | | | The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
* [build] Improve handling of missing test apparatusChris Wilson2009-09-081-0/+2
| | | | | Improve detection, reporting and disabling of test backends when we lack the required libraries and utilities.
* [boilerplate] Runtime library checkChris Wilson2009-08-291-0/+2
| | | | | | | For the purposes of benchmarking it is useful to run cairo-perf against a different library from the one it was compiled against. In order to do so, we need to check that the runtime library contains the required entry points for our targets - which we can check by using dlsym.
* [boilerplate] Fix compilation against old revisions (as old as 1.9.2!)Chris Wilson2009-07-241-0/+4
|
* Remove clip handling from generic surface layer.Chris Wilson2009-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling clip as part of the surface state, as opposed to being part of the operation state, is cumbersome and a hindrance to providing true proxy surface support. For example, the clip must be copied from the surface onto the fallback image, but this was forgotten causing undue hassle in each backend. Another example is the contortion the meta surface endures to ensure the clip is correctly recorded. By contrast passing the clip along with the operation is quite simple and enables us to write generic handlers for providing surface wrappers. (And in the future, we should be able to write more esoteric wrappers, e.g. automatic 2x FSAA, trivially.) In brief, instead of the surface automatically applying the clip before calling the backend, the backend can call into a generic helper to apply clipping. For raster surfaces, clip regions are handled automatically as part of the composite interface. For vector surfaces, a clip helper is introduced to replay and callback into an intersect_clip_path() function as necessary. Whilst this is not primarily a performance related change (the change should just move the computation of the clip from the moment it is applied by the user to the moment it is required by the backend), it is important to track any potential regression: ppc: Speedups ======== image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup ▌ image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup ▎ image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup ▏ image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup ▏ Slowdowns ========= image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown ▏
* [boilerpate] Move target definition to backends.Chris Wilson2009-07-041-14/+34
| | | | | | | | | | | By moving the backend target definition out of the massive amlagamated block in cairo-boilerplate.c and into each of the cairo-boilerplate-backend.c, we make it much easier to add new targets as the information need only be entered in a single file and not scattered across three. However, updating the target interface means trawling across all the files -- except given that I found it difficult maintaining the single massive array I do not see this as an increase in the maintenance burden.
* [test] Add group-unalignedChris Wilson2009-06-271-7/+7
| | | | | | | | | | | Test case for: Bug 22441 -- Unexpected shift with push_group and pop_group https://bugs.freedesktop.org/show_bug.cgi?id=22441 This is a test that demonstrates the error in the pdf backend when using groups on surfaces with non-integer sizes. In order to create such a surface, we need to update the boilerplate to use doubles instead of integers when specifying the surface size.
* [boilerplate] Missing static on pdf user data key.Chris Wilson2009-06-191-1/+1
|
* [test] Convert a few residual '-out.*'Chris Wilson2008-11-031-1/+1
| | | | Catch a few -out.* hiding in boilerplate.
* Automate error checking for fallback-resolution.Chris Wilson2008-09-281-13/+16
| | | | | | | | | | | For this we extend the boilerplate get_image() routines to extract a single page out of a paginated document and then proceed to manually check each page of the fallback-resolution test. (Well that's the theory, in practice SVG doesn't support multiple pages and so we just generate a new surface for each resolution. But the infrastructure is in place so that we can automate other tests, e.g. test/multi-pages.)
* [boilerplate] Retry conversion in process if first attempt fails.Chris Wilson2008-09-261-10/+1
| | | | | | | One possibility for a read failure whilst converting the image is if the external utility crashed. This information is important for the test suite as knowing input that causes the converter to crash is just as vital as identifying a crash within the library.
* [test] Cache last output and compare next time.Chris Wilson2008-08-201-13/+5
| | | | | | | | | | | | | | | | | | | | | | | Compare the current output against a previous run to determine if there has been any change since last time, and only run through imagediff if there has been. For the vector surfaces, we can check the vector output first and potentially skip the rasterisation. On my machine this reduces the time for a second run from 6 minutes to 2m30s. As most of the time, most test output will remain unchanged, so this seems to be a big win. On unix systems, hard linking is used to reduce the amount of storage space required - others will see about a three-fold increase in the amount of disk used. The directory continues to be a stress test for file selectors. In order to reduce the changes between runs, the current time is no longer written to the PNG files (justified by that it only exists as a debugging aid) and the boilerplate tweaks the PS surface so that the creation date is fixed. To fully realise the benefits here, we need to strip the creation time from all the reference images... The biggest problem with using the caches is that different runs of the test suite can go through different code paths, introducing potential Heisenbergs. If you suspect that caching is interfering with the test results, use 'make -C test clean-caches check'.
* [boilerplate] Daemonic conversion utility.Chris Wilson2008-08-191-18/+45
| | | | | | | | | | | | | | | In order to achieve substantial speed improvements the external conversion utilities are rewritten as a daemon that communicates with the test suite over a local socket. This is faster as it avoids the libtool and dynamic linker overhead for each invocation, the caches persist between tests and we no longer require a round trip through libpng. The daemon is started automatically by the test suite and if communication cannot be established then it falls back to using a pipe to a normal conversion utility. The daemon will then persist for 60 seconds waiting for further connections. Of course any memory leak (stares at poppler) is exacerbated.
* [boilerplate] Check exit code from system for trapped signals.Chris Wilson2008-08-181-1/+12
| | | | | | | If the external conversion utility was killed by a signal (e.g. the user sent SIGINT), raise that signal within our process as well. This means that a crash inside poppler or rsvg will be flagged as a crash inside the test suite, and makes interrupting the test suite far more responsive.
* [test] Avoid redundant writes/reads of test surfaces via png.Chris Wilson2008-08-181-0/+26
| | | | | | | | | As Behdad suggested, we can dramatically speed up the test suite by short-circuiting the write to a png file, only to then immediately read it back in. So for the raster based surfaces, we avoid the round-trip through libpng by implementing a new boilerplate method to directly extract the image buffer from the test result. A secondary speedup is achieved by caching the most recent reference image.
* [test] Pass a 'complete' name to create_surface().Chris Wilson2008-08-131-2/+1
| | | | | | | | Construct the test name to pass to the boilerplate creation routines such that it uniquely identifies the test in terms of test, target, content and pass (similar, offset, thread). This allows the vector targets to create output different output files for each test, whereas before, later tests would overwrite existing files making debugging more difficult.
* [test] Preparatory work for running under memfault.Chris Wilson2008-08-131-10/+35
| | | | | | | | | | | | | | | | | | | | In order to run under memfault, the framework is first extended to handle running concurrent tests - i.e. multi-threading. (Not that this is a requirement for memfault, instead it shares a common goal of storing per-test data). To that end all the global data is moved into a per-test context and the targets are adjusted to avoid overlap on shared, global resources (such as output files and frame buffers). In order to preserve the simplicity of the standard draw routines, the context is not passed explicitly as a parameter to the routines, but is instead attached to the cairo_t via the user_data. For the masochist, to enable the tests to be run across multiple threads simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired number. In the long run, we can hope the need for memfault (runtime testing of error paths) will be mitigated by static analysis. A promising candidate for this task would appear to be http://hal.cs.berkeley.edu/cil/.
* Re-enable pdf tests with gradients and add poppler-based reference imagesCarl Worth2008-02-201-42/+0
| | | | | This freezes the current (buggy) poppler result in the test suite so that we will notice any future regressions.
* Re-enable some pdf tests now that poppler has knockout supportCarl Worth2008-02-201-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several pdf tests disabled waiting for this bug fix: Poppler does not correctly handle knockout groups https://bugs.freedesktop.org/show_bug.cgi?id=12185 That's in place for poppler now, so we're turning the tests back on. Some of the affected tests now pass perfectly: over-above-source over-around-source over-below-source over-between-source Some just needed new reference images: operator-clear clip-operator-pdf-argb32 The remaining tests still fail, but none of the failures can obviously be ascribed to just poppler problems: clip-operator-pdf-rgb24 operator-source unbounded-operator The first two have some serious problems, while in the case of unbounded-operator the problem is extremely minor (a white grid appears in the background where the reference image is all black).
* Disable radial-gradient and unbounded-operator tests for pdfCarl Worth2007-08-291-1/+3
| | | | | | | These are failing due to (already reported) poppler bugs. There were also problems with the gradients in the PDF files previously, but these have recently been fixed.
* Disable 7 cairo-pdf tests due to poppler knockout-group bugCarl Worth2007-08-271-7/+18
| | | | | | | | | | | | The following 7 tests currently fail with poppler due to: Poppler does not correctly handle knockout groups https://bugs.freedesktop.org/show_bug.cgi?id=12185 and we've verified with acroread that the cairo-pdf output does render as intended there. The disabled tests are clip-operator, operator-clear, operator-source, over-above-source, over-around-source, over-below-source, and over-between-source.
* Add explanation of pdf_ignored_tests with links to upstream poppler bug reportsCarl Worth2007-08-271-0/+29
|
* Don't test PDF tests known to fail due to poppler limitationsCarl Worth2007-04-271-0/+15
| | | | | | | | | | The following four tests are disabled: gradient-alpha, linear-gradient, text-pattern, trap-clip We don't use XFAIL as that would disable all backends, (but we can still usefully use these tests on backends other than PDF).
* [pdf] Get rid of _cairo_pdf_test_force_fallbacksBehdad Esfahbod2007-04-211-0/+19
| | | | in favor of cairo_boilerplate_pdf_surface_force_fallbacks.
* [boilerplate] Clean up includes and remove unnecessary onesBehdad Esfahbod2007-04-201-1/+1
|
* [boilerplate] Strip pdf boilerplate into cairo-boilerplate-pdf*Behdad Esfahbod2007-04-201-0/+134