gnome-games r7828 - in trunk: aisleriot libgames-support



Author: chpe
Date: Fri Aug 15 10:14:52 2008
New Revision: 7828
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7828&view=rev

Log:
Take the antialias setting from the font options instead of storing it separately.

Modified:
   trunk/aisleriot/board.c
   trunk/libgames-support/games-card-theme.c
   trunk/libgames-support/games-card-theme.h
   trunk/libgames-support/games-preimage.c
   trunk/libgames-support/games-preimage.h
   trunk/libgames-support/render-cards.c

Modified: trunk/aisleriot/board.c
==============================================================================
--- trunk/aisleriot/board.c	(original)
+++ trunk/aisleriot/board.c	Fri Aug 15 10:14:52 2008
@@ -1416,9 +1416,6 @@
   const cairo_font_options_t *font_options;
 
   font_options = gdk_screen_get_font_options (gtk_widget_get_screen (widget));
-  games_card_theme_set_antialias (priv->theme,
-                                  cairo_font_options_get_antialias (font_options),
-                                  cairo_font_options_get_subpixel_order (font_options));
   games_card_theme_set_font_options (priv->theme, font_options);
 
   /* FIXMEchpe: clear the cached cards in the slots! */

Modified: trunk/libgames-support/games-card-theme.c
==============================================================================
--- trunk/libgames-support/games-card-theme.c	(original)
+++ trunk/libgames-support/games-card-theme.c	Fri Aug 15 10:14:52 2008
@@ -68,8 +68,6 @@
 
 #if GTK_CHECK_VERSION (2, 10, 0)
   cairo_font_options_t *font_options;
-  cairo_antialias_t antialias;
-  cairo_subpixel_order_t subpixel_order;
 #endif
 };
 
@@ -196,8 +194,6 @@
     goto out;
 
 #if GTK_CHECK_VERSION (2, 10, 0)
-  games_preimage_set_antialias (preimage, theme->antialias, theme->subpixel_order);
-
   if (theme->font_options) {
     games_preimage_set_font_options (preimage, theme->font_options);
   }
@@ -220,9 +216,6 @@
   g_return_val_if_fail (theme->theme_data.scalable.slot_preimage != NULL, FALSE);
 
 #if GTK_CHECK_VERSION (2, 10, 0)
-  games_preimage_set_antialias (theme->theme_data.scalable.slot_preimage,
-                                theme->antialias, theme->subpixel_order);
-
   if (theme->font_options) {
     games_preimage_set_font_options (theme->theme_data.scalable.slot_preimage,
                                      theme->font_options);
@@ -571,11 +564,6 @@
 #else
   cardtheme->use_scalable = FALSE;
 #endif /* HAVE_RSVG */
-
-#if GTK_CHECK_VERSION (2, 10, 0)
-  cardtheme->antialias = CAIRO_ANTIALIAS_DEFAULT;
-  cardtheme->subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
-#endif /* GTK 2.10.0 */
 }
 
 static void
@@ -672,32 +660,6 @@
 #if GTK_CHECK_VERSION (2, 10, 0)
 
 /**
- * games_preimage_set_antialias:
- * @theme:
- * @antialias: the antialiasing mode to use
- * @subpixel_order: the subpixel order to use
- *
- * Turns on antialising of @theme, if is is has loaded a scalable theme.
- */
-void
-games_card_theme_set_antialias (GamesCardTheme * theme,
-                                cairo_antialias_t antialias,
-                                cairo_subpixel_order_t subpixel_order)
-{
-  g_return_if_fail (GAMES_IS_CARD_THEME (theme));
-
-  if (theme->antialias == antialias &&
-      theme->subpixel_order == subpixel_order)
-    return;
-
-  theme->antialias = antialias;
-  theme->subpixel_order = subpixel_order;
-
-  games_card_theme_clear_source_pixbuf (theme);
-  g_signal_emit (theme, signals[CHANGED], 0);
-}
-
-/**
  * games_card_theme_set_font_options:
  * @theme:
  * @font_options: the #cairo_font_options_t to use

Modified: trunk/libgames-support/games-card-theme.h
==============================================================================
--- trunk/libgames-support/games-card-theme.h	(original)
+++ trunk/libgames-support/games-card-theme.h	Fri Aug 15 10:14:52 2008
@@ -49,10 +49,6 @@
                                       gboolean scalable);
 
 #if GTK_CHECK_VERSION (2, 10, 0)
-void games_card_theme_set_antialias (GamesCardTheme * theme,
-                                     cairo_antialias_t antialias,
-                                     cairo_subpixel_order_t subpixel_order);
-
 void games_card_theme_set_font_options (GamesCardTheme *theme,
                                         const cairo_font_options_t *font_options);
 #endif

Modified: trunk/libgames-support/games-preimage.c
==============================================================================
--- trunk/libgames-support/games-preimage.c	(original)
+++ trunk/libgames-support/games-preimage.c	Fri Aug 15 10:14:52 2008
@@ -44,8 +44,6 @@
 #ifdef HAVE_RSVG
   RsvgHandle *rsvg_handle;
   cairo_font_options_t *font_options;
-  cairo_antialias_t antialias;
-  cairo_subpixel_order_t subpixel_order;
 #endif
 
   /* raster pixbuf data */
@@ -62,11 +60,6 @@
   preimage->scalable = FALSE;
   preimage->width = 0;
   preimage->height = 0;
-
-#ifdef HAVE_RSVG
-  preimage->antialias = CAIRO_ANTIALIAS_DEFAULT;
-  preimage->subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
-#endif
 }
 
 static void
@@ -237,9 +230,9 @@
 
   cx = cairo_create (surface);
 
-  cairo_set_antialias (cx, preimage->antialias);
-
   if (preimage->font_options) {
+    cairo_set_antialias (cx, cairo_font_options_get_antialias (preimage->font_options));
+
     cairo_set_font_options (cx, preimage->font_options);
   }
 
@@ -335,25 +328,6 @@
 }
 
 /**
- * games_preimage_set_antialias:
- * @preimage: a #GamesPreimage
- * @antialias: the antialiasing mode to use
- * @subpixel_order: the subpixel order to use
- *
- * Turns on antialising of @preimage, if it contains an SVG image.
- */
-void
-games_preimage_set_antialias (GamesPreimage * preimage,
-                              cairo_antialias_t antialias,
-                              cairo_subpixel_order_t subpixel_order)
-{
-  g_return_if_fail (GAMES_IS_PREIMAGE (preimage));
-
-  preimage->antialias = antialias;
-  preimage->subpixel_order = subpixel_order;
-}
-
-/**
  * games_preimage_set_font_options:
  * @preimage: a #GamesPreimage
  * @font_options: the font options

Modified: trunk/libgames-support/games-preimage.h
==============================================================================
--- trunk/libgames-support/games-preimage.h	(original)
+++ trunk/libgames-support/games-preimage.h	Fri Aug 15 10:14:52 2008
@@ -45,10 +45,6 @@
 GamesPreimage *games_preimage_new_from_file (const gchar * filename,
                                              GError ** error);
 
-void games_preimage_set_antialias (GamesPreimage * preimage,
-                                   cairo_antialias_t antialias,
-                                   cairo_subpixel_order_t subpixel_order);
-
 void games_preimage_set_font_options (GamesPreimage * preimage,
                                       const cairo_font_options_t *font_options);
 

Modified: trunk/libgames-support/render-cards.c
==============================================================================
--- trunk/libgames-support/render-cards.c	(original)
+++ trunk/libgames-support/render-cards.c	Fri Aug 15 10:14:52 2008
@@ -43,7 +43,6 @@
   int *sizes = NULL, n_sizes = 0;
   char *data = NULL;
   gsize len;
-  cairo_font_options_t *font_options;
   cairo_subpixel_order_t subpixels = CAIRO_SUBPIXEL_ORDER_DEFAULT;
   cairo_antialias_t antialias_mode = CAIRO_ANTIALIAS_DEFAULT;
   char *outpath = NULL, *theme_name = NULL, *theme_dir =
@@ -135,7 +134,7 @@
   theme = games_card_theme_new (NULL, TRUE);
 
   if (antialias_set) {
-    games_card_theme_set_antialias (theme, antialias_mode, subpixels);
+    cairo_font_options_t *font_options;
 
     font_options = cairo_font_options_create ();
     cairo_font_options_set_antialias (font_options, antialias_mode);



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