Commit graph

5553 commits

Author SHA1 Message Date
Chris Wilson
17fbb652b1 [test] Avoid redundant writes/reads of test surfaces via png.
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-18 16:18:52 +01:00
Chris Wilson
9b0b55cea7 [test/leaky-dashed-rectangle] Add ref to bug report.
Yevgen Muntyan has filed a bug report with the same symptoms as
leaky-dashed-rectangle, so add a reminder for when it is finally fixed.
2008-08-18 08:26:57 +01:00
Chris Wilson
212cbd3f1b [test/user-font] Correct the lifetime of the user font face.
By keeping a static reference to the user font face, it is erroneously kept
alive during a call to cairo_debug_reset_static_data(). (A violation of
the caller's contract to ensure that no active reference to a cairo object
is held by the caller.)
2008-08-18 08:26:43 +01:00
Chris Wilson
19d721d84c [cairo-compiler-private.h] Clear definition of __attribute__
Avoid a redefinition error when playing silly tricks with 'cpp -U__GNUC__'.
2008-08-17 21:43:14 +01:00
Chris Wilson
12d3d32f22 [Makefile.am] Support uno.
For the extreme masochist only. At the moment, it only generate syntax
errors, but the command line appears functional.
2008-08-17 21:41:36 +01:00
Chris Wilson
6808174e72 [win32-font] Review error handling.
The test-suite for win32 shows less than ideal error detection whilst
running on mingw32. Looking at the code, I spotted a few places where the
error propagation could be improved, and lo...
2008-08-17 21:00:52 +01:00
Chris Wilson
5ef52cd08f [svg] Tweak base64_write_func().
On a wild goose chase to eliminate a valgrind warning (caused by libpng,
alas) tweak the code for a bit of simplification.
2008-08-17 20:27:02 +01:00
Chris Wilson
c745a622db [test/toy-font-face] Use cairo_test_init/fini().
Minor step to harmonise the test with the rest of the suite.
2008-08-17 17:33:29 +01:00
Chris Wilson
37bca38772 [test/create-from-png] Return the failure.
Having checked all the possible PNG formats, report any failures.
2008-08-17 15:30:51 +01:00
Chris Wilson
3dc8e2dd0d [boilerplate] Dead store elimination.
Value stored to 'found' is never read.
2008-08-17 15:29:20 +01:00
Chris Wilson
d5f90a241c [ft-font] Dead store elimination.
Value stored to 'stride' is never read.
2008-08-17 15:19:19 +01:00
Chris Wilson
5109fdb1e6 [xlib] Return the integer from XGetDefault().
If the default value does not match a fontconfig constant, actually return
the parsed token.
2008-08-17 15:19:19 +01:00
Chris Wilson
4f4621adbf [scaled-font-subsets] Check for a failed malloc.
Missing NULL check after malloc.
2008-08-17 15:19:19 +01:00
Chris Wilson
418ebb0930 [scaled-font-subsets] Propagate error status from index_to_ucs4().
Check for an error status from ->index_to_ucs4() and propagate.
2008-08-17 15:19:19 +01:00
Chris Wilson
2ab700f21a [type3-glyph] Propagate error from image emission.
Return the error status from ->emit_image().
2008-08-17 15:19:19 +01:00
Chris Wilson
0549fcfd85 [pdf-operators] Propagate status from end_text().
Check for an error status after end_text().
2008-08-17 15:19:19 +01:00
Chris Wilson
96d45cfeee [pdf-operators] Propagate error from emit_glyph_string*().
Do not overwrite the error status if returned by either of the
emit_glyph_string*() routines.
2008-08-17 15:19:12 +01:00
Chris Wilson
63f64ff336 [pdf-operators] Propagate error from begin_actualtext().
Check the status return from begin_actualtext().
2008-08-17 14:53:55 +01:00
Chris Wilson
56c5f9954a [pdf] Propagate error from open_stream() failure.
Check status return for _cairo_pdf_surface_open_stream().
2008-08-17 14:51:48 +01:00
Chris Wilson
311464ad50 [pdf] Propagate status return.
Check status return from type3_glyph_surface_emit_glyph().
2008-08-17 14:50:35 +01:00
Chris Wilson
b14c6ac685 [pdf] dead code elimination.
Value stored to 'matrix' is never read.
2008-08-17 14:49:02 +01:00
Chris Wilson
97a2038c76 [ps] Dead store elimination.
Value stored to 'matrix' is never read.
2008-08-17 14:47:27 +01:00
Chris Wilson
e3b6a0c89a [cairo-output-stream] Dead store.
Value stored to 'p' is never read.
2008-08-17 14:44:44 +01:00
Chris Wilson
4517ef0520 [cairo-image-surface] Dead store.
Value stored to 'ret' is never read.
Value stored to 'mask_bpp' is never read.
2008-08-17 14:35:45 +01:00
Chris Wilson
4114a7bf06 [cairo-clip] Dead store.
Value stored to 'status' is never read.
2008-08-17 14:33:38 +01:00
Chris Wilson
32843260ae [cairo-scaled-font] Dead store.
Value stored to 'status' is never read.
2008-08-17 14:31:12 +01:00
Chris Wilson
6c0da32b06 [cairo-scaled-font] Actually use bytes_per_row.
bytes_per_row was precomputed but not actually used in the inner loop.
2008-08-17 14:30:04 +01:00
Chris Wilson
c7d803fc91 [cairo-surface] Add the lcd_filter default to the nil surfaces.
The nil surfaces did not correctly initialize the lcd filter font option
to the default value.
2008-08-17 14:08:28 +01:00
Chris Wilson
3b2d49e567 Ensure ranges of wideint types are always defined.
Define the range of the fixed types (int16, int32 etc) if the standard
headers fail to provide the definitions.
2008-08-17 14:08:28 +01:00
Chris Wilson
3d548f673b [configure] Add -Werror to CC_TRY_FLAG
g++ only warns about using C-only warning flags, but add -Werror promotes
the warning to an error and enables correct detection of the unsupported
flags.
2008-08-17 14:08:16 +01:00
Chris Wilson
3501eef698 [cairo-cache] Fixup doc comment.
Missing % before the macro name in the comment.
2008-08-17 12:13:59 +01:00
Peter O'Gorman
586dbaafe6 Compile with old compilers
Some compilers fail to compile non-constant struct initializers.
2008-08-17 11:42:48 +01:00
Chris Wilson
3998040c11 [cairo-cache] Simplify a status return to boolean.
_cairo_cache_remove_random() just returned whether it found an entry to
remove and so the code can be simplified by returning a boolean as opposed
to a status code.
2008-08-17 11:39:56 +01:00
Chris Wilson
841fe91c0e [ps] Promote char to an int to avoid valgrind warnings.
valgrind warns about an uninitialized read after a single char is promoted
to an int when passed to the printf. Silence the warning by using a
explicitly promoting the output byte to a full int.
2008-08-17 11:39:56 +01:00
Chris Wilson
8f56727986 [perf] Beware $OS may not be set.
Avoid a warning by ensuring that the two strings in the equality check are
not empty.
2008-08-17 11:39:56 +01:00
Chris Wilson
c44f2ab4d1 [perf] Silence trivial compiler warning.
The compiler complained about passing a non-string literal as the format
to printf, so just to sanitize the code and keep the compiler happy, add
the magic "%s" format.
2008-08-17 11:39:56 +01:00
Chris Wilson
db7e3cb854 [Makefile.am] Delete intermediates
Clean up after calling 'gcc -save-temps'.
2008-08-17 11:39:56 +01:00
Chris Wilson
67326b728b [gitignore] Ignore *.[is]
Playing with 'gcc -save-temps' understandably leaves behind large amounts
of clutter.
2008-08-17 11:39:56 +01:00
Chris Wilson
bafcbc633a [cairo-scaled-font] Check the most recently used font used first.
When searching for a matching font, check the most recently used font
first. This optimizes the common case where pango calls save() and restore()
around rendering each layout, but almost all consecutive layouts use the
same font.
2008-08-17 11:39:56 +01:00
Behdad Esfahbod
a1e5d40376 [doc] Another typo fix 2008-08-17 00:11:34 -04:00
Behdad Esfahbod
20d178c1c2 [doc] Fix typo 2008-08-16 21:27:03 -04:00
Chris Wilson
7a0f29d2f3 [test] Update prototype of win32-printing create_surface()
Missed the recent addition of the win32-printing surface to boilerplate.
2008-08-14 11:59:22 +01:00
Chris Wilson
63befc6ab1 [xlib] Remove the key parameter from the close display hook.
By inspecting all the users of the close display hooks, we can see that
(a) the key is redundant and (b) the data is unique to the hook. This
means we can trim the interface and stop the linear searches as soon as
we've found the correct element.
2008-08-14 09:14:51 +01:00
Chris Wilson
84a541a041 [cairo-xlib-surface] Remove status return for SUCCESS only function.
Convert _cairo_xlib_surface_set_repeat() to a void return type, and
update caller, as the function can only return CAIRO_STATUS_SUCCESS.
2008-08-14 09:06:24 +01:00
Chris Wilson
2699a986d3 [cairo-gstate] Guard against unsetting the font unnecessary.
Only unset the current font if we change any of the font settings, i.e.
font_face, font_options, font_matrix and ctm.
2008-08-14 08:59:14 +01:00
Chris Wilson
8552e76ee5 [xlib] Fix leak of pending_free_glyphs on CloseDisplay.
Missing free of the pending_free_glyphs array in
_cairo_xlib_surface_remove_scaled_font.
2008-08-14 08:25:58 +01:00
Chris Wilson
e3665bde5d [test/Makefile.am] Match *-out.{pdf,ps,svg}
When cleaning files, limit the glob to only match *-out.{pdf,ps,svg} in
order to distinguish the current practice of naming vector output files
from possible future vector target/reference files.
2008-08-13 22:02:12 +01:00
Chris Wilson
49ea4fbb25 [test/create-from-png-stream] Correct check for png loading error.
The test for failure to load the image surface from the png stream
incorrectly checked for a NULL surface, instead of the error surface.
2008-08-13 22:02:00 +01:00
Chris Wilson
93af67d7fd [test] Pass a 'complete' name to create_surface().
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.
2008-08-13 22:01:51 +01:00
Chris Wilson
517e532fb7 [test] Run fallback-resolution if we have at least one vector surface.
Currently fallback-resolution is included in the test suite if we have all
of the vector surfaces available. This commit enables individual support
for the vector surfaces, so that the test can be run even if one or more
of the surfaces are not available.
2008-08-13 22:01:39 +01:00