Update to latest stable release

- Enable the GL backend
This commit is contained in:
Richard Hughes 2012-04-24 17:11:42 +01:00
parent e6d6489760
commit facaf3d652
4 changed files with 25 additions and 87 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
cairo-1.9.14.tar.gz
/cairo-1.10.0.tar.gz
/cairo-1.10.2.tar.gz
/cairo-1.12.0.tar.gz

View File

@ -1,79 +0,0 @@
From 00de16b7ac54d4c620e0be3565c83f58e01567ac Mon Sep 17 00:00:00 2001
From: Benjamin Otte <otte@redhat.com>
Date: Sat, 4 Jun 2011 13:47:15 +0200
Subject: [PATCH] image: Don't crash on weird pixman formats
_pixel_to_solid() used to assert that it got a known cairo_format_t.
However, this might not be the case when backends decide to use a pixman
format that is not representable by a cairo format (X and DirectFB are
examples for backends that do that).
This patch makes _pixel_to_solid() return NULL in that case and fixes
the callers to deal with it.
https://bugs.freedesktop.org/show_bug.cgi?id=37916
---
src/cairo-image-surface.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 93ccfe5..a2345b2 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -1246,10 +1246,12 @@ _pixel_to_solid (cairo_image_surface_t *image, int x, int y)
switch (image->format) {
default:
- case CAIRO_FORMAT_INVALID:
ASSERT_NOT_REACHED;
return NULL;
+ case CAIRO_FORMAT_INVALID:
+ return NULL;
+
case CAIRO_FORMAT_A1:
pixel = *(uint8_t *) (image->data + y * image->stride + x/8);
return pixel & (1 << (x&7)) ? _pixman_black_image () : _pixman_transparent_image ();
@@ -1364,7 +1366,9 @@ _pixman_image_for_surface (const cairo_surface_pattern_t *pattern,
}
else
{
- return _pixel_to_solid (source, sample.x, sample.y);
+ pixman_image = _pixel_to_solid (source, sample.x, sample.y);
+ if (pixman_image)
+ return pixman_image;
}
}
@@ -1403,9 +1407,11 @@ _pixman_image_for_surface (const cairo_surface_pattern_t *pattern,
if (sample.width == 1 && sample.height == 1) {
if (is_contained) {
- return _pixel_to_solid (source,
- sub->extents.x + sample.x,
- sub->extents.y + sample.y);
+ pixman_image = _pixel_to_solid (source,
+ sub->extents.x + sample.x,
+ sub->extents.y + sample.y);
+ if (pixman_image)
+ return pixman_image;
} else {
if (extend == CAIRO_EXTEND_NONE)
return _pixman_transparent_image ();
@@ -1468,8 +1474,11 @@ _pixman_image_for_surface (const cairo_surface_pattern_t *pattern,
else
{
pixman_image = _pixel_to_solid (image, sample.x, sample.y);
- _cairo_surface_release_source_image (pattern->surface, image, extra);
- return pixman_image;
+ if (pixman_image)
+ {
+ _cairo_surface_release_source_image (pattern->surface, image, extra);
+ return pixman_image;
+ }
}
}
--
1.7.7.6

View File

@ -4,13 +4,12 @@
Summary: A 2D graphics library
Name: cairo
Version: 1.10.2
Release: 7%{?dist}
Version: 1.12.0
Release: 1%{?dist}
URL: http://cairographics.org
#VCS: git:git://git.freedesktop.org/git/cairo
Source0: http://cairographics.org/snapshots/%{name}-%{version}.tar.gz
#Source0: http://cairographics.org/releases/%{name}-%{version}.tar.gz
Patch0: 0001-image-Don-t-crash-on-weird-pixman-formats.patch
#Source0: http://cairographics.org/snapshots/%{name}-%{version}.tar.gz
Source0: http://cairographics.org/releases/%{name}-%{version}.tar.gz
License: LGPLv2 or MPLv1.1
Group: System Environment/Libraries
@ -24,6 +23,8 @@ BuildRequires: freetype-devel >= %{freetype_version}
BuildRequires: fontconfig-devel >= %{fontconfig_version}
BuildRequires: glib2-devel
BuildRequires: librsvg2-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libEGL-devel
%description
Cairo is a 2D graphics library designed to provide high-quality display
@ -90,8 +91,6 @@ This package contains tools for working with the cairo graphics library.
%prep
%setup -q
%global _default_patch_fuzz 2
%patch0 -p1
%build
%configure --disable-static \
@ -102,8 +101,11 @@ This package contains tools for working with the cairo graphics library.
--enable-pdf \
--enable-svg \
--enable-tee \
--enable-gl \
--enable-gobject \
--disable-gtk-doc
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make V=1 %{?_smp_mflags}
%install
@ -123,6 +125,7 @@ rm -rf $RPM_BUILD_ROOT
%doc AUTHORS BIBLIOGRAPHY BUGS COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1 NEWS README
%{_libdir}/libcairo.so.*
%{_libdir}/libcairo-script-interpreter.so.*
%{_bindir}/cairo-sphinx
%files devel
%defattr(-,root,root,-)
@ -140,6 +143,9 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/cairo/cairo-version.h
%{_includedir}/cairo/cairo-xlib-xrender.h
%{_includedir}/cairo/cairo-xlib.h
%{_includedir}/cairo/cairo-gl.h
%{_includedir}/cairo/cairo-script.h
%{_includedir}/cairo/cairo-xcb.h
%{_libdir}/libcairo.so
%{_libdir}/libcairo-script-interpreter.so
%{_libdir}/pkgconfig/cairo-fc.pc
@ -152,6 +158,12 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/cairo-tee.pc
%{_libdir}/pkgconfig/cairo-xlib.pc
%{_libdir}/pkgconfig/cairo-xlib-xrender.pc
%{_libdir}/pkgconfig/cairo-egl.pc
%{_libdir}/pkgconfig/cairo-gl.pc
%{_libdir}/pkgconfig/cairo-glx.pc
%{_libdir}/pkgconfig/cairo-script.pc
%{_libdir}/pkgconfig/cairo-xcb-shm.pc
%{_libdir}/pkgconfig/cairo-xcb.pc
%{_datadir}/gtk-doc/html/cairo
%files gobject
@ -170,6 +182,10 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/cairo/
%changelog
* Tue Apr 24 2012 Richard Hughes <rhughes@redhat.com> - 1.12.0-1
- Update to latest stable release
- Enable the GL backend
* Thu Mar 15 2012 Benjamin Otte <otte@redhat.com> - 1.10.2-7
- Add patch to make eclipse not crash (#803878)

View File

@ -1 +1 @@
f101a9e88b783337b20b2e26dfd26d5f cairo-1.10.2.tar.gz
e6c85575ba7094f88b637bdfd835a751 cairo-1.12.0.tar.gz