This is significantly cribbed from Zach Laine's work, but reworked so
that gradients can be plugged in as either source or mask operands for
any of the paths.
cairo_gl_surface_create_for_window assumes CONTENT_COLOR_ALPHA, so
make sure the fbconfig we choose is good enough. Fixes gl-window
testcase results to basically match the non-window testcases.
This is significantly cribbed from Zach Laine's work, but reworked so
that gradients can be plugged in as either source or mask operands for
any of the paths.
This cuts the runtime of firefox-talos-svg in half on my GM45, at the
expense of gradient-alpha. surface-pattern-operator also now fails
due to small rasterization differences.
Rather than have fragment shaders try to walk a variable-length set of
stops and try to compute the interpolation between the nearest stops
per fragment, we make a little texture representing the gradient along
a line and have the shaders compute texture coordinates along the line
and sample. This should be a good tradeoff between CPU work and GPU
work.
[anholt: I pulled this set of code out of Zach Laine's tree to use for
gradient acceleration, and wanted to make sure attribution was
appropriate. I applied only minor tweaking]
This reduces the CPU work in translating fixed function state to
shaders, but currently is a slight cost on GM45 because we end up
changing shaders more frequently since other parts of the pipeline are
doing fixed function still.
Adds cairo_gl_shader_program_t, and functions to manipulate same. Multiple GL
entry points for shaders are provided -- one for the pre-GL 2.0 extenstions
entry points, and one for GL 2.0. This code is well tested, but currently
unused in the GL backend.
_cairo_quartz_surface_paint will never fail as it falls back to image
when CoreGraphics can't handle the requested operation. This means that
upon fallback the ClipImage set by the masking code gets ignored, thus
the mask fallback path is broken. Using the _cg function ensures that
masking is either completely done by CoreGraphics, or the fallback path
passes the mask operation to image.
The fallback path shouldn't be used anymore, thus fallbacks are now
handled by passing unsupported ops to the image backend.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Another bug identified by Jeff Muizelaar was that the bounds for a
zero-length (i.e. it started and stopped at the same point) were
miscomputed. This test case exercises that bug.
Note: I believe the output is wrong here when padding a zero-length
gradient. On the left it should be red, and on the right it should be
blue.
Fixes test/clip-empty-save.
The all-clipped flag was not being copied to the new clip, which occurs
for instance when an empty clip is pushed via a gstate save.
Jeff Muizelaar found a bug in _cairo_clip_init_copy() which was not
correctly propagating the all-clipped status when an empty clip was
saved in the gstate. This test case exercises that bug.
This reverts commit 26e9f14906 on
cairo-path-stroke.
The changes in cairo-path-stroke are not needed anymore since dash
pattern approximation is now done in gstate before passing the dash
pattern to the backend.
Since approximation is only done when the pattern is sub-tolerance,
it is acceptable to apply it even for vector backends.
By doing it once and for all backends, backends are guaranteed to have
non-degenerate input.
Acked-by: Adrian Johnson <ajohnson@redneon.com>
Dash pattern approximation was taking the caps style into account
only for coverage computation, but not when computing the new
pattern, thus the computed approximation had a higher coverage if
the caps style was SQUARE or ROUND.
Reviewed-by: M. Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
Comment on how the round caps coverage has been computed, explaining
the complete procedure. The comments doesn't contain intermediate
(verbose and ugly) results, but when executed in a symbolic math
program (sage, for example) computes the expected results.
Reviewed-by: M. Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
Autoconf was complaining that AC_COMPILE_IFELSE and AC_RUN_IFELSE
were called before AC_GNU_SOURCE. Moving AC_GNU_SOURCE right after
AC_INIT solves this.
Hi,
while browsing the git log I've noticed a small mistake in the above
commit, where we reversed the order of init/fini required to reset the
mime-data array.
If the surface was written to using a fallback, and so is mapped, we
need to flush those modifications by relinquishing the map. So the next
time the application tries to write to the surface, those writes are
correctly serialised with our reads.