Commit graph

5159 commits

Author SHA1 Message Date
Behdad Esfahbod
af1e168bbb [cairo-meta/analysis-surface] Make width/height of -1,-1 mean unbounded surface 2008-05-09 15:54:12 +02:00
Behdad Esfahbod
a6eb9be106 [_cairo_surface_get_extents()] return UNSUPPORTED if surface has no bounds
and set the extents to the infinite bounds.

A surface has no bounds if it does not provide get_extents(), or if its
get_extents() returns UNSUPPORTED.
2008-05-09 15:54:12 +02:00
Behdad Esfahbod
d37788f995 [cairo-analysis-surface] Initialize page bounding box
If there was no operations played to the analysis surface, page_bbox
was being left uninitialized.
2008-05-09 15:54:12 +02:00
Behdad Esfahbod
ee3672efdb [cairo-pattern] Extend infinite pattern extents to negative coordinates too
With things like meta-surface, the assumption that coordinates are always
non-negative make no sense.  Extend the "infinite" extents accordingly.

Also remove stale comment.  extents->width/height are unsigned these days and
cover the full range.
2008-05-09 15:54:12 +02:00
Behdad Esfahbod
f81b857e1f [cairo-paginated-surface] Clean up reference counting mess
Previously the paginated constructor didn't reference the target surface, but
simply assume ownership of the reference, and then unref it when shutting
down.  The callers to paginated constructor then, where just give away their
reference to paginated and not unref the reference they were holding.  While
this works correctly, it's against the usual idioms that everyone is
responsible for the reference they are holding, and should get their own
reference if they need to keep an object alive.  Fix it all.
2008-05-09 15:54:12 +02:00
Behdad Esfahbod
440b339da7 [cairo-analysis-surface] Hold reference to target surface 2008-05-09 15:54:12 +02:00
Behdad Esfahbod
25700f5cd0 [cairo-ft-font.c] Throw error on font type mismatch and remove unused function 2008-05-09 15:54:12 +02:00
Behdad Esfahbod
2a1661fba9 [cairo-win32-font.c] Return error on font type mismatch 2008-05-09 15:54:12 +02:00
Behdad Esfahbod
2a9bb6f78c Add CAIRO_STATUS_FONT_TYPE_MISMATCH 2008-05-09 15:54:12 +02:00
Behdad Esfahbod
4d77dfc78d [cairo-analysis-surface] Add _cairo_analysis_surface_[gs]et_ctm()
The functionality was there.  Just add getter/setter for the ctm.
2008-05-09 15:54:12 +02:00
Behdad Esfahbod
ad7cfb4af9 [cairo-analysis-surface] Use _cairo_matrix_transform_bounding_box_fixed()
and other conversion functions.
2008-05-09 15:54:12 +02:00
Behdad Esfahbod
bdfda97f19 [cairo-matrix] Add _cairo_matrix_transform_bounding_box_fixed() 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
6c9902fd74 Add more consts to function signatures and remove stale prototype 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
0e965c970b [cairo-path-fixed] Add _cairo_path_fixed_append() 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
e9b6bb06d6 [cairo-path-fixed] Add a couple consts to function signatures 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
2a3eec1731 [cairo-rectangle] Add new convenience functions for working with cairo_box_t
_cairo_box_from_doubles, _cairo_box_to_doubles, _cairo_box_from_rectangle.
2008-05-09 15:54:11 +02:00
Behdad Esfahbod
6836b2b8ba [cairoint.h] Fix file name in comments 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
ca8b917102 [cairo-surface] Call backend->flush even if backend->finish is null
Trivial bug.
2008-05-09 15:54:11 +02:00
Behdad Esfahbod
07cd614039 [cairo-scaled-font] Tolerate null scaled_font->backend->fini 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
1f05cae0a9 [cairo-font-face] Tolerate null font_face->backend->destroy() 2008-05-09 15:54:11 +02:00
Behdad Esfahbod
96599225e2 Define CAIRO_RECT_INT_MIN/MAX such that ints do not overflow when converted to fixed
There's not much point in having integers that will overflow.
2008-05-09 15:54:11 +02:00
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