Commit graph

5050 commits

Author SHA1 Message Date
Chris Wilson
5e95c62bbb clip: Propagate failure from retrieving the previous clip surface. 2010-05-06 09:10:55 +01:00
Chris Wilson
ded2dc8faa scaled-font: Pluck last glyph from the most recent page.
In converting to cairo_list_t, it helps to preserve the semantics of
appending the page to the end of the list where it is expected to be
plucked in the event of an allocation failure.
2010-05-05 18:07:29 +01:00
Adrian Johnson
fa937913e0 PS: Add missing 'q' when resetting clip path 2010-05-05 21:44:33 +09:30
Benjamin Otte
9c594d8b40 gl: Get rid of ctx variable
The code used renderer->ctx and ctx interchangably, that was confusing.
2010-05-05 12:30:01 +02:00
Benjamin Otte
a354f1f92a gl: Another case of proper device acquiring
This patch isn't strictly necessary, but it cleans up the code.
2010-05-05 12:30:01 +02:00
Benjamin Otte
36210ee514 gl: Get rid of another cast to cairo_gl_context_t 2010-05-05 12:30:01 +02:00
Benjamin Otte
58b03691d3 gl: Introduce _cairo_gl_device_has_glsl() function
The function takes a cairo_device_t argument as it can be called on an
unacquired device.

This is the first patch in a process to try to rid cairo-gl-surface.c of
casts from cairo_device_t to cairo_gl_context_t. As its members should
usually only be accessed when the device is locked, the only way the
cairo_gl_context_t should be acquired is using
_cairo_gl_context_acquire().
2010-05-05 12:30:01 +02:00
Benjamin Otte
5223b65423 gl: Get rid of cairo_gl_surface_glfinish() from public API
This is now done explicitly in the boilerplate code. It was not a useful
public API to begin with.
2010-05-05 12:30:01 +02:00
Benjamin Otte
e071fa2c4f gl: Remove unused member variable 2010-05-05 12:30:01 +02:00
Benjamin Otte
90c64f60d8 gl: Move device-specific code into cairo-gl-device.c 2010-05-05 12:30:01 +02:00
Benjamin Otte
0ff5a18fd5 gl: Make _gl_set_destination() take the context as an argument
Keeping with the API introduced for Xlib, functions that require an
acquired context take this context as the first argument.
2010-05-05 12:30:01 +02:00
Benjamin Otte
e8c5b6b1c2 Fix typo in docs 2010-05-05 12:30:01 +02:00
Benjamin Otte
53508e6e30 gl: Acquire the context before destroying it. 2010-05-05 12:30:01 +02:00
Benjamin Otte
c46aec4897 gl: acquire/release context during surface_finish() 2010-05-05 12:30:01 +02:00
Benjamin Otte
88801aabb3 gl: Acquire context when initing/destroying gl operands 2010-05-05 12:30:00 +02:00
Chris Wilson
5f878f9179 clip: Trivial compiler warning
cairo-clip.c: In function ‘_cairo_clip_path_reapply_clip_path_translate’:
cairo-clip.c:446: warning: suggest parentheses around assignment used as
truth value
2010-05-05 10:24:14 +01:00
Chris Wilson
ad541a1ec6 clip: Propagate memfault from translating clip region 2010-05-05 09:46:35 +01:00
Chris Wilson
4bc54643f5 image: Propagate failure from pixman_image_set_clip_region() 2010-05-05 09:46:35 +01:00
Chris Wilson
fba4cf1d94 recording: Mark an empty recording surface as clear. 2010-05-05 09:25:25 +01:00
Chris Wilson
e532980539 recording: Avoid refcycles by always copying the command array.
Short-term solution to avoid the refleaks and to make the test suite
happy. A more elegant solution would be to track the references and
avoid the substantial memory overhead of copying the recording surfaces.

Thanks to Benjamin Otte for pointing out the solution to avoiding
refcycles.
2010-05-05 09:23:59 +01:00
Chris Wilson
4a46c71556 type3: Minor tweaks to remove a redundant check. 2010-05-04 18:53:50 +01:00
Chris Wilson
11531b90a2 ps: Force finish of the type3 glyph surfaces. 2010-05-04 18:53:50 +01:00
Chris Wilson
5155ebeaa2 pdf: Assert that no other error can occur for an invertible matrix. 2010-05-04 18:53:50 +01:00
Chris Wilson
d9259bd068 paginated: Mark as clear initially. 2010-05-04 18:53:50 +01:00
Chris Wilson
bc14e0e953 scaled-font: Convert to cairo_list_t
Convert the open-coded doubly-linked list of glyph pages for a font into
the common cairo_list_t.
2010-05-04 18:53:03 +01:00
Chris Wilson
627527693c ps: Remove the fill stroke command
This is not supported by PostScript, so eliminate it from the prologue.
2010-05-04 18:53:03 +01:00
Chris Wilson
19ac81f50b scaled-font: Remove MRU cache upon detection of error. 2010-05-04 18:26:06 +01:00
Chris Wilson
6f2d4f5b2a image: Propagate failure from pixman_image_fill_boxes(). 2010-05-04 18:26:06 +01:00
Chris Wilson
38188961b9 image: Check for pixman image allocation failure during glyphs 2010-05-04 13:28:37 +01:00
Chris Wilson
4a181ebac4 pdf: Cleanup local reference to source on error paths. 2010-05-04 13:28:37 +01:00
Chris Wilson
ba48edcd86 ps: Always cleanup used font subsets. 2010-05-04 13:28:37 +01:00
Chris Wilson
08b9984da9 image: Replace assert with error return
It is possible to encounter an allocation failure here since we may have
tweaked the clip since the last evaluation of the clip region.
2010-05-04 13:28:36 +01:00
Chris Wilson
7002b82472 xlib: Don't delete gradients in unbounded fixup code
The fix is ugly, but for now it works.
2010-05-04 13:53:02 +02:00
Chris Wilson
c549203c8d scaled-font: Check for an error return when retrieving the implementation 2010-05-03 19:21:18 +01:00
Chris Wilson
c93e6f014d paginated: propagate malloc failures more cleanly. 2010-05-03 19:20:42 +01:00
Chris Wilson
8e9fd9c017 image: A few missing tests for malloc failure 2010-05-03 19:20:07 +01:00
Chris Wilson
87781ffbd9 ft: Convert an assert into an unlikely error return.
The assert depends upon good behaviour from fontconfig, which is no
guaranteed under memfault, so return an error instead.
2010-05-03 19:18:49 +01:00
Benjamin Otte
5672b7a18a fallback: get src_x/y variables right when compositing traps 2010-05-03 13:37:19 +02:00
Dave Yeo
c10a5a9fb0 os2: Fix get_extents() segfaulting.
bed2701e1c removed one line too much.
2010-05-03 10:20:51 +02:00
Benjamin Otte
358f57c876 image: remove useless optimization
The optimization is done way smarter inside
_cairo_matrix_transform_bounding_box()
2010-04-30 23:35:48 +02:00
Benjamin Otte
94aa6d24b6 fallback: Create pixman image for correct rectangle
This was most prominently shown by the a1-image-sample test, but
multiple tests exposed the problem with the xlib-fallback code.
2010-04-30 23:35:48 +02:00
Benjamin Otte
3294daf423 Create cleared surface instead of a scratch surface in clone_similar()
A cleared surface is needed when playing back a recording surface that
has semi-transparent operations.
As this only affects surface types where scratch surfaces aren't already
cleared (ie it affected xlib but not image), the effect was only visible
for those backends.
This should not cause any performance regressions as the other backends
set surface->clear = TRUE when creating the scratch surface, so the
clear operation is effectively a no-op.

Covered by the existing pdf-surface-source and svg-surface-source tests.
2010-04-30 20:19:08 +02:00
Chris Wilson
b485ae5b90 atomic: Add Andrea's copyright notice
Note Andrea's copyright for his contribution of platform agnostic
fallbacks and the implementation for MacOS/X.
2010-04-30 14:14:01 +01:00
Chris Wilson
c6dc8ad7dc Revert "paginated: Call surface finish explicitly on recording surface"
This reverts commit 5fc04bba9f.

Whilst this fixes the self-referential reference leak, it however
introduces use-after-finish into normal behaviour. Close, but not quite.
2010-04-30 12:39:59 +01:00
Chris Wilson
905c345df1 recording: Check that we do not use a finished recording surface.
User paranoia - as the replay is exposed to the user it is convenient to
add the finish check in the core replay function so that we gain a
paranoia check for the internal paths as well.
2010-04-30 10:31:50 +01:00
Chris Wilson
5fe7c5842f pdf; Emit subsurface patterns natively.
Encode subsurface patterns into the PDF stream natively (when possible),
similar to the cairo-ps backend.
2010-04-30 10:16:24 +01:00
Chris Wilson
8ded35fd69 ps: Enable native encoding of subsurface patterns.
Carefully handle subsurfaces of a recording surface through the analysis
and paginated surfaces so that we can generate a native pattern for the
vector backends, demonstrated by the PostScript backend.

Nothing remarkable, just a lot of bookkeeping to track the wrapped
surface types and to apply the correct offsets when generating the
subsurface pattern.
2010-04-30 10:16:24 +01:00
Chris Wilson
5fc04bba9f paginated: Call surface finish explicitly on recording surface
During show_page() when we destroy the recording surface after emitting
the page, ensure that we actually call cairo_surface_finish() to dispose
of any self-referential reference leaks.
2010-04-30 10:16:23 +01:00
Chris Wilson
ab2776c9a1 snapshot: Attach the backend generated snapshot to the target
Cache the result of snapshotting using the backend vfunc in the normal
manner by attaching the snapshot to the target. This should reduce
resource usage in these cases.
2010-04-30 10:16:23 +01:00
Chris Wilson
07122f37d1 surface: Convert snapshots from an array to a double-linked list.
Saves the memory allocation for the array, and the overhead of
maintaining the area for both insertions and more importantly deletes.
2010-04-30 10:16:23 +01:00