Having noticed strange discrepancies creeping into similar surfaces
whilst working on the xlib backend, I thought it wise to also run
the test harness against similar targets. For consistency, only
targets whose similar surface use the same backend are included.
This can be disabled by exporting CAIRO_TEST_IGNORE_SIMILAR=1.
Do not rely on the assumption that if the destination has render support
then the source has it as well - breaks when the boilerplate disables
render support for a surface.
Similarly do not set the XRender attributes on the source surface
unless it actually has a xrender_format.
When the clip mask is empty we perform actions like composite 0x0
surfaces, which results in a lot of unnecessary work and allocations.
Avoid doing work when we know everything is clip out and take the
liberty of freeing any memory associated with the clop state.
The reasoning is that right now, applications render glyphs to images,
upload it to the X server, and keep a local copy in the cache. The X
server works hard to reuse glyph renderings, by hashing glyph images and
reusing them. So we are wasting memory in cairo apps that don't use the
glyph surface after uploading to the server, which is the case if you
don't use the glyph in an image surface. The patch does not release the
glyph surface if it already existed in the cache, so, worst case
scenario is that we render the glyph twice, if you first use it with
xlib, then with image surface. That effect should be negligible.
_xrender_format_to_content() was using the channel offset to determine
whether the format supported a content type.
For example, the XRenderPictFormat for the A8 format looks like:
direct.alpha = 0; direct.alphaMask = 0xff;
direct.red = 0; direct.redMask = 0x00;
direct.green = 0; direct.greenMask = 0x00;
direct.blue = 0; direct.blueMask = 0x00;
which _xrender_format_to_content() matched as CAIRO_CONTENT_COLOR.
Switch to using the channel masks for deducing content type.
_cairo_sub_font_lookup_glyph() was returning either a NULL_POINTER
error or success whereas its only caller was using it as a simple
predicate and handled the 'error' rather than propagate it upwards.
The VendorString parsing (to detect broken Xserver versions) was being
performed for each surface creation, but as it is a display invariant
we can save a small amount of work by storing the result on the
cairo_xlib_display_t.
The Laplacian pyramid can only work on images larger than 3x3 due to the
size of its convolution kernel. So if the image is too small return an
error (-1) before attempting to construction the pyramid.
Do not use _cairo_error(CAIRO_STATUS_NO_CURRENT_POINT) within
_cairo_path_fixed_get_current_point() as the only caller,
cairo_get_current_point(), expects and handles that status.
The glyph names used in the Type42 and Type1 fallback fonts are now of
the form "/uniXXXX" where XXXX is the unicode character for each
glyph. When converted to pdf (eg using ps2pdf), pdf viewers are now
able to correctly extract the text.
This patch eliminates two sources of fallback images. The alpha value
of each pixel in argb32 images are checked. If all alpha values are
255 the image is treated the same as rgb24 images. If all alpha values
are either 0 or 255 and the PS level is 3, a Type 3 image (image +
mask) is emitted.
Andrew Jorgensen spotted that make dist was missing a few headers needed
for compilation and running make distcheck had spurious failures. Add
the missing files to the distribution and a silly one-liner to check for
missing reference images.
Distinguish the UNSUPPORTED case where the font backend does not
support conversion to unicode from other fatal errors by returning a
status value rather than using stream.id == 0 to indicate any error.
Ensure we restore the surface->current_group if we encounter an error
during _cairo_pdf_surface_emit_meta_surface() lest we leak the
current_group array.
gcc -ansi -pedantic gives a few syntax warnings, principally for use of
'//' comments and a comma at the end of enumerators. Apply these
corrections as they are trivial.
Set test_svg to no prior for checking for SVG availability so that the
printed summary is correct if the user explicitly disables the SVG
surface on the configure command line.
Instead of simply ignoring the error that may occur when we upload the
destination image to the xlib surface (via XPutImage) record the error
on the xlib surface.