Commit graph

7972 commits

Author SHA1 Message Date
Chris Wilson
b7c42b6aaa drm: Add missing private headers
Reported by: Thomas Jones <thomas.jones@utoronto.ca>
2010-02-23 19:27:16 +00:00
Chris Wilson
6ab5f89571 bo-rectangular: Fix incorrect skipping of colinear eo edges
Fixes test/bug-bo-rectangular

After skipping edges, we need to bd careful to only terminate the box on
a closing edge.
2010-02-23 08:54:58 +00:00
Benjamin Otte
1897156d96 test: Add bug-bo-rectangular
Exercises a bug found in the special case rectangular tessellator with
colinear eo edges.
2010-02-23 08:54:39 +00:00
Chris Wilson
21b2457aab fallback: Initialize rects.is_bounded for span renderer. 2010-02-22 15:26:37 +00:00
Chris Wilson
6dd22b7678 gl: Initialise glyphs mask to ensure allocation in absence of stash. 2010-02-22 15:24:08 +00:00
Chris Wilson
668ac047e6 gl: Avoid attempting to create a program on GLSL-incapable h/w for spans 2010-02-22 14:57:01 +00:00
Chris Wilson
29df5c91d0 gl: Return unsupported for h/w that cannot handle shaders.
Remove the ASSERT_NOT_REACHED and propagate the unsupported status so
that we fallback to fixed-function gracefully.
2010-02-22 14:46:18 +00:00
Chris Wilson
9f46bad301 bo-rectangular: Prevent invalid read during edge traversal
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.
2010-02-22 14:33:34 +00:00
M Joonas Pihlaja
75db4f0ece text: Fix assert failure from compositing by SOURCE with a mask internally.
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.
2010-02-22 02:29:00 +02:00
Andrea Canciani
20f8f17f0e xcb: Fix compilation without dri2
XCB should be able to compile without xcb-drm. To do so it
can include xcb/dri2.h only if xcb-drm is enabled.
2010-02-21 08:58:47 +00:00
Carl Worth
fc7be0014d Update version to 1.9.7.
Following the 1.9.6 snapshot.
2010-02-19 17:39:50 -08:00
Carl Worth
cb090136b2 Update REFERENCE_IMAGES list for "make distcheck".
As usual, "make distcheck" does not work until we update this list.
2010-02-19 17:30:09 -08:00
Carl Worth
20cf7c92b3 Update version to 1.9.6
For a new cairo 1.9.6 snapshot.
2010-02-19 17:24:33 -08:00
Carl Worth
1c3d417c30 NEWS: Add notes for the 1.9.6 snapshot.
Based on a very brief reading of the git log. There's certainly
a lot of interesting stuff missing here.
2010-02-19 17:24:01 -08:00
Eric Anholt
9057c4b6be test: Add an option to explicitly specify a test name to the runner. 2010-02-17 12:56:58 -08:00
Eric Anholt
e0a948bd2f gl: Be sure to do linear interpolation on gradients. 2010-02-17 11:48:41 -08:00
Eric Anholt
f1e794956f gl: Stop trying to handle first/last stop offset in the gradient shaders.
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.
2010-02-17 11:03:52 -08:00
Eric Anholt
f813a0243b gl: Remove the old unused radial/linear gradients shaders.
They're dynamically generated now for source/mask.
2010-02-17 10:58:16 -08:00
Eric Anholt
8da843e996 gl: Reduce complexity of radial fragment shaders.
This shaves 1 Mesa IR instruction, and 6 Gen4 ISA instructions.
2010-02-17 10:54:39 -08:00
Eric Anholt
89bdc2f8d5 gl: Implement draw_image for window targets.
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.
2010-02-16 14:03:14 -08:00
Eric Anholt
fcd29473ff gl: Fix glyphs texture coordinates for ARB_texture_rectangle.
Fixes most of the text testcases to match the
ARB_texture_non_power_of_two results.
2010-02-16 13:47:41 -08:00
Eric Anholt
e845450905 gl: Add GLSL support for ARB_texture_rectangle, and repeat/reflect fallbacks.
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.
2010-02-16 13:24:13 -08:00
Dave Airlie
40294377cb gl: initial support for EXT_texture_rectangle extension
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.
2010-02-16 13:24:08 -08:00
Eric Anholt
6542a515f0 gl: Reduce the size of the gradient texture for small numbers of stops.
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.
2010-02-16 12:14:45 -08:00
Chris Wilson
3b678a88b0 drm/i915: Set a source for unbounded fixups. 2010-02-12 16:44:44 +00:00
Chris Wilson
45a275ee29 drm/i915: Use correct linear mode for mask. 2010-02-12 14:12:24 +00:00
Chris Wilson
37dbf157f3 clip: Avoiding derefencing NULL clip_region 2010-02-12 14:08:32 +00:00
Chris Wilson
6995e1d982 boilerplate: Include X11.h for GL/GLX 2010-02-12 14:08:14 +00:00
Chris Wilson
5390df961f clip: Restrict composite extents to clip extents
Fixes test/clip-rectangle-twice.
2010-02-12 12:24:01 +00:00
Chris Wilson
51047483f4 test: Add clip-twice-rectangle
Jeff Muizeelar found another bug with clipping whereby the clip was
been incorrectly discarded.
2010-02-12 12:24:01 +00:00
Chris Wilson
22b5f78c1c gl: Remove eagle support
Eagle is no more, Kristian has superseded it with true EGL support. He
is so happy...
2010-02-11 10:38:51 +00:00
Benjamin Otte
ed4a30b383 build: Add -Wdeclaration-after-statement
... 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.
2010-02-10 22:13:33 +01:00
Chris Wilson
4113e455a3 drm/i965: fix use of uninitialized variable whilst dumping errors
Cut'n'paste bug from i915 error path.
2010-02-10 21:09:56 +00:00
Chris Wilson
5d34902c0c script: Compile without mmap
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.
2010-02-10 12:10:16 +00:00
Chris Wilson
fb5af4ae40 drm/intel: An interrupted SET_TILING modifies the input parameters
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.
2010-02-10 12:00:59 +00:00
Chris Wilson
3c66c721d1 qt: Fix compile error.
Update after prototype changed for create_similar(), as pointed out by
augzilla.
2010-02-09 08:48:42 +00:00
Chris Wilson
a1e5b07fa8 ps: Initialise page bbox to page size 2010-02-07 20:26:53 +00:00
Chris Wilson
44b6370cb0 ps: Propagate NOTHING_TO_DO
The upper layers should know what to do if there is nothing to be done,
so pass on that knowledge.
2010-02-07 19:36:29 +00:00
Chris Wilson
a4793d1331 test: Add linear-gradient-subset
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.
2010-02-07 19:27:32 +00:00
Chris Wilson
0f99303cd6 gl: Use pixman to create the gradient texture
This is just for consistency as we know that pixman has to handle all
the corner cases anyway...
2010-02-07 14:34:39 +00:00
Eric Anholt
b028d287e6 [gl] Make the VBO once at startup instead of recreating per glyphs/spans.
This shaves 2% off of firefox-talos-gfx.
2010-02-06 14:08:30 +01:00
Eric Anholt
696a715702 [gl] Add radial gradients acceleration.
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.
2010-02-05 00:13:30 -08:00
Eric Anholt
297b0ab47f [gl] When making a boilerplate GLX window, ensure it has alpha.
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.
2010-02-05 00:12:12 -08:00
Eric Anholt
6708bc0593 [gl] When filling a gradient texture, multiply alpha after interpolating.
Fixes gradient-alpha testcase.
2010-02-04 23:47:33 -08:00
Eric Anholt
e426cdd569 [gl] Implement linear gradients acceleration.
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.
2010-02-04 07:05:41 -08:00
Eric Anholt
05b18fc09a [gl] Fix create_gradient_texture to premultiply alpha. 2010-02-04 07:05:41 -08:00
Eric Anholt
31e706454b [gl] Pull the gradient operand setup out to its own function.
Hopefully this clarifies what's going on, including the fallthrough to
texture setup on failure.
2010-02-04 07:05:41 -08:00
T. Zachary Laine
745f263c1c [gl] Add function for creating a 1D texture to use for gradient lookups.
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]
2010-02-04 07:05:41 -08:00
Eric Anholt
88c8304e90 [gl] Sanity check the sampler uniform binding. 2010-02-04 07:05:41 -08:00
Eric Anholt
42597170f2 [gl] Convert the spans code to using GLSL when available. 2010-02-04 07:05:41 -08:00