[cairo-commit] cairo-demo/gtkcairo_slide ChangeLog, 1.5, 1.6 gtkcairo_slide.c, 1.1, 1.2 puzzle.c, 1.4, 1.5

OEyvind Kolaas commit at pdx.freedesktop.org
Tue Jun 22 20:34:09 PDT 2004


Committed by: pippin

Update of /cvs/cairo/cairo-demo/gtkcairo_slide
In directory pdx:/tmp/cvs-serv2502

Modified Files:
	ChangeLog gtkcairo_slide.c puzzle.c 
Log Message:
font selection factored out of drawing loop, making the app much more responsive


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/gtkcairo_slide/ChangeLog,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ChangeLog	13 May 2004 21:47:14 -0000	1.5
--- ChangeLog	23 Jun 2004 03:34:06 -0000	1.6
***************
*** 1,2 ****
--- 1,6 ----
+ 2004-06-23 OEyvind Kolaas <pippin at freedesktop.org>
+ 	* puzzle.c : moved the font selection out of the loop drawing the
+ 	pieces, this leads to a speedup making gtkcairo_slide useable.
+ 
  2004-05-13 OEyvind Kolaas <pippin at freedesktop.org>
  	* *.[ch] : removed gdk_cairo_set_color, replaced with

Index: gtkcairo_slide.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/gtkcairo_slide/gtkcairo_slide.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gtkcairo_slide.c	14 Feb 2004 19:19:50 -0000	1.1
--- gtkcairo_slide.c	23 Jun 2004 03:34:06 -0000	1.2
***************
*** 25,29 ****
  
      gtk_dialog_run (GTK_DIALOG (dialog));
!     gtk_main_quit ();    
  }
  
--- 25,29 ----
  
      gtk_dialog_run (GTK_DIALOG (dialog));
!     gtk_main_quit ();
  }
  
***************
*** 42,50 ****
  
      puzzle = puzzle_new ();
!     
      g_object_set (G_OBJECT (puzzle), "rows", 4, NULL);
      g_object_set (G_OBJECT (puzzle), "cols", 4, NULL);
      g_object_set (G_OBJECT (puzzle), "shuffles", 2048, NULL);
!     
  	gtk_widget_set_usize (GTK_WIDGET (puzzle), 192, 192);
  
--- 42,50 ----
  
      puzzle = puzzle_new ();
! 
      g_object_set (G_OBJECT (puzzle), "rows", 4, NULL);
      g_object_set (G_OBJECT (puzzle), "cols", 4, NULL);
      g_object_set (G_OBJECT (puzzle), "shuffles", 2048, NULL);
! 
  	gtk_widget_set_usize (GTK_WIDGET (puzzle), 192, 192);
  

Index: puzzle.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/gtkcairo_slide/puzzle.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** puzzle.c	13 May 2004 21:47:14 -0000	1.4
--- puzzle.c	23 Jun 2004 03:34:06 -0000	1.5
***************
*** 566,569 ****
--- 566,571 ----
  
      cairo_save (cr);
+     cairo_select_font (cr, "sans", 0, 0);
+     cairo_scale_font (cr, 0.35);
      cairo_scale (cr, puzzle->ratio_x, puzzle->ratio_y);
      cairo_translate (cr, 0.5, 0.5);
***************
*** 614,619 ****
                  {
                    cairo_text_extents_t extents;
-                   cairo_select_font (cr, "sans", 0, 0);
-                   cairo_scale_font (cr, 0.35);
                    cairo_text_extents (cr, item->label, &extents);
  
--- 616,619 ----





More information about the cairo-commit mailing list