Commit graph

4856 commits

Author SHA1 Message Date
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
869942a97e [quartz] some more quartz ref images 2008-03-07 16:55:47 -08:00
Vladimir Vukicevic
2e33d5f57b [quartz] Update a bunch of reference images
Generated with Bitstream Vera font family installed, using ATSUI
font backend.
2008-03-07 16:46:53 -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
b181f40949 [test/a8-mask] Check negative strides as well.
Check that we also allow surfaces to be created using a negative stride.
2008-03-04 09:31:20 +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
Carl Worth
6295c46569 INSTALL: Add notes on running autogen.sh if there is no configure script 2008-02-28 17:08:40 -08:00
Carl Worth
e7e4a03dd3 get-path-extents: Fix APPROX_EQUALS to round values on both sides of the comparison 2008-02-28 16:39:42 -08:00
Carl Worth
602489b150 get-path-extents: Use APPROX_EQUALS instead of EQUALS for text path tests
This is done grudgingly due to freetype rounding the coordinates
of the extents when hinting is enabled.
2008-02-28 16:33:51 -08:00
Carl Worth
50a6fe1a2a Remove unnecessary cairo_set_tolerance call from get-path-extents test 2008-02-28 16:32:55 -08:00
Carl Worth
4a73471087 Merge branch 'master' of git.cairographics.org:/git/cairo 2008-02-28 16:21:11 -08:00
Carl Worth
54a61911f2 Increment version to 1.5.13 after the 1.5.12 snapshot 2008-02-28 16:20:56 -08:00
Behdad Esfahbod
523c7dbf6d [cairo-scaled-font] Pedantic check for zero-area glyphs 2008-02-28 18:53:45 -05:00
Carl Worth
3ec4b9a4fc Increment cairo version to 1.5.12 and libtool versioning to 18:0:16 2008-02-28 15:46:22 -08:00
Carl Worth
bf99e355d9 Clarify that 16-bit limit still exists in pixman 2008-02-28 15:45:11 -08:00
Carl Worth
4cc174f72f Mark the big-line test as XFAIL 2008-02-28 15:41:36 -08:00
Carl Worth
5d0bc97b20 Fix incorrect reference images for big-line test
I mistakenly generated the original reference images with
a 16.16 version of cairo, (which manifests a different
buggy behavior than does the current 24.8 cairo).
2008-02-28 15:35:46 -08:00