Commit graph

6200 commits

Author SHA1 Message Date
Uli Schlachter
a349564e3c Revert "xcb: Error on 0x0 source surfaces"
This reverts commit 8f8149a207.
2011-09-15 16:21:42 +02:00
Uli Schlachter
c00e4c6671 Tee: compile fix for recent compositor API
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-15 16:21:41 +02:00
Chris Wilson
088d483043 ps: Check earlier for a supported mask
Fixes crash in fill-and-stroke-alpha.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-15 14:51:11 +01:00
Chris Wilson
13bd9592d8 ps: Fix return value for mask_supported and ps2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-15 14:28:53 +01:00
Chris Wilson
1eaab086f3 ps: Set transparency for stencil_masks
Fixes crash in a8-mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-15 13:53:15 +01:00
Adrian Johnson
47e16d0e56 subsetting: Support unicode fontnames
Most fonts use Window platform specific encoded font names since they
allow unicode names.

- Make _cairo_truetype_read_font_name() read the Windows platform
  names first. If this fails, fallback to reading he the Mac platform
  MacRoman encoded name.

- Use the PDF method of encoding non ASCII PS font names. Poppler will
  correctly extract the unicode name.

- Make PDF embed the font family name as AsciiHex if the name is not ASCII.
2011-09-15 22:05:22 +09:30
Chris Wilson
472e4515de image: fix compilation of spans with LERP 2011-09-14 20:21:08 +01:00
Chris Wilson
872e1c87b3 skia: fix compilation 2011-09-14 20:21:03 +01:00
Chris Wilson
cf71821a33 mono: Amalgamate adjacent spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-14 19:22:24 +01:00
Chris Wilson
8a80bbf78d image: Adapt to updated pixman lerp operators
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-14 19:10:22 +01:00
Uli Schlachter
e3131242b2 xlib-xcb: Make this compile again
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-14 15:50:19 +02:00
Uli Schlachter
af11d26752 xcb: Remove some dead code
surface->use_pixmap always had the value 0. This code is taken from cairo-xlib.
However, in cairo-xlib use_pixmap is set to 20 if XGetImage() fails.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-14 15:21:37 +02:00
Uli Schlachter
cd69c8ef68 cairo_clip_path_t: Remove extents
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-14 15:21:37 +02:00
Chris Wilson
7cf7ee5e29 traps: Skip compositing an empty bounded regions
Fixes the cairo-xlib crash with tighten-bounds. (I thought I had fixed
it earlier, but I was obviously wrong.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-14 12:45:59 +01:00
Chris Wilson
3e655f0819 traps: Send unaligned boxes as trapezoids
According to the little fishies this performs significantly better.
As a bonus, it did not handle overlapping boxes correctly...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-13 12:31:14 +01:00
Adrian Johnson
8218f5278e ps: turn off debug 2011-09-13 18:52:50 +09:30
Chris Wilson
4f2c7b8cf8 mono-scan-converter: Decrement height as we skip straight edges
Fixes paint-clip-fill-mono.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-12 15:49:13 +01:00
Adrian Johnson
7b6586a738 scaled-subsets: ensure different glyphs with same utf8 mapping are not merged together
If a glyph maps to a latin char that is already assigned in the latin
subset, put the glyph in a non latin subset.
2011-09-12 22:04:06 +09:30
Adrian Johnson
497258a4cf ft: fix warning 2011-09-12 22:01:09 +09:30
Adrian Johnson
b0d9b4ce53 pdf: add status check 2011-09-12 21:53:59 +09:30
Chris Wilson
65a954d5ba test-surfaces: compilation fixes
Update to the last minute changes in the traps compositor API.

And so it begins.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-12 11:39:59 +01:00
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +01:00
Adrian Johnson
0540bf384a ps: improve formatting of fallback image comment 2011-09-11 00:45:09 +09:30
Adrian Johnson
2d887d99c7 ps: use reusable stream for mesh pattern data
File data used by a shading pattern must reusable since the pattern
may read the file multiple times. As currentfile is not reusable, use
the /ReusableStreamDecode to make it reusable.
2011-09-11 00:45:09 +09:30
Adrian Johnson
166be70cb8 pdf: latin text must use character codes in the toUnicode CMap, not glyph indices 2011-09-09 22:30:49 +09:30
Adrian Johnson
80fc566eaf cff: strip subset tag when reading font name
so we don't end up with two subset tags in the font name when cairo
appends its own subset tag.
2011-09-08 19:29:16 +09:30
Adrian Johnson
7dca94fbc4 pdf: use interpolate in image smask 2011-09-06 23:50:46 +09:30
Adrian Johnson
d47e05f8c2 ps/pdf: fix the polarity of stencil masks 2011-09-06 23:41:12 +09:30
Adrian Johnson
a7ed3dd914 ps: support stencil masks
When the mask is an A1 image (or can be reduced to A1) use the imagemask operator.
2011-09-06 23:21:35 +09:30
Adrian Johnson
c34d6adfcc pdf: use _emit_smask() instead of _emit_imagemask to emit stencil mask
Now that _emit_smask() can generate A1 masks, the _emit_imagemask()
code can be removed and emit_smask() used instead. An additional
benefit is stencil masks can be generated from ARGB32 and A8 images as
well as A1 providing that the analysis of the transparency shows that
the image is opaque or has bilevel alpha.
2011-09-06 21:36:54 +09:30
Adrian Johnson
d6d3825b51 ps: each row of 1-bit image data needs to begin on a byte boundary 2011-09-05 22:31:53 +09:30
Adrian Johnson
3614892d8d pdf: each row of 1-bit image data needs to begin on a byte boundary 2011-09-05 22:30:15 +09:30
Adrian Johnson
42fecf37dc pdf: use ink extents in content stream XObjects 2011-09-05 21:36:43 +09:30
Adrian Johnson
d1f146b54f pdf: use ink extents for pattern bbox 2011-09-05 21:22:12 +09:30
Adrian Johnson
37a22669d8 pdf: use ink extents for smask bbox
There are some inkscape bugs reporting very slow rendering of inkscape
generated PDFs (inkscape uses cairo for PDF output). These bugs are
caused by cairo specifying a page sized bounding box in XObjects and
Patterns. PDF renderers usually use the BBox as the image size when
compositing. As PDFs generated from SVG tends to use a lot of XObjects
and Patterns this can lead to very long rendering times.

These three patches tighten up all the BBoxes in PDF output.
2011-09-05 21:18:36 +09:30
Andrea Canciani
ed84cb522c wideint: Fix build on suncc
"static cairo_private" means nothing and suncc complains loudly about
it. The visibility of _cairo_double_to_uint64() and
_cairo_uint64_to_double() should just be "static".
2011-09-04 16:23:37 -07:00
Andrea Canciani
01729606fb malloc: Fix build on suncc
cairo-malloc-private.h depends on malloc() and realloc() being
declared, hence it should include stdlib.h.
2011-09-04 16:23:37 -07:00
Andrea Canciani
60e04ff49e observer: Fix build on suncc
Returning a void value is an error on suncc and causes a warning on msvc:
cairo-surface-observer.c(1273) : warning C4098:
'_cairo_surface_observer_release_source_image' : 'void' function
returning a value
2011-09-04 16:23:36 -07:00
Jesse van den Kieboom
b0aec95c8e quartz: Rename declaration of _cairo_quartz_create_cgimage
The function was renamed in 81efbc1847
but the prototype was not updated.

Silences the warning:
cairo-quartz-surface.c:165: warning: no previous prototype for 'CairoQuartzCreateCGImage'

Along with 0c620080af, fixes
https://bugs.freedesktop.org/show_bug.cgi?id=40082
2011-09-03 09:15:48 -07:00
Uli Schlachter
968eb30bba xcb: Steal from the pending list for GetImage
Before using some piece of SHM again, we must be sure that the X11 server is no
longer working with it. For this, we send a GetInputFocus when we are done with
the SHM locally and will only use the memory again when the reply comes in.

However, if we are allocating the memory for SHM GetImage, then we can re-use
memory earlier, because the server processes requests in order. So it will only
start writing to the memory after it is done with earlier requests for this
memory. So instead of using GetInputFocus for synchronisation, the SHM GetImage
request will automatically do this for us.

Thanks to Chris Wilson for this idea.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-02 15:21:20 +02:00
Uli Schlachter
ea52556531 xcb: Fix fixup_unbounded_with_mask
This code was casting a pixman_box32_t* to cairo_box_t*. However, a box uses
fixed point numbers while the pixman box uses integers which means the result
was off by factor 256.

The fix is to replace the use of _cairo_boxes_limit() with
_cairo_boxes_init_with_clip(). However, this means this function no needs to be
passed a clip instead of a clip region which causes some minor changes to
_composite_boxes().

This improves the result for tighten-bounds again. Out of the tested
combinations, 10 are fixed by this. This bug was hit by code similar to this
(Repeating here since that test has so many different cases):

cairo_set_operator (cr, CAIRO_OPERATOR_IN);
cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
cairo_rectangle (cr, 0, 0, SIZE, SIZE);
cairo_rectangle (cr, SIZE / 4, SIZE / 4, SIZE / 2, SIZE / 2);
cairo_clip_preserve (cr);
cairo_fill (cr);

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-02 15:12:25 +02:00
Uli Schlachter
ed7f992c13 xcb: Skip drawing if bounded extents are empty
This only wraps the whole code block in an if which checks if the bounded
extents are empty. No other changes are done in here.

This fixes the failed assertion from the tighten-bounds test.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-02 15:12:25 +02:00
Andrea Canciani
b1a1dfcdcf win32: Fix linking
round() is not available on win32 and causes the linking to fail with:

cairo-surface-observer.obj : error LNK2019: unresolved external symbol
round referenced in function percent
2011-09-02 12:45:49 +02:00
Andrea Canciani
04a7bad923 surface: Fix make check
cairo_surface_map_to_image() and cairo_surface_unmap_image() are
called by cairo-surface-observer but they are not slim_hidden:

Checking .libs/libcairo.so for local PLT entries
00000000002e27a8  0000019d00000007 R_X86_64_JUMP_SLOT
     000000000005df30 cairo_surface_unmap_image + 0
00000000002e2b90  0000026100000007 R_X86_64_JUMP_SLOT
     000000000005f5c0 cairo_surface_map_to_image + 0
2011-09-02 12:45:49 +02:00
Andrea Canciani
14fab8f84a script: Fix make check
make check fails because cairo-script-private.h cannot be compiled
standalone:

./cairo-script-private.h:45:1: error: unknown type name ‘cairo_private’
...

./cairo-script-private.h:48:40: error: unknown type name ‘cairo_output_stream_t’
2011-09-02 12:45:49 +02:00
Andrea Canciani
0101a54579 time: Add cairo_time_t type
Add the cairo_time_t type (currently based on cairo_uint64_t) and use
it in cairo-observer and in the perf suite.

Fixes the build on MacOS X (for the src/ subdir) and Win32, whch
failed because they don't provide clock_gettime:

cairo-surface-observer.c:629: error: implicit declaration of function 'clock_gettime'
cairo-surface-observer.c:629: warning: nested extern declaration of 'clock_gettime'
cairo-surface-observer.c:629: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
...
2011-09-02 12:27:13 +02:00
Andrea Canciani
e7204a3631 win32: Fix compilation
cairo-image-surface-private.h is needed in order to access
cairo_image_surface_t fields.

Fixes multiple build errors:

error C2037: left of '...' specifies undefined struct/union
'_cairo_image_surface'
2011-09-02 12:00:29 +02:00
Andrea Canciani
0c620080af quartz: Fix compilation
cairo-image-surface-private.h is needed in order to access
cairo_image_surface_t fields.

Fixes multiple build errors: dereferencing pointer to incomplete type
2011-09-02 12:00:29 +02:00
Uli Schlachter
d66d9cd777 xcb: Fix fallback for *_shm_put_image
This function shouldn't ever be called is xcb-shm is disabled. However, it is
still defined to avoid lots of #ifdefs.

Additionally, this removes the only use of uint64_t from cairo-xcb.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-30 22:19:33 +02:00
Uli Schlachter
5f45f696d0 xcb: Add an assert for the tighten-bounds test
This code casts the result of _cairo_xcb_surface_create_similar() to
cairo_xcb_surface_t*. However, the tighten-bounds test makes this run with
bounded extents of size 0x0 and thus _cairo_xcb_surface_create_similar() falls
back to an image surface. Ugly.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-30 22:10:34 +02:00