Commit graph

10045 commits

Author SHA1 Message Date
Uli Schlachter
3ebe0ca876 xlib-xcb: Implement surface_set_drawable
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 22:55:58 +01:00
Uli Schlachter
9ec5e9fee6 xcb: Fixup some internal state in set_{drawable,size}
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-05 22:48:56 +01:00
Chris Wilson
3dbb0f17a7 gl: Unbreak the glyph cache
Use the embedded operand on the surface instead of copying it across and
trying to then wrap the surface from it - as it would then unref the
glyph cache surface after the operation and so we would lose the glyphs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 18:32:58 +00:00
Chris Wilson
e68eb874e9 fallback: fix the offset for painting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
dd73add00c gl: Set the device offset on map-to-image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
f7daaa8fce gl: Propagate clip region
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
3b1151f60d gl: Substitute the white source for the default pattern
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
0ce8dad9a2 gl: Decouple glyphs on shutdown from the scaled font caches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
31c0726f68 gl: Embed the operand rather than a pattern into the glyph cache
Use the native encoding for patterns.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
16038150b3 gl: Use the embedded operand to allow passing sources around
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
65cd7d3beb gl: Propagate surface texture to embedded operand
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
d7dcf9d28f gl: Check against user-provided invalid sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
3edf369ead gl: Make the backend struct static
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Chris Wilson
934a3dcc6b doc: Drop the gtk-doc markup from _cairo_radial_pattern_focus_is_inside
Stop confusing gtk-doc with this private function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:19:48 +00:00
Chris Wilson
aa5a9c46e1 doc: add CAIRO_DEVICE_TYPE_COGL
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:17:18 +00:00
Chris Wilson
4a0913eb52 doc: Add new antialias symbols
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:16:32 +00:00
Chris Wilson
d6440f2d66 script: Add documentation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 16:12:02 +00:00
Chris Wilson
d86ce9ca2f doc: Add sections for cairo-script
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:35:42 +00:00
Chris Wilson
498ca4bf74 doc: Add similar-image, map-to-image, unmap-image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:51 +00:00
Chris Wilson
9156339295 xcb: Silence a compiler warning for mixing status and internal status enums
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:51 +00:00
Keith Packard
b9d4a5f106 Add cairo_xcb_surface_set_drawable
Mirrors cairo_xlib_surface_set_drawable, allowing the drawable
targeted by a surface to be changed on the fly.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:51 +00:00
Keith Packard
a30013f72a Create XCB documentation.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:50 +00:00
Keith Packard
d5c7d2e2f4 cairo-xcb: gtk-doc doesn't like _ in parameter names
Any function documented with gtk-doc must not have _ in any parameter
names, or at least that's what I've found. This patch simply renames
parameters as needed to make things work.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 15:31:50 +00:00
Chris Wilson
a6def3874c gl: Even repeating subsurfaces need to be cloned
As we can't reuse the existing surface definition for a repetition of
the subsurface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:29:51 +00:00
Chris Wilson
f308ba7a44 subsurface: Replace any existing snapshot
Only allow one owner to keep their snapshot on the subsurface, and
so automatically replace any previous snapshot.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:25:38 +00:00
Chris Wilson
03be2019cd gl: And enable subsurface caching of the clones
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:21:18 +00:00
Chris Wilson
5f6d3fe40b gl: Temporarily clone a subsurface as required
When the sample extents exceed the subsurface bounds we need to clone
the subsurface into a regular surface in order to correctly handle the
CAIRO_EXTEND_NONE extend mode (i.e prevent sampling out-of-bounds).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 12:17:24 +00:00
Chris Wilson
4713562eda trace: Remove the warning about the unstable format
We're stuck with the PostScript style for this generation now.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:50:21 +00:00
Chris Wilson
f5f303f10d script: Prefer polymorphorism for mesh path construction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:48:50 +00:00
Chris Wilson
8844d50308 Convert cairo_mime_surface_t to cairo_raster_source_pattern_t
As discussed, overloading the cairo_surface_t semantics to include
sources (i.e. read-only surfaces) was duplicating the definition of
cairo_pattern_t. So rather than introduce a new surface type with
pattern semantics, start along the thorny road of extensible pattern
types.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 10:35:42 +00:00
Chris Wilson
2c4f6bbfbc gl: Prevent the traps compositor from exploding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
5e4a0bd892 gl: Embed a operand into the surface for pass-through
The traps compositor expects to be able to pass either in a surface or a
source to its composite functions, so make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
4cf001244a gl: Avoid cleaning up an uninitialised composite upon UNSUPPORTED
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
5edb3a29b9 gl: Fallback for complex subsurfaces
In the process we need to supply the sampled area and operation extents
into the operands.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
12b8f94161 gl: Correctly offset sub-image uploads
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:16:22 +00:00
Chris Wilson
e280e67b86 gl: Update glyphs to use cairo_gl_source_t
It was being passed into the function but then interpreted as a
cairo_pattern_t. Fix it!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 21:20:21 +00:00
Martin Robinson
d99ebe9862 gl: Properly prepare the source when compositing glyphs with a mask.
After the architecture rewrite, glyph compositing via a mask was
disabled. This change reinstates that.
2011-11-23 20:49:37 +00:00
Martin Robinson
33c59030b5 gl: Fix offset for non-texture surface patterns
Instead of drawing only a portion of the image into the intermediate
texture, draw the entire image and adjust the translation matrix to
compensate.
2011-11-23 20:49:30 +00:00
Martin Robinson
c94c3eede0 gl/msaa: Fix scissor bounds
Scissor bounds should depend on both the height and y coordinate
of the bounding box. Also remove _cairo_gl_y_flip() since we were
the last caller.
2011-11-23 20:49:16 +00:00
Andrea Canciani
e3ec127e39 subsurface: Fix 'make check'
2fb4a0e119 made the
_cairo_surface_subsurface_set_snapshot available with default
visibility.

'make check' correctly points out that it should be marked as private.
2011-11-23 20:17:56 +01:00
Chris Wilson
6a2b754ec9 xlib: Eliminate redundant copies of subsurfaces
If the sample is wholly contained within the subsurface of the original,
we can simply use the original with an offset; thereby only copying the
data if we are sampling outside the subsurface bounds.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 18:40:02 +00:00
Chris Wilson
49d3a6a95e xlib: Cache the subsurface Picture
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 17:36:16 +00:00
Chris Wilson
763d98071e surface: Bump reference count around finish
In order to handle reference cycles during finish (through snapshots) we
need to bump the reference on the surface first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 17:35:39 +00:00
Chris Wilson
2fb4a0e119 subsurface: Support caching for cloned subsurfaces
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 17:35:30 +00:00
Chris Wilson
894d8c8bf7 xlib: Handle subsurfaces correctly
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 15:40:15 +00:00
Chris Wilson
e217677ce6 xlib: ADD only reduces to SOURCE for alpha-only targets
Fixes operator.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:57:35 +00:00
Chris Wilson
44a868b552 subsurface: And remove the dead code for releasing complex source
Following the previous commit, we only allocate a simple image when
acquiring the source so we only need to unreference it upon release.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:28:27 +00:00
Chris Wilson
1fe16f75b1 image: Remove dubious "optimisations" for acquired source images
By this point we have already paid the penalty for acquiring the source
image, so kiss.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:19:22 +00:00
Chris Wilson
c52129feb4 subsurface: Simplify acquire_source_image
Remove all of the special casing and simply extract the source. The time
for special casing is to avoid calling the generic acquire in the first
place, so kiss.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:19:22 +00:00
Chris Wilson
73dc2c4e27 image: Only unwrap a subsurface if the sample is fully contained
In order to handle out-of-bounds sampling of a subsurface target we need
to first avoid incorrectly unwrapping it.

Fixes crash in subsurface-outside-target

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-23 14:14:39 +00:00