Commit graph

6788 commits

Author SHA1 Message Date
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
Chris Wilson
f10eaadf89 Revert "[png] Complete the idempotent read_png() -> write_png()"
This reverts commit 564d64a132.

In hindsight, and with further discussion with Jeff Muizelaar, this
behaviour of using the stored contents from the mime-data is completely
the opposite of the users' expectations. When the user calls
cairo_surface_write_to_png(), usually in the course of debugging their
rendering code, they expect the precise contents of the surface to be
saved.
2009-01-30 21:50:24 +00:00
Chris Wilson
dd11d905a5 [util] Use a hash-table for malloc-stats.
At Behdad's request, convert the array of allocators into a simple hash
table (large static number of buckets + chaining) in order to speed up
malloc profiling.
2009-01-30 10:18:15 +00:00
Chris Wilson
322fb00066 [test] Compile again without memfault.
Hide the valgrind macro when not using memfault.
2009-01-29 22:15:21 +00:00
Chris Wilson
5e6d25e204 [skiplist] Provide an initial stack allocated pool.
Since we only need to allocate elts for intersection events and edges, the
number of elts in flight at any one time is actually quite small and can
usually be accommodated from an embedded pool.
2009-01-29 16:47:53 +00:00
Chris Wilson
dd4276c661 [stroker] Rectilinear dashing.
Extend the rectilinear stroker to handle dashes, so that for pixel-aligned
dashed strokes we completely avoid tessellation overhead.
2009-01-29 14:55:21 +00:00
Chris Wilson
7f95288c03 [ft] Improve error status propagation.
Propagate the error status from deep within the bowels, in order to reduce
the number of duplicate _cairo_error() and generally clean up the return
values.
2009-01-29 10:10:43 +00:00
Chris Wilson
53bd2ae2ce [ft] Distinguish fatal backend errors whilst constructing scaled fonts.
We now have the ability to distinguish an error case where the backend is
left in an inconsistent state from a transitory error. For the former we
need to report the error condition via the return value, which will be
propagated to the font-face. For the latter we just construct an in-error
scaled font nil-object which is passed back to the user.
2009-01-29 10:10:42 +00:00
Chris Wilson
f17aeedab3 [scaled-font] Differentiate fatal error when creating fonts
We only want to set the error state on the backend when it implies that
the font-face is in an inconsistent state. For example, this may be due to
a locking error in the backend or that we have detected a corrupt font.

In contrast, if we merely fail to allocated the scaled font then we just
wish to return that error to the user, without making the font-face itself
inert.
2009-01-29 10:10:42 +00:00
Chris Wilson
58cab06c4c [scaled-font] Guard against invalid matrices when creating the scaled font.
Check the user input for validity before passing the values on to the
backend. Currently the error is detected by the backend and the error is
propagated onto the font-face.
2009-01-29 10:10:42 +00:00
Chris Wilson
97c88f2af0 [surface] Fix memleak of along set_mime_data() error path
Free the mime_data holder if we fail to attach it to the surface.
2009-01-29 10:10:42 +00:00
Chris Wilson
d20e5fc2d9 [ps] Free images after emitting patterns.
Ensure that the temporary images are freed after we finish with the
pattern.

Note that we are using 3 members of the surface for temporary storage
whilst emitting patterns, this should be reviewed.
2009-01-29 10:10:41 +00:00