[cairo-commit] cairo-demo/png ChangeLog,1.7,1.8 outline.c,1.3,1.4

David Reveman commit at pdx.freedesktop.org
Tue Apr 6 13:08:24 PDT 2004


Committed by: davidr

Update of /cvs/cairo/cairo-demo/png
In directory pdx:/tmp/cvs-serv29919/png

Modified Files:
	ChangeLog outline.c 
Log Message:
Fix cairo_set_pattern

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/png/ChangeLog,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** a/ChangeLog	13 Mar 2004 11:57:33 -0000	1.7
--- b/ChangeLog	6 Apr 2004 20:08:20 -0000	1.8
***************
*** 1,2 ****
--- 1,6 ----
+ 2004-04-06  David Reveman  <c99drn at cs.umu.se>
+ 
+ 	* outline.c: Fix cairo_set_pattern.
+ 
  2004-03-13  Richard Worth  <richard at theworths.org>
  

Index: outline.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/png/outline.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/outline.c	11 Dec 2003 15:09:12 -0000	1.3
--- b/outline.c	6 Apr 2004 20:08:20 -0000	1.4
***************
*** 42,46 ****
  draw_cylinder (cairo_t *ct, double width, double height);
  
! cairo_surface_t *
  create_gradient (cairo_t *ct, double width, double height);
  
--- 42,46 ----
  draw_cylinder (cairo_t *ct, double width, double height);
  
! cairo_pattern_t *
  create_gradient (cairo_t *ct, double width, double height);
  
***************
*** 74,82 ****
  }
  
! cairo_surface_t *
  create_gradient (cairo_t *ct, double width, double height)
  {
      cairo_surface_t *gradient;
      cairo_matrix_t *matrix;
  
      cairo_save (ct);
--- 74,83 ----
  }
  
! cairo_pattern_t *
  create_gradient (cairo_t *ct, double width, double height)
  {
      cairo_surface_t *gradient;
      cairo_matrix_t *matrix;
+     cairo_pattern_t *gradient_pattern;
  
      cairo_save (ct);
***************
*** 105,113 ****
  		   2.0 / width,
  		   1.0 / height);
!     cairo_surface_set_matrix (gradient, matrix);
!     cairo_surface_set_filter (gradient, CAIRO_FILTER_BILINEAR);
      cairo_matrix_destroy (matrix);
  
!     return gradient;
  }
  
--- 106,117 ----
  		   2.0 / width,
  		   1.0 / height);
!     
!     gradient_pattern = cairo_pattern_create_for_surface (gradient);
!     cairo_surface_destroy (gradient);
!     cairo_pattern_set_matrix (gradient_pattern, matrix);
!     cairo_pattern_set_filter (gradient_pattern, CAIRO_FILTER_BILINEAR);
      cairo_matrix_destroy (matrix);
  
!     return gradient_pattern;
  }
  
***************
*** 115,119 ****
  draw_outlines (cairo_t *ct, int surface_width, int surface_height)
  {
!     cairo_surface_t *gradient;
      double width, height, pad;
  
--- 119,123 ----
  draw_outlines (cairo_t *ct, int surface_width, int surface_height)
  {
!     cairo_pattern_t *gradient;
      double width, height, pad;
  
***************
*** 137,141 ****
      cairo_restore (ct);
  
!     cairo_surface_destroy (gradient);
  }
  
--- 141,145 ----
      cairo_restore (ct);
  
!     cairo_pattern_destroy (gradient);
  }
  





More information about the cairo-commit mailing list