Commit graph

7486 commits

Author SHA1 Message Date
Eric Anholt
4c6e7a1603 [gl] Add support for constant color directly, not through a texture. 2009-02-12 04:45:40 -08:00
Eric Anholt
31fb7382d2 [gl] Fix some memory leaks on boilerplate-based runs. 2009-02-12 04:10:52 -08:00
Eric Anholt
df96fc1f92 [gl] Avoid re-binding the same draw buffer.
The driver could be smarter and avoid a lot of the cost, but this is easy
and avoids needing much driver smarts.
2009-02-12 04:10:52 -08:00
Eric Anholt
fb6937565b [gl] Add interface for creating surfaces from window backbuffers. 2009-02-12 04:10:52 -08:00
Eric Anholt
6cc3d8dcc0 [gl] Fix unantialiased-shapes tests. 2009-02-12 04:10:51 -08:00
Eric Anholt
23a8c58dc1 [gl] Fix infinite recursion on compositing A1 images.
We could do this fast, but let's do it correct first.
2009-02-12 04:10:51 -08:00
Eric Anholt
b6dde667fa [gl] Add support for composite and composite_trapezoids.
This is a simple implementation that uses GL_ARB_texture_env_combine after
converting everything to GL surfaces (FBOs).
2009-02-12 04:10:47 -08: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
Eric Anholt
6fb4c6200c [gl] Clamp surface size to a minimum of (1,1) in create_similar.
Fixes clip-zero test.
2009-02-08 15:09:39 +01:00
Eric Anholt
a8a4081027 [gl] clear surfaces to transparent on creation 2009-02-08 15:09:38 +01:00
Eric Anholt
e7eb6dab12 [gl] Hook up fill_rectangles.
First actual "acceleration" for cairogears.  Actually slows things down since
we're now pingponging between cpu and gpu.
2009-02-08 15:09:38 +01:00
Eric Anholt
2ad5c3fc8f [gl] Add a shortcut from image to gl in clone_similar. 2009-02-08 15:09:38 +01:00
Eric Anholt
d9d56bb2ed [gl] Make create_similar actually create similar instead of image. 2009-02-08 15:09:38 +01:00
Eric Anholt
90b30219b9 [gl] Replace all-software implementation with all-GL-read/drawpixels. 2009-02-08 15:09:35 +01: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
Eric Anholt
235de8d7a4 [gl] Add basics for GL surface backend using test-fallback as base. 2009-02-05 09:38:43 -08: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
Chris Wilson
e6102dbe02 [png] Avoid a double free of the memory stream after error.
_cairo_memory_stream_destroy() finalizes the stream even if the stream was
in error and that error is reported back to the caller - so ensure we
don't try to free the stream again.
2009-01-29 10:10:41 +00:00
Chris Wilson
0f3e366f8b [font-face] Close a race when resurrecting fonts.
Paul Messmer provided a thorough analysis of a race between destroying the
final reference on a font and a concurrent recreation of the font -
demonstrating how it is possible for the create() to return the font that
was in the process of being freed.

To stop the race, we need to recheck the reference count upon taking the
mutex guarding the hash table.
2009-01-29 10:10:41 +00:00