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.
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.
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
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.
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
-- 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
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
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.
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.
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.
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
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.
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.
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).