[cairo-commit] cairo-java/test/snippets CairoSnippetsPNG.java, 1.2, 1.3

Jeffrey Morgan commit at pdx.freedesktop.org
Sat Apr 2 08:07:36 PST 2005


Committed by: kuzman

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

Modified Files:
	CairoSnippetsPNG.java 
Log Message:
fixed bug and updated to upstream API

Index: CairoSnippetsPNG.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPNG.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CairoSnippetsPNG.java	1 Apr 2005 13:58:45 -0000	1.2
+++ CairoSnippetsPNG.java	2 Apr 2005 16:07:34 -0000	1.3
@@ -11,6 +11,7 @@
 
 import org.freedesktop.cairo.Cairo;
 import org.freedesktop.cairo.Format;
+import org.freedesktop.cairo.ImageSurface;
 import org.freedesktop.cairo.PngSurface;
 
 /**
@@ -28,15 +29,15 @@
 		for (int i = 0; i < Snippets.snippets.length; i++) {
 			String filename = "./" + Snippets.snippets[i] + ".png";
 			Cairo cr = new Cairo();
-			PngSurface surface = new PngSurface(filename);
+			PngSurface surface = new PngSurface(Format.ARGB32, IMAGE_WIDTH, IMAGE_HEIGHT);
+			//PngSurface surface = new PngSurface(filename);
 			cr.setTargetSurface(surface);
 			
 			cr.save();
 			Snippets.invokeSnippet(snip, i, cr, IMAGE_WIDTH, IMAGE_HEIGHT);
 			cr.restore();
-			cr.showPage();
+			surface.write(filename);
 			cr.dispose();
-			surface.close();
 		}
 	}
 }




More information about the cairo-commit mailing list