Commit graph

5968 commits

Author SHA1 Message Date
Chris Wilson
3c18d95b29 Compute device_transform_inverse.
Because we can independently set either the device scale or the device
offset, we need to be careful and recompute the inverse rather than simply
assuming that the original contents of the device transform is identity.

Fixes regression https://bugs.launchpad.net/inkscape/+bug/234546.
2008-09-28 16:08:18 +01:00
Chris Wilson
9841d9d58e Automate error checking for fallback-resolution.
For this we extend the boilerplate get_image() routines to extract a
single page out of a paginated document and then proceed to manually
check each page of the fallback-resolution test.

(Well that's the theory, in practice SVG doesn't support multiple pages
and so we just generate a new surface for each resolution. But the
infrastructure is in place so that we can automate other tests,
e.g. test/multi-pages.)
2008-09-28 14:57:12 +01:00
Chris Wilson
cca1fc6358 [test] Fix target specific tests for recent SVG/PS version split.
A few tests explicitly checked whether the "ps" or "svg" target was
enabled and this broke because of the name change. So fixup, to run
the generic test if either PS or SVG target is enabled as appropriate.
2008-09-27 21:53:21 +01:00
Chris Wilson
39e4a0bcd0 [test] Update list of REFERENCE_IMAGES
A few typos, deletions and additions from the inclusion of versioned
SVG/PS testing.
2008-09-27 19:33:51 +01:00
Chris Wilson
260362e572 [cairo-test] Fix cairo_test_file_is_older().
It did not even compile, so no longer it wasn't deleting cached results
if you updated the reference images.
2008-09-27 19:16:34 +01:00
Chris Wilson
ffbb67303c [test/gradient-constant-alpha] Remove ps2 reference images.
PostScript level 2 has no support for gradients and so should uses image
fallbacks and hence do not require the GS specific reference images.
2008-09-27 18:54:45 +01:00
Chris Wilson
4fa9f8c060 [test/large-source] Remove stale comment.
Delete a reference to an old limitation of pixman.
2008-09-27 17:42:06 +01:00
Chris Wilson
35f1e2fa4f [test/operator*] Remove XFAIL descriptions.
The tests should now pass, so remove the line claiming that they fail
for unknown reasons.
2008-09-27 17:37:32 +01:00
Chris Wilson
871f683367 clone_similar(): s/device_offset/clone_offset/
A little bit of sleep and reflection suggested that the use of
device_offset_[xy] was confusing and clone_offset_[xy] more consistent
with the function naming.
2008-09-27 17:27:21 +01:00
Chris Wilson
95c3c06932 [surface] Only return early for no traps if the operator is bounded by a mask.
If the operator is unbounded, then its area of effect extends beyond
the definition of the mask by the trapezoids and so we must always perform
the image composition.

Fixes test/operator*.
2008-09-27 17:17:58 +01:00
Emmanuel Pacaud
922a580116 Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2008-09-27 11:55:50 +02:00
Emmanuel Pacaud
0c4317085e [svg] Fix comp-op for paint, mask and show_glyphs operations.
In paint and show_glyphs, the compositing operator was not emitted at all.
In mask, the operator was also emitted for the mask itself, which is
wrong.

SVG clear and source differ from cairo as it also affects the
destination if the source pixel are completely transparent. We need to emit
an additional clip-to-self property.

Librsvg does not support clip-to-self, so it renders the SVG
test outputs incorrectly.

This patch also remove a lot of useless spaces in the style property
strings (I know, this should go in another commit).
2008-09-27 11:47:32 +02:00
Adrian Johnson
1e45da48b5 Update ref images in Makefile.am 2008-09-27 14:38:22 +09:30
Adrian Johnson
c0535e8e33 Remove miter-precision from XFAIL
The miter-precision PS output prints correctly on my LaserJet 4050. So
file a Ghostscript bug, supply PS ref images and remove from XFAIL.
2008-09-27 14:31:50 +09:30
Chris Wilson
5b97ee6525 Allow cloning sub-regions of similar surfaces.
Previously the rule for clone_similar() was that the returned surface
had exactly the same size as the original, but only the contents within
the region of interest needed to be copied. This caused failures for very
large images in the xlib-backend (see test/large-source).

The obvious solution to allow cloning only the region of interest seemed
to be to simply set the device offset on the cloned surface. However, this
fails as a) nothing respects the device offset on the surface at that
layer in the compositing stack and b) possibly returning references to the
original source surface provides further confusion by mixing in another
source of device offset.

The second method was to add extra out parameters so that the
device offset could be returned separately and, for example, mixed into
the pattern matrix. Not as elegant, a couple of extra warts to the
interface, but it works - one less XFAIL...
2008-09-27 02:20:42 +01:00
Behdad Esfahbod
7f3a48f90b [cairo.h] Don't define cairo_public to __declspec(dllimport) for static build
That define should target win32 DLL builds only.  We can't tell though,
so we require user to define CAIRO_WIN32_STATIC_BUILD to signal that.
2008-09-26 13:27:42 -04:00
Behdad Esfahbod
b6e910f4b6 [README.win32] Update wording from Tor Lillqvist 2008-09-26 12:44:53 -04:00
Chris Wilson
fc12267405 [scaled-font] Spelling fix.
Arbitrary spelling fix.
2008-09-26 17:26:30 +01:00
Chris Wilson
e0f2147107 [boilerplate] Add a PS 2 target.
Ensure that we can generate PS2 output when required by creating a PS
level 2 target and using GhostScript for conformance testing.
2008-09-26 17:26:25 +01:00
Chris Wilson
0c030d3b76 [boilerplate] Add svg-1.2 target.
SVG 1.2 is sufficiently different from 1.1 that it has separate code
paths within cairo-svg-surface and so justifies its own boilerplate
target.
2008-09-26 17:11:51 +01:00
Behdad Esfahbod
86e57671dd [check-*.sh] Redirect error reports to stderr 2008-09-26 11:08:22 -04:00
Behdad Esfahbod
096f9def0f Add slim markers to make check-plt.sh happy 2008-09-26 11:07:10 -04:00
Behdad Esfahbod
1de059b33b [RELEASING] Add ftp-release@lists.freedesktop.org
That list is monitored by various distros to pick up new releases.
We should CC release announcements there.
2008-09-26 10:04:37 -04:00
Behdad Esfahbod
9662be8ee7 [twin-font] Adjust ascent/descent
The font data uses a 64 int high font space with baseline at 50.
2008-09-26 10:04:36 -04:00
Behdad Esfahbod
3883a371f2 [scaled-font] Use full ctm matrix when comparing scaled-font keys
We use the full matrix in hash computation, but only compare the
non-translation items in equality check.  This is no bug though,
as we set the ctm translation components of a scaled font to zero
explicitly.  But the change makes the hash and equal functions
consistent, which is good.
2008-09-26 10:04:36 -04:00
Chris Wilson
48099af9fe [boilerplate] Retry conversion in process if first attempt fails.
One possibility for a read failure whilst converting the image is if the
external utility crashed. This information is important for the test suite
as knowing input that causes the converter to crash is just as vital as
identifying a crash within the library.
2008-09-26 13:42:28 +01:00
Chris Wilson
f2c484d73c [test/any2ppm] Handle short reads/writes.
No excuse other than simple laziness - it manifested itself with random
"error whilst reading" failures.
2008-09-26 13:42:28 +01:00
Chris Wilson
681424cbaf [analysis] Merge two analysis status codes.
Since there is an implicit precedence in the ranking of the analysis
return codes, provide a function to centralize the logic within the
analysis surface and isolate the backends from the complexity.
2008-09-26 13:42:28 +01:00
Chris Wilson
06f0cc81d2 Add a macro to determine whether a status is a fatal error.
In a few places we need to check whether we have a fatal error or an
internal return code, so provide a utility macro to centralise the check.
2008-09-26 13:42:28 +01:00
Chris Wilson
ba18d57339 [pdf] Propagate status
Check and return a few forgotten error codes from static functions.
2008-09-26 13:42:28 +01:00
Adrian Johnson
907f550a1b Fix bitmap-font XFAIL
Images in PDF are scaled to a unit square. In PS we set the
ImageMatrix to do the same. When the image is painted we scale the
graphics state to paint the image at the right size. In the case of
Type 3 fonts consisting of bitmap images we want to paint the images
at their original size so we scale the graphics state by the image
width and height.

The bug was that we were scaling by the width/height in the glyph
metrics. For non rotated fonts this worked. However for rotated fonts
the width/height of the glyph images may be larger than the
width/height in the glyph metrics. This resulted in a Type 3 font
where the glyph images were scaled slightly smaller than they should
have been.
2008-09-26 20:26:55 +09:30
Behdad Esfahbod
f8542dc9dd [twin-font] Clean up font data by joining lines and closing paths
Two changes here:

  * Replace move_to;line_to;move_to;line_to sequences with
    move_to;line_to;line_to when feasible.

  * Close paths for round glyphs.

Both improve the stroke rendering of the joint.

The first change also saves 3 bytes per joint (33 such joints).
Which we have just left unused for now.  To reclaim them one need
to update the charset table.  Something for a lazy Sunday afternoon
scripting task.

In the saving department, we can save further by:

  - Getting rid of the left/ascent/descent values as we compute
    glyph bounding box automatically.  Then we can liberally use
    the right value to adjust glyph advance width.  Saves three
    bytes per glyph (there's 96 glyphs in the font).

  - First operation is always a move_to.  So we can remove the 'm'
    for that.  Ugly though.

And the charset has zeros for the first 32 entries.  Can get rid of
that too at the expense of handling it in the code...

In total, combining the above we can save some 500 bytes.  The font
currently takes about 3.7kb.
2008-09-25 19:25:11 -04:00
Behdad Esfahbod
d5a998387b Add an internal font face
The font data and rendering is adapted from Keith Packard's Twin
window system.  The hinting stuff is not ported yet, but hey, it renders!

The implementation uses user fonts, and the user font backend is modified
to use this font face (which we call "twin" font face internally) when
a toy font is needed.

The font face layer is then modified to use this font if:

  - The toy font face "cairo" is asked for, or

  - No native font backend is available, or

  - The preferred native font backend fails to return a font with
    STATUS_UNSUPPORTED.  No font backend does this right now but
    the idea is to change FreeType to return it if no fonts found
    on the system.

We also allow building with no font backends now!

The new doc/tutorial/src/twin.c file tests the twin face at various
sizes.
2008-09-25 19:25:11 -04:00
Carl Worth
dd7e2461ce Increment cairo version to 1.8.1 after the 1.8.0 release. 2008-09-25 16:06:19 -07:00
Carl Worth
6b3aa86b1c Increment cairo version to 1.8.0. 2008-09-25 15:57:07 -07:00
Carl Worth
e1560eceab NEWS: Add notes for the 1.8.0 release.
Heavily cribbed from 1.7.x snapshot NEWS of course.
2008-09-25 15:57:07 -07:00
Carl Worth
9a210ab228 Add missing reference images REFERENCE_IMAGES list.
The standard ritual before being able to release.
2008-09-25 15:57:06 -07:00
Carl Worth
1d896aa9d8 Actually remove cairo_has_show_text_glyphs
The release notes for 1.7.6 say that we had dropped this
function, but apparently we had only planned to do that
and didn't actually get around to it until now.

Thanks to the RELEASING insctructions which gave a diff
command that pointed out this problem.
2008-09-25 15:56:57 -07:00
Carl Worth
483ab915c0 Remove excessive whitespace.
It looks sloppy (and wastes space) to have two blank lines
where one will do.
2008-09-25 15:25:54 -07:00
Carl Worth
e52f0fe8bd Ignore test/png-test.png
Finally, "git status" is clean after "make distcheck".
2008-09-25 14:16:14 -07:00
Jeff Muizelaar
c62b4c7386 [user-font-rescale] Do proper ref-counting of substitute font
The problem showed up on OS X because the freetype backend reuses font_face_t's
which kept the reference count high enough for long enough to avoid the problem.
2008-09-25 16:57:38 -04:00
Carl Worth
cd540dc22e Update text-antialias-subpixel reference image.
Now that we reverted back to cairo's code for sub-pixel
text rendering, we need to update the reference image
to match it.
2008-09-25 13:37:53 -07:00
Carl Worth
5d887ad5dc Remove all lcd_filter code.
We reverted the public API for setting lcd_filter font options
back in 1b42bc8033 , but we had left the implementation which
would examine fontconfig and Xft properties for the option, and
which would call into freetype for subpixel glyph rasterization.

However, I recently realized, (and the test suite had been trying
to tell me for a while), that this approach would cause a
regression for users who were previously using sub-pixel text,
but without sub-pixel rendering built directly into freetype.
That's not acceptable, so all the code is coming out for now.
2008-09-25 13:31:20 -07:00
Carl Worth
3d32e7110b Note that we're using ghostscript 8.62 now for reference images.
As opposed to 8.61.

I had actually forgotten we had documented this. If I had
remembered I could have put more meaningful messages with
some of my recent updates to ps-specific reference images.
2008-09-25 02:58:01 -07:00
Carl Worth
a172d87b4c Make device-offset-scale an XFAIL test due to SVG failure.
It's sad to have to do this. Back with commit 1a9809baa was the
original fix for device-offset-scale, (right after the test was
added), and it fixed it for all backends, including SVG. The fix
involved combining device_transform and CTM into the pattern matrix.

But then, we added the mask-transformed-image and
mask-transformed-similar tests, and commit 20be3182ef for fixing an
SVG-specific bug with masks. That fix involved subtracting away the
pattern matrix when emitting a mask to adhere to SVG semantics.

Unfortunately, this change also made the device-offset-scale test
start failing. A correct fix would probably subtract away only the CTM
portion and not the devive_transform. However, the
_cairo_svg_surface_mask function sees only a pattern matrix and
doesn't know how to separate it into CTM and device_transform pieces.

So fixing this will probably require a change to the surface-backend
interface. And since we're not willing to do that so close to a major
release, we're adding yet another XFAIL.
2008-09-25 02:49:44 -07:00
Carl Worth
36eef09b58 Update pdf-specific reference images for mask test.
Something had changed to introduce some very minor rasterization
details around the circles.
2008-09-25 02:30:00 -07:00
Carl Worth
503506bf0d Add pdf-specific reference image for mask-transformed-similar
Thanks to help from Chris, we fixed the bug that was making this
test fail with the PDF backend. All that was left was differing
treatment of the edges of the image---easy enough to address
with a pdf-specific reference image.
2008-09-25 02:16:47 -07:00
Chris Wilson
31ff6c863f [pdf] Explicitly order the sequence of checks when analyzing masks
There is an implicit precedence when analyzing patterns for
compatibilty, in order of descending precedence:
  fatal error
  unsupported
  needs image fallback
  needs meta-surface analysis
  success.

So wehen we have two patterns, we need to check both analysis statuses
simulataneously, in order to correctly report the combined status.
2008-09-25 02:09:44 -07:00
Carl Worth
69635bc054 Fix the analysis of mask operations (fixing mask-transformed-similar test case)
The primary bug here was some missing braces. The code was conditionally
assigning to backend_status, but then unconditionally checking for the
value assigned. The result was the leaking of an internal status value
(CAIRO_INT_STATUS_ANALYZE_META_SURFACE) which finally resulted in
an incomplete PDF file in the mask-transformed-similar test case.

While fixing this, also avoid re-using the backend_status variable so
much so that the code is more readable.
2008-09-25 02:09:40 -07:00
Carl Worth
5599b08dfa Drop _cairo_analysis_surface prefix from some static functions
Since these functions are static we don't really need the full
name. And these two functions were both so long that they were
causing some serious line-wrap issues.
2008-09-25 01:42:03 -07:00