Commit graph

6799 commits

Author SHA1 Message Date
Chris Wilson
6eb0a9d97f [scaled-font] Hold reference to original font face
As noted by Carl during his LCA talk, caching of toy fonts was broken
because we create the scaled font using the implementation font face and
lose the reference to the containing font face that is cached by the toy
font face create routines. So the toy fonts were not being preserved for
the duration of the holdover scaled fonts and we recreated a new font
face, new scaled font and new glyph caches every time we needed a font.
2009-02-24 20:00:17 +00:00
Jeff Muizelaar
fe7d5323f5 Relanding: Add CAIRO_ENSURE_UNIQUE macro and use it in _cairo_error()
When using MSVC, _cairo_error() can be folded into other identical functions.
If that happens, _cairo_error isn't really useful anymore. Using the
CAIRO_ENSURE_UNIQUE macro makes sure this doesn't happen.

Use __asm to serve as a line delimiter. This allows us to use the
__asm{} block in a macro.
2009-02-19 16:00:17 -05:00
Jeff Muizelaar
78de0e045e Revert "Add CAIRO_ENSURE_UNIQUE macro and use it in _cairo_error()"
This reverts commit 126824f5e6.

It turns out MSVC doesn't handle line continuation characters in __asm{}
blocks very well, so revert for now until I come up with something that
works.
2009-02-19 15:45:11 -05:00
Jeff Muizelaar
126824f5e6 Add CAIRO_ENSURE_UNIQUE macro and use it in _cairo_error()
When using MSVC, _cairo_error() can be folded into other identical functions. If
that happens, _cairo_error isn't really useful anymore. Using the
CAIRO_ENSURE_UNIQUE macro makes sure this doesn't happen.
2009-02-19 13:31:55 -05:00
Jeff Muizelaar
d4227fc912 [test] Fix assert on default font family in toy-font-face
toy-font-face was checking that cairo_toy_font_face_get_family returned ""
which is CAIRO_FONT_FAMILY_DEFAULT when the freetype font backend is the
default. However, when other font backends are the default the returned family
is different. Therefore, instead of checking for "", we check for the appropriate
string depending on the backend.
2009-02-19 11:45:33 -05:00
Jeff Muizelaar
06fa7a8386 Fix a const warning in _cairo_user_data_array_foreach()
_cairo_user_data_array_foreach() was taking a function
with a void *key parameter instead of a const void *key
to match cairo_user_data_slot_t.
2009-02-18 18:43:29 -05:00
Jeff Muizelaar
f7b3c9df58 Add test/Makefile.sources
This lets test/Makefile.am and test/Makefile.win32 share a common list of sources.
It also makes test/Makefile.win32 useful again.
2009-02-16 22:28:32 -05:00
M Joonas Pihlaja
e380beae53 [sdl] Remove new backend.
The SDL backend makes invalid assumptions about SDL_Surface locking
semantics and doesn't deal correctly with the unpremultiplied pixel
format supported by SDL.  Removed as per discussion on the mailing list.

http://lists.cairographics.org/archives/cairo/2009-February/016595.html
2009-02-16 14:01:43 +02:00
Søren Sandmann Pedersen
79a72e6358 Delete _cairo_region_boxes_fini() 2009-02-16 05:44:15 -05:00
Søren Sandmann
f6daa664c1 Delete _cairo_region_get_boxes() in favor of _cairo_region_get_box()
The _cairo_region_get_boxes() interface was difficult to use and often
caused unnecessary memory allocation. With _cairo_region_get_box() it
is possible to access the boxes of a region without allocating a big
temporary array.
2009-02-15 18:57:31 -05:00
Søren Sandmann Pedersen
fcb13d262c Simplify region handling in xlib surface 2009-02-15 15:59:10 -05:00
Jeff Muizelaar
b43e7aee98 [wince] We don't need cairo_win32_tmpfile on Windows CE
_cairo_win32_tmpfile() uses _open_osfhandle() which is not available
on Windows CE. However, Windows CE doesn't have the permisions problems
that necessitated _cairo_win32_tmpfile() in the first place so we can just
use tmpfile() on Windows CE.
2009-02-13 12:15:23 -05:00
Chris Wilson
fa66291c88 [perf] Test non-antialiased fill.
Just because the i915 can special case such fills using a single-pass
tessellation in the stencil buffer.
2009-02-13 14:13:32 +00:00
Chris Wilson
aab9ed3432 [perf] Env variable to ignore similar targets whilst benchmarking.
Use CAIRO_TEST_IGNORE_SIMILAR to skip similar targets.
2009-02-13 14:13:25 +00:00
Chris Wilson
655f698733 [perf] Split can_run? into a separate precondition.
Allow tests to skip unnecessary setup when pruning the list of perf cases.
2009-02-13 13:26:53 +00:00
Chris Wilson
798581a1b5 [perf] Extend range of testing.
Primarily to test longer glyph runs, but also test large upper bounds for
strokes and fills.
2009-02-13 13:26:53 +00:00
Chris Wilson
1522fac5c7 [perf] Fix infinite loop in text
The row would wrap-around with the character index, causing an infinite
loop when trying to fill a window of size 512x512 and above.
2009-02-13 13:26:52 +00:00
Chris Wilson
187e347351 [test] Free ref_name in fallback-resolution.
Trivial leak of a few thousand bytes.
2009-02-13 13:26:52 +00:00
Chris Wilson
005436758c [path] Inline path ops during append_to_context()
By inlining the operations, and most significantly, precomputing the
combined user-to-backend matrix, we can achieve a speed up of over 50%,
which is a noticeable performance boost in swfdec - where append-to-path
accounts for over 35% [inclusive] of the time for a h/w accelerated
backend.
2009-02-13 13:26:52 +00:00
Chris Wilson
d295942b9d Inline _cairo_restrict_value()
This is one instance where the function call overhead dominated the
function call in both time and size.
2009-02-13 13:26:52 +00:00
Chris Wilson
cc8a09567c [surface] Move the meta-data copy-on-snapshot to the generic layer.
As pointed out by Paolo Bonzini, copying the meta data for a snapshot is
common for all backends and so should be handled by the generic layer.
2009-02-13 13:26:52 +00:00
Chris Wilson
adaf70a93f [surface] Separate the mime-data from the user-data.
Move the mime-data into its own array so that it cannot be confused with
user-data and we do not need to hard-code the copy list during
snapshotting. The copy-on-snapshotting code becomes far simpler and will
accommodate all future mime-types.

Keeping mime-data separate from user-data is important due to the
principle of least surprise - the API is different and so it would be
surprising if you queried for user-data and were returned an opaque
mime-data pointer, and vice versa. (Note this should have been prevented
by using interned strings, but conceptually it is cleaner to make the
separation.) Also it aides in trimming the user data arrays which are
linearly searched.

Based on the original patch by Adrian Johnson:
http://cgit.freedesktop.org/~ajohnson/cairo/commit/?h=metadata&id=37e607cc777523ad12a2d214708d79ecbca5b380
2009-02-13 13:08:24 +00:00
Chris Wilson
2280de9d02 Merge branch '1.8' 2009-02-13 10:08:21 +00:00
Chris Wilson
de7270cb1e [cairo] Describe the restrictions upon cairo_set_tolerance()
Truc Troung reported that the behaviour of
cairo_set_tolerance()/cairo_get_tolerance() was inconsistent with the
documentation, i.e. we failed to mention that the tolerance would be
restricted to the smalled fixed-point value.

Add a sentence to the documentation that describes the restriction without
mentioning what that is... Hopefully that is sufficient detail to
accommodate the reporter, without exposing internal implementation details.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=20095
Bug 20095 - The cairo_set_tolerance() function behavior is inconsistency
with the spec
2009-02-13 10:07:37 +00:00
Chris Wilson
17ce8584e7 [NEWS] Add API changes.
Scan the public headers for obvious additions.
2009-02-12 18:27:52 +00:00
Chris Wilson
2df611a381 [script] Expose a normal xlib window for replay
Provide a visible surface for replaying scripts against.
2009-02-12 18:27:51 +00:00
Jeff Muizelaar
8e1f103540 Divert pclose to _pclose for MSVC
Commit bf62798b12 added a diversion for
popen but not for pclose. This is needed for linking the boilerplate
with the test suite.
2009-02-12 12:02:17 -05:00
Chris Wilson
38a1061bbc Merge branch '1.8' 2009-02-12 10:46:29 +00:00
Chris Wilson
e7d4bc3d86 [png] Correct documentation to avoid reference to NULL
As pointed out by Truc Truong,
cairo_image_surface_create_from_png_stream() cannot return NULL and so the
documentation was incorrect.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=20075
Bug 20075 There is a misprint in the spec for
cairo_image_surface_create_from_png_stream() function
2009-02-12 10:42:24 +00:00
Søren Sandmann
b3e2433f1e Correct the reference image for the rotate-image-surface-paint test 2009-02-11 17:55:15 -05:00
Jeff Muizelaar
41cbd935f9 [test] Add cairo_test_NaN and use it in place of strtod
strtod("NaN") returns 0.0 with the MSVC runtime so we
need to generate NaN some other way.
2009-02-11 15:24:24 -05:00
Jeff Muizelaar
70297f257d [test] Add crtdbg.h include
crtdbg.h is required for _CrtSetReportMode() and _CrtSetReportFile().
2009-02-10 17:58:28 -05:00
Jeff Muizelaar
b9f0c4b252 Use _cairo_round() instead of round()
MSVC doesn't have round() and the code probably wants
to round in the same direction regardless of whether
the values are negative or positive.
2009-02-10 17:57:00 -05:00
Jeff Muizelaar
dffdbd8515 Add _cairo_round()
_cairo_round() has the same behaviour as _cairo_lround() except
it returns a double instead of an integer.
2009-02-10 17:53:39 -05:00
Jeff Muizelaar
41e46c7754 [test] Don't embed preprocessor directives inside macros
MSVC can't handle this. GCC will warn with -pedantic, but I'm not
sure we want to enable that.
2009-02-10 11:44:20 -05:00
Jeff Muizelaar
fe40d3bdb0 [test] Allocate glyph array with malloc
Keeping it on the stack causes a stack overflow of Window's
default 1mb stack.
2009-02-09 23:43:04 -05:00
Jeff Muizelaar
50f8c2e4f3 [test] define isnan() on MSVC
Needed for user-font-rescale.c
2009-02-09 23:39:38 -05:00
Jeff Muizelaar
dd9fc47418 Remove zero size data array for compilation with MSVC
MSVC doesn't support zero sized arrays very well. For example, zero
sized arrays in arrays.
2009-02-10 01:58:15 +02:00
Jeff Muizelaar
a6c8f18a39 [test] Avoid C99 designated initializers
MSVC doesn't support these so we shouldn't use them.
2009-02-09 15:59:01 -05:00
Jeff Muizelaar
3d2fcec948 [test] Define INFINITY on MSVC
1./0. produces a compiler error on MSVC so we'll use HUGEVAL instead.
2009-02-09 15:12:41 -05:00
Behdad Esfahbod
c22ca79863 Don't distribute cairo-features.h (#19992)
Second time I fix this bug.  Mabe we should add a test for it!
2009-02-06 12:56:48 -05:00
Behdad Esfahbod
a55655a82d [test] Fix "make dist" 2009-02-06 12:47:51 -05:00
Jeff Muizelaar
af5ca7249f [test] Fix the definition of INFINITY
In my defence, even with INFINITY as 0, I was seeing new asserts on win32.
Caught by Jeremy Lea.
2009-02-05 16:46:50 -05:00
Jeff Muizelaar
83ec4b16b7 Elaborate the meaning of arithmetic rounding as done by _cairo_lround() 2009-02-04 14:04:05 -05:00
Jeff Muizelaar
2676b3bdd6 [test] Define INFINITY if it hasn't been defined.
This lets us use more of invalid-matrix on win32
2009-02-03 14:18:44 -05:00
Chris Wilson
6b0c2c8ba6 [directfb] Don't access the scaled_font->glyphs cache directly
Not only does it no longer exist, but doing so bypassed the locking
mechanisms and sanity checks!

Spotted by Lance Hepler.
2009-02-02 09:14:15 +00:00
Behdad Esfahbod
d63c1ab3ff [util/malloc-stats] Do a single backtrace_symbols() call
I was hoping that this may speed things up, but it didn't.  :(
2009-01-31 22:10:57 -05:00
Behdad Esfahbod
64d1c75870 [util] Fix memset bug in malloc-stats 2009-01-31 21:34:46 -05:00
Behdad Esfahbod
b02aeb367d [util] Don't link backtrace-symbols into malloc-stats
On my rawhide machine, seems like the glibc backgrace-symbols is now as
good as our private backtrace-symbols.
2009-01-31 21:33:42 -05:00
Chris Wilson
7375f4c76b Trivial warning fixes.
Cleanup a few compiler warnings about unused variables and mismatching
pointer types.
2009-01-30 21:54:56 +00:00