Commit graph

8329 commits

Author SHA1 Message Date
Benjamin Otte
ee32dfb3de test: Add a test for various zero mask operations 2010-05-13 12:11:05 +02:00
Owen W. Taylor
986ae42320 language bindings guide: clarify mapping for cairo_pattern_create_rgb[a]
Clarify that cairo_pattern_create_rgb() and cairo_pattern_create_rgba()
should be be overloaded as a single constructor for SolidPattern, but
instead should be static methods.
2010-05-13 10:08:32 +01:00
Chris Wilson
18b48a6ebc Make cairo_color_stop_t a unique type.
Hopefully reduce the occurrence of the confusion between the
premultiplied shorts in cairo_color_t and the non-premultiplied shorts
in cairo_color_stop_t.

The existence of the two separate types is debatable and open for
review.
2010-05-13 10:00:18 +01:00
Chris Wilson
dfa2544f15 color: Special case comparing color stops.
color stops are not premultiplied so we need to handle them carefully
when comparing. The next step will be to make cairo_color_stop_t a
unique type to prevent this mistake again.
2010-05-13 09:52:39 +01:00
Chris Wilson
4741d33cf6 gstate: Don't reduce solid source and mask for SOURCE and CLEAR
Not all operators are created equal, and this optimization breaks for
SOURCE and CLEAR where the mask operates on the clip and not the source.
2010-05-13 09:33:12 +01:00
Andrea Canciani
ee871940ff Revert bd672d080c
on src/cairo-composite-rectangles.c

The extent of the operation can be larger than the source if
the operator is not bounded by the source.

Fixes clip-unbounded, operator-source, surface-pattern-operator
2010-05-13 01:57:24 +02:00
Chris Wilson
0870c6fb5b gcc-4.5 warnings and optimisation flags. 2010-05-12 20:54:49 +01:00
Chris Wilson
cf0933a05a gallium: Refresh.
Catch up with changes in APIs, still no substance and the integration
with winsys handles needs review.
2010-05-12 20:54:49 +01:00
Chris Wilson
bd672d080c drm: code dump, sorry.
Lots upon lots of tiny fixes mixed in with experimental code. :(
2010-05-12 20:54:49 +01:00
Chris Wilson
c8fba49603 rtree: Remove the unused evict hook. 2010-05-12 20:54:49 +01:00
Chris Wilson
2a07263373 rtree: defer propagating pinned nodes until eviction.
Only during infrequent eviction do we require absolute knowledge of
which graph of nodes are in use and thus pinned. So during the common
use of querying the glyph cache, we just mark the leaf as used. Then we
need to make space for a new glyph, we move the parents of the left
nodes from the evictable list to the pinned list.
2010-05-12 20:54:49 +01:00
Chris Wilson
cbe8fd0794 script: Avoid the expensive of the redundant memset.
As we are about to immediately fill the entire image, allocate the
memory ourselves to avoid the redundant memset performed by pixman.
2010-05-12 20:54:49 +01:00
Chris Wilson
b9f7a4b526 script: Don't hash the entire image.
The reuse hit rate is very small, and most images are quickly
distinguished in the first few bytes... Though perhaps not for video as
in the swfdec-youtube case...
2010-05-12 20:54:49 +01:00
Chris Wilson
a85c6c1e36 gstate: reduce a couple more operators 2010-05-12 20:54:48 +01:00
Chris Wilson
a3cb52e403 simplify pattern extents for translation matrices 2010-05-12 20:54:48 +01:00
Chris Wilson
d45c7dc62d xcb: discard glyph mask and use dst directly when possible. 2010-05-12 20:54:48 +01:00
Chris Wilson
a8b611ea8e clip: Fill instead of creating intermediate surfaces. 2010-05-12 20:42:18 +01:00
Chris Wilson
fb53d05a69 test: Remove pthread_yield()
I accidentally pushed this debugging left-over from when I was tracking
down a race in memfault. Remove it so that the test suite compiles on
more minimal pthread setups.
2010-05-12 20:09:44 +01:00
Chris Wilson
cdd98dba6a win32-printing: compile fix.
Missing arg for _cairo_recording_surface_replay_region().
2010-05-12 20:09:44 +01:00
Jonathan Kew
35307fc66f win32: Grow glyph extents to account for ClearType
Add extra pixel on each side of the glyph's black box returned by
GetGlyphOutlineW, to avoid clipping ClearType pixels.

From https://bugzilla.mozilla.org/show_bug.cgi?id=445087
2010-05-11 15:12:01 -04:00
Robert O'Callahan
d65e8064c0 Ensure the quartz backend returns the first stop for negative positions on the gradient line of a nonrepeating linear gradient.
I discovered a small bug in cairo-quartz gradients. If you have multiple stops
at position 0, then cairo-quartz pads with the *last* stop at position 0,
instead of the first stop at position 0. This patch fixes that.

From https://bugzilla.mozilla.org/show_bug.cgi?id=513395
2010-05-11 13:59:58 -04:00
Robert O'Callahan
ce27db9a55 Don't repeat a Quartz gradient more times than necessary, to avoid Quartz quality problems when there are lots of repeated color stops.
-- Add a parameter to _cairo_quartz_setup_source so we can pass down the
extents of the object we're drawing
-- Compute fill/stroke/glyph extents and pass them down in the cases we need to
(repeating/reflecting gradients)
-- Pass those extents on down to where we set up the gradients
-- Make _cairo_quartz_setup_linear_source fall back to pixman for the
degenerate case where the linear gradient vector has no length
-- In CreateRepeatingRadialGradientFunction and
CreateRepeatingLinearGradientFunction, use the object extents (or surface
extents, for the paint() case) instead of the clip box to calculate the
parameters for the gradient
-- I've changed the way CreateRepeatingLinearGradientFunction calculates the
repetition count. The new approach gives much more precise bounds on the number
of repetitions needed (and is very similar to what we do for radial gradients).
This is important because if we specify a much larger input range than we
really need for our gradient color function, Quartz samples it too coarsely
over the range we actually care about, and the gradients look bad.

For example, suppose start = (5,0), end = (6,10), the CTM is identity and the
bounds we want to cover is (0,0)-(10,10). I think the current approach sets up
the gradient to be repeated 10 times. In fact only 3 repetitions are needed.

Also, using 'width' here didn't look right:
-       y_rep_end = (int) ceil((surface->extents.width - MAX(mstart.y, mend.y))
/ dy

From https://bugzilla.mozilla.org/show_bug.cgi?id=508730
2010-05-11 13:59:52 -04:00
Robert O'Callahan
7b4e63d5b8 Clean up Quartz gradient code by moving some local variables to static const globals.
From https://bugzilla.mozilla.org/show_bug.cgi?id=508730
2010-05-11 13:59:43 -04:00
Robert O'Callahan
8302952dcf quartz: Don't fallback to pixman for repeating radial gradients.
Figuring out where the outer circle should move to is tricky. I hope the
algebra in there is understandable.

This is a nice performance improvement, probably because we avoid painting the
gradient over the entire clipBox (which is usually the entire surface).

I tried to write reftests that compared a repeating radial gradient to a
non-repeating gradient with manually repeated stops, but it didn't work because
the rasterization was slightly different --- I'm not sure why.

This patch also forces us to use pixman for all degenerate cases where the
circles intersect. This at least makes us consistent across platforms.

From https://bugzilla.mozilla.org/show_bug.cgi?id=508227
2010-05-11 13:58:10 -04:00
Chris Wilson
1bda2334b3 trace: And for the bonus round... Make it compile. 2010-05-11 13:51:38 +01:00
Chris Wilson
b23f3bd204 trace: Try wrapping FT_Open_Face()
We have to be careful to disambuigate an internal call by FreeType from
the application.
2010-05-11 13:46:44 +01:00
Jeff Muizelaar
ee446910aa Add an additional set parantheses around the container_of macro
The non-__GNUC__ version of the container_of macro would do wrong
when used like container_of(...)-> because '->' binds tighter
than the cast in the container_of macro. Adding an additional
set of parantheses fixes this.
2010-05-10 15:06:25 -04:00
Chris Wilson
e540d040bd xcb: trivial memfault fixes.
The first fixes required to kick-start memfault testing of the xcb
backend.
2010-05-10 13:36:53 +01:00
Chris Wilson
8b486db9a9 region: _cairo_region_create_in_error()
Avoid leaks when reporting memfault associated with constructing
regions.
2010-05-10 12:45:31 +01:00
Chris Wilson
9d863cd394 xcb: Find the correct xcb_screen_t for faking Screen
When choosing the xcb_screen_t to use for the xlib-xcb backing surface,
it helps if it matches the screen used to generate similar surfaces and
snapshots - otherwise we end up pulling the image back from the XServer
every time we want to use the Picture.
2010-05-08 18:24:48 +01:00
Chris Wilson
448d357108 xcb: Upload images in place.
A common operation is to store an image in a similar surface, so
construct a fast path to avoid the allocation and double-blit through a
temporary pixmap.
2010-05-08 18:24:48 +01:00
Chris Wilson
e48cbd3b47 xcb: Reset picture after failed snapshot.
Clear the local picture variable if we cannot use the snapshot so that
we are forced to create a new and valid picture.
2010-05-08 18:24:48 +01:00
Chris Wilson
4e3c19833e test: Force cairo-test-suite to return SUCCESS
Set the CAIRO_TEST_FORCE_PASS environment variable to run through the
test suite and ignore errors. Useful for forcing distcheck to continue
past a broken test suite.
2010-05-08 18:24:48 +01:00
Chris Wilson
ad8abc0110 subsurface: Don't double apply device offset for deep subsurfaces.
If we have a subsurface of a subsurface then the device offset has
already been applied to the extents that we use to offset the new
subsurface.
2010-05-08 18:24:48 +01:00
Benjamin Otte
d2a250ad33 gl: Make the shader implementation per-context, not global 2010-05-08 18:08:18 +02:00
Benjamin Otte
4571055c46 gl: Print GL errors when releasing the device
Don't scatter calls to error printing around everywhere, instead do it
in the one place where it matters.

Also, convert the functions to macros, so we can use __FILE__ and
__LINE__ when printing a warning
2010-05-08 18:03:05 +02:00
Benjamin Otte
59b31aeed9 gl: Make check_span_renderer() call not require a device lock
Note that we didn't lock the device previously, so the function was
broken.
2010-05-08 15:09:39 +02:00
Chris Wilson
81f4dd65a3 cairo: Special case cairo_t with NULL_POINTER
Avoid allocation for the potential user error of attempting to use
cairo_create(NULL).
2010-05-07 22:35:18 +01:00
Chris Wilson
a61570a55e test/copy-path: memfault status checks. 2010-05-07 22:35:14 +01:00
Chris Wilson
e6180d1d5e surface-fallback: Only destroy the clip after it has been initialized.
More memfault detected error path errors.
2010-05-07 22:19:43 +01:00
timeless
01a208f7e3 Remove useless null checks of a and b in _cairo_path_fixed_equal
'a' and 'b' are dereferenced before being checked for null.

From https://bugzilla.mozilla.org/show_bug.cgi?id=555706
2010-05-07 10:24:49 -04:00
Jonathan Kew
0068d9b5cd quartz: Work around bad glyph extents returned by CoreGraphics for empty glyphs in Al Bayan font
This resolves the problem by checking for the crazy glyph bbox result from
CoreGraphics, and replacing it with an empty rect.

From https://bugzilla.mozilla.org/show_bug.cgi?id=534260
2010-05-07 10:16:32 -04:00
Chris Wilson
c5d9643417 doc: regen 2010-05-07 11:25:03 +01:00
Chris Wilson
b9e9ff5934 subsurface: Include device offset in extents
Adjust the subsurface extents so that the user specifies the extents in
world space rather than device space.
2010-05-07 11:25:03 +01:00
Jeff Muizelaar
5e3b28ffea Remove comma from the end of the CAIRO_PATTERN_ACQUIRE enum 2010-05-06 22:27:09 -04:00
Chris Wilson
cc8442514a gl: Enable fixed-function without glsl.
Through a very simple mistake we were triggering fallbacks after
detecting we were not able to perform the composite using GLSL -- we
were just returning the UNSUPPORTED status instead of enabling the
fixed-function path.
2010-05-06 21:55:44 +01:00
Metal Sonic
30d358e098 Update license blocks to use "Mozilla Foundation" instead of "Mozilla Corporation"
From https://bugzilla.mozilla.org/show_bug.cgi?id=507387
2010-05-06 16:07:43 -04:00
Chris Wilson
506636e19e cairo: stash a number of contexts for use with NO_MUTEX
The implementation is the same as the atomic one (bar the use of atomic
primitives to manipulate the occupancy!).

Patch based on the original by Jeff Muizelaar.
2010-05-06 17:21:59 +01:00
Chris Wilson
91dfee420c device: Reorder finalization so that user data is destroyed last.
As the user is likely to attach the underlying resources to the device
for automatic collection upon finalization, it is important that the
user data is then destroy last (so that those resources are still
available in the surface and device cleanup routines).
2010-05-06 17:07:02 +01:00
Chris Wilson
2658d7ef5f test/gl-surface-source: Attach GLXContext to device user data.
As we actually use the GLXContext to create the device, we only want to
free those resources upon the final unreference of the device (and not
the initial surface).
2010-05-06 17:07:02 +01:00