summaryrefslogtreecommitdiff
path: root/boilerplate/cairo-boilerplate.h
AgeCommit message (Collapse)AuthorFilesLines
2011-06-20boilerplate: Silence MSVC warningsAndrea Canciani1-0/+1
On Win32 INT_MIN/MAX macros are defined in stdint.h, which makes MSVC complain about the following redefinitions: ...\stdint.h(73) : warning C4005: 'INT16_MIN' : macro redefinition ...\boilerplate\cairo-boilerplate.h(64) : see previous definition of 'INT16_MIN' ...\stdint.h(77) : warning C4005: 'INT16_MAX' : macro redefinition ...\cairo-boilerplate.h(67) : see previous definition of 'INT16_MAX' ...\stdint.h(80) : warning C4005: 'UINT16_MAX' : macro redefinition ...\boilerplate\cairo-boilerplate.h(70) : see previous definition of 'UINT16_MAX'
2011-06-02perfChris Wilson1-2/+9
2010-11-28Boilerplate: Set fallback resolution using force_fallbacks functionAdrian Johnson1-1/+2
cairo_set_fallback_resolution() does not work when testing rgb24 surfaces
2010-07-03boilerplate: Add a describe vfuncBenjamin Otte1-0/+4
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.
2010-06-24whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.M Joonas Pihlaja1-21/+23
Ran a script to align the formal parameters of functions and collapse spaces to tabs in code.
2010-03-27boilerplate: Create an image16 targetChris Wilson1-0/+1
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.
2010-03-23boilerplate: Cleanup the list of backends upon shutdown.Chris Wilson1-0/+3
2009-10-22[meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja1-1/+1
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
2009-08-29[boilerplate] Runtime library checkChris Wilson1-0/+1
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.
2009-07-23Remove clip handling from generic surface layer.Chris Wilson1-0/+2
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 ▏
2009-07-04[boilerpate] Move target definition to backends.Chris Wilson1-2/+1
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.
2009-06-27[test] Add group-unalignedChris Wilson1-4/+4
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.
2009-06-19[test] Experiment with reference targetsChris Wilson1-0/+5
Specify another boilerplate target to use as the reference for this target. We then use this in cairo-test-trace in preference to using the image surface. Still not perfect, though the framework is improving.
2009-06-16Import Qt backend by MozillaVladimir Vukicevic1-0/+3
Written by Vladimir Vukicevic to enable integration with Qt embedded devices, this backend allows cairo code to target QPainter, and use it as a source for other cairo backends. This imports the sources from mozilla-central: http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter renames them from cairo-qpainter to cairo-qt, and integrates the patch by Oleg Romashin: https://bugs.freedesktop.org/attachment.cgi?id=18953 And then attempts to restore 'make check' to full functionality. However: - C++ does not play well with the PLT symbol hiding, and leaks into the global namespace. 'make check' fails at check-plt.sh - Qt embeds a GUI into QApplication which it requires to construct any QPainter drawable, i.e. used by the boilerplate to create a cairo-qt surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion failures that all cairo objects are accounted for upon destruction. [Updated by Chris Wilson] Acked-by: Jeff Muizelaar <jeff@infidigm.net> Acked-by: Carl Worth <cworth@cworth.org>
2009-06-12[boilerplate] Make array of targets const.Chris Wilson1-2/+2
Protect the boilerplate targets from unexpected modifications.
2009-06-12[boilerplate] Export cairo_boilerplate_get_image_target()Chris Wilson1-0/+3
A routine to scan the compiled list of targets and return the entry corresponding to the image backend.
2009-01-03[boilerplate] Remove CAIRO_BOILERPLATE_LOG()Chris Wilson1-4/+0
The variadic macro is only used within boilerplate/ so replace it with a simple, and portable, call to fprintf.
2009-01-03[boilerplate] Redefine DEBUG() for portability concernsChris Wilson1-1/+1
Behdad warned that using an empty variadic macro was non-portable.
2009-01-03[boilerplate] Suppress xlib warnings on stderrChris Wilson1-0/+4
If we cannot test the xlib backend simply because there is no Display, just report UNTESTED and do not clutter the output with superfluous warnings [see the output from the buildbots for an example]. However, keep the warnings around so that a developer can re-enable them and so simply move them to a new "lower priority" macro.
2008-11-05[test] Mark targets with is_meta?Chris Wilson1-0/+1
Allow tests to skip targets based on whether they are a meta surface or not.
2008-10-31[test] Build test suite into single binary.Chris Wilson1-0/+1
Avoid calling libtool to link every single test case, by building just one binary from all the sources. This binary is then given the task of choosing tests to run (based on user selection and individual test requirement), forking each test into its own process and accumulating the results.
2008-09-28Automate error checking for fallback-resolution.Chris Wilson1-0/+7
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.)
2008-09-26[boilerplate] Retry conversion in process if first attempt fails.Chris Wilson1-2/+9
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.
2008-09-10[boilerplate] Include cairo-compiler-private.hChris Wilson1-0/+2
Actually use the compiler specific diverts and defines.
2008-09-04[boilerplate] Rename xmalloc.[ch] to boilerplate namespaceBehdad Esfahbod1-1/+1
2008-09-02[boilerplate] Add cairo_boilerplate_version[_string]() functionsBehdad Esfahbod1-0/+6
2008-08-20[test] Cache last output and compare next time.Chris Wilson1-0/+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'.
2008-08-19[boilerplate] Daemonic conversion utility.Chris Wilson1-0/+7
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.
2008-08-18[test] Avoid redundant writes/reads of test surfaces via png.Chris Wilson1-22/+40
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.
2008-08-13[test] Preparatory work for running under memfault.Chris Wilson1-6/+5
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/.
2008-04-11[test] Handle TEST_CONTENT_COLOR_ALPHA_FLATTENED similar surfaces.Chris Wilson1-0/+3
Convert the boilerplate specific flattened content value to the ordinary CAIRO_CONTENT_COLOR_ALPHA for use with cairo_push_group_with_content() - otherwise cairo rightfully flags an error and the test harness decides that the similar surface is not available.
2008-02-06Some fixes and improvements to the Win32 buildAzar@.(none)1-0/+4
2007-04-20[boilerplate] Add cairo_boilerplate_format_from_contentBehdad Esfahbod1-0/+3
2007-04-20[boilerplate] Move xasprintf to xmalloc.cBehdad Esfahbod1-17/+15
2007-04-20[boilerplate] Rename xcairo_surface_set_user_data to ↵Behdad Esfahbod1-0/+6
cairo_boilerplate_surface_set_user_data and make it public.
2007-04-20[boilerplate] Add a boolean is_vector to boilerplate target typeBehdad Esfahbod1-0/+1
This is used to move the skip-these-tests-for-vector code into cairo-test which it belongs.
2007-04-18[boilerplate] Add cairo_boilerplate_get/free_targetsBehdad Esfahbod1-1/+5
This means, test and perf suites now share the same target handling code, including parsing CAIRO_TEST_TARGET.
2007-04-18[boilerplate] s/_cairo_test_content_name/cairo_boilerplate_content_name/gBehdad Esfahbod1-1/+1
2006-10-16Rename wait_for_rendering to syncrhonizeCarl Worth1-1/+1
We're not using this call both before and after rendering so the old name just didn't make sense anymore.
2006-09-11perf: Make xlib testing wait for the X server to finish rendering.Carl Worth1-0/+4
We do this by adding a new cairo_perf_timer_set_finalize function and in the case of the xlib backend passing a callback to that function that does a 1x1 XGetImage.
2006-09-09boilerplate: Allow targets to distinguish between test and perf.Carl Worth1-5/+11
Add a new cairo_boilerplate_mode_t so that the boilerplate targets can do slightly different things if being tested for correctness vs. being run for performance.
2006-09-09Use unsigned consistently to avoid compiler warning.Carl Worth1-1/+1
2006-09-09boilerplate: Rename cairo_test_target_t to cairo_boilerplate_target_tCarl Worth1-9/+9
2006-09-06perf: Report times not rates. Interface in integers not doubles.Carl Worth1-0/+31
2006-09-05Move target tolerance to cairo_test_target structure (should let ↵Carl Worth1-0/+1
single-pixel SVG errors pass) Previously we were setting the target tolerance based on the surface type. But that doesn't work as multiple backends will provide a surface of type meta. So instead we put the tolerance as a value in the cairo_test_target data structure. With this change, some single-pixel errors of 1 in the SVG backend should now be ignored.
2006-08-31Initial hookup of Vlad's timer/alarm codeCarl Worth1-0/+1
2006-08-31perf: Don't measure meta-surface-backed surface types.Carl Worth1-0/+3
2006-08-31boilerplate: Fix missing include of config.h which was preventing many ↵Carl Worth1-0/+4
backends from being tested
2006-08-31boilerplate: Remove custom read/write-png code in favor of using cairo surfacesCarl Worth1-1/+9
Also combine image_diff and image_diff_flattened into a single function
2006-08-30Separate the sharable stuff out of cairo-test.c into cairo-boilerplate.cCarl Worth1-0/+80