Commit graph

7181 commits

Author SHA1 Message Date
Chris Wilson
dcb7f1d034 [script] Add missing include <string.h>
As reported by Magnus Boman <captain.magnus@gmail.com>.

Fixes Bug 22610 -- Patch to add missing include in util/cairo-script/csi-replay.c
http://bugs.freedesktop.org/show_bug.cgi?id=22610
2009-07-04 08:08:25 +01:00
Chris Wilson
97bd2228a6 [script] Insert spaces around '<<' and '>>'
The dictionary constructors are just ordinary tokens so need space for
delimiters.
2009-07-03 19:41:51 +01:00
Chris Wilson
6003ab77e1 Export meta-surface
The meta-surface is a vital tool to record a trace of drawing commands
in-memory. As such it is used throughout cairo.

The value of such a surface is immediately obvious and should be
applicable for many applications. The first such case is by
cairo-test-trace which wants to record the entire graph of drawing commands
that affect a surface in the event of a failure.
2009-07-03 18:26:50 +01:00
Chris Wilson
2a9903dbbf [script] Trim some excess verbage
Remove some redundant defining of surfaces and contexts and of setting
defaults. In order to reduce the number of defines, we need to operate on
the operand stack more frequently - though in practice those operations
are quite rare.
2009-07-03 16:47:42 +01:00
Chris Wilson
28773fe79f [test-meta] Initialize image
Oops, stupid mistake - missed off the initialization of the image to NULL
from the last commit.
2009-07-03 13:19:02 +01:00
Chris Wilson
ac6c3dbbae [test-meta] Lazily allocate image
Only allocate the image on first use, as we may never actually need to
construct the image output.
2009-07-03 12:57:53 +01:00
Chris Wilson
fe73a9dd14 [test] Record trace to an in-memory meta-surface
Requires hooking into test-meta-surface currently. Export meta-surface!

The idea is that on detection of an error, we can reconstruct a minimal
trace from the meta-surface. The first step is to simply dump the trace
for the failing meta-surface. Later, we should automatically minimise
this further.
2009-07-03 12:34:10 +01:00
Chris Wilson
633efe8187 [surface] Allocate temporary region on stack
Avoid a very short-lived temporary heap allocation of a region.
2009-07-02 15:29:22 +01:00
Carlos Garcia Campos
b2e2a2f31a [test] Update argb32 pdf reference image for trap-clip 2009-07-02 15:01:41 +02:00
Carlos Garcia Campos
910afc7a8e [test] Mark all smask tests as XFAIL for pdf
Those tests use linear gradients which are not correctly handled by
poppler yet. See https://bugs.freedesktop.org/show_bug.cgi?id=10942
2009-07-02 15:01:33 +02:00
Carlos Garcia Campos
5becfc2bd5 [test] Add pdf reference image for rotate-image-surface-paint
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:56:58 +02:00
Carlos Garcia Campos
f81203cde8 [test] Add pdf reference image for mask-transformed-image 2009-07-02 14:56:48 +02:00
Carlos Garcia Campos
9d538ef337 [test] Update argb32 and rgb24 pdf reference image for mask 2009-07-02 14:56:39 +02:00
Carlos Garcia Campos
97def877bb [test] Update pdf reference image for surface-pattern
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:56:30 +02:00
Carlos Garcia Campos
8a6bdc63c1 [test] Update argb32 and rgb24 pdf reference image for text-pattern 2009-07-02 14:56:22 +02:00
Carlos Garcia Campos
b46ba7aa33 [test] Update pdf reference image for text-transform 2009-07-02 14:56:14 +02:00
Carlos Garcia Campos
9bc7ab980d [test] Update pdf reference image for filter-nearest-transformed
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
27938f7e3f [test] Update pdf reference image for filter-nearest-offset
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
e6576e8912 [test] Update argb32 pdf reference image for clip-operator 2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
13d9374ec1 [test] Remove PDF reference images for scale-source-surface-paint
It works with current poppler now
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
3710c4184c [test] Remove PDF reference images for paint-with-alpha
It works with current poppler now
2009-07-02 14:50:15 +02:00
Carlos Garcia Campos
8162acd81a [test] Remove PDF reference images for paint-source-alpha
It works with current poppler now
2009-07-02 14:50:15 +02:00
Carlos Garcia Campos
1e1f4fd092 [test] Use poppler_page_render with a transparent surface
Instead of using an opaque surface filled in white, use a transparent
surface and fill it in white by using CAIRO_OPERATOR_DEST_OVER after
rendering.
2009-07-02 14:50:15 +02:00
Chris Wilson
700a555d19 [surface] Expose a SURFACE_TYPE_MISMATCH nil object
Gah, yet more error object bloat. Must finish cairo-object.
2009-07-01 19:45:11 +01:00
Chris Wilson
8f4611a94b [perf] Fix use-after-free when retrieving error line number
We find out the status on destroying the script and then attempt to query
the defunct script for more info about the error. Wrong.
2009-07-01 19:45:06 +01:00
Chris Wilson
7c160dea54 [perf] Unbreak cairo-perf-diff builder 2009-07-01 10:12:50 +01:00
Chris Wilson
3d88f99668 [perf] Enable cairo-perf-trace in cairo-perf-diff
Only as a --trace option for now.
2009-07-01 09:57:56 +01:00
Chris Wilson
1564d67d63 [perf] Exclude the xlib-reference target from cairo-perf 2009-06-30 22:23:21 +01:00
Chris Wilson
e5b4f78bff [boilerplate] Only include null-test-surface >= cairo-1.9.3 2009-06-30 22:12:50 +01:00
Chris Wilson
e0bdbb437e [xlib] Remove redundant checks for src_picture==None
Before attempting to even set the attributes on the source Picture, we
ensure that it exists. So remove the redundant safe-guards to do nothing
if it doesn't exist.
2009-06-30 22:04:01 +01:00
Chris Wilson
b7f68d3518 [perf] Enable trace directory recursion.
I have an idea to categorise traces within their own subdirectories and so
for convenience added path walking to cairo-perf-trace. Principally this
should allow for forests of symlinks of all types.
2009-06-30 20:46:12 +01:00
Chris Wilson
6102dd0c1c [ft] Correct reference counting for implementation font face
We are expected to return a new reference from get_implementation(), and
failing to do so was causing use-after-frees (detected by the reference
counting checks).
2009-06-29 10:50:44 +01:00
Chris Wilson
4f745fbe33 [test] Only run fallback-resolution for enabled targets
A secondary check that both activates CAIRO_TEST_TARGET and prevents a
NULL-deref with the null test surface.
2009-06-29 10:49:51 +01:00
Chris Wilson
d80f5580ef [pattern] Mark _cairo_pattern_nil as static
Fixes check-def.sh failure.
2009-06-28 21:11:41 +01:00
Chris Wilson
758a18b354 [test] Timeout support for tests
Enforce that each test must render within 60 seconds or be considered to
have hit an infinite loop and be reported as a CRASH. The timeout value is
adjustable via CAIRO_TEST_TIMEOUT -- a value of 0 will disable.
2009-06-28 21:10:30 +01:00
Chris Wilson
f7021d8f3e [script] Enable error handling for recursive scanners
It's conceivable that a script could execute another file and so we should
only setjmp on the first invocation.
2009-06-28 20:44:30 +01:00
Chris Wilson
963664727b [trace] Compile fix for --enable-script
Silly typo as pointed out by Hans Breuer <hans@breuer.org>.
2009-06-28 10:49:37 +01:00
Chris Wilson
2ecafb025c [script] Reuse glyph advance cache over multiple invocations
Store the metric cache as user-data on the scaled-font so that we can
retrieve it on future calls to show-glyphs and friends.
2009-06-28 10:09:01 +01:00
Chris Wilson
663da31bbe [boilerplate] Propagate original error from create_from_png()
During cairo_boilerplate_get_image_surface_from_png() the original status
returned by cairo_image_surface_create_from_png() could have been masked
by inappropriate context construction when flattening or extracting.
Simply check after creating the surface from the png file, and return
immediately if in error.
2009-06-28 01:17:13 +01:00
Chris Wilson
2bbb694202 [test] Disable fallback16 testing
Only use the RGB16_565 surface as a source during testing. We presume that
pixman is itself rigorously tested and the output is equivalent to the
image surface. Enabling this test surface would require too large of a
burden to maintain the reference images for the 16-bit backend.
2009-06-28 01:00:53 +01:00
Chris Wilson
34ac8673b2 [script] Use setjmp exception handling during scanning
Save ~5% of overhead by using longjmp on error to terminate scanning
instead of propagating the error, incurring lots of redundant error
checks.
2009-06-28 00:48:05 +01:00
Chris Wilson
2b1ec7a4d8 [cairo] Report true error via pattern from cairo_pop_group()
Report the correct error via the returned pattern->status rather than
simply returning the NO_MEMORY nil object.
2009-06-27 22:48:19 +01:00
Chris Wilson
5c3be3ece2 [cairo] Mark cr->status guard as unlikely
For correct operation, the context should never be in error, so mark the
error context as being unlikely to optimize the common path.
2009-06-27 22:40:15 +01:00
Chris Wilson
f388028333 [gstate] Avoid temporary allocation for transformed patterns
Observe that patterns are not altered during an operation and so we are
safe to use the data from the original pattern without copying. (This is
enforced through the declaration that the backends operate on constant
patterns which are not allowed to be referenced or destroyed.)
2009-06-27 20:18:18 +01:00
Chris Wilson
3759c7b34b [perf] Enable the null-backend for trace replays. 2009-06-27 19:38:30 +01:00
Chris Wilson
8d4c704129 [ft] Cache the resolved font face
Keep the resolved font face alive whilst the default FcConfig remains
identical i.e. resolve the pattern again if the system configuration
changes (e.g. a new font is added or the rules are updated). This should
retain the benefits of lazily resolving font patterns whilst improving
performance by reducing the number of calls to FcFontMatch().
2009-06-27 19:34:20 +01:00
Chris Wilson
ddadd41a6c [test] Remove broken PDF reference images for push-group
More XFAIL reference images that are now invalidated by changes in
poppler.
2009-06-27 18:07:36 +01:00
Chris Wilson
4d233fa4a6 [test] Remove invalid smask PDF reference images
These need to be recorded using an XFAIL reference. In the meantime, as
the poppler output has changed, just remove all the invalid PDF reference
images.
2009-06-27 18:04:37 +01:00
Chris Wilson
86624627e4 [test] Add group-unaligned
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-27 17:53:18 +01:00
Chris Wilson
c506ddb586 [pdf] Restore original surface size after emitting group mask
A trivial fix to reset the original surface size after emitting the group.
The annoying aspect is that this should have been caught by the test suite.
Alas, no. A gentle reminder that simple line coverage is insufficient. :(
2009-06-27 16:57:35 +01:00