[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/cairo/devel cairo-0.6.0-font-options-to-scaled-font.patch, NONE, 1.1 cairo.spec, 1.17, 1.18



Author: krh

Update of /cvs/dist/rpms/cairo/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26761

Modified Files:
	cairo.spec 
Added Files:
	cairo-0.6.0-font-options-to-scaled-font.patch 
Log Message:
* Tue Aug  2 2005 Kristian Høgsberg <krh redhat com> - 0.6.0-2
- Add cairo-0.6.0-font-options-to-scaled-font.patch to make sure font
  cache eviction works correctly (#164664).



cairo-0.6.0-font-options-to-scaled-font.patch:
 cairo-font.c       |    8 ++++++++
 cairo-ft-font.c    |    7 ++-----
 cairo-win32-font.c |    4 +---
 cairoint.h         |   17 ++++++++++-------
 4 files changed, 21 insertions(+), 15 deletions(-)

--- NEW FILE cairo-0.6.0-font-options-to-scaled-font.patch ---
--- cairo-0.6.0/src/cairo-font.c.font-options-in-cache	2005-08-02 12:03:16.000000000 -0400
+++ cairo-0.6.0/src/cairo-font.c	2005-08-02 12:03:59.000000000 -0400
@@ -466,6 +466,10 @@
     { 1., 0., 0., 1., 0, 0},	/* font_matrix */
     { 1., 0., 0., 1., 0, 0},	/* ctm */
     { 1., 0., 0., 1., 0, 0},	/* scale */
+    { CAIRO_ANTIALIAS_DEFAULT,	/* options */
+      CAIRO_SUBPIXEL_ORDER_DEFAULT,
+      CAIRO_HINT_STYLE_DEFAULT,
+      CAIRO_HINT_METRICS_DEFAULT} ,
     NULL,			/* font_face */
     CAIRO_SCALED_FONT_BACKEND_DEFAULT,
 };
@@ -864,6 +868,7 @@
 _cairo_scaled_font_init (cairo_scaled_font_t               *scaled_font, 
 			 const cairo_matrix_t              *font_matrix,
 			 const cairo_matrix_t              *ctm,
+			 const cairo_font_options_t        *options,
 			 const cairo_scaled_font_backend_t *backend)
 {
     scaled_font->status = CAIRO_STATUS_SUCCESS;
@@ -871,6 +876,8 @@
     scaled_font->font_matrix = *font_matrix;
     scaled_font->ctm = *ctm;
     cairo_matrix_multiply (&scaled_font->scale, &scaled_font->font_matrix, &scaled_font->ctm);
+
+    scaled_font->options = *options;
     
     scaled_font->ref_count = 1;
     scaled_font->backend = backend;
@@ -1071,6 +1078,7 @@
 	key.font_face = scaled_font->font_face;
 	key.font_matrix = &scaled_font->font_matrix;
 	key.ctm = &scaled_font->ctm;
+	key.options = scaled_font->options;
 	
 	_cairo_cache_remove (cache, &key);
 	_unlock_global_font_cache ();
--- cairo-0.6.0/src/cairo-ft-font.c.font-options-in-cache	2005-08-02 12:03:16.000000000 -0400
+++ cairo-0.6.0/src/cairo-ft-font.c	2005-08-02 12:03:59.000000000 -0400
@@ -1218,7 +1218,6 @@
 typedef struct {
     cairo_scaled_font_t base;
     int load_flags;
-    cairo_font_options_t options;
     ft_unscaled_font_t *unscaled;
 } cairo_ft_scaled_font_t;
 
@@ -1385,14 +1384,12 @@
     f->unscaled = unscaled;
     _cairo_unscaled_font_reference (&unscaled->base);
     
-    f->options = *options;
-
     if (options->hint_metrics != CAIRO_HINT_METRICS_OFF)
 	load_flags |= PRIVATE_FLAG_HINT_METRICS;
 
     f->load_flags = load_flags;
 
-    _cairo_scaled_font_init (&f->base, font_matrix, ctm, &cairo_ft_scaled_font_backend);
+    _cairo_scaled_font_init (&f->base, font_matrix, ctm, options, &cairo_ft_scaled_font_backend);
 
     return (cairo_scaled_font_t *)f;
 }
@@ -1611,7 +1608,7 @@
      * Get to unscaled metrics so that the upper level can get back to
      * user space
      */
-    if (scaled_font->options.hint_metrics != CAIRO_HINT_METRICS_OFF) {
+    if (scaled_font->base.options.hint_metrics != CAIRO_HINT_METRICS_OFF) {
 	double x_factor, y_factor;
 
 	if (scaled_font->unscaled->x_scale == 0)
--- cairo-0.6.0/src/cairoint.h.font-options-in-cache	2005-08-02 12:03:16.000000000 -0400
+++ cairo-0.6.0/src/cairoint.h	2005-08-02 12:03:59.000000000 -0400
@@ -458,13 +458,22 @@
     const cairo_unscaled_font_backend_t *backend;
 };
 
+struct _cairo_font_options {
+    cairo_antialias_t antialias;
+    cairo_subpixel_order_t subpixel_order;
+    cairo_hint_style_t hint_style;
+    cairo_hint_metrics_t hint_metrics;
+};
+
 struct _cairo_scaled_font {
     cairo_status_t status;
     int ref_count;
     cairo_matrix_t font_matrix;	  /* font space => user space */
     cairo_matrix_t ctm;	          /* user space => device space */
     cairo_matrix_t scale;	  /* font space => device space */
+    cairo_font_options_t options;
     cairo_font_face_t *font_face; /* may be NULL */
+
     const cairo_scaled_font_backend_t *backend;
 };
 
@@ -475,13 +484,6 @@
     const cairo_font_face_backend_t *backend;
 };
 
-struct _cairo_font_options {
-    cairo_antialias_t antialias;
-    cairo_subpixel_order_t subpixel_order;
-    cairo_hint_style_t hint_style;
-    cairo_hint_metrics_t hint_metrics;
-};
-
 /* cairo_font.c is responsible for a global glyph cache: 
  *  
  *   - glyph entries: [[[base], cairo_unscaled_font_t, scale, flags, index],
@@ -1320,6 +1322,7 @@
 _cairo_scaled_font_init (cairo_scaled_font_t 	           *scaled_font, 
 			 const cairo_matrix_t              *font_matrix,
 			 const cairo_matrix_t              *ctm,
+			 const cairo_font_options_t        *options,
 			 const cairo_scaled_font_backend_t *backend);
 
 cairo_private void
--- cairo-0.6.0/src/cairo-win32-font.c.font-options-in-cache	2005-08-02 12:03:16.000000000 -0400
+++ cairo-0.6.0/src/cairo-win32-font.c	2005-08-02 12:03:59.000000000 -0400
@@ -58,7 +58,6 @@
     cairo_scaled_font_t base;
 
     LOGFONTW logfont;
-    cairo_font_options_t options;
 
     BYTE quality;
 
@@ -227,7 +226,6 @@
 	return NULL;
 
     f->logfont = *logfont;
-    f->options = *options;
 
     /* We don't have any control over the hinting style or subpixel
      * order in the Win32 font API, so we ignore those parts of
@@ -263,7 +261,7 @@
     cairo_matrix_multiply (&scale, font_matrix, ctm);
     _compute_transform (f, &scale);
 
-    _cairo_scaled_font_init (&f->base, font_matrix, ctm, &cairo_win32_scaled_font_backend);
+    _cairo_scaled_font_init (&f->base, font_matrix, ctm, options, &cairo_win32_scaled_font_backend);
 
     return &f->base;
 }


Index: cairo.spec
===================================================================
RCS file: /cvs/dist/rpms/cairo/devel/cairo.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- cairo.spec	28 Jul 2005 20:17:22 -0000	1.17
+++ cairo.spec	2 Aug 2005 18:06:43 -0000	1.18
@@ -5,13 +5,15 @@
 Summary:   A vector graphics library
 Name:      cairo
 Version:   0.6.0
-Release:   1
+Release:   2
 URL:       http://cairographics.org
 Source0:   %{name}-%{version}.tar.gz
 License:   LGPL/MPL
 Group:     System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 
+Patch0: cairo-0.6.0-font-options-to-scaled-font.patch
+
 Requires: /sbin/ldconfig
 BuildRequires: pkgconfig
 BuildRequires: libpixman-devel >= %{libpixman_version}
@@ -47,6 +49,8 @@
 %prep
 %setup -q
 
+%patch0 -p1 -b .font-options-to-scaled-font
+
 %build
 %configure --enable-warnings --disable-glitz --disable-quartz \
 	--disable-atsui --disable-xcb --disable-win32 \
@@ -80,6 +84,10 @@
 %{_datadir}/gtk-doc/*
 
 %changelog
+* Tue Aug  2 2005 Kristian Høgsberg <krh redhat com> - 0.6.0-2
+- Add cairo-0.6.0-font-options-to-scaled-font.patch to make sure font
+  cache eviction works correctly (#164664).
+
 * Thu Jul 28 2005 Owen Taylor <otaylor devserv devel redhat com> 0.6.0-1
 - Update to cairo-0.6.0
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]