Commit graph

2999 commits

Author SHA1 Message Date
Vladimir Vukicevic
56800e6ea0 [quartz] Remove cairo-atsui-font.c 2008-04-01 13:28:03 -07:00
Vladimir Vukicevic
8ddae11b54 [quartz] Update documentation 2008-04-01 13:26:00 -07:00
Vladimir Vukicevic
94b67d13f3 [quartz] Handle further 10.4 vs. 10.5 differences; fix text AA handling 2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
a1d1be4234 [cgfont] Round surface rectangle outwards to ensure whole-pixel dimensions 2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
c064ad1b56 [cgfont] Fix whitespace errors 2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
2be3e67db2 [cgfont] Add CGFont backend to replace deprecated ATSUI backend
Create a new font backend that uses the CGFont API on MacOS X
10.4 and beyond.
2008-04-01 13:04:08 -07:00
Vladimir Vukicevic
30f7fae647 [cgfont] Add start of CGFont font backend to replace ATSUI 2008-04-01 13:04:08 -07:00
Emmanuel Pacaud
9e6d679870 [SVG] Fix stroke-image test failure.
The pattern transform inherit the object transform matrix, and that was not
taken into account.
2008-04-01 16:50:12 +02:00
Adrian Johnson
47981226db Fix PDF analysis of OPERATOR_SOURCE surface patterns 2008-03-29 23:45:31 +10:30
Adrian Johnson
b3b3e3810d PS: Clear pattern background to when using OPERATOR_SOURCE
Set pattern background to white if surface content is COLOR_ALPHA or
black if surface content is COLOR when operator is SOURCE.
2008-03-29 23:00:34 +10:30
Adrian Johnson
5b8b3a9765 PS/PDF: Save/Restore surface clip when emitting a meta-surface pattern 2008-03-29 15:52:37 +10:30
Carl Worth
75972167a2 Use floating-point offsets for color stops
Previously we were using the cairo_fixed_t type which meant we've
historically only been using 16 bits of precision for these offsets,
and recently only 8 bits. Meanwhile, all manipulatons of offsets
have been in floating-point anyway, so we might as well store them
that way.

This change also prevents a rendering regression introduced with the
24.8->16.16 change betwen snapshots 1.5.10 and 1.5.12 .

This change affected gradient-rendering details for the clip-operator
and operator-source tests, so the corresponding reference images are
updated here.
2008-03-26 14:52:09 -07:00
Carl Worth
80dc1714c8 Remove unused variable 2008-03-26 14:52:09 -07:00
Chris Wilson
f676f18050 [cairo] Fixup make check.
make check demands that all function references in the docs are suffixed
with ().
2008-03-26 13:13:20 +00:00
Chris Wilson
452a1de2a0 [cairo-gstate] Remove dead code.
Eliminate _cairo_gstate_recursive_apply_clip_path, as its last caller
was removed over 2 years ago.
2008-03-26 13:13:19 +00:00
Adrian Johnson
ed42916028 Win32: Fix bug in cairo_win32_font_face_create_for_hfont()
Use GetObjectW for LOGFONTW.
2008-03-26 23:04:35 +10:30
Carl Worth
6dc75ab0f8 Quiet compiler warnings about unhandled PIXMAN_yuy2 and PIXMAN_yv12
We still don't handle these format codes of course, (they're meaningless
for the context in which they're used here).

Note that we previously avoided adding these to avoid people being forced
to upgrade pixman just to get two enum values that cairo doesn't really
care about. But now we're depending on a new pixman anyway, (for the
pixman_format_code_to_masks function), so we'll go ahead and do this now.
2008-03-25 16:46:02 -07:00
Carl Worth
1675713aff Depend on pixman 0.9.7 for new pixman_format_supported_destination function
This allows us to do a much more general and complete implementation of
_pixman_format_from_masks and _pixman_format_to_masks so that we'll
even pick up new pixman formats as they get added.
2008-03-25 16:45:21 -07:00
Carl Worth
d7e5f6b6a0 Rename _popcount to _cairo_popcount and make it available for internal use
Both cairo-image-surface.c and cairo-xlib-surface.c want to
use this function now.
2008-03-25 16:32:24 -07:00
Carl Worth
90cf7c2faf Quiet warning about signed vs. unsigned comparison 2008-03-25 13:17:49 -07:00
Carl Worth
770633c05a Quiet warnings about unhandled enum values in _cairo_surface_create_in_error 2008-03-25 13:17:49 -07:00
Carl Worth
d15c7c94bd Document performance advantage of cairo_path_extents
The cairo_path_extents function can perform better than either
cairo_stroke_extents or cairo_fill_extents, so provide that
pointer from the documentation of the other two functions.
2008-03-25 13:17:49 -07:00
Vladimir Vukicevic
8aba5b8029 [win32] Prevent crash in create_similar if win32_surface_create fails 2008-03-25 11:53:52 -07:00
Vladimir Vukicevic
ae143d779b [quartz] When stroking with an image source, use the right CTM for the image
Since the CTM was modified for the stroke transform, we need to reset
it before calling ConcatCTM for the source transform.
2008-03-25 11:17:57 -07:00
Adrian Johnson
e9906ae202 Win32-Printing: Fix fallback resolution when DC ctm is not identity
And also move the _cairo_surface_set_resolution() into
_cairo_win32_printing_surface_start_page as the DC ctm may be changed
between pages.

This bug was found in Inkscape now that they are using the cairo
win32-printing surface for printing on Windows.
2008-03-25 21:56:19 +10:30
Adrian Johnson
ae9635bf33 Fix assertion in PS/PDF/Win32-print when fallback image is off the page
If during analysis the bounding box of an operation or the number of
traps is 0, the operation is marked as natively supported. The problem
here is if the operation is unsupported by the backend, we get an
assertion when the operation is replayed during
CAIRO_PAGINATED_MODE_RENDER.

This bug was found in Inkscape when printing to the
win32_printing_surface a page that has been layed out as landscape but
landscape paper had not been selected in the print dialog.

Fix this by being careful not to mark unsupported operations as
supported during analysis even they may not be visible on the page.
2008-03-24 12:16:20 +10:30
Benjamin Otte
9a1f7bbc35 [API] unbreak CAIRO_FONT_TYPE_ATSUI
commit 9d61f7db80 broke API by making the
CAIRO_FONT_TYPE_ATSUI symbol not work anymore. However, this symbol was part of
Cairo's public API and should continue working this way.
2008-03-23 15:31:24 +01:00
Chris Wilson
104c2825ea [cairo-png] Set bKGD gray value.
For PNG_COLOR_TYPE_GRAY images the bKGD value is read from white.gray
which was uninitialized, triggering the "PNG warning = Ignoring attempt
to write bKGD chunk out-of-range for bit_depth" reported by Emmanuel
Pacaud. This patch sets the background gray value to white, the same as
for RGB images.
2008-03-21 09:15:42 +00:00
Adrian Johnson
4f56a6324f Finish the PDF text operator decimal reduction commit
Commit 158b32b60b reduced excess
decimals emitted for the TJ operator. However it only fixed the first
of the two locations in pdf-operators where the TJ position
adjustments are emitted.
2008-03-21 16:30:53 +10:30
Adrian Johnson
13e05bffd5 Fix PS glyph positioning bug in PDF operator emulation
The emulation of the PDF 'TJ' operator in the PS prolog was
incorrectly updating the glyph position between strings. The glyph
position values are a negative x offset that are in 1/1000 unit of
text space. We were incorrectly multiplying the number by -0.0001
instead of -0.001. We also need to transform this to device space
before calling rmoveto.
2008-03-21 16:15:57 +10:30
Carl Worth
4ad5937648 Enable PLT avoidance for cairo_image_surface_get_data/stride 2008-03-20 15:55:28 -07:00
Carl Worth
5d9eefccd6 Disable enum_regexp test in check-doc-syntax.h
It's returning false positives on non-gtk-doc comments with non-public
enum values. Ick.
2008-03-20 15:37:04 -07:00
Carl Worth
0c17ca52aa Mark new cairo_xlib_visual_info functions as private. 2008-03-20 15:33:37 -07:00
Carl Worth
e96f382549 Add support for 8-bit PseudoColor visuals
This support involves allocating a 16-bit grayscale ramp as well
as a 5x5x5 RGB color cube. Afterwards, the 256 colors are queried
and an array is generated mapping from r3g3b3 colors to the closest
available color. Both the queried colors and the reverse mapping
are stored in a new visual-specific cairo_xlib_visual_info_t
structure which hangs off of the cairo_xlib_screen_info_t.

Both the color-cube allocation and the distance metric could be
improved by someone sufficiently motivated, (for example, allocating
and matching in a perceptually linear color space rather than just
in RGB space). Also, making this work well in the face of a changing
color map, or in the case of GrayScale, StaticGray, or DirectColor
visuals are left entirely as exercises for the reader. StaticColor
support should be fine as is, but is entirely untested.
2008-03-20 11:51:57 -07:00
Carl Worth
d413c5ab21 xlib: Add support for arbitrary TrueColor visuals
This fixes the following bugs:

	cairo doesn't support 8-bit truecolor visuals
	https://bugs.freedesktop.org/show_bug.cgi?id=7735

	cairo doesn't support 655 xlib format
	https://bugs.freedesktop.org/show_bug.cgi?id=9719
2008-03-20 11:51:57 -07:00
Emmanuel Pacaud
aeaec94fd0 [SVG] Replace the color property by stroke.
Color property doesn't support URL as value. This pacth fixes
http://bugs.freedesktop.org/show_bug.cgi?id=14556 .
2008-03-20 16:05:34 +01:00
Adrian Johnson
158b32b60b PDF: Reduce excess decimals in text position offsets
The numbers output in the TJ array for adjusting the horizontal
position of the next glyph are in 1/1000 of the text space
units. Rounding these numbers to an integer should still provide
sufficient precision.

We use the rounded numbers to update the text position in
pdf-operators so subsequent numbers in the TJ array will compensate
for the rounding error.
2008-03-20 18:15:10 +10:30
Adrian Johnson
222041530c Use %g for printing path coordinates in pdf-operators
to eliminate unnecessary decimal places in the output.
2008-03-20 18:15:10 +10:30
Adrian Johnson
d78013470b Add %g conversion specifer to output-stream for limited precision
The %g conversion specifier is for printing numbers that were at some
time stored in a cairo_fixed_t type and as a result have their
precision limited by the size of CAIRO_FIXED_FRAC_BITS.

Using %g will limit the number of digits after the decimal point to
the minimum required to preserve the available precision.
2008-03-20 18:15:10 +10:30
Adrian Johnson
f3734085a1 Make _cairo_dtostr() static
It is only used in cairo-output-stream.c
2008-03-20 18:15:09 +10:30
Adrian Johnson
4d9e5b51aa Rescale CTM used for PS/PDF stroking to reduce rounding error
The PS/PDF CTM is transformed to the user space CTM when emitting
paths to be stroked to ensure the correct pen shape used. However this
can result in rounding errors.

For example the device space point (1.234, 3.142) when transformed to
a user space CTM of [100 0 0 100 0 0] will be emitted as
(0.012, 0.031).

Fix this by rescaling the user space CTM so that the path coordinates
emitted to the PDF file stay within the range the maximizes the
precision. The line width and dashing is also rescaled to be the same
size in the rescaled CTM.
2008-03-20 18:15:09 +10:30
Carl Worth
7f4b967c02 Make CAIRO_FORMAT_STRIDE_FOR_WIDTH_BPP available to the cairo internals. 2008-03-18 17:20:08 -07:00
Carl Worth
eb31c52feb Make _pixman_format_to_masks accept a cairo_format_masks_t structure
This makes it work similarly to _pixman_format_from_masks
2008-03-18 17:20:08 -07:00
Carl Worth
cdb1ae97f2 Move assertion failure for unsupported masks up one level
We're moving the assertion up from inside _pixman_format_to_mask
to its callers. This will allow us to selectively eliminate the
assertion from the supported xlib backend, while leaving it in
the unsupported glitz and xcb backends for now.
2008-03-18 17:20:08 -07:00
Adrian Johnson
b83b8c26f5 Optimize generated PostScript when EXTEND_PAD is used
Allow image patterns with EXTEND_PAD to use the currentfile
optimization.
2008-03-18 21:08:55 +10:30
Vladimir Vukicevic
df5087992b [quartz] Fix bogus CGContextGetType warning that's printed on the console
This is caused by 0x0 surfaces being special, and not having an
associated cgContext.
2008-03-17 17:37:22 -07:00
Vladimir Vukicevic
9d61f7db80 [quartz] Rename ATSUI font to Quartz font 2008-03-17 17:37:19 -07:00
Adrian Johnson
e4f087b8b9 Factor out common stroke code in pdf-operators 2008-03-17 22:04:05 +10:30
Adrian Johnson
344af99d35 Improve the PDF operators word wrapping
to correctly count the columns and avoid breaking hex strings
immediately after the '<' and before any hex digits have been written.
2008-03-15 22:07:01 +10:30
Vladimir Vukicevic
0a8478ca1a [quartz] don't say we forced subpixel AA when we didn't
Whoops.  Net result was that this was disabling subpixel AA on
contexts if CAIRO_ANTIALIAS_DEFAULT was being used.
2008-03-14 23:23:16 -07:00