Commit graph

7932 commits

Author SHA1 Message Date
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
Eric Anholt
8d16fb10ea [gl] Test for required EXT_bgra and explain what it's used for. 2010-02-04 07:05:41 -08:00
Eric Anholt
b2d8c9cbf2 [gl] Use the shader source choice from operand setup instead of DIY. 2010-02-04 07:05:41 -08:00
Eric Anholt
0fceac4d52 [gl] Move the component alpha composite to using GLSL when available. 2010-02-04 07:05:41 -08:00
Eric Anholt
8357336ed7 [gl] Move normal composites to using GLSL when available. 2010-02-04 07:05:41 -08:00
Eric Anholt
106bc158ba [gl] Move the glyphs shader construction to a more general location. 2010-02-04 07:05:41 -08:00
Eric Anholt
f475351f75 [gl] Use GLSL when available for glyph rendering.
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.
2010-02-04 07:05:41 -08:00
Eric Anholt
672973caa0 [gl] Convert fill_rectangles to the new GLSL core/arb wrapper. 2010-02-04 07:05:41 -08:00
Eric Anholt
416273db34 [gl] Cut out the abstraction of GL_VERTEX_SHADER vs GL_VERTEX_SHADER_ARB.
They're the same number, so just use the core 2.0 name.
2010-02-04 07:05:41 -08:00
Eric Anholt
48a5a6eefc [gl] Avoid macro obfuscation of the shader impl structures. 2010-02-04 07:05:41 -08:00
Zach Laine
25ccc5dcb0 [gl] Add shader support code for GL versions < 3.0.
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.
2010-02-04 07:05:40 -08:00
Eric Anholt
a6897ad386 [gl] Check for GLSL support once at context init instead of per draw. 2010-02-04 07:05:40 -08:00
Andrea Canciani
b1829a47bf [quartz] Unbreak mask fallback path
_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.
2010-02-03 11:43:29 +01:00
Chris Wilson
597dd24ddc drm/i915: Free potential leak of cloned textures. 2010-02-03 09:13:20 +00:00
Chris Wilson
913a31494e drm/i915: Increase batch buffer space. 2010-02-03 09:13:20 +00:00
Chris Wilson
1315323b20 drm/i915: check for batch buffer overflow.
Oops, the check for sufficient batch space mysteriously disappeared
during the rearrangement.
2010-02-03 09:13:20 +00:00
Andrea Canciani
e2be50c722 [quartz] Fix UNSUPPORTED operations
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>
2010-02-02 19:48:47 +01:00
Andrea Canciani
3e69c38fe6 [quartz] Fix surface to CGImage conversion
Snapshotting a surface doesn't produce a cairo_image_surface_t.
Acquiring (and later releasing) the surface is needed to access
its image data.
2010-02-02 18:26:52 +01:00
Andrea Canciani
7aba47e9d8 [quartz] Silence compiler warnings 2010-02-02 18:26:52 +01:00
Chris Wilson
e9b07d1946 drm/i915: Don't tile page sized bo.
Minor tweak from < to <= so that a page sized bo is also not tiled for
those 32x32 pixmaps...
2010-02-02 16:31:36 +00:00
Chris Wilson
70ca9dd170 drm/i915: Pass the correct length to dump the batchbuffer. 2010-02-02 16:31:36 +00:00
Chris Wilson
3266a1a72b drm: Handle absence of PCI_ID 2010-02-02 16:31:36 +00:00
Chris Wilson
1ecefc53a1 pattern: Zero-length gradients are not necessary empty
Fixes: test/linear-step-function

If the extend mode is unbounded, then the gradient is also unbound.
2010-02-02 16:31:36 +00:00
Chris Wilson
2a59220aa4 test: Add linear-step-function
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.
2010-02-02 16:31:36 +00:00
Chris Wilson
7b37ba8a49 clip: Propagate all-clipped when copying
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.
2010-02-02 16:31:36 +00:00
Chris Wilson
7dc464bb2b test: Add clip-empty-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.
2010-02-02 16:31:36 +00:00
Chris Wilson
ab3dc7bb31 csi-replay: compile fix 2010-02-02 16:31:36 +00:00
Andrea Canciani
ab605214d1 Partially revert "Improve stroking of densely dashed styles"
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.
2010-02-01 09:48:13 +01:00
Andrea Canciani
8ffe0fc382 Revert "[quartz] Approximate dense dashing patterns"
This reverts commit 27701ed844.
Approximation is now done in gstate.
2010-02-01 09:48:13 +01:00
Andrea Canciani
2e91648bcb Approximate dash patterns in gstate
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>
2010-02-01 09:48:12 +01:00
Andrea Canciani
67f666896c Improve comments style consistency
Each line of a multi-line comment should begin with '*'.
2010-02-01 09:48:12 +01:00
Andrea Canciani
45c795a182 Improve dash pattern approximation
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>
2010-02-01 09:48:12 +01:00
Andrea Canciani
8d7841048b Round caps coverage extimate explanation
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>
2010-02-01 09:48:11 +01:00
Eric Anholt
8558cd5790 [gl] Use GL_MESA_pack_invert to flip get_image of windows around.
This doesn't have any fallback for a GL that fails to implement the
extension.  Fixes 120 testcases for gl-window.
2010-01-29 13:02:31 -08:00
Andrea Canciani
11a120fb84 Silence autoconf on Mac OS X
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.
2010-01-29 14:25:15 +01:00
Chris Wilson
05d4f9b461 xlib: Compile fix for no fontconfig 2010-01-29 11:30:49 +00:00
Chris Wilson
e3e7464145 atomic: Fix up compile on PPC with libatomic-ops 2010-01-29 11:24:40 +00:00
Alexander Shulgin
e11d2d0b4d surface: Fix detach mime-data after ecda633f88
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.
2010-01-29 09:17:01 +00:00
Chris Wilson
5f0a0088af drm-intel: Unmap a full glyph cache.
When we swap a full glyph cache for a fresh one, be sure to unmap the
old one prior to release.
2010-01-28 13:23:39 +00:00
Chris Wilson
78cd947120 drm: Paranoid assert that the fallback is released upon finish. 2010-01-27 23:45:17 +00:00
Chris Wilson
5aa1191204 drm-intel: flush in memory modifications to texture.
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.
2010-01-27 23:42:26 +00:00