Commit graph

4932 commits

Author SHA1 Message Date
Carl Worth
fbab4bbb06 Update clip-operator and operator-clear reference images
There were legitimate bugs in the ps and pdf backends for these
tests, (particularly with the row of glyphs), but these bugs
were recently fixed with:

commit d89edde84d
Author: Vladimir Vukicevic <vladimir@pobox.com>
Date:   Tue Mar 4 00:15:46 2008 -0800

    [meta] always copy glyph array before passing to _cairo_surface_show_glyphs

and we just failed to notice the fix at the time.
2008-03-26 14:52:09 -07:00
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
49a140b04b [osx] additional fix to configure for multi-arch OSX builds 2008-03-25 11:22:43 -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
Carl Worth
ee3981fb92 Add new text-transform test
Previously, the test suite wasn't supplying any coverage of transformed
text rendering.
2008-03-24 16:26:28 -07:00
Adrian Johnson
184d9cbf9c Update REFERENCE_IMAGES with PS ref images
for finer finer-grained-fallbacks.
2008-03-24 12:36:37 +10:30
Adrian Johnson
2ad3915797 Add PS reference images for finer-grained-fallbacks test 2008-03-24 12:32:07 +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
Adrian Johnson
179ab7d286 Add finer-grained-fallbacks test
This reproduces the bug in PS/PDF/Win32-printing where an unsupported
operation that is off the page causes an unsupported operation
assertion in the backend.
2008-03-24 11:43:29 +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
c459932482 Update PS reference images
Some of the text tests require new PS specific reference images as a
result of the PS glyph positioning fix.
2008-03-21 18:12:03 +10:30
Adrian Johnson
f3a5f75701 Add PS/PDF ref images for ft-show-glyphs-positioning 2008-03-21 16:34:01 +10:30
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
Adrian Johnson
8348668452 Add ft-show-glyphs-positioning test
This demonstrates the glyph positioning bug in the PS backend.
2008-03-21 16:14:56 +10:30
Carl Worth
37fedd108e Increment cairo version to 1.5.15 after the 1.5.14 snapshot 2008-03-20 17:02:01 -07:00
Carl Worth
f4d4d7b3d0 Cleanup up png-test.png file in 'make clean' 2008-03-20 16:13:28 -07:00
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
f32f81fa1b Increment cairo version to 1.5.14 and libtool versioning to 18:1:16 2008-03-20 13:49:29 -07:00
Carl Worth
ffa50c31d3 Doc template churn 2008-03-20 13:49:19 -07:00
Carl Worth
3bb0474ea7 NEWS: Add notes for 1.5.14 snapshot 2008-03-20 13:48:29 -07:00
Carl Worth
191440101e Fix the REFERENCE_IMAGES list, (like always before a snapshot) 2008-03-20 12:38:26 -07:00
Carl Worth
46bbead898 RELEASING: Clarify steps for verifying no unpushed modifications 2008-03-20 12:18:39 -07:00
Carl Worth
c91a2a2e80 Track minor change in pixman filtering sample location
This change in reference image was triggered by the following commit
in the pixman library:

	commit f2d8a5caa63596739b4dc47c00daaaafd9f522e2
	Author: Søren Sandmann <sandmann@redhat.com>
	Date:   Mon Mar 10 23:41:52 2008 -0400

	Add rounding epsilon for NEAREST filter after transformation, not before.

This hasn't appeared in a pixman release yet. So for now, getting
correct results is a matter of "use latest pixman". Soon we'll
have a new pixman release and we'll make cairo depend on that.
2008-03-20 11:51:57 -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