Commit graph

10422 commits

Author SHA1 Message Date
Chris Wilson
6cd1f5040f clip: Apply clip boxes to the clip surface
As we convert the unaligned clip boxes to a region, we need to process
the intersection of the boxes with the clip surface as a separate step.

Fixes tighten-box for the base compositor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 23:14:21 +01:00
Chris Wilson
4ea3ace6c8 spans: Only fallback for a clipmask if unbounded
For a bounded operation with a clip we will already have performed the
clip geometrically.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:53:55 +01:00
Chris Wilson
cd1004ce19 traps,spans-compositor: Avoid mistreating unaligned clips as aligned
An unaligned clip requires careful handling, and so exclude processing
along the fast paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
de1150cc0e spans-compositor: Add tracepoints for debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
197e5b7324 spans-compositor: Handle unaligned unbounded boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
2d26f7da77 test: Fix tighten-bounds reference images
Uli Schlachter spotted that I had inadvertently committed (606e9e1c9) a
broken set of test images for the tighten-bounds case and so masked a
nasty bug with the mishandling of unaligned clips.

Reported-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 21:31:13 +01:00
Chris Wilson
117a44a335 gl: Reject SOURCE + mask in composite_boxes()
As SOURCE requires a bounded operation and the GL compositor only
implements a simple operation (i.e. it just blits from source to
destination instead of applying a linear interpolation as required), we
need to reject the operation and fallback. In the future, we should
make the linear interpolation available through a GL shader or as a
dual-source blend (better).

Spotted-by: Chuanbo Weng <strgnm@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-11 17:30:42 +01:00
Chuanbo Weng
0196327b30 gl: Convert CLEAR to DEST_OUT when there's a mask for composite_boxes.
As Cairo's CLEAR sematics are for a bounded operation, and GL's uses the
simple semantics for its CLEAR composite, we need to convert the
operation into an equivalent DEST_OUT when we have a mask.
2012-05-11 17:11:55 +01:00
Chris Wilson
9ecf2f7c4f damage: Prevent reducing an error object
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 21:01:36 +01:00
Chris Wilson
f4631dca37 damage: Prevent accumulating damage to an error object
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 21:00:49 +01:00
Chris Wilson
50e51389bd damage: Avoid freeing the NIL error object
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-10 20:58:33 +01:00
Uli Schlachter
3bff546ebe c_surface_set_mime_data: Remove duplicate "Since"
This fixes the following message from "make check":

./cairo-surface.c (1192): ERROR: cairo_surface_set_mime_data: Duplicate 'Since'
field

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 16:59:58 +02:00
Uli Schlachter
fcccb1a65a check-doc-syntax: Find duplicate "Since:" tags
It makes no sense to say more than one time when some symbol was introduced.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 16:59:58 +02:00
Uli Schlachter
a184de9064 check-doc-syntax: Make this work again
Commit ed90616b77 changed the way the awk script gets invoked. Due to a
missing "test", this resulted in the awk script never getting invoked at all.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-09 16:59:58 +02:00
Henry (Yu) Song
3e02dccb97 gl/msaa: Add support for unbounded operators
When filling and stroking with an unbounded operator, first fill
and stroke to a temporary surface and then paint the entire surface
back to the original target.
2012-05-08 12:48:30 -07:00
Henry (Yu) Song
b099f8b0c7 gl/msaa: Support for masking
Add support for masking in the OpenGL MSAA compositor. This is
accomplished simply by properly setting up the masking source,
emitting the entire bounded composite region, and unforking
vertex emission.
2012-05-08 12:13:42 -07:00
Henry (Yu) Song
929a96ed03 gl/msaa: Support for texture sources
Add support for texture sources, by unforking _cairo_gl_composite_begin.
_cairo_gl_composite_begin_tristrip is now just a small wrapper. Also
properly emit the source texture coordinates when emitting tristrip
vertices.
2012-05-08 11:42:29 -07:00
Henry (Yu) Song
a60bb83f28 gl/msaa: Prevent stroke overlap
When stroking we do not send our polygon to the tessellator, so
it may have overlapping stroke components. Use the stencil buffer
to prevent stroke components from overlapping.
2012-05-08 11:06:31 -07:00
Uli Schlachter
138e595c11 Remove some dead code
This code could never be executed, because the status variable doesn't get set
since the last time it is checked and errors get returned to the caller.

This was noticed while looking into the build log provided by
http://lists.cairographics.org/archives/cairo/2012-April/022993.html

Reported-by: Ryan Schmidt <cairo-2012b@ryandesign.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 10:14:54 +02:00
Uli Schlachter
494cfd7eb9 Remove some unused functions
All of these are unused since af9fbd176b "Introduce a new compositor
architecture". Since no one complained yet, I guess that means that we don't
need these any more. :-)

This was noticed while looking into the build log provided by
http://lists.cairographics.org/archives/cairo/2012-April/022993.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 10:14:54 +02:00
Chuanbo Weng
748dcdef4b gl: fix the translate value in copy_boxes.
Fixes 36 test cases (such as push-group-color)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48221
2012-05-04 10:15:01 +01:00
Chris Wilson
db4ee947c3 Split finish into multiple stages
In order to handle the snapshot copy-on-write losing a race with another
thread using the snapshot as a source, we may find the target acquires a
fresh reference as we attempt to finalize it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 16:55:22 +01:00
Chris Wilson
52dfa038b9 snapshot: Avoid triggering assertion for grabbing the target during destroy
If the source wins the race to acquire the original surface as it is
being destroyed, it triggers an assertion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 16:55:22 +01:00
Chris Wilson
f62f8f907d snapshot: Hold a reference to target whilst querying
Due to race with cow and accessing target from multiple threads, we need
to be careful that we always acquire a reference for our access to
the snapshot target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-01 16:55:22 +01:00
Søren Sandmann Pedersen
af3c8abbce Revert "Use pixman glyphs"
This was pushed accidentally - apologies.

This reverts commit 752c3b69e0.
2012-04-30 12:02:38 -04:00
Søren Sandmann Pedersen
752c3b69e0 Use pixman glyphs 2012-04-30 09:41:44 -04:00
Chris Wilson
821a9af33c version: Post release bump to 1.12.3 2012-04-29 20:54:07 +01:00
Chris Wilson
dbc0efad7e version: bump for cairo-1.12.2 release 2012-04-29 19:49:12 +01:00
Chris Wilson
ed90616b77 check-doc-syntax: Only parse the source files for incorrect tags
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 19:29:12 +01:00
Chris Wilson
c16cdf0b4e check-doc-syntax: Fix handling of return value in make check 2012-04-29 19:29:12 +01:00
Chris Wilson
a1d4f416e4 path-stroke-boxes: Fix degenerate end-caps for anti-clockwise paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 15:55:16 +01:00
Chris Wilson
71df65f95a test: Update degenerate-solid-dash reference
Looking at the base output for cairo-1.0 reveals we have an issue with
the placement of degenerate end-caps.
2012-04-29 15:55:16 +01:00
Chris Wilson
f5df96748e gstate: Correctly compact degenerate dash segments
The danger of the incomplete test masking the failure to correctly skip
the degenerate elements in the final dash state.

Fixes the fixed degenerate-solid-dash.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 14:32:14 +01:00
Chris Wilson
ba21231491 test: Fix array lengths for degenerate-solid-dash
The latter arrays were meant to test compaction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 14:23:11 +01:00
Chris Wilson
9176e640d7 gstate: Reduce degenerate dash to solid
If the dash specifies that the pen is always on (i.e. the total of the
off segments is zero), then we can eliminate the dash pattern.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 14:02:17 +01:00
Chris Wilson
47368d5e83 image: Add a little bit of debugging to show number of boxes being drawn
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 14:02:17 +01:00
Chris Wilson
0c14ce6dca test: Exercise degenerate dashes that are wholly solid
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 13:56:43 +01:00
Chris Wilson
d2f740ccbd test: Exercise clip inversion imperfections
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 12:40:10 +01:00
Chris Wilson
4a9a6b7efb Satisfy check-doc-syntax.awk for unimplemented functions
./cairo.c (634): ERROR: cairo_set_opacity: missing 'Since' field
./cairo.c (3578): ERROR: cairo_get_opacity: missing 'Since' field

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-29 12:22:20 +01:00
Chris Wilson
ec400daf9e image: Avoid overflow when computing lerp spans for a8
Reported-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-28 23:16:32 +01:00
Chris Wilson
a18506acf0 Update the remaining backends to handle a NULL extents for _cairo_surface_get_source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-27 22:13:01 +01:00
Chris Wilson
7eb33099d3 snapshot: Perform the cow under a mutex
In order to prevent a race between concurrent destroy and use in another
thread, we need to acquire a reference to the snapshot->target under a
mutex. Whilst we hold that reference, it prevents the internal destroy
mechanism from freeing the memory we are using (if we have a pointer to
the original surface) and the client drops their final reference.

Oh boy, talk about opening a can of worms...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-27 14:10:50 +01:00
Chris Wilson
455b4de1fc image: Allow a snapshot to steal the original memory upon finish
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-27 11:41:41 +01:00
Chris Wilson
957a9cc619 image: Fix typo in _blit_spans()
The height is 'h' not 'y'!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-26 08:54:39 +01:00
Chris Wilson
fe428fc7f0 xlib: Fix inline conversion for TrueColor PutImage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 20:56:20 +01:00
Chris Wilson
9e81c5b737 xlib: Allow applications to create 0x0 surfaces
Although 0x0 is not a legimate surface size, we do allow applications
the flexibility to reset the size before drawing. As we previously never
checked the size against minimum legal constraints, applications expect
to be able to create seemingly illegal surfaces, and so we must continue
to provide backwards compatibility.

Many thanks to Pauli Nieminen for trawling through the protocol traces,
diving into the depths of libreoffice and identifying the regression.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=49118 (presentation
mode in loimpress is blank).

Reported-by: Eric Valette <eric.valette@free.fr>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-04-25 20:51:20 +01:00
Jeff Mahoney
f736cd1443 pdf: Fix wrong allocation in _cairo_pdf_surface_add_source_surface
_cairo_pdf_surface_add_source_surface allocates unique_id with
size unique_id_length but then copies surface_key.unique_id_length into it.

This causes e.g. evince to crash predictably while trying to print with:
*** buffer overflow detected ***: evince terminated

We should be using surface_key.unique_id_length instead.

Reported-by: Dominique Leuenberger <dominique-freedesktop.org@leuenberger.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49089
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2012-04-23 22:13:57 +01:00
Alexandros Frantzis
e6a04c2f67 gl: Fix creation of gradient ramps for GLESv2
glTexImage2D is not allowed to perform an implicit format conversion
with GLESv2, so fixup the internal format to match the incoming pixel
format.
2012-04-23 20:21:40 +01:00
Dimiter Stanev
1ca8c049ca win32: compilation fix for recent private/inline header separation 2012-04-23 19:10:44 +01:00
Adrian Johnson
abedc6b46a ps: support all image types
If the image is not rgb24/argb32/a8/a1, create a new image with the
same CAIRO_CONTENT and paint image to the new image.
2012-04-23 13:22:16 +09:30