Commit graph

7738 commits

Author SHA1 Message Date
Andrea Canciani
d44414191a [quartz] Fix source-unbounded compositing of surface sources
Surface sources were not respecting EXTEND_NONE when composited
because the part outside of the surface rectangle was not changed.
To correctly extend the source, it's sufficient to composite a
transparent rectangle with a hole in the region covered by the surface.
Fixes clip-unbounded and operator-source. Changes the output of
surface-pattern-operator.
2009-11-10 12:25:47 +01:00
Andrea Canciani
7ef611a67a [quartz] Fix stroking with unbounded operator
Stroking was not fixed up correctly when the stroke trasform
was not the identity and when the stroked path was dashed.
Instead of building a mask image and clearing through it
(forgetting to use the CTM and the dash setting), the code now
simply fills the outside of the stroke with tranparent black.
Additionally this commit moves the CTM composition so that the invocation
of _cairo_quartz_setup_source is always done with the base CTM.
This commit changes the result of clip-stroke-unbounded (the clip
mask is now correctly aligned to the stroked path).
2009-11-10 12:25:46 +01:00
Andrea Canciani
577ac4fc6d [quartz] Fix implied colour of alpha-only surface sources
If a fill colour was set, an alpha-only surface source would
have used that colour instead of black.
2009-11-10 12:25:46 +01:00
Andrea Canciani
8b25e4a7fd [quartz] Improve unbounded operators fixup
Don't allocate a colorspace and use a 16-bytes aligned stride and
an alpha-only image for the rendering of the fixup mask.
2009-11-10 12:25:45 +01:00
Andrea Canciani
ed8bdcd598 [quartz] Improve A8 image handling
A8 images were cosidered grayscale, whereas they should behave like
transparency mask. They are now alpha-only images and the stride is
16-bytes aligned, as suggested.
Fixes alpha-similar and mask-transformed-similar. Makes the patterns
behave (as expected) as masks in surface-pattern-operator.
Affects the output of operator-alpha-alpha, but the result is not
correct because of wrong compositing.
2009-11-10 12:25:45 +01:00
Robert O'Callahan
b32695c248 [quartz] Fix gradient pattern painting
CTM was changed and not restored when painting gradients.
Fixes the alignment of surface patterns in surface-pattern-operator.
Patch by Robert O'Callahan, see Mozilla bug #507939.
2009-11-10 12:22:20 +01:00
Andrea Canciani
1ce096657b Fix compilation on MacOS X
Enable "ld_preload" (DYLD_INSERT_LIBRARIES + DYLD_FORCE_FLAT_NAMESPACE)
and build cairo-trace as a library instead of a module to make it
work also on MacOS X.
2009-11-09 16:59:31 +00:00
Andrea Canciani
c181f9e9ae Add new operator-alpha-alpha test
Compositing of alpha-only sources is not throughly tested and
as a consequence the misbehaviour of some backends is not
shown by the test suite.

[ickle: Added XFAILs for pdf, ps, svg.]
2009-11-09 16:58:06 +00:00
Adrian Johnson
cee3a6169b Type1-subset: Append "cleartomark" operator for binary fonts that don't include it
Type 1 fonts embedded in PDF may omit the fixed-content portion of the
font that contains the "cleartomark" operator.
2009-11-08 21:52:06 +10:30
Adrian Johnson
d962d6bae2 PDF: Include Type 1 fixed-content portion in the embedded font
Some fonts may contain additional PostScript code after the
cleartomark.
2009-11-08 21:46:16 +10:30
Adrian Johnson
ac59c75808 Type1-subset: Check for binary eexec data
Type 1 fonts embedded in PDF have the the encrypted portion in binary
but the existing check for binary only works for Type 1 fonts in PFB
format.

Add an additional check based on the first 4 characters of eexec data.
The Type 1 specification gurantees that at least one of the first 4
bytes of ciphertext is not an ASCII Hex character.
2009-11-08 21:38:58 +10:30
Adrian Johnson
a4a59be600 Type 1 subset: Don't add a new line when in binary mode
At the end of the private dictionary a new line is appended so that
the trailing zeros will not exceed 80 columns. In hex mode (used for
PS embedding) extra white space is harmless as it is ignored when
parsing the ascii hex encoded data. But in binary mode (used for PDF
embedding) the new line must not be added as it corrupts the binary
data.

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/419143
2009-11-07 14:36:49 +10:30
Chris Wilson
9775f44436 AUTHORS: Add Andrea Canciani 2009-11-05 10:13:34 +00:00
Andrea Canciani
d51915f873 xlib: Fix double free
Both _cairo_xlib_call_close_display_hooks and _cairo_xlib_screen_destroy
invoke _cairo_xlib_screen_close_display, which frees all the cached
GCs, but (if HAS_ATOMIC_OPS is undefined) doesn't mark them as freed,
thus freeing them agin upon the second invocation.
2009-11-05 10:11:56 +00:00
Andrea Canciani
7c1424a315 quartz: Fix compilation
The function _cairo_image_surface_create_for_content does not exist.
The correct name of the function is instead _cairo_image_surface_create_with_content.
2009-11-05 10:11:41 +00:00
Chris Wilson
8a10c25c3f test: Tweak Benjamin's xcomposite-projection
Include Benjamin's advice on how to make the bug more visible inline
with the code.
2009-11-05 10:02:54 +00:00
Benjamin Otte
a9f37953c7 [xlib] Use correct number when checking if points are out of range 2009-11-04 13:59:58 +01:00
Benjamin Otte
aa1f245ea3 [test] Add "target=raster" to test
The test isn't useful on vector backends and fails there due to
antialiasing issues.
2009-11-04 13:56:15 +01:00
Benjamin Otte
52afe9c77f [xlib] Fix new Composite test
When the reference point was tirggering _line_exceeds_16_16() and got
adjusted, the code failed to compute the srcX and srcY arguments for the
call to XRenderCompositeTrapezoids() correctly and caused the resulting
source image to be misaligned.
2009-11-04 11:20:45 +01:00
Benjamin Otte
84bbf179c3 [test] Add a test exposing bugs in XRenderComposite
This test fills a slightly rotated surface slightly above the 0 line.
This hits some corner cases in the XRenderComposite path.
I discovered these issues while playing with video rendering onto the
canvas in HTML5 (both Webkit and Mozilla have this problem).
I used CAIRO_ANTIALIAS_NONE and a single-color source in the test to get
rid of aliasing issues in the output images. This makes some issues
slightly less visible, but still fails for all of them. If you want to
get a clearer view, disable it and use romedalen.png instead - it has
the same size as the red surface.

(At least) 3 bugs are at work here:
- if _line_exceeds_16_16() triggers for the reference point, the
  source surface will be misaligned.
- the intel driver seems to have an off-by-one bug on my i945 when
  positioning the source surface, causing black seams at the top
  (not visible in the test unless using romedalen.png) and on the left
  of the image.
- My Xvfb fails completely in picture up/download in the xlib-fallback
  path.
2009-11-04 11:20:04 +01:00
Chris Wilson
9b42b6156d build: Add -pthread to real_pthread_CFLAGS 2009-11-02 12:50:45 +00:00
Benjamin Otte
3eecf2f60c sphinx: Add required pthread libs
Try again, this time for real hopefully.
2009-11-02 13:20:25 +01:00
Chris Wilson
837eb577b4 sphinx: Add required pthread libs
Switching to pthread-stubs broke the build for sphinx on unbroken
platforms [those that do not unnecessarily link against -lpthreads].
2009-11-02 12:01:45 +00:00
Benjamin Otte
942a15ba9e [test] Update upscale test to expose an Xlib failure
By filling the background with grey, we can see that Xlib fills areas
with black that it shouldn't. Xlib therefore now fails this test.
2009-11-02 12:51:14 +01:00
Chris Wilson
19c411a5b8 path: Skip any secondary degenerate line-to segments.
Only the very first line-to following a move-to can have any
significance if degenerate whilst stroking, so skip all others.
In other words,

  0 0 m 0 0 l stroke

produces a capped degenerate path (i.e a dot),

  0 0 m 0 0 l 0 0 l stroke

produces the same degenerate stroke, and

  0 0 m 0 0 l 1 0 l stroke

produce a horizontal line.
2009-10-30 08:08:27 +00:00
Chris Wilson
23bcf91748 path: Misclassification of rectilinear after degenerate line-to
Malte Nuhn reported hitting an assertion:

  cairo-path-stroke.c:1816: _cairo_rectilinear_stroker_line_to: Assertion `a->x == b->x || a->y == b->y' failed.
  http://bugs.freedesktop.org/show_bug.cgi?id=24797

when stroking an apparently simple path:

  0 8.626485 m
  0 8.626485 l
  5.208333 2.5 l
  10.416667 2.5 l
  15.625 2.5 l
  20.833333 2.5 l
  26.041667 2.5 l
  31.25 2.5 l
  36.458333 2.5 l
  41.666667 2.5 l
  46.875 2.5 l
  52.083333 2.5 l
  57.291667 2.5 l
  62.5 2.5 l
  67.708333 2.5 l
  72.916667 2.5 l
  78.125 2.5 l
  83.333333 2.5 l
  88.541667 2.5 l
  93.75 2.5 l
  98.958333 2.5 l
  104.166667 2.5 l
  109.375 2.5 l
  114.583333 2.5 l
  119.791667 2.5 l
  125 2.5 l
  stroke

which upon reduction becomes:

  0.000000 8.625000 m 5.207031 2.500000 l 125.000000 2.500000 l stroke

The bug is that after spotting a repeated line-to we move the previous
end-point without reclassifying the path, hence we miss the
non-rectilinear step.
2009-10-30 08:08:13 +00:00
Adrian Johnson
600dd83398 Provide a builtin implementation of isspace() and isdigit()
The glibc versions are slow in utf8 locales.
2009-10-29 22:05:19 +10:30
Chris Wilson
f571356d34 xlib: Set has_component_alpha = FALSE for gradient Pictures
Whilst creating the xlib surface wrapper for gradient Pictures, the
corresponding attributes require ComponentAlpha disabled.
2009-10-27 20:27:09 +00:00
Chris Wilson
1a80cd2aa0 scaled-font: Fix documentation examples with incorrect derefs
Bug 24730 -- New: misleading use cases in cairo_scaled_font_text_to_glyphs's docs
http://bugs.freedesktop.org/show_bug.cgi?id=24730

An apparent copy'n'paste error from the code which has to deal with
indirect pointers crept into the documentation for the same functions.
2009-10-26 11:05:38 +00:00
Chris Wilson
f648fcd2f9 gitignore: Add forgotten cairo-perf-print 2009-10-26 11:03:16 +00:00
Chris Wilson
6911ba2f76 perf: Fix comparisons
The sort order was unstable resulting in incorrect ordering dependent
upon libc version.
2009-10-26 11:03:16 +00:00
Chris Wilson
f955a4cba7 wideint: Protect 64_32_div for non-HAVE_UINT16_T systems
Peter Clifton spotted that we failed to properly wrap
_cairo_int64_32_div() for systems without a native 64 bit type.
2009-10-25 11:04:17 +00:00
Chris Wilson
c701d7813b [pattern] Compute zero extents for empty patterns
If the pattern is for example a repeating 0x0 image, then treat it as
having zero extents.

This should workaround the bug presented here:

  https://bugs.freedesktop.org/show_bug.cgi?id=24693
  Attached PDF crashes evince with a Floating point exception
2009-10-23 14:58:33 +01:00
M Joonas Pihlaja
43a775f60d [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.
The new name is more descriptive than the rather opaque meta surface.
Discussed with vigour on the mailing list and #cairo:

http://lists.cairographics.org/archives/cairo/2009-July/017571.html
2009-10-22 02:29:47 +03:00
Chris Wilson
df357f26ff Support component-alpha.
Within our code base we carried a few hacks to utilize the component
alpha capabilities of pixman, whilst not supporting the concept for our
own masks. Thus we were setting it upon the pixman_image_t that we
passed around through code that was blissfully unaware and indeed the
component-alpha property was forgotten (e.g. upgrading glyph masks).

The real issue is that without explicit support that a pattern carries
subpixel masking information, that information is lost when using that
pattern with composite. Again we can look at the example of compositing
a sub-pixel glyph mask onto a remote xlib surface for further failure.
2009-10-21 11:37:16 +01:00
Chris Wilson
f0cd20e6ce [gl] Do not clear internal surfaces.
Create a scratch surface that will be initialised as required for
internal use. External surfaces, i.e. those returned to the user, are
cleared as normal.
2009-10-21 11:37:16 +01:00
Chris Wilson
7c9ebd4a85 Make the surface->is_clear logic common
A nasty surprise whilst profiling is that performing redundant clear
operations is extremely painful. We can mitigate this somewhat by
tracking the cleared state of surfaces and skipping repeated attempts to
clear a surface.
2009-10-21 11:37:16 +01:00
Chris Wilson
723055722f [doc] Add comments on when surfaces are cleared on construction.
Or perhaps, more importantly, when the contents are left unmodified.
2009-10-21 11:37:16 +01:00
Andrea Canciani
cef8194178 [test] Add surface-pattern-operator
Test the results of compositing ALPHA and COLOR_ALPHA surfaces
with different operators.
2009-10-20 14:57:41 +01:00
Chris Wilson
710303ef15 [test] Update rotate-image-surface-paint
Update this test case so the background is not the default border colour
so that we spot when the backend pads out the transformed image surface.
2009-10-19 17:21:57 +01:00
Luo Jinghua
ea39f0302a atomic: correct libatomic_ops version of _cairo_atomic_int_cmpxchg
AO_compare_and_swap_full() doesn't have the same semantic as
_cairo_atomic_int_cmpxchg(). The former returns a TRUE on success
FALSE otherwise while the later returns the atomic value.
2009-10-19 22:28:05 +08:00
Benjamin Otte
a2254e5647 [gstate] Apply target device offsets to patterns immediately
Previously target device offsets were applied in cairo-surface.c which
could cause bugs when paths were taken as fallbacks, as for example
pointed out by ade55037ff and quick-fixed
by 79190d8985. The quick-fix is now
unnecessary and was removed.
2009-10-18 22:12:13 +02:00
Benjamin Otte
4b720d56db [clip] Remove non-existing functions from header 2009-10-18 21:32:10 +02:00
Benjamin Otte
cacf9ccedf [path] Fix compiler warnings 2009-10-18 21:30:22 +02:00
Benjamin Otte
a70705b2ed [xlib] Fix compiler warnings 2009-10-18 21:30:06 +02:00
Chris Wilson
96117c1212 [test] Add radial-gradient-source
ranma42 found a bug in compositing with a radial gradient using the
SOURCE operator with EXTEND_NONE, as exercised here.
2009-10-17 10:37:38 +01:00
Chris Wilson
54df07a3da [surface] Don't AND in the desired content.
Gah, that was a horrible mistake. It was a flawed hack to create Pixmaps
of the correct depth when cloning patterns for blitting to the xlib
backend. However, it had the nasty side-effect of discarding alpha when
targeting Window surfaces. The correct solution is to simply correct the
Pixmap of the desired depth and render a matching pattern onto the
surface - i.e. a reversal the current acquire -> clone. See the
forthcoming revised xcb backend on how I should have done it originally.
2009-10-16 17:04:16 +01:00
Chris Wilson
6a19a82efd [image] Clone the format for a similar surface with identical content
Honour the incoming surface format when we are asked to create a similar
surface with identical content. The goal of
cairo_surface_create_similar() is to create an intermediate with similar
characteristics to the original that can be used in place of the
original and be quick to copy to the original. Matching the format for
the same content, ensures that the blits between the two need only be a
memcpy.
2009-10-16 10:13:57 +01:00
Chris Wilson
ed94d7caad [fallback] Create intermediate surface with same content.
The goal is to create a similar surface with an identical format to
maximise performance in the subsequent blit, e.g. the xlib backend could
make the similar surface with an identical depth and so use the core
protocol, or the image surface could indeed make an identical copy so
that pixman only has to do a fast memcpy. As there is no direct method
to specify such a clone, we ask the backend for a similar surface of
identical content, and trust that the semantics are clear enough for the
intent to obvious.
2009-10-16 09:00:16 +01:00
Carl Worth
c739940137 Increment version to 1.9.5
Just after the 1.9.4 snapshot.
2009-10-15 16:24:44 -07:00