Benjamin Otte tracked down an invalid read triggered by WebKit. The
cause is that we attempt to dereference the list_head as an edge as we
failed to check that during the skipping of colinear edges we advanced
to the end, under the false assumption that there would always
be a closing edge in a rectangle. This assumption is broken if the tail
rectangles having colinear right edges.
Change the operator used to upgrade the format of a glyph mask from
CAIRO_OPERATOR_SOURCE to CAIRO_OPERATOR_ADD.
The _cairo_scaled_font_show_glyphs() function upgrades the pixel
format of a glyph mask by calling _cairo_surface_composite() to copy
the mask to an image surface of the upgraded destination. The way it
was doing it however was to use CAIRO_OPERATOR_SOURCE, a white source
pattern and the glyph's rasterised glyph as the mask pattern. This
combination isn't supported by _cairo_surface_composite(), which
asserts that no mask is present when the operator is SOURCE or CLEAR.
Reported by Mikael Magnusson to #cairo on irc.freenode.net.
Since moving to pixman for the gradient textures, first=0 and last=1,
so there's no need to rescale to 0,1 any more. Shaves 6 Gen4 ISA
instructions, including 2 inverses, in the radial fragment shader.
Creates a texture and draws with it instead of doing TexSubImage.
Open question is whether this wouldn't be better in general. Fixes
several failures with ARB_texture_rectangle path due to fallbacks to
window drawing.
Most testcases are now passing like the ARB_texture_non_power_of_two
case. EXT_texture_rectangle support is dropped in favor of
ARB_texture_non_power_of_two. If we have issues with drivers not
having that but having EXT (which just lacks the GLSL part of the
spec), we can split it out. Right now non-GLSL support in cairo-gl is
probably in bad shape anyway and will require someone that cares for
it in order to get fixed up.
The only issue is the repeat modes aren't supported for rectangular
textures. In any case even with ARB_npot radeon's pre-r600 lie and
fail to do repeats anyway.
This code is stolen straight from cairo-drm-intel.c. This saves a
bunch of time calculating interpolated points when we just do
interpolation between points at sampling time anyway. Reduces
firefox-talos-svg from 47 seconds back to the 42 it was at before the
pixman change.
This regresses the reported result of huge-radial, but there's no
visible difference.
... and fix the compile errors from it I get on my build.
It's Cairo style to put declarations before the code, so better warn
about it.
Besides, it eases porting to old compilers like MSVC.
Should fix:
Bug 26509 - Cairo fails to compile without mmap
http://bugs.freedesktop.org/show_bug.cgi?id=26509
As reported by Hib Eris, Cairo files to compile under a mingw32
cross-compiler as we use a structure only defined if HAVE_MMAP
unconditionally.
If a signal interrupts the SET_TILING ioctl, the tiling and stride
values are updated to reflect the current condition of the buffer, so we
need to restore those to the desired values before repeating the ioctl.
It was observed that we never actually test the condition that the
gradient is only defined for a portion of its range, i.e. the starting
offset is >0 and the ending offset is <0. By definition the colour
between 0 and start offset is the start color, so check that this
behaviour is followed by all backends.
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]