Commit graph

2893 commits

Author SHA1 Message Date
Carl Worth
67d543716e PS: Fix to never break the final ~> that terminates a base85 stream.
This was recently broken in commit 40d5082c24
which uses a base85-stream but without strings for encapsulating image
data. The bug was that the protection for ~> was only being applied
to the string encodings rather than all base85 streams.

We got lucky recently that the 24.8 change just happened to put the ~>
sequence on the line-wrap boundary so the test suite tripped up the
bug. Otherwise, we could have missed this for quite some time.
2008-02-27 20:39:53 -08:00
Carl Worth
1df0b001b5 Change cairo's fixed-point format from 16.16 to 24.8
The additional 8 bits of integer allows device space to be 256
times larger before applications need to start worrying about
any issues with overflow. So this should help in many cases.
And the loss of 8 bits of sub-pixel precision shouldn't cause
any harm at all---16 was really much more than necessary.

With this change the details of rasterization for several tests
are changed slightly, (particularly on arcs, for example), so
many reference images are updated here.

NOTE: This change is currently breaking get-path-extents for
ps/pdf/svg as well as push-group for ps. We do not yet know
the reasons for these new failures.
2008-02-27 15:08:18 -08:00
Vladimir Vukicevic
1889427e78 Fix usage of rectangle_int16_t in ps surface, and rename types
The rectangle_int16_t usage was causing failures on 24.8 (due to a wrong
pointer used to get_extents); I removed all the specific int16/int32 typedefs
to avoid this situation in the future.
2008-02-27 12:36:16 -05:00
Chris Wilson
4f7d306352 [cairo-paginated-surface] Fix enum compiler warning.
Add a CAIRO_SURFACE_TYPE_QUARTZ_IMAGE to the switch to suppress a
compiler warning.
2008-02-27 10:11:08 +00:00
Chris Wilson
cb5ea8abfd [cairo-image-surface] Compiler warnings and whitespace.
Silence a couple of enum compiler warnings and tweak the whitespace.
2008-02-27 09:51:37 +00:00
Chris Wilson
22600e2393 [cairo-gstate] Remove a couple of impossible guards.
Delete a couple of superfluous gstate != NULL guards.
2008-02-27 09:48:24 +00:00
Chris Wilson
37e597f1e5 [cairo-gstate] Propagate the error from _cairo_gstate_clone().
Propagate the true status value back from the _cairo_gstate_init_copy()
instead of assuming that is a NO_MEMORY and re-raising the error in the
caller.
2008-02-27 09:48:13 +00:00
Chris Wilson
127d7f43ea [cairo-path-bounds] _cairo_path_fixed_bounds() can fail...
I was wrong in my assertion that the call to
_cairo_path_fixed_interpret_flat() could not possibly fail with the
given _cairo_path_bounder_* callbacks - as I had missed the implicit
spline decomposition. (An interesting exercise would be to avoid the
spline allocation...) As a result we do have to check and propagate the
status return through the call stack.
2008-02-27 09:47:35 +00:00
Chris Wilson
cdeffc69d9 [cairo-quartz-surface] Make check fixup.
A couple of minor corrections to satisfy make check.
2008-02-26 17:05:22 +00:00
Adrian Johnson
40f4750f5e Use PDF 're' operator for rectangle paths
Modify cairo-pdf-operators.c to emit to 're' path operator when the
path contains only a rectangle. This can only be done when the path is
logically equivilent to the the path drawn by the 're'
operator. Otherwise dashed strokes may start on the wrong line.

ie the path must be equivalent to:

  cairo_move_to (cr, x, y);
  cairo_rel_line_to (cr, width, 0);
  cairo_rel_line_to (cr, 0, height);
  cairo_rel_line_to (cr, -width, 0);
  cairo_close_path (cr);

which is also equivilent to cairo_rectangle().
2008-02-26 23:17:04 +10:30
Vladimir Vukicevic
7acfee38b1 [atsui] Make default font 'Helvetica'
The previous default font was Monaco, which is a fixed-pitch font; Helvetica
is more inline with the other platform defaults.
2008-02-25 21:44:04 -05:00
Vladimir Vukicevic
baec928a69 [quartz] More mask fixes -- handle all types via fallback mask image 2008-02-25 21:06:36 -05:00
Vladimir Vukicevic
b439e63808 [quartz] fix mask to correctly take CTM into account 2008-02-25 21:06:25 -05:00
Vladimir Vukicevic
a4975ab117 [quartz] Optimize path handling where possible 2008-02-25 21:06:23 -05:00
Vladimir Vukicevic
63711b1d4a [quartz] Add quartz-image-surface type 2008-02-25 21:06:21 -05:00
Adrian Johnson
7c8c9cf334 PDF: Support OPERATOR_SOURCE when pattern is opaque 2008-02-25 21:50:37 +10:30
Adrian Johnson
eae259168f Using correct surface size and clip when analyzing meta surface patterns
The surface size and clip needs to be saved before and restored after
replaying meta surface patterns back to the analysis surface. The clip
is reset and the correct surface size is set before replaying the meta
surface.
2008-02-22 21:07:31 +10:30
Adrian Johnson
0db2c67cc5 PS: Replace gsave/grestore with q/Q 2008-02-22 19:43:03 +10:30
Adrian Johnson
187ace8024 PS: Make debug code compile 2008-02-22 19:43:03 +10:30
Behdad Esfahbod
70bb2abed0 [cairo-ft] Handle font sizes smaller than 1px correctly
The FT_Set_Char_Size() docs say it replaces sizes smaller than 1.0 with 1.0.
So, we can't use x_scale and y_scale values less than one.  The fix is easy thouh,
cap them to 1.0 and let the FT transform do the scaling down.
2008-02-20 20:55:21 -05:00
Emmanuel Pacaud
70b683363f [SVG] Fix a8-mask test failure.
For A8 and A1 masks, the embedded mask image doesn't have an alpha channel.
In this case, the feColorMatrix should not be used, since it's goal is to
discard the color channels and to only keep the alpha one (which is what
we want when we have an ARGB32 mask image, since SVG uses all the channels
for the mask operation, where cairo only use the alpha channel).
2008-02-20 23:46:27 +01:00
Emmanuel Pacaud
c5d056aaeb [SVG] Fix the extend-reflect-similar test failure.
SVG doesn't support extend reflect for image pattern, and there isn't
any trivial way to emulate this feature. So we use the image fallback
for now. This fix also forces an image fallback for extend-reflect, but
in the end, it generates more or less the same file (one big image for
the pattern). No other test is forced to use an image fallback by this
patch.
2008-02-20 21:51:21 +01:00
Carl Worth
98189d860e svg: Add support for flattening SOURCE painting when there's nothing beneath it
This avoids unnecessary rasterization in many cases when using
cairo_surface_create_similar with an SVG surface. Because of that
it eliminates test-suite failures for the -similar cases where we
have svg-specific reference images. Namely:

	font-matrix-translation, ft-text-vertical-layout-type1,
	ft-text-vertical-layout-type3, mask, meta-surface-pattern,
	paint-source-alpha, paint-with-alpha, rotate-image-surface-paint,
	scale-source-surface-paint, source-clip-scale, text-pattern,
	text-rotate

In all of these cases the test suite was kindly noticing that we
weren't getting the same 'native' SVG output that was desired.
2008-02-20 04:04:04 -08:00
Carl Worth
a186741221 cairo-svg: Make operation_supported depend on analyze_operation instead of the other way around.
This prepares for analyze_operation to be able to return more than
just two values, (which will allow the svg backend to take advantage
of CAIRO_INT_STATUS_FLATTEN_TRANSPARENCY).
2008-02-20 04:04:04 -08:00
Carl Worth
8f11c4583f Revert "[meta-surface] Adjust tolerance when replaying to surfaces with device scale"
This reverts commit 7f21bfb0a8.

We don't yet have consensus on whether this is a good change or not.
So for now, we're favoring the existing behavior until we can work
that out.
2008-02-20 04:04:04 -08:00
Carl Worth
d6d81c92b5 Eliminate a potential infinite loop in spline stroking
Sometimes > rather than >= can make a bug difference. The infinite loop
was noticed here:

	Infinite loop when scaling very small values using 24.8
	http://bugs.freedesktop.org/show_bug.cgi?id=14280

Note that that particular test case only exposes the infinite
loop when using 24.8 instead of 16.16 fixed-point values by
setting CAIRO_FIXED_FRAC_BITS to 8.
2008-02-20 04:04:04 -08:00
Carl Worth
770b058c9e Remove _cairo_slope_[counter_]clockwise
These two functions were hiding away some important details
about strictness of inequalities. Also, the callers differ
on the strictness they need. Everything is cleaner and more
flexible by making the callers just call _cairo_slope_compare
directly.
2008-02-20 04:04:04 -08:00
Carl Worth
2d22d698d3 Make _cairo_slope_compare return a non-zero result for slopes that differ by pi
This was an initial attempt to fix the infinite loop bug
described here:

	Infinite loop when scaling very small values using 24.8
	http://bugs.freedesktop.org/show_bug.cgi?id=14280

This doesn't actually fix that bug, but having a more robust
comparison function can only be a good thing.
2008-02-20 04:04:03 -08:00
Chris Wilson
9292c0a1b5 [gitignore] Ignore cairo-no-features.h
Add the autogenerated header to the ignore list.
2008-02-20 10:57:14 +00:00
Chris Wilson
e6a8768a04 [cairo-scaled-font-subsets] Fix memleak on failure to reserve .notdef glyph.
Remember to destroy the sub_font if we fail to reserve the .notdef glyph
during construction.

Whilst in the vicinity, adjust the function prototype to remove
duplicated calls to _cairo_error().
2008-02-20 10:57:04 +00:00
Chris Wilson
e208f31236 [cairo-surface] Check surface status on internal paths as well.
Return any error status on the surface to the caller.
2008-02-20 10:56:53 +00:00
Chris Wilson
1d59daecfe [cairo-pdf-operators] Cleanup word_wrap_stream
Ensure that the stream is destroyed on the error paths.
2008-02-20 10:56:37 +00:00
Chris Wilson
aac5650bee [pdf-operators] Missing private markup.
Fixup make check by adding the required cairo_private markup.
2008-02-20 10:56:24 +00:00
Adrian Johnson
eaaa1415a9 Change PDF newline characters from \r\n to \n
The PDF backend has always used "\r\n" for the newline character.
There was no particular reason for this choice. PDF allows "\n", "\r",
or "\r\n" as the end of line marker.

Since the PS backend (which uses "\n") has started sharing
cairo-pdf-operators.c with the PDF backend, the PS output has been
getting mixed "\n" and "\r\n" newlines.

Fix this by changing the PDF backend to use "\n".
2008-02-20 21:05:23 +10:30
Antoine Azar
21049a9a5e Added cairo-misc.c to makefile 2008-02-19 00:17:47 -05:00
Vladimir Vukicevic
f2d21e7382 [stroker] fix _compute_normalized_device_slope to return correct sign
The optimization to avoid sqrt() for horizontal/vertical lines in
_compute_normalized_device_slope was causing us to return a negative
magnitude with a positive slope for left-to-right and bottom-to-top
lines, instead of always returning a positive magnitude and a slope
with an appropriate sign.
2008-02-18 17:18:51 -08:00
Adrian Johnson
8fb624dbf2 Use correct prefix for _cairo_pdf_operators_stroke
s/operator/operators/
2008-02-17 21:33:25 +10:30
Adrian Johnson
d2a1576941 PDF/PS: Fix mismatched save restore when using fill-stroke 2008-02-17 21:33:16 +10:30
Adrian Johnson
3a05b5d2d5 PDF/PS: No need to use save/restore for solid colors 2008-02-17 21:33:04 +10:30
Behdad Esfahbod
c7204adcf3 [cairo-misc.c] Add misc functions to this file
Anything functions that doesn't group with other functions enough to
justify its own file should go here now.
2008-02-17 02:32:24 -05:00
Adrian Johnson
a1360322c4 PS: Remove unused code 2008-02-17 17:21:35 +10:30
Adrian Johnson
2dfe32a0ff Implement PDF fill-stroke 2008-02-17 17:21:35 +10:30
Behdad Esfahbod
1e7fa4b9f5 [cairo-pdf-operators] Pass matrix by reference, not by value 2008-02-16 22:48:06 -05:00
Adrian Johnson
357f2334f0 PDF: Allow word_wrap_stream to split hex strings 2008-02-16 20:37:16 +10:30
Adrian Johnson
204a27aadb PDF: Word wrap _cairo_pdf_operators_show_glyphs output 2008-02-16 20:35:42 +10:30
Behdad Esfahbod
bcb0395288 [docs] Fix typo 2008-02-15 15:56:29 -05:00
Shailendra Jain
536e1963b7 Compile fix for AIX.
Minor correction for a build failure on AIX:
"mozilla/gfx/cairo/cairo/src/cairo-gstate.c", line 45.43: 1506-294 (S)
Syntax error in expression on #if directive.

(Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=415867.)
2008-02-15 13:50:43 +00:00
Chris Wilson
31a67c5f22 [pdf] Minor make check fix.
Add a missing '%' in the documentation.
2008-02-15 13:50:43 +00:00
Chris Wilson
fc732c3aaa [cairo-scaled-font] Create error objects on demand.
In order to correctly report the error back to the user during the
creation of a scaled font, we need to support a nil object per error.
Instead of statically allocating all possible errors, lazily allocate
the nil object the first time we need to report a particular error.

This fixes the misreporting of an INVALID_MATRIX or NULL_POINTER that
are common user errors during the construction of a scaled font.
2008-02-15 13:50:42 +00:00
Chris Wilson
38fcc015a5 [cairo-ft-font] Propagate error detected during determination of scale factors.
Ensure that if an invalid matrix is detected when creating the toy font,
the error is propagated to the caller.
2008-02-15 13:50:42 +00:00