Commit graph

9015 commits

Author SHA1 Message Date
Andrea Canciani
8d7486a6ea image: Fix _pixel_to_solid
An A1 image with full alpha should be opaque black, not opaque white.

Use specialized solid black image instead of the generic constructor
for an A8 image with full alpha (it is likely to be cached).
2010-11-28 18:37:16 +01:00
Andrea Canciani
72b0a44a1f image: Fix compositing of unaligned boxes
The input of _fill_unaligned_boxes is (supposed to be) composed only
of disjoint rectangles, that can safely be passed to the rectilinear
span converter, but this function artificially introduces intersecting
rectangles when drawing non-aligned boxes.

Using non-intersecting rectangles is easy and makes the code correct.

Fixes rectilinear-grid.

Reviewed-by: Uli Schlachter <psychon@znc.in>
2010-11-28 18:35:16 +01:00
Andrea Canciani
1038973083 test: Add rectilinear-grid
The rectilinear scan converter assumes disjoint rects as input, but
cairo-image passes intersecting rectangles to it.

This test shows that image and any backends passing through it for the
rasterization (fallbacks, vector backends whose renderer is
cairo-based) fail in compute the corners of intersecting rectangles
correctly.
2010-11-28 15:42:08 +01:00
Andrea Canciani
cfafa3924b array: Fix comment
The comment was talking about using 0 as index, but was using
"num_elements" instead.
2010-11-28 09:33:14 +01:00
Adrian Johnson
f238da5291 CFF subset: fix bug with euro glyph in fallback fonts 2010-11-28 11:45:00 +10:30
Adrian Johnson
7feefc75f6 CFF subset: fix subsetting of Euro glyph
https://bugs.freedesktop.org/show_bug.cgi?id=31878
2010-11-28 03:46:10 +10:30
Adrian Johnson
f85af7fe8d Change fallback resolution test to use resolutions in multiples of 72
With integer aligned clipping the test output has no seams.
2010-11-28 03:39:05 +10:30
Adrian Johnson
126108a6ac Boilerplate: Set fallback resolution using force_fallbacks function
cairo_set_fallback_resolution() does not work when testing rgb24 surfaces
2010-11-28 03:38:42 +10:30
Adrian Johnson
59661f8af4 Fix fallback-resolution test
The recording surface source image painted onto fallback images always
had the resolution 72ppi instead of the fallback resolution of the
target surface. Fix this by passing adding a new
acquire_source_image_transformed backend function for the recording
surface to use and passing the target device transform through to the
recording surface when the image is acquired.

Based on Carl Worth's experimental acquired_source_image_transformed
branch.

https://bugs.freedesktop.org/show_bug.cgi?id=24692
2010-11-28 03:38:29 +10:30
Andrea Canciani
063a3894d7 pdf: Silence compiler warnings
The compiler complains about a const pointer being free'd and memcpy'd
to:

cairo-pdf-surface.c: In function ‘_cairo_pdf_surface_add_source_surface’:
cairo-pdf-surface.c:1208: warning: passing argument 1 of ‘__builtin___memcpy_chk’ discards qualifiers from pointer target type
cairo-pdf-surface.c:1208: warning: passing argument 1 of ‘__inline_memcpy_chk’ discards qualifiers from pointer target type
cairo-pdf-surface.c: In function ‘_cairo_pdf_source_surface_entry_pluck’:
cairo-pdf-surface.c:1666: warning: passing argument 1 of ‘free’ discards qualifiers from pointer target type
2010-11-26 13:49:46 +01:00
Andrea Canciani
1ab6496578 array: Silence warnings
493aaf0f15 made all cairo_array
functions use unsigned int for indexes and sizes.

This commit fixes the compiler warnings about those values being
compared to signed int's.
2010-11-26 13:14:37 +01:00
Adrian Johnson
47b81b9fea Truetype subset: add missing unicode ranges to cmap
A couple of unicode ranges were missing from the cmap generated for latin fonts.

https://bugs.freedesktop.org/show_bug.cgi?id=31878
2010-11-26 21:54:39 +10:30
Adrian Johnson
2ae2be36d4 PDF: Add missing clipper_reset 2010-11-26 21:54:39 +10:30
Chris Wilson
2a1e7e18de wgl: Use CreateWindowA with an ASCII string
... or else compilation with fail on Windows if UNICODE is defined

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-26 09:48:13 +00:00
Andrea Canciani
493aaf0f15 array: Cleanup types
Const-ify where appropriate and make all index and element counts
unsigned int.

This is needed to enable accessing const cairo_array_t's without
having to manually remove the const qualifier (which happens in the
to-be-merged mesh pattern code, for example).
2010-11-24 14:45:19 +01:00
Andrea Canciani
9960f299ac array: Add read-only accessor
It is sometimes useful to read the elements of a const cairo_array_t,
but it is currently only possible by ignoring the const qualifier.
The _cairo_array_index_const function allows read-only access to the
array elements.

This is needed to enable accessing const cairo_array_t's without
having to manually remove the const qualifier (which happens in the
to-be-merged mesh pattern code, for example).
2010-11-24 14:45:14 +01:00
Andrea Canciani
ae6a0de23b array: Remove snapshot support
Array snapshots are not used anymore and just bloat the implementation
of cairo_array_t.

In particular, double indirection was needed to implement array
snapshots, as explained in c786853993.
2010-11-24 14:45:07 +01:00
Uli Schlachter
520206e991 xcb: Handle deferred_clear in _copy_to_picture
This ensures that surfaces with the deferred_clear flag on are cleared
before being used as sources.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-11-23 22:12:45 +01:00
Andrea Canciani
56528d7b9d ps: Fix painting
Painting of some pattern was broken because the paint operation was
implemented as a fill to a rect containing the clip, but this rect was
not transformed as appropriate (using the cairo_to_ps matrix).
PDF simply fills the whole surface rect, so we implement the same
behavior in PS.

Fixes clip-group-shapes-circles, clip-stroke, linear-gradient-extend,
linear-gradient-one-stop, radial-gradient-one-stop.
2010-11-23 15:08:44 +01:00
Andrea Canciani
e2c9964c3e quartz-font: Implement new load_truetype_table semantics
fb0304e2a9 changed and specified the
behavior of load_truetype_table.
This commit makes quartz-font implement the new behavior.
2010-11-23 14:29:24 +01:00
Adrian Johnson
8db239660f Check is_synthetic() font backend exists before calling it 2010-11-23 23:26:49 +10:30
Adrian Johnson
12b1cbb07e Fix xml-surface use of load_truetype_font 2010-11-23 23:20:25 +10:30
Adrian Johnson
e2dcbfd895 Automate error checking for ps-eps test 2010-11-23 23:13:50 +10:30
Adrian Johnson
67a90e8035 Check table size in cairo_truetype_get_style() 2010-11-23 22:02:55 +10:30
Adrian Johnson
fb0304e2a9 Document load_truetype_table function and ensure ft-font and Win32-font are compliant
There were some difference between how the FT and Win32
load_truetype_table font backend functions worked due to the
difference between FT_Load_Sfnt_Table() and GetFontData(). eg FT
returns an error if less than the requested number of bytes could be
read while Win32 returns success and sets the length to the number of
bytes read.
2010-11-23 21:44:31 +10:30
Chris Wilson
abff335348 pdf: Silence compiler for an impossible case
Make the default case be an assert to catch a silly programming error
and silence the compiler:

  cairo-pdf-operators.c: In function ‘_word_wrap_stream_write’:
  cairo-pdf-operators.c:300: warning: ‘count’ may be used uninitialized in
  this function

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-22 18:49:22 +00:00
Adrian Johnson
1effa1e823 win32: add synthetic font subsetting support 2010-11-23 00:13:56 +10:30
Adrian Johnson
7f0029c31e Use fallback font for synthetic fonts
If the font has been synthesized we can't use the native subsetters as
the outlines won't be the same. Instead force the use of the fallback
subsetters so the synthesized outlines will used to generate the font.
2010-11-23 00:13:24 +10:30
Adrian Johnson
9862c38fc7 Add unique_id mime type
to ensure surfaces with the same unique_id mime type are not embedded
more than once in PDF files.
2010-11-23 00:13:02 +10:30
Adrian Johnson
3445401ae6 Fix regression in fallback-resolution test
a2254e56 caused the fallback-resolution test to display empty fallback
images for to push_group/pop_group part of the test.
2010-11-21 20:09:13 +10:30
Adrian Johnson
bb4055dac6 PS: Fix regression - incorrect EPS bounding box
https://bugs.freedesktop.org/show_bug.cgi?id=24688
2010-11-21 00:37:29 +10:30
Adrian Johnson
d3746448d7 PS: Fix regression - missing page content in EPS output
https://bugs.freedesktop.org/show_bug.cgi?id=24688
2010-11-20 23:54:00 +10:30
Adrian Johnson
e7c5f47043 PS/PDF: Fix regression when changing page size to a larger size
https://bugs.freedesktop.org/show_bug.cgi?id=24691
2010-11-20 00:50:04 +10:30
Adrian Johnson
6e3e329170 win32: fix font_face hashing
some bugs were discovered while testing with firefox
2010-11-18 23:07:45 +10:30
Behdad Esfahbod
268cb0a2bb Add note re gtk-doc.make 2010-11-17 13:30:28 -05:00
Koji Otani
653ceb517f PS: fix embedding of grayscale jpegs
https://bugs.freedesktop.org/show_bug.cgi?id=31632
2010-11-17 00:07:03 +10:30
Adrian Johnson
d565639478 win32-print: print as unicode where possible
One of the problems identified in
https://bugzilla.mozilla.org/show_bug.cgi?id=454532 is that there are
some older printer drivers that do not work with ExtTextOut and the
ETO_GLYPH_INDEX option.

Fix this by where possible mapping glyph indices back to unicode and
calling ExtTextOut without ETO_GLYPH_INDEX. Glyphs that can not be
mapped back to unicode are printed with ETO_GLYPH_INDEX.
2010-11-16 23:53:05 +10:30
Adrian Johnson
eb29a25dd6 win32: Use a font_face hash table to provide unique font faces
Similar to the freetype and toy font backends, use a hash table
to map logfont,hfont to font faces.

This fixes the multiple embedding of the same font in PDF.

https://bugs.freedesktop.org/show_bug.cgi?id=24849
2010-11-16 23:48:39 +10:30
Eric Anholt
31e116f084 gl: Avoid using gl_FragCoord for linear gradients.
The issue is that we store our data flipped based on whether we're
rendering to an FBO or to a window.  By not flipping our gl_FragCoord
usage based on that (either with math or ARB_frag_coord_conventions),
this caused linear gradients to be flipped when rendering either to a
window or to an FBO.  To avoid this, pass in appropriate texcoords.
And, if we're passing in texcoords, just do the projection to the
linear gradient factor on the CPU side per vertex instead of providing
a bunch of uniforms to do the math per fragment.

Fixes 18 testcases.
2010-11-15 15:26:50 +08:00
Jeff Muizelaar
7237eb62be Sync get-path-extents test with the one on 1.10.
The problem fixed by e9bb70d2de
had already been fixed on master by always computing exact extents:
89e1261dd0
2010-11-10 14:21:58 -05:00
Adrian Johnson
3afd7cd031 PDF: Restrict ActualText to PDF version >= 1.5
The use of ActualText in a marked content sequence is a PDF 1.5
feature.

A 'use_actual_text' flag linked to the PDF version has already been
implemented in pdf-operators but for some reason this flag had not
been used to control the use of ActualText.
2010-11-10 20:09:53 +10:30
Benjamin Otte
7ee313d7b8 xcb: Add more _cairo_error() calls
We still don't track various error conditions...
2010-11-08 14:26:55 -05:00
Benjamin Otte
78dadf11ca xlib: Add more _cairo_error() calls
We still don't track various error conditions...
2010-11-08 14:26:55 -05:00
Chris Wilson
5f2e647dcf drm/intel: Drop the bo cache.
As this remains experimental, rely on the highly experimental kernel
caching...
2010-11-07 14:37:05 +00:00
Uli Schlachter
b4e55b84e2 test/README: Change suggested screen size
The dash-state test needs a surface with a width of 1500 pixels. If the screen
size is smaller than that, the boilerplate backends that create a window on the
X server can't properly do their job because part of the window would be outside
of the screen. This means people should use a screen large enough for all the
needed test surfaces. 1680 seemed like a more-or-less realistic value here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-07 12:54:54 +00:00
Uli Schlachter
95f6f7a174 Make both versions of _cairo_lround consistent again
Commit c0008242b0 made cairo use libm's lround instead of its own _cairo_lround
by default. However, since commit ce58f874 from 2006, _cairo_lround does
arithmetic rounding instead of away-from-zero rounding (before said commit, it
was using baker's rounding).

So to make the rounding of _cairo_lround be independent from
DISABLE_SOME_FLOATING_POINT, we have to use another function. Turns out that
_cairo_round already does the same thing that _cairo_lround does. Their only
difference is the return type.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-07 12:54:08 +00:00
Uli Schlachter
5d5a7d6b22 _cairo_round: Fix documentation
Despite what the comment says, this function rounds halfway cases towards
positive infinity.

_cairo_round ( 0.5) => floor ( 1.0) =>  1.0
_cairo_round (-0.5) => floor ( 0.0) =>  0.0
_cairo_round (-1.5) => floor (-1.0) => -1.0

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-07 12:53:22 +00:00
Uli Schlachter
6383e1442c XCB: Check screen size in boilerplate
Trying to create a window for drawing that is larger than the available screen
space is a bad idea. When the test finishes and tries to grab the resulting
image from the X server, the window's area that is outside of the screen will
have undefined content.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-07 12:51:56 +00:00
Adrian Johnson
daaef055b5 PDF: Fix toUnicode for CID fonts
1047dc6b introduced a regression for text that is using 16-bit glyphs
in the content stream.
2010-11-07 21:50:56 +10:30
Uli Schlachter
f1d1928d13 xcb: Fix transformation matrix setting
_cairo_xcb_picture_set_matrix() checked if the matrix that it should
set is an identity matrix. In this case this function simply didn't do
anything at all.  The assumption here seems to be that a picture's
matrix is the identity matrix by default.

The problem here is that we might first set a picture's matrix to
something else and then later need an identity transform again. Fix
this by still setting the new matrix if it is an identify matrix. We
just skip some unneeded checks and optimizations in this case.

This fixes the "finer-grained-fallbacks" test in the test suite.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-11-06 17:29:04 +01:00