Commit graph

5587 commits

Author SHA1 Message Date
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
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
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
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
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
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
Adrian Johnson
5906e64000 Type 1 glyph names: Do not use an array of pointers for winansi glyph names
Similar to ps_standard_encoding array, use a string pool and lookup
indices for the winansi glyph names to reduce .data size. As
ps_encoding and winansi share mostly the same names, the perl script
has been modified to merge the symbols into the one string pool and
generate separate lookup indices for ps_encoding and winansi.
2010-11-06 22:45:11 +10:30
Adrian Johnson
048a43e5c4 Move glyph names into separate file
The latin subsets feature requires these names. As
cairo-type1-subsets.c depends on FreeType, move these names out to a
separate file to allow compilation without FT.
2010-11-06 22:31:46 +10:30
Adrian Johnson
74873c8224 Fix type1-fallback bbox 2010-11-06 21:15:30 +10:30
Markus Stange
b53084b7c5 Fix type of _cairo_memory_stream_destroy parameter
In 9b9952ab4f
_cairo_memory_stream_destroy was changed to take an unsigned long
instead of unsigned int, and the two callsites in cairo-gl-shaders.c
weren't updated.
2010-11-05 09:25:11 +01:00
Adrian Johnson
84a7fe8a5c CFF Subset: Remove debug code 2010-11-02 21:57:15 +10:30
Adrian Johnson
1047dc6b94 PDF: Use correct bfchar size in toUnicode for latin fonts
poppler was printing warnings about the wrong size
2010-11-02 21:57:10 +10:30
Andrea Canciani
c7027c9d89 image: Use correct size for allocation
In 06e9caf861 the type of the variables
was changed, but the type used to compute the allocation size was not.

Fixes a crash in user-font-mask (test-fallback backend).
2010-11-01 21:20:29 +01:00
Andrea Canciani
852e789b75 quartz-font: Do not leak CFDataRef's
CFData is allocated and thus needs to be freed.
2010-11-01 15:53:10 +01:00
Andrea Canciani
947d35c195 quartz-font: Add truetype font table tags accessor
Improves the quality of embedded fonts.
2010-11-01 14:06:32 +01:00
Andrea Canciani
bb30dae210 script: Fix compilation
Use accessors instead of directly accessing path optimization flags.

Change the conditions for outputting tolerance (was 'when
path->is_rectilinear is FALSE', now is 'whenever the path includes a
curve').

Always output tolerance for strokes, because pen depends on tolerance
(for round caps/joins and for cusps).
2010-10-30 13:37:33 +02:00
Andrea Canciani
e43ae00211 cff: Fixes for 'make check'
Fixed some complaints by 'make check' about exported symbols in cff.
2010-10-30 13:36:44 +02:00
Andrea Canciani
22ea4609be path: Solve co-dependency problem
FALSE and TRUE are defined in cairoint.h, but cairoint.h depends on
cairo-path-fixed-private.h, so just use 0/1 to avoid the depencency
loop.

Fixes a number of errors reported by 'make check'.
2010-10-30 13:36:18 +02:00
Andrea Canciani
330b343952 drm: Do not access path flags directly
Fixes compilation
2010-10-30 11:26:13 +02:00
Uli Schlachter
5b2ed2422d xcb: Do not access flags directly
This fixes compilation of the xcb backend by porting commit e9c1fc31887c5bfbb's
changes from the image backend.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-30 10:23:16 +02:00
Andrea Canciani
b8444a5c78 path: Tighten transformed extents
The transformation code should produce tight extents if they are to be
used in the new simple extents functions.
2010-10-29 17:31:24 +02:00
Andrea Canciani
89e1261dd0 path-bounder: Simplify code
If the path extents are tight, all the extents computations and
approximations become trivial except for the stroke extents.
2010-10-29 17:31:23 +02:00
Andrea Canciani
958c56e2b4 path: Tighten curve_to extents
The additional time spent in the computation of tight extents for the
curve_to operation doesn't seem to be significant, but it makes the
extents computations faster and the approximations more accurate.
2010-10-29 17:31:23 +02:00
Andrea Canciani
0655198301 Fix degenerate arcs
Make sure that degenerate arcs become a move_to-line_to sequence
instead of just a move_to.

Fixes get-path-extents.
2010-10-29 17:31:23 +02:00
Andrea Canciani
a1d8763236 path: Replace _cairo_path_fixed_extents_add with _cairo_box_add_point
Path extents now satisfy _cairo_box_add_point requirements, so it can
be used instead of _cairo_path_fixed_extents_add.
2010-10-29 17:31:23 +02:00
Andrea Canciani
0268706550 path: Fix _cairo_path_fixed_transform
current_point and last_move_to were previously left in their old
position (which could lead to incorrect flag computation if other
operations were added to the path) and flags were not updated.
2010-10-29 17:31:23 +02:00
Andrea Canciani
29d5b18cba path: Recompute flags in _cairo_path_fixed_scale_and_offset
Only fill_maybe_region can change its value because the transformation
preserves vertical and horizontal lines, but can move the points and
make them integer if they were not or non-integer if they were.

Recomputing it is just as easy as checking if all the points are
integer and the path is fill_is_rectilinear.
2010-10-29 17:31:23 +02:00
Andrea Canciani
634fcf2c0a path: Transform current_point and last_move_to in _cairo_path_fixed_scale_and_offset
They were previously left in their old position (which could lead to
incorrect flag computation if other operations were added to the
path).
2010-10-29 17:31:23 +02:00