[oe-commits] Koen Kooi : cairo 1.8.10: even faster version of patch

git version control git at git.openembedded.org
Wed Jun 2 17:43:11 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: eb1cfd85ca2aa47f33b18aed69497ee61c09333b
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=eb1cfd85ca2aa47f33b18aed69497ee61c09333b

Author: Koen Kooi <koen at openembedded.org>
Date:   Wed Jun  2 19:39:42 2010 +0200

cairo 1.8.10: even faster version of patch

---

 recipes/cairo/cairo_1.8.10.bb                      |    2 +-
 ...ss-on-DP-FPU-for-common-matrix-test-funcs.patch |   37 ++++++++++++++-----
 2 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/recipes/cairo/cairo_1.8.10.bb b/recipes/cairo/cairo_1.8.10.bb
index ebbef70..884a6a7 100644
--- a/recipes/cairo/cairo_1.8.10.bb
+++ b/recipes/cairo/cairo_1.8.10.bb
@@ -1,6 +1,6 @@
 require cairo.inc
 
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
            file://dolt-fix.patch \
diff --git a/recipes/cairo/files/0001-Rely-less-on-DP-FPU-for-common-matrix-test-funcs.patch b/recipes/cairo/files/0001-Rely-less-on-DP-FPU-for-common-matrix-test-funcs.patch
index c54da08..c82b3d9 100644
--- a/recipes/cairo/files/0001-Rely-less-on-DP-FPU-for-common-matrix-test-funcs.patch
+++ b/recipes/cairo/files/0001-Rely-less-on-DP-FPU-for-common-matrix-test-funcs.patch
@@ -8,7 +8,7 @@ Subject: [PATCH] Rely less on DP FPU for common matrix funcs.
  1 files changed, 10 insertions(+), 10 deletions(-)
 
 diff --git a/src/cairo-matrix.c b/src/cairo-matrix.c
-index de1c6ed..3aec9e5 100644
+index de1c6ed..7519852 100644
 --- a/src/cairo-matrix.c
 +++ b/src/cairo-matrix.c
 @@ -43,6 +43,13 @@
@@ -25,7 +25,7 @@ index de1c6ed..3aec9e5 100644
  static void
  _cairo_matrix_scalar_multiply (cairo_matrix_t *matrix, double scalar);
  
-@@ -58,10 +65,7 @@ _cairo_matrix_compute_adjoint (cairo_matrix_t *matrix);
+@@ -58,10 +65,8 @@ _cairo_matrix_compute_adjoint (cairo_matrix_t *matrix);
  void
  cairo_matrix_init_identity (cairo_matrix_t *matrix)
  {
@@ -33,11 +33,12 @@ index de1c6ed..3aec9e5 100644
 -		       1, 0,
 -		       0, 1,
 -		       0, 0);
-+	*matrix = _cairo_matrix_identity;
++	matrix->xx = matrix->yy = 1;
++	matrix->xy = matrix->yx = matrix->x0 = matrix->y0 = 0;
  }
  slim_hidden_def(cairo_matrix_init_identity);
  
-@@ -86,7 +90,6 @@ slim_hidden_def(cairo_matrix_init_identity);
+@@ -86,7 +91,6 @@ slim_hidden_def(cairo_matrix_init_identity);
  void
  cairo_matrix_init (cairo_matrix_t *matrix,
  		   double xx, double yx,
@@ -45,14 +46,33 @@ index de1c6ed..3aec9e5 100644
  		   double xy, double yy,
  		   double x0, double y0)
  {
-@@ -653,16 +656,13 @@ _cairo_matrix_compute_basis_scale_factors (const cairo_matrix_t *matrix,
+@@ -650,19 +654,32 @@ _cairo_matrix_compute_basis_scale_factors (const cairo_matrix_t *matrix,
+     return CAIRO_STATUS_SUCCESS;
+ }
+ 
++static inline cairo_bool_t
++_cairo_compare_matrix (const cairo_matrix_t *a, const cairo_matrix_t *b, const int n)
++{
++	uint64_t *ia = (uint64_t*) a;
++	uint64_t *ib = (uint64_t*) b;
++	uint64_t x = 0;
++	int i;
++
++	assert(sizeof(double) == sizeof(uint64_t));
++
++	for(i=0; i < n; i++)
++		x |= ia[i] ^ ib[i];
++
++	return !x;
++}
++
  cairo_bool_t
  _cairo_matrix_is_identity (const cairo_matrix_t *matrix)
  {
 -    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
 -	    matrix->xy == 0.0 && matrix->yy == 1.0 &&
 -	    matrix->x0 == 0.0 && matrix->y0 == 0.0);
-+	return !memcmp(matrix, &_cairo_matrix_identity, sizeof(cairo_matrix_t));
++	return _cairo_compare_matrix(matrix, &_cairo_matrix_identity, 6);
  }
  
  cairo_bool_t
@@ -60,10 +80,7 @@ index de1c6ed..3aec9e5 100644
  {
 -    return (matrix->xx == 1.0 && matrix->yx == 0.0 &&
 -	    matrix->xy == 0.0 && matrix->yy == 1.0);
-+	return !memcmp(matrix, &_cairo_matrix_identity, sizeof(double)*4);
++	return _cairo_compare_matrix(matrix, &_cairo_matrix_identity, 4);
  }
  
  cairo_bool_t
--- 
-1.5.6.1
-





More information about the Openembedded-commits mailing list