Commit graph

3162 commits

Author SHA1 Message Date
Carl Worth
df2d42ac7f Merge branch 'radial-gradient-fixes' into cairo 2007-03-01 17:08:03 -08:00
Behdad Esfahbod
ec11ca33a7 [PS/PDF] Mark CAIRO_EXTEND_PAD for surface patterns as natively supported
since the image surface does not implement that case either, so image
fallbacks have no benefit.
2007-03-01 19:14:40 -05:00
Behdad Esfahbod
4ee6cda6e5 [test] Move .la dependencies around 2007-03-01 19:13:19 -05:00
Behdad Esfahbod
ff06ea1abf [boilerplate] Add correct dependency on libcairo.la 2007-03-01 19:12:58 -05:00
Behdad Esfahbod
4b1f450f4c [test] Add more valgrind suppressions 2007-03-01 18:36:27 -05:00
Behdad Esfahbod
dcdcb7ac2a Fix leak in rectilinear stroking code
The code was not cleaning up after itself when rejecting a path as
rectilinear.
2007-03-01 18:36:16 -05:00
Behdad Esfahbod
2acd5b5277 [test] Add leak-revealing path to rectilinear-stroke
Based on this thread:
http://lists.freedesktop.org/archives/cairo/2007-March/009860.html
2007-03-01 18:34:53 -05:00
Carl Worth
97dbbae621 SVG: Support CAIRO_EXTEND_NONE for radial gradients.
This is as simple as adding transparent color stops on either end.
2007-03-01 15:17:19 -08:00
Behdad Esfahbod
bd2cd2c868 [test] Plug a leak in the test suite 2007-03-01 18:14:33 -05:00
Behdad Esfahbod
7de96a1faa [xlib] Drop XrmFinalize() stuff. That didn't ever exist in any public X server 2007-03-01 18:00:23 -05:00
Carl Worth
fe68e8aa32 Fix gradient walker to not reset needlessly
Previously the gradient walker was doing excessive resets, (such
as on every pixel in constant-colored regions or outside the
gradient with CAIRO_EXTEND_NONE). Don't do that.
2007-03-01 14:55:29 -08:00
Carl Worth
9a5dfe1415 Fix implementation of radial gradients for inner radius != 0
The previous implementation fell apart quite badly when neither radius
value was equal to 0.0. I derived the math from scratch, (much thanks to
Vincent Torri <vtorri@univ-evry.fr> for guiding me to a simpler derivation
than I was doing originally), and it's working much better now without
being any slower, (in fact, cairo-perf shows speedup of 1.05x to 1.58x on
my laptop here).

This work also provides groundwork for defining the behavior of radial
gradients where neither circle is wholly contained within the other, (though
we haven't done that definition yet---it will require a new test case and a
very little bit of work on the implementation).

This is a fix for the following bug report:

	Radial Gradients with nonzero inner radius misplace stops
	https://bugs.freedesktop.org/show_bug.cgi?id=7685
2007-03-01 14:53:48 -08:00
Carl Worth
0439f4c4f7 Rename radial gradient inner/outer to c1/c2
The inner/outer names were totally bogus. It is quite
legitimate to have the first circle's radius be larger than
that of the second.
2007-03-01 13:21:54 -08:00
Carl Worth
d65455ed38 Add radial-gradient test case
Embarrassingly enough, the test suite previously never called
into cairo_pattern_create_radial at all. Unsurprisingly, this
has led to bugs creeping into the radial gradient implementation.
2007-03-01 13:16:38 -08:00
Behdad Esfahbod
17f6174bb2 [TODO] Add cairo_surface_copy_page() 2007-03-01 13:51:29 -05:00
Behdad Esfahbod
c9ddb86e67 [paginated] Also increase page number in copy_page 2007-03-01 13:51:29 -05:00
Adrian Johnson
dc0043383b PDF: Ensure ToUnicode CMap name is unique
and remove an unused printf argument.
2007-03-01 23:39:10 +10:30
Behdad Esfahbod
7d03fe94d7 [RELEASING] Add notifying desktop-devel-list 2007-02-28 17:08:23 -05:00
Behdad Esfahbod
1dd647e265 [TODO] Add/remove items 2007-02-28 16:59:47 -05:00
Behdad Esfahbod
d0fe666a6a Revert the solid-pattern cache
This reverts the following commits:

	2715f20981
	67e3b3c53b

See this thread for an analysis of the problems it caused:

	http://lists.freedesktop.org/archives/cairo/2007-February/009825.html

In short, a single cache for all backends doesn't work, as one thread
using any backend can cause an unused xlib pattern to be evicted from
the cache, and trigger an xlib call while the display is being used
from another thread.  Xlib is not prepared for this.
2007-02-28 14:58:57 -05:00
Behdad Esfahbod
5f5afac8f4 [boilerplate/test-paginated] Issue a show_page before writing buffer
This is needed since cairo-test does not issue a show_page now, and
the one coming from paginated layer is too late (around finish).

The way we force the show_page is kinda funny.  That is, we create
a temporary cairo_t and call cairo_show_page() on it.  But works.
2007-02-28 14:32:11 -05:00
Behdad Esfahbod
efe8c82738 [paginated] Also do an automatic show page if nothing ever drawn
That is, we always emit at least one page of output.  Otherwise our
PS/PDF/SVG files would be corrupt, and output with zero pages does
not make much sense.
2007-02-28 14:19:18 -05:00
Behdad Esfahbod
07d61af809 [paginated] Automatically issue a final cairo_show_page()
This means, PS/PDF/SVG do not need the final cairo_show_page() anymore.
If there is any drawing in the page, a cairo_show_page() is done
automatically.
2007-02-28 13:46:27 -05:00
Behdad Esfahbod
d30178b3dc [doc] Add new APIs to cairo-sections.txt 2007-02-27 20:22:05 -05:00
Behdad Esfahbod
ef53465a03 Slim-hidden cairo_scale() 2007-02-27 20:18:16 -05:00
Behdad Esfahbod
ed75e24898 Implement cairo_get_scaled_font() 2007-02-27 20:09:46 -05:00
Behdad Esfahbod
d64b194a45 [quartz] Remove comment syntax that is recognized by gtkdoc from regular comments 2007-02-27 20:03:26 -05:00
Behdad Esfahbod
65ab63cb8d [cairo.c] Reorder some function implementations for clarity 2007-02-27 19:45:10 -05:00
Behdad Esfahbod
ed933a199c [cairo.h] Reorder function prototypes a bit for clarity 2007-02-27 19:43:18 -05:00
Behdad Esfahbod
153465bfe5 [test] Add ref images for new tests 2007-02-27 19:28:37 -05:00
Behdad Esfahbod
e2ce27db30 [PS/PDF] Fix xstep/ystep values for CAIRO_EXTEND_NONE
This fixes the fallback-resolution test, as well as the two of
surface-pattern-scale-up and surface-pattern-scale-down.
2007-02-27 18:47:47 -05:00
Behdad Esfahbod
de0a6522b0 [test] Add tests that show xstep/ystep failures in PS/PDF backends
with surface patterns.  One test scaled the pattern up, another scales
down.  We observe that both PS and PDF are broken when scaling down.
This is the reason that PDF is failing in the fallback-resolution test
too.
2007-02-27 17:33:17 -05:00
Behdad Esfahbod
4c1d788219 [Makefile.am] Remove ChangeLog.cache-* in distclean 2007-02-27 13:33:53 -05:00
Behdad Esfahbod
7185c00e15 [PS] Add note about possible need for fix. 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
aa3ebdbd01 [TODO] More TODO items 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
38b590d8b7 [SVG] Fix warnings 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
69edcd4623 [SVG] Rename a local variable for clarity 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
11b3f43e92 [TODO] Add various TODO items 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
2d908e6a95 [test] Add a new, XFAIL, extend-pad test 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
289ac33fa2 [PS] Fix surface patterns with transforms
Previously we were generating an image object with the desired
transform and then a pattern with only a translation.  This means,
the pattern was alwasys axis-aligned.  Obviously this does not
work correctly with repeated rotated patterns.

We now use an identity matrix for the image and put all the
pattern transformation (well, it's inverse) into the pattern.
This fixes the issue nicely.

The surface-pattern test is still failing even with a reference
image, because the gs rendering of the normal case and the
device-offset=25 case are different and both have seams.
2007-02-23 17:26:43 -05:00
Behdad Esfahbod
16013ced09 [test] Remove non-existing test extend-pad 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
c87edd9e10 [test] Update surface-pattern test to include transformations
The surface-pattern test was very naive, painting a surface pattern
repeated at identity size.  With the new test, the surface pattern
is scaled and rotated.  This reveals a serious bug in the PS backend.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
7c39276366 [PS/PDF] Accept CAIRO_EXTEND_REFLECT surface patterns natively
With the hack in _cairo_pattern_acquire_surface to return a 2x2
surface for reflected patterns, we can now accept REFLECT surface
patterns natively in all backends.  SVG was already doing that.
The PDF case needed some changes to go through
_cairo_pattern_acquire_surface.  A similar change to the recent
change in SVG.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
3405fb870e [test] Increase size of extend-reflect test to see that pattern repeats 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
63c011bb6b [surface] Copy device_transform_inverse in _cairo_surface_clone_similar 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
3516d8092b [SVG] Use _cairo_pattern_acquire_surface instead of _cairo_surface_acquire_source_image
This change is required for the upcoming hack to support
CAIRO_EXTEND_REFLECT.  In short, the idea is that the surface returned
by _cairo_pattern_acquire_surface may look different from the one
returned by _cairo_surface_acquire_source_image, to support some pattern
modes not supported by the backends directly.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
8d812ae9a6 [cairo-pattern] Correctly delegate device_transform so tests pass again 2007-02-23 17:26:42 -05:00
Behdad Esfahbod
7cbfb9556d [cairo-pattern] Fall back on cairo_surface_create_similar in _cairo_pattern_acquire_surface_for_surface
This was needed for SVG backend because it does not implement clone_similar.
However, I'm worried about possible infinite recursion here.  Not sure what
to do.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
5562050bcf Support CAIRO_EXTEND_REFLECT on surface patterns
We do this through a hack, that is, we make
_cairo_pattern_acquire_surface to return a surface that has four
copies of the original surface painted such that this image can
be simply repeated to get the effect of reflecting the original
surface.

This fixes the formerly XFAIL test extend-reflect.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
81935bb131 [PS] Update surface_pattern_supported() from PDF
The PS backend was accepting all surface patterns, just to ASSERT_NOT_REACHED
later if extend type of the pattern was PAD or REFLECT.  That didn't make
sense and was causing crash for PAD (surprisingly not for REFLECT.  Not sure
why).  So now it rejects those types of surface patterns, just like the PDF
surface does.
2007-02-23 17:26:42 -05:00