Commit graph

5138 commits

Author SHA1 Message Date
Behdad Esfahbod
eb63e5609e [_cairo_surface_set_device_scale] zero xy and yx matrix entries
Just in case...
2008-05-09 15:54:11 +02:00
Behdad Esfahbod
80c5906267 [cairo-surface] Tone down a Caution comment
We have tested the case of device transforms that have both translate and
scale.  So it basically works.  We just are not sure that we handle it in
all places (In fact we know we don't.)
2008-05-09 15:54:10 +02:00
Behdad Esfahbod
901c56cba2 [image surface] Rename cairo_image_surface_backend to _cairo_image_surface_backend 2008-05-09 15:54:10 +02:00
Behdad Esfahbod
5744b0b9a5 [cairo-deprecated.h] Remove mention of cairoint.h from public header 2008-05-09 15:54:10 +02:00
Behdad Esfahbod
5f63358018 [src/check-doc-syntax.sh] Fix some bugs in the check and fix errors found 2008-05-09 15:54:04 +02:00
Behdad Esfahbod
7dce536042 Add XXX marker 2008-05-09 15:54:04 +02:00
Behdad Esfahbod
a3c091e292 [src/check-doc-syntax.sh] Use cairo_all_source_files if available 2008-05-09 14:54:31 +02:00
Behdad Esfahbod
e39127627a [Makefile.am] Rename cairo_all_source_file to cairo_all_source_files 2008-05-09 14:54:31 +02:00
Behdad Esfahbod
d6654ce2a6 [Makefile.am] Sort source files 2008-05-09 14:54:30 +02:00
Chris Wilson
b7272e9e8e [cairo-xlib] Batch XRenderFreeGlyphs
For every glyph evicted from the cache we would allocate a very small
structure to push onto the xlib work queue. This quickly becomes
noticably for an app that consumes a lot of scaled fonts and glyphs,
e.g. trying to draw text at various angles. So we maintain a small array
of glyphs pending finalisation and issue the XRenderFreeGlyphs() once the
array is full.
2008-05-06 15:11:00 +01:00
Chris Wilson
3428acf25d [cairo-scaled-font] Mark the scaled font as finished during destruction.
During the destruction of every font used with an xlib surface, we send
an XRenderFreeGlyphs() for every single glyph in the cache. These
requests are redundant as the server-side glyphs will be released along
with the XRenderFreeGlyphSet(), so we skip the individual glyph
destruction if the font is marked as finished.
2008-05-06 15:10:51 +01:00
Chris Wilson
24284c5101 [cairo-xlib] Enlarge the on-stack arrays.
Grow the on-stack arrays for the XRectangles and XTrapezoids to the
standard size in order to reduce the frequency of allocations.
2008-05-06 14:31:55 +01:00
Chris Wilson
fda9586802 [cairo-xlib] Cache standard xrender formats.
XRender performs a round-trip in order to query the available formats on
the xserver, before searching for a matching format. In order to save
that round-trip and to avoid the short-lived allocation of the array of
available formats, we cache the result on the display.
2008-05-06 14:31:45 +01:00
Chris Wilson
8457374c9c [cairo-pattern] Repaint existing cached similar solid surfaces.
The current solid surface cache returns an existing similar surface only
if it is an exact match for the desired colour.  This gives a high hit
rate for the original goal of drawing text, but fails when using a lot
of colours - for example drawing a pie-chart, the mosaic perf case, or
browsing the web.  So instead of creating a new surface from scratch we
can repaint an existing one, providing that we have sufficient surfaces
already cached, i.e. if we are going to evict a surface, we may as well
just repaint it.
2008-05-06 14:31:32 +01:00
Chris Wilson
4b3f9c7c7d [cairo-arc] Protect against division-by-zero.
Avoid a division-by-zero which can only happen if the start angle is
exactly equal to the end angle.

Fixes test/degenerate-arc.
2008-05-06 14:31:13 +01:00
Chris Wilson
ff596c64fb [test] Add degenerate-arc
This test case is to exercise the divide-by-zero error reported by
Luiz Americo Pereira Camara <luizmed@oi.com.br>,
http://lists.cairographics.org/archives/cairo/2008-May/014054.html.
2008-05-06 14:31:02 +01:00
Chris Wilson
fed9d9060e [test/invalid-matrix] Disable floating point exception.
test/invalid-matrix purposely feeds invalid numbers into cairo, in
order to check its detection of garbage values. In doing so, cairo
raises an Invalid exception, but as this is a direct result of an abuse
of the API we can treat it as expected behaviour and ignore the
exception.
2008-05-06 14:30:49 +01:00
Chris Wilson
1755a2d27d [test] Enable floating point exceptions.
Some platforms and applications enable floating point exceptions, so it
seems sensible to run the test-suite with the most serious exceptions
enabled - divide by zero, invalid result and overflow.
2008-05-06 14:30:35 +01:00
Chris Wilson
bf49015202 [configure.in] Add lcov-1.6 to list of valid versions.
Accept version 1.6 of lcov.
2008-05-06 14:30:07 +01:00
Adrian Johnson
504132db6d win32-font: Check status in load_truetype_table 2008-05-04 23:05:01 +09:30
Adrian Johnson
2a7c5cd1ee Eliminate warning in win32 load_truetype_table with bitmap fonts
Use cairo_win32_scaled_font_select_font() instead of
_cairo_win32_scaled_font_select_unscaled_font() to select the font.
Because _cairo_win32_scaled_font_select_unscaled_font() displays a
warning when used with a bitmap font.
2008-05-04 23:01:48 +09:30
Adrian Johnson
7063e7b0bf Fix bug in win32 font metrics with bitmap fonts
The glyph width caculation was not compensating for the
WIN32_FONT_LOGICAL_SCALE resulting in a glyph width and glyph advance
32 times larger than it should be.
2008-05-04 22:56:50 +09:30
Adrian Johnson
d35d6eec24 Fix win32 bitmap font metrics when device scale != 1
158d24412b fixed win32 printing of bitmap fonts by forcing the use
of fallback images. This exposed a bug in the win32 bitmap font
metrics when a device scale is used that resulted in clipped glyphs.
2008-05-04 22:54:02 +09:30
Adrian Johnson
158d24412b Make win32-printing surface work with bitmap fonts
The win32 printing surface has the same problem with bitmap fonts as
it does with Type 1 fonts. ie ExtTextOutW() with glyph indices works
for a display DC but not a printer DC.

Fix this by forcing fallback for bitmap fonts.
2008-05-04 22:46:41 +09:30
Adrian Johnson
547e2f552c Fix win32-printing show_glyphs analysis for Type 1 fonts
The analysis code needs to include the Type 1 font check that was
previously adding the the rendering code.
2008-05-04 22:43:08 +09:30
Adrian Johnson
141bca74ba Make cairo_win32_surface_get_dc work with win32 printing surface
The win32 printing surface is a paginated surface so we need to get
the paginated surface target to get to the win32_printing surface.
2008-05-04 22:40:49 +09:30
Chris Wilson
8742429c79 [test] Add test case for a leaky dashed rectangle.
Franz Schmid reported on the mailing list,
http://lists.cairographics.org/archives/cairo/2008-April/013912.html,
an issue with drawing a dashed rubber band in Scribus. The problem
appears when segments of the dashed rectangle are outside the image,
with the errant dash connecting the ends of the visible segments.
2008-04-29 15:19:40 +01:00
Chris Wilson
afa4ff8df5 [check] Filter programlistings for check-doc-syntax.sh
We do not want to enforce the gtk-doc markup in the preformated
examples, so run the files through sed to filter out <programlisting>
before checking with the error detecting regexp.
2008-04-29 10:02:51 +01:00
Chris Wilson
e94126fb67 [cairo-ft] Add a demonstration of how to handle the lifetime of the FT_Face.
Extend the documentation for cairo_ft_font_face_create_for_ft_face() to
demonstrate using cairo_font_face_set_user_data() to destroy the FT_Face
after the final reference to the cairo_font_face_t has been dropped.
2008-04-29 09:28:59 +01:00
Chris Wilson
78cb05a1b7 [cairo-ft-font] Fixup doc reference to cairo_ft_font_face_create_for_ft_face()
The documentation referred to cairo_ft_font_face_create_for_face().
2008-04-29 09:28:48 +01:00
Chris Wilson
f43e5e9ed9 [cairo-ft] Correct the function references in the docs.
The docs reference cairo_ft_font_lock_face() instead of the correct
cairo_ft_scaled_font_lock_face() (and friends).
2008-04-29 09:28:31 +01:00
Chris Wilson
5d20479b99 [test/ft-font-create-for-ft-face] Fix the lifetime issues of FT_Face.
The font_face created from cairo_ft_font_face_create_for_ft_face()
was being kept alive by a reference from the context beyond the
lifetime of the parent cairo_scaled_font_t (which owned the FT_Face).
Correct the example in the test code to remove this errant reference
before cleaning up the fonts. (To be fair, to actually trigger a bug
one has to evict the FT_Face from the cache before using the font_face
- merely creating a cairo_scaled_font_t for every font on the system is
enough.)
2008-04-29 09:28:10 +01:00
Chris Wilson
00965edf49 [cairo-ft] Remove unused private aliases.
cairo_ft_scaled_font_lock_face() and friends are unused internally
(instead _cairo_ft_unscaled_font_lock_face() is used directly), so
remove the unnecessary aliases.
2008-04-29 09:23:27 +01:00
Vladimir Vukicevic
122a31a075 [quartz] Fix CGFont leaks when creating quartz fonts
The toy font constructor and the _with_atsu_font_id constructor were
not properly managing the refcount of the CGFontRef.
2008-04-27 15:20:43 -07:00
Adrian Johnson
76e655e508 Fix group-paint PDF test failure 2008-04-27 22:59:22 +09:30
Adrian Johnson
5e102b06d1 PDF: Fix unbalanced save/restore 2008-04-27 21:52:25 +09:30
Adrian Johnson
3a2a867210 PS: Fix gradients with one stop 2008-04-27 21:52:25 +09:30
Adrian Johnson
f99d86e708 PDF: Fix gradients with one stop 2008-04-27 21:52:25 +09:30
Sebastien Pouliot
6135ee716b [configure.in] Build fails on Solaris due to non-POSIX ctime_r()
Check for a Solaris build host and adjust the CFLAGS to force POSIX
semantics.

(Fixes https://bugs.freedesktop.org/show_bug.cgi?id=15463.)
2008-04-25 18:49:37 +01:00
Chris Wilson
b4b77cedc9 [test/Makefile.am] EXTRA_DIST += create-from-png*-ref.png
Add the new reference images for create-from-png to the distributable.
2008-04-21 22:51:24 +01:00
Chris Wilson
63bba7e60c [cairo-png] Call png_set_filler() before png_read_update_info().
Otherwise libpng gets very confused and we start scribbling over invalid
memory whilst reading in the PNG.
2008-04-21 20:15:28 +01:00
Chris Wilson
20b1b33c0f [cairo-png] Recheck png_info after setting transformation options.
After specifying how to transform the various colour modes into ones we
can handle, re-read the image header to confirm that the output on
reading the PNG will be RGB24 or ARGB32. This simplifies our logic
considerably as we no longer have to second guess the colour space
transformation that will be performed by libpng. (And allows for some
paranoid checks.)
2008-04-21 19:54:48 +01:00
Chris Wilson
a313547f6d [test/create-from-png] Check loading of various colour types.
Check that when loading from index/gray/rgb PNGs, with and without
alpha/transparency, that the correct surface is generated by read_png(),
i.e. if the PNG contains an alpha channel then the image must be an
ARGB32 surface.
2008-04-21 19:44:11 +01:00
Chris Wilson
f2f91db131 [cairo-png] Create an ARGB32 surface for paletted PNGs.
jeremie54 reported a regression in the handling of transparent paletted
PNGs beween 1.4.14 and 1.6.4. This was caused by the change to load
opaque PNGs into a RGB24 image surface, which made the assumption that
indexed PNGs were opaque. However, alpha/transparency in PNG is more
complicated, as PNG uses a tRNS chunk to supply transparency data for
paletted images and other image types that don't need a full alpha
channel. Therefore if the PNG contains a tRNS chunk always generate an
ARGB32 surface.
2008-04-21 18:35:07 +01:00
Chris Wilson
ea6dbfd36f [cairo-meta-surface] Save and restore the original clip.
When replaying the meta-surface to the target, we apply a stack-based
clip to the surface. However, we did not remove this clip from the
surface and so a pointer into our stack existed beyond the scope of
function.

Saving the original clip pointer and restoring it before leaving the
function resolves the issue and appears to fix
https://bugzilla.mozilla.org/show_bug.cgi?id=429071.
2008-04-21 18:35:07 +01:00
Adrian Johnson
a2c4fd0572 Add "Since: 1.6" to win32 printing surface 2008-04-18 18:18:30 +09:30
Robert O'Callahan
212357cb4c Clone surface correctly when doing a deep clip copy
The rect specifies the clip surface location within the owning surface;
when cloned, the x/y should be 0 to get the entire surface.

Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=409227
2008-04-18 06:15:26 +02:00
Chris Wilson
a0d71e5a38 [Makefile.am] Fix breakage in previous commit.
I checked with --disable-pdf and with --disable-ps, but forgot to
check with them both enabled. D'oh.
2008-04-16 14:33:00 +01:00
Chris Wilson
472637da05 [Makefile.am] Add cairo-pdf-operators*.[ch] to ps_sources
The postscript backends depends upon cairo-pdf-operators.c, so list it
as a requirement in ps_sources. This enables the postscript backend to
build even if the pdf backend is disable by the user during configure.

(Fixes http://bugs.freedesktop.org/show_bug.cgi?id=15532.)
2008-04-16 14:19:02 +01:00
Behdad Esfahbod
12831201d2 [doc/tutorial/src/singular.c] Fix a bug in delta computation 2008-04-15 15:57:41 -04:00