summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2008-12-30 17:11:09 +0000
committerDoug Goldstein <cardoe@gentoo.org>2008-12-30 17:11:09 +0000
commit2ef8096bc5c6239715815e5740b91a42033830a7 (patch)
tree4b453f96ceec748a6168ca4d67d4ccc80ebd79f0 /x11-libs/cairo
parentVersion bump (diff)
downloadhistorical-2ef8096bc5c6239715815e5740b91a42033830a7.tar.gz
historical-2ef8096bc5c6239715815e5740b91a42033830a7.tar.bz2
historical-2ef8096bc5c6239715815e5740b91a42033830a7.zip
add ClearType-style sub-pixel hinting patch from Arch Linux
Package-Manager: portage-2.1.6.4/cvs/Linux 2.6.28-gentoo x86_64
Diffstat (limited to 'x11-libs/cairo')
-rw-r--r--x11-libs/cairo/ChangeLog7
-rw-r--r--x11-libs/cairo/Manifest13
-rw-r--r--x11-libs/cairo/cairo-1.8.6.ebuild7
-rw-r--r--x11-libs/cairo/files/cairo-1.2.4-lcd-cleartype-like.diff275
-rw-r--r--x11-libs/cairo/metadata.xml2
5 files changed, 295 insertions, 9 deletions
diff --git a/x11-libs/cairo/ChangeLog b/x11-libs/cairo/ChangeLog
index 345dc76ca7a2..875c70686b6d 100644
--- a/x11-libs/cairo/ChangeLog
+++ b/x11-libs/cairo/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for x11-libs/cairo
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/ChangeLog,v 1.204 2008/12/24 17:17:57 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/ChangeLog,v 1.205 2008/12/30 17:11:09 cardoe Exp $
+
+ 30 Dec 2008; Doug Goldstein <cardoe@gentoo.org>
+ +files/cairo-1.2.4-lcd-cleartype-like.diff, metadata.xml,
+ cairo-1.8.6.ebuild:
+ add ClearType-style sub-pixel hinting patch from Arch Linux
*cairo-1.8.6 (24 Dec 2008)
diff --git a/x11-libs/cairo/Manifest b/x11-libs/cairo/Manifest
index 27d8407795c3..7ecf87438b5e 100644
--- a/x11-libs/cairo/Manifest
+++ b/x11-libs/cairo/Manifest
@@ -1,6 +1,7 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
+AUX cairo-1.2.4-lcd-cleartype-like.diff 7244 RMD160 e50d5bf17cbead688a8b808a78fe4104c09af52e SHA1 f63131fd75bb496db59e3ce6bc755bbfb70baacb SHA256 4926d20d2b6b5071a5bf9ee9a12a36fef69510ebebd717c1dab151fe650f173a
AUX cairo-1.6.4-libpng-api-change.patch 799 RMD160 407e2bdbaa1624c2b70c4837eb872b84d48086e6 SHA1 aac038b81fba395b68b27c64814e19bbc1e8826d SHA256 82cf3e542f46b6c07dc32b16c622c0b15bb356f5069b34a9d1cdbd4b4d7481f4
DIST cairo-1.4.12.tar.gz 3276610 RMD160 5ed65d5872c0561f3392e60007898d9360d83d0a SHA1 45d5257e5a0c1524bcc25660a96b2c79d012ad3f SHA256 a1a1e4ccec8da980141d903adbe83535481b4fda96a479456438d3dfbc767d5d
DIST cairo-1.4.14.tar.gz 3283608 RMD160 9e7c87a292c889b06b29e9622be0a7daa3ddd6fd SHA1 63310243ba8af949060b06c01fc28ee5471ed5a4 SHA256 8914f9c34a77bf9d908b0c617c2d7ffebdd6d1e855cfd367d2a1b3d677f22e3c
@@ -16,13 +17,13 @@ EBUILD cairo-1.6.4.ebuild 2116 RMD160 6cfab08aed7d254c8b78982b1c036add7c3c7346 S
EBUILD cairo-1.8.0.ebuild 2405 RMD160 4b79ea5d95b163a0a4cc3219a7de22d228cf69ce SHA1 be002121f050448d2aa16389ea9c5185cf396115 SHA256 43371cd964112bf652fbfa219800a3b86fa0d78bcd5890375f12af6fc0276021
EBUILD cairo-1.8.2.ebuild 2405 RMD160 3b42b4dd8a9b0d274fd9f5b3e7c3d54a9fa91c72 SHA1 1c457da5e0af7398e5677f6a3c2c9fde0803dfd6 SHA256 79c9fa89fd20089798dd4bf50b6ef3e9e93163a4502d4389ad8291d5d14c9cde
EBUILD cairo-1.8.4.ebuild 2405 RMD160 77a7ec3032544962a82cdad2413fd97770ee239b SHA1 5d2683bc8f2baf2b20783b80b998b950b099f771 SHA256 46c18de34dde2b9144da1d0b5463514994d5eabcf441fc08bd9413cf64a6414f
-EBUILD cairo-1.8.6.ebuild 2856 RMD160 5e7c540ea5bdf3980886045a54e0de7e4ca1002b SHA1 b0dcad2972cadc99b54b6bdc79e1097ba4f6fb39 SHA256 ced8816a8ca452b526b2916c8dbdec87560931b42053472566982297b2de8afe
-MISC ChangeLog 28489 RMD160 f59a00af6e1332efde28a6f53fe5f55de583b3fd SHA1 3dff96aa7c5c560bd803ab185607c533128f4c2e SHA256 977e26ce866ca88be611de69cc0c2eb1f5c230ad762bacff7b257a285385e82c
-MISC metadata.xml 579 RMD160 a8e2ab1e575154d20f372f4cef09cfee18c6e8c3 SHA1 3f2062d658c0d780083e366f7f3d63d95586d7e1 SHA256 484df9f3a5c0775495ad4022f142f8d1a324abe0377269b8b3696a8f733989e4
+EBUILD cairo-1.8.6.ebuild 2989 RMD160 510a9b547d3417c1e8eeebc093169b9c43339392 SHA1 b16eb08e98d4969e29f58c366ccd646873804559 SHA256 634cf33e293b5285c5425e1d1c568e9e4570d5c83197b88ca450a72dffb9be12
+MISC ChangeLog 28684 RMD160 cbc49e9a945f9bb0521283bd2211073cc0d707a9 SHA1 30549fcd1a7aad7d13fd6615f91b90226b364383 SHA256 bfdf2de1d673956d719320c1bd47be624ec23059a68899c2b20946a25d3a0874
+MISC metadata.xml 692 RMD160 ec10ea9327552fb41c40e3cbf55a987acf88e052 SHA1 91f8cfd740390019d26ae2c177ff1dd9067afe0f SHA256 7b5477bf22b1a16f88f0b8acdedc9d2b14c914154d37cec5d8719af28a58fc8c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
-iEYEARECAAYFAklUUe0ACgkQn/5bYzqsSmF9nwCdEII7KVzR2E4kJE9tFf8eybFI
-NowAmgMkx19y7v5pEUf4W8qUS3LBi/n3
-=2KfL
+iEYEARECAAYFAklaVpsACgkQoeSe8B0zEfwzegCfRed0CsNMzrs/T9JsquLQp3Fm
+idYAn2fCekDp+C76QiaFbfRBmHaAqjbl
+=8+2/
-----END PGP SIGNATURE-----
diff --git a/x11-libs/cairo/cairo-1.8.6.ebuild b/x11-libs/cairo/cairo-1.8.6.ebuild
index 64f7ceaedd75..73b7eb6b551a 100644
--- a/x11-libs/cairo/cairo-1.8.6.ebuild
+++ b/x11-libs/cairo/cairo-1.8.6.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/cairo-1.8.6.ebuild,v 1.1 2008/12/24 17:17:57 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/cairo-1.8.6.ebuild,v 1.2 2008/12/30 17:11:09 cardoe Exp $
inherit eutils flag-o-matic libtool
@@ -11,7 +11,7 @@ SRC_URI="http://cairographics.org/releases/${P}.tar.gz"
LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
-IUSE="debug directfb doc glitz opengl svg X xcb"
+IUSE="cleartype debug directfb doc glitz opengl svg X xcb"
# Test causes a circular depend on gtk+... since gtk+ needs cairo but test needs gtk+ so we need to block it
RESTRICT="test"
@@ -59,6 +59,9 @@ src_unpack() {
unpack ${A}
cd "${S}"
+ # ClearType-like patches applied by ArchLinux
+ use cleartype && epatch "${FILESDIR}"/cairo-1.2.4-lcd-cleartype-like.diff
+
# We need to run elibtoolize to ensure correct so versioning on FreeBSD
elibtoolize
}
diff --git a/x11-libs/cairo/files/cairo-1.2.4-lcd-cleartype-like.diff b/x11-libs/cairo/files/cairo-1.2.4-lcd-cleartype-like.diff
new file mode 100644
index 000000000000..2f908b855387
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-1.2.4-lcd-cleartype-like.diff
@@ -0,0 +1,275 @@
+diff -rup libcairo-1.2.4.orig/src/cairo-ft-font.c libcairo-1.2.4/src/cairo-ft-font.c
+--- libcairo-1.2.4.orig/src/cairo-ft-font.c 2006-08-22 21:40:02.802247352 +0800
++++ libcairo-1.2.4/src/cairo-ft-font.c 2006-08-22 21:40:39.443677008 +0800
+@@ -53,6 +53,8 @@
+ #include FT_SYNTHESIS_H
+ #endif
+
++#define FIR_FILTER 1
++
+ #define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 64.0))
+ #define DOUBLE_FROM_26_6(t) ((double)(t) / 64.0)
+ #define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0))
+@@ -492,6 +494,8 @@ _cairo_ft_unscaled_font_destroy (void *a
+ }
+ }
+
++static const int fir_filter[5] = { 0x1C, 0x38, 0x55, 0x38, 0x1C };
++
+ static cairo_bool_t
+ _has_unlocked_face (void *entry)
+ {
+@@ -779,7 +783,220 @@ _get_bitmap_surface (FT_Bitmap *bi
+ }
+ format = CAIRO_FORMAT_A8;
+ break;
+- case CAIRO_ANTIALIAS_SUBPIXEL: {
++ case CAIRO_ANTIALIAS_SUBPIXEL:
++#ifdef FIR_FILTER
++ {
++ unsigned char* line;
++ unsigned char* bufBitmap;
++ int pitch;
++ unsigned char *data_rgba;
++ unsigned int width_rgba, stride_rgba;
++ int vmul = 1;
++ int hmul = 1;
++
++ switch (font_options->subpixel_order) {
++ case CAIRO_SUBPIXEL_ORDER_DEFAULT:
++ case CAIRO_SUBPIXEL_ORDER_RGB:
++ case CAIRO_SUBPIXEL_ORDER_BGR:
++ default:
++ width /= 3;
++ hmul = 3;
++ break;
++ case CAIRO_SUBPIXEL_ORDER_VRGB:
++ case CAIRO_SUBPIXEL_ORDER_VBGR:
++ vmul = 3;
++ height /= 3;
++ break;
++ }
++ /*
++ * Filter the glyph to soften the color fringes
++ */
++ width_rgba = width;
++ stride = bitmap->pitch;
++ stride_rgba = (width_rgba * 4 + 3) & ~3;
++ data_rgba = calloc (1, stride_rgba * height);
++
++ /* perform in-place FIR filtering in either the horizontal or
++ * vertical direction. We're going to modify the RGB graymap,
++ * but that's ok, because we either own it, or its part of
++ * the FreeType glyph slot, which will not be used anymore.
++ */
++ pitch = bitmap->pitch;
++ line = (unsigned char*)bitmap->buffer;
++ if ( pitch < 0 )
++ line -= pitch*(height-1);
++
++ bufBitmap = line;
++
++ switch (font_options->subpixel_order) {
++ case CAIRO_SUBPIXEL_ORDER_DEFAULT:
++ case CAIRO_SUBPIXEL_ORDER_RGB:
++ case CAIRO_SUBPIXEL_ORDER_BGR:
++ {
++ int h;
++
++ for ( h = height; h > 0; h--, line += pitch ) {
++ int pix[6] = { 0, 0, 0, 0, 0, 0 };
++ unsigned char* p = line;
++ unsigned char* limit = line + width*3;
++ int nn, val, val2;
++
++ val = p[0];
++ for (nn = 0; nn < 3; nn++)
++ pix[2 + nn] += val * fir_filter[nn];
++
++ val = p[1];
++ for (nn = 0; nn < 4; nn++)
++ pix[1 + nn] += val * fir_filter[nn];
++
++ p += 2;
++
++ for ( ; p < limit; p++ ) {
++ val = p[0];
++ for (nn = 0; nn < 5; nn++)
++ pix[nn] += val * fir_filter[nn];
++
++ val2 = pix[0] / 256;
++ val2 |= -(val2 >> 8);
++ p[-2] = (unsigned char)val2;
++
++ for (nn = 0; nn < 5; nn++)
++ pix[nn] = pix[nn + 1];
++ }
++ for (nn = 0; nn < 2; nn++ ) {
++ val2 = pix[nn] / 256;
++ val2 |= -(val2 >> 8);
++ p[nn - 2] = (unsigned char)val2;
++ }
++ }
++ }
++ break;
++ case CAIRO_SUBPIXEL_ORDER_VRGB:
++ case CAIRO_SUBPIXEL_ORDER_VBGR:
++ {
++ int w;
++
++ for (w = 0; w < width; w++ ) {
++ int pix[6] = { 0, 0, 0, 0, 0, 0 };
++ unsigned char* p = bufBitmap + w;
++ unsigned char* limit = bufBitmap + w + height*3*pitch;
++ int nn, val, val2;
++
++ val = p[0];
++ for (nn = 0; nn < 3; nn++)
++ pix[2 + nn] += val*fir_filter[nn];
++
++ val = p[pitch];
++ for (nn = 0; nn < 4; nn++ )
++ pix[1 + nn] += val * fir_filter[nn];
++
++ p += 2*pitch;
++ for ( ; p < limit; p += pitch ) {
++ val = p[0];
++ for (nn = 0; nn < 5; nn++ )
++ pix[nn] += val * fir_filter[nn];
++
++ val2 = pix[0] / 256;
++ val2 |= -(val2 >> 8);
++ p[-2 * pitch] = (unsigned char)val2;
++
++ for (nn = 0; nn < 5; nn++)
++ pix[nn] = pix[nn+1];
++ }
++
++ for (nn = 0; nn < 2; nn++) {
++ val2 = pix[nn] / 256;
++ val2 |= -(val2 >> 8);
++ p[(nn - 2) * pitch] = (unsigned char)val2;
++ }
++ }
++ }
++ break;
++ default: /* shouldn't happen */
++ break;
++ }
++
++ /* now copy the resulting graymap into an ARGB32 image */
++ {
++ unsigned char* in_line = bufBitmap;
++ unsigned char* out_line = data_rgba;
++ int h = height;
++
++ switch (font_options->subpixel_order) {
++ case CAIRO_SUBPIXEL_ORDER_DEFAULT:
++ case CAIRO_SUBPIXEL_ORDER_RGB:
++ for ( ; h > 0; h--, in_line += pitch, out_line += stride_rgba) {
++ unsigned char* in = in_line;
++ int* out = (int*)out_line;
++ int w;
++
++ for (w = width; w > 0; w--, in += 3, out += 1) {
++ int r = in[0];
++ int g = in[1];
++ int b = in[2];
++
++ out[0] = (g << 24) | (r << 16) | (g << 8) | b;
++ }
++ }
++ break;
++ case CAIRO_SUBPIXEL_ORDER_BGR:
++ for ( ; h > 0; h--, in_line += pitch, out_line += stride_rgba) {
++ unsigned char* in = in_line;
++ int* out = (int*)out_line;
++ int w;
++
++ for (w = width; w > 0; w--, in += 3, out += 1) {
++ int r = in[2];
++ int g = in[1];
++ int b = in[0];
++
++ out[0] = (g << 24) | (r << 16) | (g << 8) | b;
++ }
++ }
++ break;
++ case CAIRO_SUBPIXEL_ORDER_VRGB:
++ for ( ; h > 0; h--, in_line += pitch*3, out_line += stride_rgba) {
++ unsigned char* in = in_line;
++ int* out = (int*)out_line;
++ int w;
++
++ for (w = width; w > 0; w--, in += 1, out += 1) {
++ int r = in[0];
++ int g = in[pitch];
++ int b = in[pitch*2];
++
++ out[0] = (g << 24) | (r << 16) | (g << 8) | b;
++ }
++ }
++ break;
++ case CAIRO_SUBPIXEL_ORDER_VBGR:
++ for ( ; h > 0; h--, in_line += pitch*3, out_line += stride_rgba) {
++ unsigned char* in = in_line;
++ int* out = (int*)out_line;
++ int w;
++
++ for (w = width; w > 0; w--, in += 1, out += 1) {
++ int r = in[2*pitch];
++ int g = in[pitch];
++ int b = in[0];
++
++ out[0] = (g << 24) | (r << 16) | (g << 8) | b;
++ }
++ }
++ break;
++ }
++ }
++
++ if (own_buffer)
++ free (bitmap->buffer);
++ data = data_rgba;
++ stride = stride_rgba;
++ format = CAIRO_FORMAT_ARGB32;
++ subpixel = TRUE;
++ break;
++ }
++#else /* !FIR_FILTER */
++ {
+ int x, y;
+ unsigned char *in_line, *out_line, *in;
+ unsigned int *out;
+@@ -871,6 +1088,7 @@ _get_bitmap_surface (FT_Bitmap *bi
+ subpixel = TRUE;
+ break;
+ }
++#endif /* !FIR_FILTER */
+ }
+ break;
+ case FT_PIXEL_MODE_GRAY2:
+@@ -986,12 +1204,22 @@ _render_glyph_outline (FT_Face
+ matrix.xx *= 3;
+ hmul = 3;
+ subpixel = TRUE;
++#ifdef FIR_FILTER
++ cbox.xMin -= 64;
++ cbox.xMax += 64;
++ width += 2;
++#endif
+ break;
+ case CAIRO_SUBPIXEL_ORDER_VRGB:
+ case CAIRO_SUBPIXEL_ORDER_VBGR:
+ matrix.yy *= 3;
+ vmul = 3;
+ subpixel = TRUE;
++#ifdef FIR_FILTER
++ cbox.yMin -= 64;
++ cbox.yMax += 64;
++ height += 2;
++#endif
+ break;
+ }
+ FT_Outline_Transform (outline, &matrix);
+Only in libcairo-1.2.4/src: cairo-ft-font.c.orig
diff --git a/x11-libs/cairo/metadata.xml b/x11-libs/cairo/metadata.xml
index 2c308436e302..10dce299b361 100644
--- a/x11-libs/cairo/metadata.xml
+++ b/x11-libs/cairo/metadata.xml
@@ -10,6 +10,8 @@
<email>compnerd@gentoo.org</email>
</maintainer>
<use>
+ <flag name='cleartype'>Add ClearType-style behavior for sub-pixel hinting.
+ Patch taken from Arch Linux</flag>
<flag name='glitz'>Build with glitz support, which replaces some software
render operations with Mesa OpenGL operations</flag>
<flag name='opengl'>When used along with USE=glitz, enables glitz-glx usage.