Commit graph

2936 commits

Author SHA1 Message Date
Adrian Johnson
2d9203c349 win32-printing: Don't scale the miter limit
since the miter is a ratio it should not be scaled like the other
stroke parameters when the user ctm is scaled.
2008-03-10 22:30:16 +10:30
Adrian Johnson
f534fe434d PDF: Use cairo_image_analyse_transparency during analysis
OPERATOR_SOURCE is only supported for opaque images. Check if and ARGB
image really contains transparency before returing unsupported.
2008-03-10 17:23:10 +10:30
Adrian Johnson
61d45c9d1f Remember the results of _cairo_image_analyze_transparency
As _cairo_image_analyze_transparency() is only used on images in the
meta surface, we can store the results of the image analysis and
return the saved value on second and subsequent calls to analyze the
same image.

Previously each image was analyzed twice - once during
CAIRO_PAGINATED_MODE_ANALYZE and once during
CAIRO_PAGINATED_MODE_RENDER.
2008-03-10 17:04:01 +10:30
Adrian Johnson
7eb8f497d8 Move analyze_image_transparency in to cairo-image-surface.c 2008-03-10 17:02:31 +10:30
Adrian Johnson
00091d50a6 Add fallback image comment to PS output
To help better understand when fallback images are used, a comment
similiar to the following is included with each fallback image in the
PS output.

% Fallback Image: x=101, y=478, w=50, h=10 res=300dpi size=31500
2008-03-09 16:44:18 +10:30
Adrian Johnson
95acec69d8 Round fallback image size up instead of down
to ensure the fallback image completely covers the fallback region.
2008-03-09 16:40:25 +10:30
Vladimir Vukicevic
94e41d5565 [quartz] Don't force interpolation off for images
Creating a CGImage with interpolation set to FALSE means that
it will never be interpolated; otherwise the interoplation
is controlled by the destination context's interpolation
quality setting.
2008-03-08 17:45:47 -08:00
Vladimir Vukicevic
08e38d3f20 [quartz] align strides to 16 bytes, as per apple docs
The docs indicate that doing so can yield a peformance win, so we align
ARGB32/RGB24 surface strides to 16 bytes.
2008-03-08 16:06:01 -08:00
Vladimir Vukicevic
73444f16fa [quartz] Don't try to call CGBitmapContextCreateImage on non-bitmap contexts 2008-03-08 15:31:15 -08:00
Vladimir Vukicevic
091df2c59b [quartz] properly honor text antialiasing modes in show_glyphs 2008-03-08 15:16:05 -08:00
Vladimir Vukicevic
4f7ac14b8f [quartz] implement REPEAT/REFLECT for gradients
Implement REPEAT/REFLECT for gradients in Quartz: for linear gradients,
they're implemented natively (by extending the gradient region); for
radial gradients, we generate a fallback image using pixman and render
that.
2008-03-08 15:15:45 -08:00
Vladimir Vukicevic
fb1378a24b [quartz] Correctly handle gradients with non-identity pattern transform
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=14248
2008-03-07 16:46:15 -08:00
Vladimir Vukicevic
6c7610067f [quartz] handle antialiasing correctly in stroke() and clip()
A CoreGraphics bug was fixed so strokes are no longer incorrectly
drawn with antialiasing disabled; we no longer have to ignore
antialiasing for stroke().  Also, antialiasing was not being
correctly set for clip().  This fixes both issues.
2008-03-07 15:35:31 -08:00
Vladimir Vukicevic
21dab3c5e9 [quartz] look up the right symbol name for CGContextGetType 2008-03-07 14:49:46 -08:00
Vladimir Vukicevic
e52bad5e33 [quartz] split out (experimental) quartz-image into separate file 2008-03-07 14:49:15 -08:00
Vladimir Vukicevic
b52f127c12 [quartz] fix text rendering with gradient or image source
A quirk in how CGContextShowGlyphsWithAdvances works was causing all
non-solid glyphs to be rendered on top of eachother.  This fixes the problem.
2008-03-06 16:53:39 -08:00
Chris Wilson
de515e0f9a [cairo-png] Revert accidental chunk from FORMAT_A1 support.
Whilst splitting the patches, I left in this line which would preserve
1-bit grayscale unexpanded, but without any of the other FORMAT_A1
support.
2008-03-06 08:10:16 +00:00
Chris Wilson
8ba8a11924 [win32] make check doc fixup.
Add the missing '%' to the macro as demanded by make check.
2008-03-04 13:59:57 +00:00
Chris Wilson
1dd894115e [cairo-pattern] Raise an error for _cairo_pattern_create_solid() failure.
Add a missing _cairo_error() for the malloc failure in
_cairo_pattern_create_solid().
2008-03-04 09:31:21 +00:00
Chris Wilson
5efc5238d5 [cairo-hull] Propagate error during hull computation.
Propagate the original error status instead of returning a new NO_MEMORY
error.
2008-03-04 09:31:21 +00:00
Chris Wilson
11a2444ec8 [cairo-png] Support generating CAIRO_FORMAT_RGB24 from PNGs.
If the PNG does not have an alpha channel, then create an opaque image.
2008-03-04 09:31:21 +00:00
Chris Wilson
06b375aee9 [cairo-png] Use cairo_format_stride_for_width()
Use cairo_format_stride_for_width() instead of assuming the pixel size
and manually calculating the row stride. This should make it easier to
support loading multiple image formats in future.
2008-03-04 09:31:21 +00:00
Chris Wilson
b6eb1c5c92 [cairo-image-surface] Harden cairo_format_stride_for_width().
Check the user supplied values for validity and potential overflow,
returning -1 in such cases, and update the documentation to warn of the
new error return.
2008-03-04 09:31:20 +00:00
Chris Wilson
c06d929325 [cairo-png] Further hardening against malloc failures.
On some OOM paths, libpng raises a warning as opposed to an error,
these were not being propagated back to the caller. We were also not
checking that we did not overwrite a pre-existing error status when
raising an error whilst performing I/O.
2008-03-04 09:31:20 +00:00
Chris Wilson
c985096e6d [cairo-xlib] Tidy usage of _cairo_error().
Avoid a duplicate call to _cairo_error() and add a missing one.
2008-03-04 09:31:20 +00:00
Chris Wilson
914f4a3ec5 [cairo-pattern] Tidy usage of _cairo_error().
Remove the duplicate calls to _cairo_error() along the constructor
error paths and a missing call to _cairo_error().
2008-03-04 09:31:20 +00:00
Chris Wilson
d9fb4d4bc5 [cairo-ft-font] Simplify return of the nil font face during construction.
Simply return the nil font face from the internal constructor rather
than returning NULL and repeating the same fixup in the callers.
2008-03-04 09:31:20 +00:00
Chris Wilson
fd7d5d6e1d [cairo-clip] Raise _cairo_error() at original error site.
In a couple of places where we detect an error and return an error
object to the user, we did not throw a _cairo_error().
2008-03-04 09:31:20 +00:00
Chris Wilson
1654510a34 [cairo-cff-subset] Propagate error status.
Remove duplicate _cairo_error() by ensuring that the error status is
always propagated from the original error site. Note that in one case
this eliminates a potential _cairo_error(CAIRO_INT_STATUS_UNSUPPORTED)!
2008-03-04 09:31:20 +00:00
Chris Wilson
3b93d90edd [cairo-type1-fallback] Propagate original error status.
_cairo_error() has already been called at the originating error site, so
remove the duplicate (hard-coded!) call at the return statement.
2008-03-04 09:31:20 +00:00
Chris Wilson
141c54cd27 [cairo-truetype-subset] Remove duplicate _cairo_error().
_cairo_error() has already been called at the originating error site, so
remove the duplicate call at the return statement.
2008-03-04 09:31:19 +00:00
Vladimir Vukicevic
d89edde84d [meta] always copy glyph array before passing to _cairo_surface_show_glyphs
_cairo_surface_show_glyphs is allowed to mutate the glyph array; if it's
handed the internal array that the meta surface holds, then any subsequent
playback (such as for fine-grained fallbacks) will result in incorrect
glyph rendering.

Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=419917
(I was unable to create a simple cairo testcase to demonstrate the problem.)
2008-03-04 00:15:46 -08:00
Vladimir Vukicevic
4a1f65b63e Fix msvc compilation issue in cairo-compiler-private.h
__WIN32__ is not a standard define set by MSVC; we have to check for
__WIN32__ (for mingw/gcc) and for _MSC_VER, for MSVC.
2008-03-03 21:16:12 -08:00
Vladimir Vukicevic
4588b016d3 [quartz] compilation fix
I'm an idiot and forgot to stg refresh, apparently.
2008-03-03 20:00:08 -08:00
Vladimir Vukicevic
2f9350424f [win32] Treat all incoming HDCs as RGB24, regardless of depth
Assuming A8/A1 doesn't really make sense in any case, and doing
this allows for rendering to 8bpp displays.
2008-03-03 17:43:41 -08:00
Vladimir Vukicevic
9dd55f6fe8 [quartz] use CGContextGetType API if available
We need to have a way to figure out if a context is a bitmap context;
the current method works, but it prints a warning to the system console
if called on a non-bitmap context.  There's a private CGContextGetType
API that seems to let us get this information.
2008-03-03 17:40:21 -08:00
Antoine Azar
5b334b2747 fixed compilation typo on win32 2008-03-03 10:21:17 -08:00
Claudio Ciccani
39d18ecbfd [cairo-directfb] Fixed bug in clone_similar() (src_x added twice). 2008-03-01 11:07:47 +01:00
Behdad Esfahbod
523c7dbf6d [cairo-scaled-font] Pedantic check for zero-area glyphs 2008-02-28 18:53:45 -05:00
Jody Goldberg
4c7784e91e Fix PDF ouput when cross-compiling with mingw
Need to use __WIN32__ instead of _MSC_VER to select _snprintf in
place of snprintf when cross compiling. Otherwise all all %ld
arguments get misprinted resulting in broken PDF output.
2008-02-28 15:23:53 -08:00
Carl Worth
3d9db511c6 Remove references to PIXMAN_yuy2 and PIXMAN_yv12 enum values
These were added in cb5ea8abfd to
quiet a compiler warning. We're reverting them now to avoid
gratuitously requiring a new pixman version just to pick up two
enum values that we aren't actually using.
2008-02-28 15:07:50 -08:00
Carl Worth
a8e5c6b924 Fix typo in comment 2008-02-28 15:05:12 -08:00
Carl Worth
c8c77f01f7 Fix typo in documentation 2008-02-28 13:02:27 -08:00
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