Commit graph

6470 commits

Author SHA1 Message Date
Chris Wilson
e6963a5bfe Mark allocation failures as unlikely.
Use the gcc likelihood annotation to indicate that allocation failures are
extremely unlikely.
2008-11-29 11:20:34 +00:00
Chris Wilson
d1801c23fa Mark if(status) as being unlikely.
The error paths should be hit very rarely during normal operation, so mark
them as being unlikely so gcc may emit better code.
2008-11-29 11:20:33 +00:00
Chris Wilson
f0804d4856 [test] Exercise caps and joins under reflection.
The nature of the joins depends critically upon whether the joint is
clockwise or counter-clockwise, so extend the basic caps-joins test to
exercise both conditions i.e. repeat the test under a reflection.
2008-11-29 11:20:29 +00:00
Chris Wilson
f39dd86e29 [test] Add simple cap test.
Add a test case that only exercises capping, useful for developing
new strokers.
2008-11-29 10:14:26 +00:00
Chris Wilson
f2982e103c [fill] Allow rectangles to be implicitly closed.
Also scan for appendages of simple rectangles.
2008-11-29 10:14:26 +00:00
Chris Wilson
d2bcf1d76d [path] Carefully check for no more points.
As the empty path points to an embedded buf, we cannot rely on the buf
pointer being NULL to mark end-of-path.
2008-11-29 10:14:26 +00:00
Chris Wilson
424aba9be5 [check] Search for the word NOTE
Add word boundary markers around the regexp so that we only match for the
word NOTE and not on substrings like GL_NOTEQUAL.
2008-11-29 10:14:26 +00:00
Chris Wilson
36147140ce [perf] Fix build
If automake detects the use of cairo_perf_LDADD in an unused conditional
that overrides the default - so we need to manually set cairo_perf_LDADD.
2008-11-29 10:13:53 +00:00
Luo Jinghua
ed6bd4766c image: Use unsigned long to compute color masks.
Use unsigned long in the first place to prevent compiler from
expanding signed bit to all upper bits. e.g, a alpha mask 0xff0000
will expand to 0xffffffffff00000 on 64 bit platform which is not
what we expected.
2008-11-28 07:54:41 +08:00
M Joonas Pihlaja
41cb91d417 [script] Use the in-tree libcairo for csi-replay.
csi-replay was missing the in-tree libcairo.la so the build was
failing while looking for new symbols from the system libcairo.
2008-11-26 23:49:12 +02:00
Chris Wilson
5591cb58fd [script] Only use zlib if available.
Conditionally link against zlib - replaying a script will fail if the
trace uses a compressed format.
2008-11-26 17:43:22 +00:00
Chris Wilson
9432c0c9b8 [script] Link the interpreter against the built library.
Ensure we correctly link against the version of cairo just built.
2008-11-26 17:35:09 +00:00
Chris Wilson
815e5b962e [script] Add a fallback image surface for replay
If we do not have a native windowing surface compiled into the library,
just replay the script to an image surface.
2008-11-26 17:30:29 +00:00
Chris Wilson
5e37652362 [skiplist] Check for ffs()
Wine at least does not provide ffs(), so check at configure time and
open-code a replacement.
2008-11-26 17:26:57 +00:00
Chris Wilson
60282b866a [glitz] Fix clone_similar().
Clone similar open-coded various image surface functions and failed to
clone a sub-region resulting in failures for mask-transformed-* and
large-source.
2008-11-26 16:58:29 +00:00
Paolo Bonzini
47275c7ece [test] Fix glitz-surface-source test
The recent changes to separate glitz/agl broke the compilation of the
glitz-surface-source test.
2008-11-26 16:18:41 +00:00
Paolo Bonzini
a84ea78290 [test] Add quartz-surface-source test
Add a simple test to exercise using a Quartz surface as a source.
2008-11-26 16:17:45 +00:00
Paolo Bonzini
993941cfd7 [perf] Fix SDL compilation for MacOS X
The attached patch makes the SDL tests compile under Mac OS X.  The
problem is:

1) that <SDL_main.h> should be included in files that define the main
function for SDL Mac OS X programs (this is not true with the upcoming
SDL 1.3 release).

2) that -lSDLmain, because it is statically linked, needs the Cocoa
framework in the LDADD of the main program.  Again, 1.3 will not require
this.
2008-11-26 16:15:35 +00:00
Chris Wilson
8a5b55ca6c [matrix] Impose a maximum number of refinement iterations
Ensure we do not loop forever trying to minimise the error between the
pixman and cairo matrices - for instance when the FPU is not running at
full precision.
2008-11-26 16:15:35 +00:00
Chris Wilson
4218699642 [skiplist] Use ffs()
Use ffs() [find-first-set-bit] instead of open-coding, which is about 25%
faster on my test machine.
2008-11-26 16:15:35 +00:00
Chris Wilson
039437c9cf [png] Use FILE* instead of void*.
Adrian Johnson reported that cygwin complained about the use of the void *
within feof() as it was using a macro and attempted a to deference the
void*...
2008-11-26 10:33:33 +00:00
Adrian Johnson
8fa3cd9564 Change uint to uint32_t 2008-11-26 06:40:47 +10:30
Luo Jinghua
e828f73306 glitz: Apply fixup to unbounded operators to clear area outside of mask 2008-11-26 00:09:11 +08:00
Luo Jinghua
449e7518be glitz: set correct parameters for linear and radial pattern.
Glitz expects 16.16 fixed point, but we use 24.8 fixed point by default.
2008-11-25 22:55:24 +08:00
Luo Jinghua
3bde440e00 glitz: fixup another stupid bug in fill_rectangles.
Wny I doesn't notice them before. Without fixes it fills n_rect times of
the first one in the rectangle list.
2008-11-25 22:36:53 +08:00
Chris Wilson
4ac38f7c2b [fill] Emit rectangles for GdkRegion
Scan the path for a series of consistently wound rectangles.
2008-11-25 12:54:58 +00:00
Chris Wilson
23df74e5ff [xlib] Cosmetic tweak.
Tightly scope the local rects.
2008-11-25 12:54:58 +00:00
Chris Wilson
06fabd6cbd [path] Fix up extents.
Forgot to round the box to the integer rectangle and missed why only
testing on image. Very naughty.
2008-11-25 12:54:58 +00:00
Luo Jinghua
1f44fb97f3 cairo-script: add $(top_builddir)/src to CPPPATH.
$(top_builddir)/src is needed to find cairo-features.h while
building out of tree.
2008-11-25 20:45:03 +08:00
Paolo Bonzini
487c708b3b [boilerplate] fix compilation for glitz-agl
As suggested on the list, this splits the cairo-boilerplate-glitz.c
file in three separate files, one for each backend.  Furthermore,
it fixes a few problems in compilation of the AGL backend test harness.
2008-11-25 20:40:37 +08:00
Chris Wilson
ca80b8c652 [pdf] Add a default case to silence the compiler.
The foolish compiler was emitting a warning about a potential
uninitialized variable even though the switch was fully populated.
2008-11-25 10:25:24 +00:00
Chris Wilson
b8991a1c69 [in-fill] Add the implicit close-path during move-to.
When interpreting a fixed-path for a fill operation, any move-to
implicitly closes the current path.
2008-11-25 10:24:58 +00:00
Chris Wilson
59de6fb89e [path] Compute approximate extents.
When computing the bounds of the clip path, we care more for a fast result
than absolute precision as the extents are only used as a guide to trim
the future operations. So computing the extents of the path suffices.
2008-11-25 10:16:32 +00:00
Chris Wilson
b6bf047494 [clip] Check for error surface
The update to use a NULL backend with an error surface broke creating a
context from an error surface.
2008-11-25 10:14:25 +00:00
Adrian Johnson
721cad9b24 Fix typo 2008-11-24 22:41:03 +10:30
Adrian Johnson
70e4c53272 Document location of image format specifications 2008-11-24 22:38:30 +10:30
Adrian Johnson
4ca644af27 Win32-print: Add PNG embedding support 2008-11-24 22:27:09 +10:30
Adrian Johnson
f59a3e03fc Add PNG get info function 2008-11-24 22:27:09 +10:30
Adrian Johnson
1892907e24 PDF: Disable PDF 1.5 features when version 1.4 is selected
JPEG 2000 image embedding and ActualText marked content are
PDF 1.5 features.
2008-11-24 22:27:09 +10:30
Adrian Johnson
c4a57385fa PDF: Add cairo_pdf_surface_restrict_to_version API
Now that we are using PDF 1.5 features, add an api to select between
version 1.4 or 1.5.
2008-11-24 22:27:09 +10:30
Adrian Johnson
d85e836911 PDF: Add newline to end of binary streams
PDF requires white space before the "endstream"
2008-11-24 22:27:09 +10:30
Adrian Johnson
b87d81ef0b Add image/jp2 to mime-data test 2008-11-24 22:27:03 +10:30
Adrian Johnson
7fdb712cba PDF: Add JPEG2000 image embedding
Requires increasing the PDF version to 1.5.
2008-11-23 21:05:41 +10:30
Adrian Johnson
0746efbf07 Add JPEG2000 mimetype and image info function 2008-11-23 21:05:36 +10:30
Adrian Johnson
5de1e4de93 Move cairo-jpeg-info.c to cairo-image-info.c
Other image formats will be added to the same file.
2008-11-23 18:33:58 +10:30
Luo Jinghua
63180edf6f glitz: set clone_offset_{x, y} on success in clone_similar.
With this fix, glitz backend passes 135 test cases and fails 66 test cases.
2008-11-23 11:42:26 +08:00
Luo Jinghua
36c1b3e591 glitz: fixup a stupid bug in get_image.
_pixman_format_from_masks returns a boolean instead of cairo status code.
Without this fix, get_image bails out over and over again even operations
was completed successfully. :-(
2008-11-23 10:27:49 +08:00
Nicolas Bruguier
c8b70aacc6 glitz: bring glitz backend to more or less working state.
Thanks Nicolas Bruguier for writing the original patch and
thanks Paolo Bonzini for pointing out. This patch converts 24.8
fixed point values into 16.16 ones before passing them down to glitz.
And I fixed a use-after-free issue in _cairo_glitz_surface_set_clip_region.
glitz_surface_set_clip_region takes the pointer and doesn't copy the
clip boxes, the original code frees the clip boxes immediately after
setting clip region. Keeping the box around with the life time of clip
region fixes the bug.
2008-11-22 18:16:17 +08:00
Chris Wilson
f15b1f26be [region] Use the caller supplied array for extracting boxes.
Allow the user to pass in a pre-allocated array and use it if the number
of boxes permits. This eliminates the frequent allocations during clipping
by toolkits.
2008-11-21 09:40:42 +00:00
Chris Wilson
9d2c55c661 [traps] Embed sufficient traps to accommodate a stroke rectangle
Small numbers of traps are frequently generated from either a path of a
single line, or that of a rectangle. Therefore should embed sufficient
storage with cairo_traps_t to accommodate the stroke of a single rectangle
(e.g. a pango unknown glyph hexbox) to avoid frequent allocations.
2008-11-21 09:40:42 +00:00