[vte/vte-next: 21/114] Remove obsolete antialias handling from VteDraw



commit 3b3b2603d32024fd47f9ac62e4755794ccbcbd6c
Author: Christian Persch <chpe gnome org>
Date:   Mon May 2 21:28:32 2011 +0200

    Remove obsolete antialias handling from VteDraw

 src/vte.c     |    3 +-
 src/vtedraw.c |   58 +++++++++++++++-----------------------------------------
 src/vtedraw.h |    3 +-
 3 files changed, 18 insertions(+), 46 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 9c1e08c..f2c52e6 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -7270,8 +7270,7 @@ vte_terminal_ensure_font (VteTerminal *terminal)
 			gint width, height, ascent;
 			terminal->pvt->fontdirty = FALSE;
 			_vte_draw_set_text_font (terminal->pvt->draw,
-					terminal->pvt->fontdesc,
-					VTE_ANTI_ALIAS_USE_DEFAULT);
+					terminal->pvt->fontdesc);
 			_vte_draw_get_text_metrics (terminal->pvt->draw,
 						    &width, &height, &ascent);
 			vte_terminal_apply_metrics(terminal,
diff --git a/src/vtedraw.c b/src/vtedraw.c
index 029ebb3..a45d4a2 100644
--- a/src/vtedraw.c
+++ b/src/vtedraw.c
@@ -586,7 +586,6 @@ font_info_find_for_context (PangoContext *context)
 static struct font_info *
 font_info_create_for_context (PangoContext               *context,
 			      const PangoFontDescription *desc,
-			      VteTerminalAntiAlias        antialias,
 			      PangoLanguage              *language,
 			      guint                       fontconfig_timestamp)
 {
@@ -607,37 +606,16 @@ font_info_create_for_context (PangoContext               *context,
 
 	pango_context_set_language (context, language);
 
-	switch (antialias) {
-		cairo_font_options_t *font_options;
-		cairo_antialias_t cr_aa;
+        /* Make sure our contexts have a font_options set.  We use
+          * this invariant in our context hash and equal functions.
+          */
+        if (!pango_cairo_context_get_font_options (context)) {
+                cairo_font_options_t *font_options;
 
-	case VTE_ANTI_ALIAS_FORCE_ENABLE:
-	case VTE_ANTI_ALIAS_FORCE_DISABLE:
-
-		if (antialias == VTE_ANTI_ALIAS_FORCE_ENABLE)
-			cr_aa = CAIRO_ANTIALIAS_DEFAULT; /* let surface decide between gray and subpixel */
-		else
-			cr_aa = CAIRO_ANTIALIAS_NONE;
-
-		font_options = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
-		cairo_font_options_set_antialias (font_options, cr_aa);
-		pango_cairo_context_set_font_options (context, font_options);
-		cairo_font_options_destroy (font_options);
-
-		break;
-
-	default:
-	case VTE_ANTI_ALIAS_USE_DEFAULT:
-		/* Make sure our contexts have a font_options set.  We use
-		 * this invariant in our context hash and equal functions.
-		 */
-		if (!pango_cairo_context_get_font_options (context)) {
-			font_options = cairo_font_options_create ();
-			pango_cairo_context_set_font_options (context, font_options);
-			cairo_font_options_destroy (font_options);
-		}
-		break;
-	}
+                font_options = cairo_font_options_create ();
+                pango_cairo_context_set_font_options (context, font_options);
+                cairo_font_options_destroy (font_options);
+        }
 
 	return font_info_find_for_context (context);
 }
@@ -645,25 +623,23 @@ font_info_create_for_context (PangoContext               *context,
 static struct font_info *
 font_info_create_for_screen (GdkScreen                  *screen,
 			     const PangoFontDescription *desc,
-			     VteTerminalAntiAlias        antialias,
 			     PangoLanguage              *language)
 {
 	GtkSettings *settings = gtk_settings_get_for_screen (screen);
 	int fontconfig_timestamp;
 	g_object_get (settings, "gtk-fontconfig-timestamp", &fontconfig_timestamp, NULL);
 	return font_info_create_for_context (gdk_pango_context_get_for_screen (screen),
-					     desc, antialias, language, fontconfig_timestamp);
+					     desc, language, fontconfig_timestamp);
 }
 
 static struct font_info *
 font_info_create_for_widget (GtkWidget                  *widget,
-			     const PangoFontDescription *desc,
-			     VteTerminalAntiAlias        antialias)
+			     const PangoFontDescription *desc)
 {
 	GdkScreen *screen = gtk_widget_get_screen (widget);
 	PangoLanguage *language = pango_context_get_language (gtk_widget_get_pango_context (widget));
 
-	return font_info_create_for_screen (screen, desc, antialias, language);
+	return font_info_create_for_screen (screen, desc, language);
 }
 
 static struct unistr_info *
@@ -912,24 +888,22 @@ _vte_draw_clear (struct _vte_draw *draw, gint x, gint y, gint width, gint height
 
 void
 _vte_draw_set_text_font (struct _vte_draw *draw,
-			const PangoFontDescription *fontdesc,
-			VteTerminalAntiAlias antialias)
+			const PangoFontDescription *fontdesc)
 {
 	PangoFontDescription *bolddesc = NULL;
 
-	_vte_debug_print (VTE_DEBUG_DRAW, "draw_set_text_font (aa=%d)\n",
-			  antialias);
+	_vte_debug_print (VTE_DEBUG_DRAW, "draw_set_text_font\n");
 
 	if (draw->font_bold != draw->font)
 		font_info_destroy (draw->font_bold);
 	font_info_destroy (draw->font);
-	draw->font = font_info_create_for_widget (draw->widget, fontdesc, antialias);
+	draw->font = font_info_create_for_widget (draw->widget, fontdesc);
 
 	/* calculate bold font desc */
 	bolddesc = pango_font_description_copy (fontdesc);
 	pango_font_description_set_weight (bolddesc, PANGO_WEIGHT_BOLD);
 
-	draw->font_bold = font_info_create_for_widget (draw->widget, bolddesc, antialias);
+	draw->font_bold = font_info_create_for_widget (draw->widget, bolddesc);
 	pango_font_description_free (bolddesc);
 
 	/* Decide if we should keep this bold font face, per bug 54926:
diff --git a/src/vtedraw.h b/src/vtedraw.h
index 4f65183..b75fdb6 100644
--- a/src/vtedraw.h
+++ b/src/vtedraw.h
@@ -88,8 +88,7 @@ void _vte_draw_clear(struct _vte_draw *draw,
 		     gint x, gint y, gint width, gint height);
 
 void _vte_draw_set_text_font(struct _vte_draw *draw,
-			     const PangoFontDescription *fontdesc,
-			     VteTerminalAntiAlias anti_alias);
+			     const PangoFontDescription *fontdesc);
 void _vte_draw_get_text_metrics(struct _vte_draw *draw,
 				gint *width, gint *height, gint *ascent);
 int _vte_draw_get_char_width(struct _vte_draw *draw, vteunistr c, int columns,



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