[cairo-commit] cairo-java/test/snippets CairoSnippetsPNG.java, 1.6, 1.7

Jeffrey Morgan commit at pdx.freedesktop.org
Tue Aug 16 17:23:46 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/snippets
In directory gabe:/tmp/cvs-serv18581/test/snippets

Modified Files:
	CairoSnippetsPNG.java 
Log Message:
Numerous updates and bug fixes (thanks Owen)

Index: CairoSnippetsPNG.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPNG.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CairoSnippetsPNG.java	9 May 2005 14:47:03 -0000	1.6
+++ CairoSnippetsPNG.java	17 Aug 2005 00:23:44 -0000	1.7
@@ -10,6 +10,8 @@
 package snippets;
 
 import org.freedesktop.cairo.Context;
+import org.freedesktop.cairo.Format;
+import org.freedesktop.cairo.ImageSurface;
 import org.freedesktop.cairo.Surface;
 
 /**
@@ -26,11 +28,12 @@
 		Snippets snip = new Snippets();
 		for (int i = 0; i < Snippets.snippets.length; i++) {
 			String filename = "./" + Snippets.snippets[i] + ".png";
-			Surface surface = new Surface();
+			Surface surface = new ImageSurface(Format.ARGB32, IMAGE_WIDTH, IMAGE_WIDTH);
 			Context cr = new Context(surface);
 			
 			cr.save();
 			Snippets.invokeSnippet(snip, i, cr, IMAGE_WIDTH, IMAGE_HEIGHT);
+            surface.writeToPNG(filename);
 			cr.restore();
 		}
 	}



More information about the cairo-commit mailing list