Commit graph

6782 commits

Author SHA1 Message Date
Eric Anholt
69a150b7d8 [gl] Initialize has_alpha in the image surface composite fastpath.
Fixes bilevel-image, set-source, and zero-alpha.
2009-06-01 13:36:32 -07:00
Eric Anholt
d3a478b6c0 [gl] Fix check-plt.sh for the GL surface. 2009-06-01 10:37:40 -07:00
Eric Anholt
1f7c393a6d [gl] Fix check-doc-syntax.sh for GL surface. 2009-06-01 10:37:40 -07:00
Eric Anholt
19bc0f2f1d [gl] Fix check-def.sh for GL surface. 2009-06-01 10:37:37 -07:00
Chris Wilson
87b764908a [gl] Add EGL target
Split the GLX context from the GL surface to enable use of an alternative
EGL interface.
2009-05-20 08:13:45 +01:00
Eric Anholt
17b41fe7e3 [gl] Use filtering of GL_NEAREST to hint to TexImage not to alloc for mipmaps.
Gl defaults to NEAREST_MIPMAP_LINEAR on new texture objects.
This should save space or bandwidth with DRI drivers, as they'll use the
parameter as a hint, and then not have to either fix up later or waste
space for unused mipmap levels.
2009-05-10 10:17:27 -07:00
Eric Anholt
a438acd37c [gl] Handle PIXMAN_b8g8r8a and PIXMAN_b8g8r8x8 in the image tex shortcut. 2009-05-09 11:33:53 -07:00
Eric Anholt
29768c2193 [gl] Don't forget that we require ARB_texture_non_power_of_two currently. 2009-05-09 11:30:46 -07:00
Eric Anholt
979337dd4d [gl] Wire blend factors using dst alpha to constants for CAIRO_CONTENT_COLOR.
This fixes the operator and operator-alpha tests to rgb24 destinations.
While we request an RGB texture, the returned texture has alpha bits, so when
we blend against it as a renderbuffer, we get the junk alpha values.  Whether
or not this is a driver bug, we'll have this problem when we get visuals
with alpha bits for windows despite not requestiong alpha, so we have to
handle it in cairo.
2009-03-28 21:53:04 -07:00
Eric Anholt
809f7dc4c8 [gl] Make sure test visuals for CAIRO_CONTENT_COLOR_ALPHA have alpha bits.
Since we're just making FBOs, the visual chosen probably shouldn't matter,
and it doesn't on Intel.  But it does seem like the right thing to do.
2009-03-28 21:48:42 -07:00
Eric Anholt
93c437d4b9 [gl] Use GLEW to detect required extension presence. 2009-03-28 21:00:49 -07:00
Eric Anholt
2df498ba45 [gl] Use triangle fan instead of GL_QUADS for the single quad we draw.
This saves the driver from converting the quad into tris on its own.  We'd
rather be able to specify a rect as 2-3 points and use the rectangular
rendering feature that most of our hardware has, if it was possible, but
it isn't exposed in GL.
2009-03-05 23:27:16 -08:00
Eric Anholt
54228cb5fe [gl] Use textures and not fbo-based surfaces for image surface patterns.
This cuts the BO allocation overhead for traps in more than half, and reduces
the load on the accelerator.
2009-02-15 14:30:24 -08:00
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
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
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
Chris Wilson
312b5680a5 [cff-subset] Free ps_name.
Ensure ps_name is freed along error paths and by the normal destructor.
2009-01-29 10:10:41 +00:00
Chris Wilson
5176507fcb [truetype] Free font name.
Remember to free the font name on destruction.
2009-01-29 10:10:41 +00:00
Chris Wilson
ab0ac1b8a8 [truetype] Initialise font_name
Ensure the font_name is initialized to NULL.
2009-01-29 10:10:41 +00:00