Commit graph

8015 commits

Author SHA1 Message Date
Chris Wilson
ca6e4e1f91 spans: Initialise rects->is_bounded for polygon compat. 2010-03-11 01:48:08 +00:00
Chris Wilson
6754f1db17 gstate: Account for undropped non-transformed glyphs.
In the simplest case of pass-through glyphs we made a mistake in
propagating the number of glyphs.

Reported-by: Christophe de Dinechin <christophe@taodyne.com>
2010-03-10 15:13:00 +00:00
Chris Wilson
5fb36fe5ab drm/i965: Acquire device around commit. 2010-03-08 15:37:17 +00:00
Chris Wilson
4083f40fbd glew: don't pull in GL/glu.h 2010-03-07 16:59:57 +00:00
Chris Wilson
473e006ad6 test: Add a1-mask-sample
Test sampling positions with a NEAREST mask.
2010-03-06 18:12:36 +00:00
Chris Wilson
f79b2ceea4 drm/i915: Discard redundant solitary clips during fill 2010-03-04 19:52:58 +00:00
Chris Wilson
7cea9ae290 drm/i915: Apply more micro-optimisations when targetting CONTENT_ALPHA 2010-03-04 17:23:55 +00:00
Chris Wilson
dce8b028cd drm/i915: Adjust clip matrix for clip origin. 2010-03-04 17:13:53 +00:00
Chris Wilson
8e702044b3 drm/i915: Handle clip/combine coords for spans. 2010-03-04 17:13:02 +00:00
Chris Wilson
e1f0c2e73f perf: Check for and include unistd.h
isatty() and access() require unistd.h, so include it!
2010-03-04 17:11:58 +00:00
Chris Wilson
271752b944 gl: Pad the gradient texture.
Fixes test/linear-gradient-subset
2010-03-04 08:24:08 +00:00
Chris Wilson
afe6f4f051 drm/i915: Use a preserved temporary to store the radial texcoord. 2010-03-04 00:04:30 +00:00
Chris Wilson
4b2e047882 drm/i915: Eliminate redundant radial vertex shader.
It is always equivalent to a simple texture transformation, so reduce it
to the texture shader.
2010-03-04 00:04:30 +00:00
Chris Wilson
5161051798 drm/i915: Fix encoding of negated operand channels
Long ago when converting the pixel shader structs into macros and
reducing the code size by ~100k (the inlines were too depth for constant
propagation and CSE), I broke the encoding of negated channels. So
instead use a single bit to indicate a negation rather than 2s
complement (with sign extension into neighbouring channels, oops). The
disadvantage is that expressing the negated channel is a little more
ugly.
2010-03-04 00:04:30 +00:00
Chris Wilson
5b973c6708 drm/i915: Fix crash with linear-step-function
Avoid the potential divide by zero by falling back to pixman rendered
gradient textures for such troublesome input.
2010-03-04 00:04:30 +00:00
Chris Wilson
404ead7eeb drm/i915: Ensure simple alpha is written to green on alpha-only surfaces.
The intricacies of h/w make convoluted s/w.
2010-03-04 00:04:30 +00:00
Chris Wilson
1f2daf6524 drm/i915: Avoid double multiplication of linear alpha. 2010-03-04 00:04:21 +00:00
Chris Wilson
cdaef58c19 drm/i915: Acquire device before shader commit. 2010-03-03 23:57:36 +00:00
Chris Wilson
dd6f96dd4a drm/i965: Ignore flushing on device finish. 2010-03-03 23:57:36 +00:00
Chris Wilson
3692597567 drm/i965: Merge the constants into the surface stream.
As we can use an offset from the surface base for the constant buffers,
we need to fold the constants into the surface stream.
2010-03-03 23:57:35 +00:00
Chris Wilson
cc58594757 drm/intel: Set the 1D gradient texture to be untiled. 2010-03-03 23:57:35 +00:00
Chris Wilson
543cf07364 drm/intel: Set default extend mode for rendering gradient subsets. 2010-03-03 23:57:35 +00:00
Chris Wilson
521d1c1d2c surface: Simplify is_clear logic.
As we pre-check whether the operation is a no-op on an already cleared
surface, then for all but a paint with CLEAR and no clip, the result is
a non-clear surface.
2010-03-03 23:57:35 +00:00
Chris Wilson
017db95664 gstate: Use _cairo_pattern_clear for CLEAR. 2010-03-03 23:57:35 +00:00
Chris Wilson
70412bba0e test: Avoid derefencing a NULL xcb connection 2010-03-03 23:57:35 +00:00
Chris Wilson
5bfea8447b test: Add references for rounded-rectangle-{fill,stroke} 2010-03-03 23:57:35 +00:00
Chris Wilson
4126d580d8 surface-fallback: Free traps on composite_trapezoids() error 2010-03-02 14:38:36 +00:00
Chris Wilson
8a59522bbd surface-fallback: Propagate NOTHING_TO_DO
NOTHING_TO_DO is converted to SUCCESS by the surface layer, so clean up
the code slightly by reducing the number of checks and conversions.
2010-03-02 14:36:16 +00:00
Chris Wilson
f071958606 xlib: Handle a1 image uploads through converter
Fixes test/large-source [xlib]
2010-03-02 13:58:18 +00:00
Chris Wilson
f979dd22d8 image: Don't rely on clip regions being clipped to surface extents.
Fixes a crash in test/clip-fill-unbounded [xlib-fallback].
2010-03-02 13:58:02 +00:00
Alexander Shulgin
15d9c5fcd8 Added new MIME type CAIRO_MIME_TYPE_URI and it's support in SVG backend
The rationale behind this change is that when someone is trying to
draw on a SVG surface using image surface patterns, the resulting SVG
file can take up to ridiculous 20 megabytes for 3-4 typical
photographic images in a single SVG file.  This also can take
significant amount of CPU time to complete.

The reason for this behaviour is that currently whenever SVG backend
needs to emit an image tag for a surface pattern it takes a snapshot
of the subject surface, encodes it in PNG, then Base64-encodes and
emits the (huge) resulting string.  With use of
cairo_surface_set_mime_data API this can be somewhat improved by
associating JPEG image contents with the corresponding surfaces.
Still this doesn't allow for post-processing of involved photographic
images without regenerating the SVG file.

As SVG specification allows URIs in the image tag's xlink:href
attribute, it is possible instead of embedding encoded image data to
simply link image files residing physically on the same medium as the
generated SVG file: files on disk under common directory, files on a
web server at common base URI, etc.

To make this happen we add new (unofficial) MIME type "text/x-uri" and
let users associate URIs with surfaces through
cairo_surface_set_mime_data() API.  When SVG backend needs to emit
surface contents and it sees "text/x-uri" attached to the surface, it
emits this data instead of taking snapshot.  The URI data is emitted
as is, so correctness check is left solely to the client code.
2010-03-02 10:07:19 +00:00
Chris Wilson
d91bab565c test: Remove the double-clip from clip-group-shapes
A push/pop is an implicit save/restore, so a clip applied inside the
group is temporary, whereas a clip applied outside affects both the
geometry inside *and* the application of the group when painted. So
reset the clip afterwards to get the desired behaviour.
2010-03-02 08:12:52 +00:00
Chris Wilson
e8c819c522 Warnings cleanup for CAIRO_FORMAT_INVALID.
A few more fixes required case statements to handle the addition of
CAIRO_FORMAT_INVALID.
2010-03-01 10:25:01 +00:00
M Joonas Pihlaja
1a7ba1a806 xcb: Update minimum required versions of libxcb.
The new xcb surface uses xcb_writev() and xcb_take_socket()
which were introduced in libxcb 1.1.92.  The boilerplate
in turn uses the major_code and minor_code fields in
xcb_generic_error_t, which were introduced in 1.4.
2010-03-01 01:23:17 +02:00
M Joonas Pihlaja
5b7f4bb241 api: Introduce CAIRO_FORMAT_INVALID formally in the API.
We were exposing the actual value of CAIRO_FORMAT_INVALID
through API functions already, so it makes sense to just
go ahead and put it in the cairo_format_t enum.
2010-03-01 01:21:31 +02:00
Chris Wilson
620cd9c2be image: Allow reduction of repeat modes for unity scaled patterns. 2010-02-28 09:09:20 +00:00
M Joonas Pihlaja
9ecb0f3cec image: Fix bug optimizing surface pattern extend modes.
The image surface tries to convert surface pattern's extend
modes to EXTEND_NONE, if it can, when converting a cairo_pattern_t
to a pixman_image_t. The check was not taking into account the
transformation matrix on the pattern, so it was possible to
trick it into using EXTEND_NONE by downscaling the source
pattern enough.  This patch changes the optimization to only
take if the pattern has no transformation.

Fixes surface-pattern-scale-down-extend-{pad,reflect,repeat}
failures in the test suite for the image backend.
2010-02-28 01:49:50 +02:00
M Joonas Pihlaja
260d7f8ace test: Test downscaling and extending a surface pattern.
Franz Schmid reported a regression in 1.9.6 when downscaling
and using EXTEND_REPEAT for an image surface pattern.  This
patch adds such tests for every extend mode.
2010-02-27 17:41:28 +02:00
M Joonas Pihlaja
ebadc2ed08 test: Add tests covering more clip fast paths in groups.
The clip-group-shapes-* tests check that it doesn't
matter whether the clip path is set before or after
pushing a group using specific types of clip paths
(aligned/unaligned rectangles and general paths.)
2010-02-27 03:28:59 +02:00
Chris Wilson
e8d0b4fb39 gl: Markup internal functions with cairo_private 2010-02-26 10:28:23 +00:00
M Joonas Pihlaja
ef807119ff compiler: Explain the slim hidden macros.
The slim_hidden_* macro definitions are rather cryptic at first
sight and I keep needing to rederive how they work just find out
what they're supposed to do.  This patch adds a comment explaining
how they're used and work.
2010-02-25 14:33:58 +02:00
M Joonas Pihlaja
dcf897967d test: Fix a wrongly typed return value in scaled-font-zero-matrix.
The test was returning a cairo_status_t, but should be returning
a cairo_test_status_t instead.  When the test failed it was
being reported as having crashed, rather than merely failed,
because the enum value of CAIRO_TEST_CRASHED happened to be
same as the cairo_status_t value of the cairo context at
the end of the failing test.
2010-02-25 14:20:27 +02:00
Benjamin Otte
8bb06915ed image: split cairo_image_surface_coerce()
Split into a general cairo_image_surface_coerce() that coerces to one of
the 3 supported formats (ARGB32, RGB24, A8) based on content and the
more general cairo_image_surface_coerce_to_format() that coerces to a
specified format.
2010-02-23 21:03:31 +01:00
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