Commit graph

5328 commits

Author SHA1 Message Date
Behdad Esfahbod
4eae72317f [cairo-pattern] Remove stale comment 2008-06-19 19:08:50 -04:00
Behdad Esfahbod
52cf67a8f2 Rename cairo_* global vars to _cairo_* 2008-06-19 17:44:43 -04:00
Behdad Esfahbod
9388cc71db [src/check-def.sh] Make sure no global variables are named cairo_*
Even if they are marked cairo_private.
2008-06-19 17:43:52 -04:00
Behdad Esfahbod
aef25b8345 [cairo-pattern] Fix solid surface cache to check for content match too
The code in that cache is becoming uglier and uglier.  But at least it
works correctly again.  Time for a rewrite.

(Also move the destroy after unlocking)
2008-06-19 17:31:10 -04:00
Chris Wilson
565644e616 [cairo-pattern] Band-aid for the solid surface cache.
Behdad noticed that the mixing of dissimilar surfaces within the cache
was fubar
(http://lists.cairographics.org/archives/cairo/2008-June/014348.html).

This corrects the dereferencing of the evicted surface, but leaves open
the question of the future of the cache.
2008-06-19 12:29:49 +01:00
Chris Wilson
47d8739ea1 [test/xlib-surface-source] Build under --disable-xlib-xrender.
Add an ifdef to support compiling without XRender.
2008-06-19 12:25:01 +01:00
Chris Wilson
38c4bcc2da [test/solid-pattern-cache-stress] Do what it says on the tin.
Actually draw to the surface after setting the source in order to
trigger use of the solid surface cache.
2008-06-19 12:24:30 +01:00
Behdad Esfahbod
233ba271d6 [cairo-xlib-xrender] Simplify dummy XRender function stubs
for the case of missing Xrender that is.  This compiles
warning-clean now.
2008-06-18 20:48:09 -04:00
M Joonas Pihlaja
d36347e0e2 Bug: tessellator sometimes ends rightmost trapezoids too late
Reported on the cairo mailing list:

http://lists.cairographics.org/archives/cairo/2008-May/014233.html

The tessellator would sometimes produce self-intersecting trapezoids
because it would skip the last edge in the active list when deciding
whether we can continue the current trapezoid or not.

The bug never caused a problem with pixman based rasterisation
because pixman stops filling in a trapezoid once it detects a self
intersection.
2008-06-18 18:35:42 +03:00
Chris Wilson
f2ea46edf4 [cairo-xlib-surface] Optimize away clip that covers the entire surface.
Replace a clip rectangle that covers the entire surface with no
clipping as this is quite a common operation when toolkits (i.e. GTK+)
clear surfaces before drawing and avoids a redundant
XRenderSetClipRectangles.
2008-06-13 21:52:37 +01:00
Chris Wilson
b06bd9379a [cairo-xlib-surface] Handle a NULL visual along core FillRectangles path.
It is possible for an XRender capable surface to use
_cairo_xlib_surface_solid_fill_rectangle() if the surface
HAS_CREATE_PICTURE() && ! HAS_FILL_RECTANGLES(), in which case we need to
handle the surface having no associated visual.

Fixes test/xlib-expose-event.
2008-06-13 21:37:58 +01:00
Chris Wilson
db32e5ffcc [check-def.sh] Ignore magic PPC symbols
It appears that the PowerPC Linux ABI specifies a number of magic
functions for register saves and restores which currently appear as
exported symbols in the shared object. Ignore them.
2008-06-13 21:37:58 +01:00
Chris Wilson
ad9a334e2c Allocate the correct pattern type on the stack.
Instead of allocating the union of all possible pattern types, just
allocate the specific pattern as used by the function in order to trim
the stack space consumption and flag potential misuse.
2008-06-13 21:37:58 +01:00
Chris Wilson
74c1e9b545 Trivial warning fixes to silence the compiler. 2008-06-13 21:37:58 +01:00
Chris Wilson
b235050316 [cairo-pattern] Generate an opaque solid colour if alpha >= 1.
If the user supplies an alpha value of >= 1 to
cairo_pattern_create_rgba(), substitute a call to
cairo_pattern_create_rgb() instead.
2008-06-13 21:37:57 +01:00
Chris Wilson
40e1aa60f2 [cairo-pattern] Try to repaint the evicted surface from the solid surface cache.
Behdad Esfahbod complained that commit
8457374c9c overwhelmed the function with
added complexity and arbitrary limited a backend to one-quarter of the
cache. The elegant solution, he outlined, was to look at the surface that
would be evicted and if possible repaint it, instead of creating a
replacement. This not only simplifies the code, reduces the number of
checks performed to find a match (or victim) and allows the cache to be
naturally shared between the various backends.
2008-06-13 21:37:57 +01:00
Chris Wilson
ea79af728c [cairo-xlib] Scan for a glyphset to match a pending free glyph.
In order to avoid re-rasterising a glyph that is pending an
XRenderFreeGlyph, we first scan all glyphsets and their arrays of
pending_free_glyphs for a matching glyph. The additional cost of
scanning the extra arrays should be negligble as most fonts will only
have the single array (which we would scan anyway) but we potentially
save an expensive rasterisation and short-lived image surface.

(As suggested by Behdad Esfahbod.)
2008-06-13 21:37:57 +01:00
Chris Wilson
c2963fa6c1 [cairo-boilerplate] Silence compiler warning.
Mark the optstr argument as const to silence a compiler warning in
cairo-perf.
2008-06-13 21:34:43 +01:00
Chris Wilson
ac44817c4a [cairo-perf] Only allocate arrays once.
Store the array of times on the cairo_perf_t context to avoid
reallocating it for every perf-case.
2008-06-13 21:34:42 +01:00
Chris Wilson
335ed74589 Enlarge the embedded arrays to eliminate frequent allocations.
Enlarge the embedded arrays of edges and points for cairo_polygon_t and
cairo_spline_t respectively, such that the frequent allocations are
eliminated whilst running a firefox3 benchmark.
2008-06-13 21:34:42 +01:00
Chris Wilson
963ff0b948 [cairo-pen] Embed a small array of vertices into cairo_pen_t.
Eliminate allocation of the vertex array for the common cases.
2008-06-13 21:34:42 +01:00
Chris Wilson
d9b2e8f004 [cairo-path-stroke] Avoid allocation for single rectangle.
The most common case for path stroking is a single rectangle, so embed
sufficient segments into the stroker to avoid an extra allocation.
2008-06-13 21:34:41 +01:00
Chris Wilson
ba6b2d092a [cairo-hull] Attempt to allocate vertices on stack.
First try to allocate the vertices using an on-stack array, otherwise, if
we need more vertices than can be accomodated, fallback to using a heap
array.
2008-06-13 21:34:41 +01:00
Chris Wilson
b2eadb94f8 [cairo] Cache freed gstates.
Reduce the malloc pressure from frequent cairo_save()/cairo_restore() by
caching the freed gstates in a list on the context.
2008-06-13 21:34:41 +01:00
Søren Sandmann
c57b1eca18 Merge branch 'region32' 2008-06-13 16:18:13 -04:00
Behdad Esfahbod
b9acf625d6 Make check-*.sh scripts more portable (#16299) 2008-06-12 21:03:19 -04:00
Behdad Esfahbod
d47142907f [xlib-visual] Make the 5x5x5 color cube better approximate the rgb333 space
That is, instead of uniformly spreading the colors at 0/4, 1/4, 2/4, 3/4, 4/4
intensities, we do 0/7, 1.5/7, 3.5/7, 5.5/7, 7/7 now.  Those better
approximate the 0/7..7/7 of the rgb333 space that we first convert to.
2008-06-12 14:18:06 -04:00
Behdad Esfahbod
4fcef1a490 [xlib-visual] Allocate 8-entry gray ramp instead of 16-entry
We convert to rgb333 before doing pseudo-color lookup, so we cannot
get more than 8 gray levels anyway.
2008-06-12 14:16:47 -04:00
Søren Sandmann
cba1543c92 Remove large-clip from xfail list 2008-06-10 18:09:00 -04:00
Søren Sandmann
a95e81261f Require pixman 0.11.2 for 32 bit regions 2008-06-10 18:09:00 -04:00
Søren Sandmann
c3121543f8 Fix xlib incarnation of the large-clip bug.
Intersect the clip region with the bounds of the surface to prevent
overflows when converting from 32 to 16 bits.
2008-06-10 18:09:00 -04:00
Søren Sandmann
75fdccc1db Use 32 bit pixman regions for cairo_region_t 2008-06-10 18:09:00 -04:00
Søren Sandmann
bd0cf05623 Add the correct reference image for the large-clip test 2008-06-10 18:09:00 -04:00
Søren Sandmann
60971fb514 New large-clip test
This tests clipping to a rectangle that doesn't fit in 16 bits.
2008-06-10 18:08:59 -04:00
Behdad Esfahbod
4210bab61a [cairo-ft-font] Make font face caching work again
Recent change to the cache key had broken all caching as we were always
comparing unscaled->face.
2008-06-10 02:19:05 -04:00
Behdad Esfahbod
c5b1674349 [cairo-ft-font] Fix thinko in _cairo_ft_unscaled_font_keys_equal() 2008-06-10 02:19:05 -04:00
Behdad Esfahbod
9e1b4704ce [cairo-xlib-screen] Protect fontconfig call with CAIRO_HAS_FT_FONT 2008-06-10 02:19:05 -04:00
Adrian Johnson
c8fc587ede Update user-font test PS/PDF ref images
The PDF output no longer requires a PDF specific reference image. The
lastest poppler from git is required to get the fix for a bug in Type
3 font rendering.
2008-06-09 23:14:47 +09:30
Adrian Johnson
42c212135d Implement PS Type 3 font image support
There does not appear to be any way of emulating PDF inline images in
PostScript so we call back to the PS or PDF surface to emit the image.
2008-06-08 17:12:02 +09:30
Adrian Johnson
5b05034cc9 Implement PS Type 3 font subsetting of user fonts 2008-06-08 17:11:53 +09:30
Adrian Johnson
100a34bea6 Implement PDF Type 3 font subsetting of user fonts
show_glyphs inside a Type 3 font currently results in a fallback
image. Some refactoring is required before font subsets can be created
while emitting all the font subsets.
2008-06-08 17:11:39 +09:30
Adrian Johnson
1e1c05e58f Change _cairo_font_face_is_user() from static to cairo_private 2008-06-08 16:50:34 +09:30
Adrian Johnson
d157e4861a Fix win32-printing show_glyphs analysis 2008-06-07 08:58:39 +09:30
Behdad Esfahbod
06b15d2f2d [doc] Document user-font callback types 2008-06-05 22:58:57 -04:00
Behdad Esfahbod
4c17a5ee11 [configure.in] Change version to 1.7.1
We branched weeks ago.
2008-06-05 22:58:33 -04:00
Behdad Esfahbod
a87c94d247 [user-font] Add XXX mark for text_to_glyphs memory allocation issue 2008-06-05 19:29:47 -04:00
Behdad Esfahbod
adcfe83356 [user-font] Reorder methods to the order they should appear in docs 2008-06-05 19:19:27 -04:00
Behdad Esfahbod
6702c7edc4 [user-font] Let user decide to fall back to unicode_to_glyph in text_to_glyphs
User does this by not setting *num_glyphs.
2008-06-05 18:42:50 -04:00
Behdad Esfahbod
3b1b074695 [user-font] Add XXX mark about metrics-hinting the font extents 2008-06-05 18:32:54 -04:00
Behdad Esfahbod
60cf2ef844 [cairo-ft] Respect FC_FT_FACE element of pattern
Based on patch from Stuart Parmenter.  Now one can use
cairo_ft_font_face_create_for_pattern() to create cairo-ft font
faces using provided FT_Face but also requesting advanced
options like emboldening and hinting.
2008-06-05 15:44:37 -04:00