[cairo-commit] cairo-java/test/snippets CairoSnippetsPDF.java, 1.5, 1.6 CairoSnippetsPNG.java, 1.4, 1.5

Jeffrey Morgan commit at pdx.freedesktop.org
Fri May 6 17:27:08 PDT 2005


Committed by: kuzman

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

Modified Files:
	CairoSnippetsPDF.java CairoSnippetsPNG.java 
Log Message:
update so we compile after massive upstream API change.

Index: CairoSnippetsPDF.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPDF.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CairoSnippetsPDF.java	3 May 2005 01:40:40 -0000	1.5
+++ CairoSnippetsPDF.java	7 May 2005 00:27:02 -0000	1.6
@@ -27,9 +27,8 @@
 
 	public static void main(String[] args) throws Exception {
 		// initialize
-		Context cr = new Context();
 		PDFSurface surface = new PDFSurface("./snippets.pdf", X_INCHES, Y_INCHES, X_PPI, Y_PPI);
-		cr.setTargetSurface(surface);
+		Context cr = new Context(surface);
 		
 		// call the snippets
 		Snippets snip = new Snippets();

Index: CairoSnippetsPNG.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/snippets/CairoSnippetsPNG.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CairoSnippetsPNG.java	3 May 2005 01:36:16 -0000	1.4
+++ CairoSnippetsPNG.java	7 May 2005 00:27:02 -0000	1.5
@@ -10,9 +10,7 @@
 package snippets;
 
 import org.freedesktop.cairo.Context;
-import org.freedesktop.cairo.Format;
-import org.freedesktop.cairo.ImageSurface;
-import org.freedesktop.cairo.PngSurface;
+import org.freedesktop.cairo.Surface;
 
 /**
  */
@@ -28,15 +26,12 @@
 		Snippets snip = new Snippets();
 		for (int i = 0; i < Snippets.snippets.length; i++) {
 			String filename = "./" + Snippets.snippets[i] + ".png";
-			Context cr = new Context();
-			PngSurface surface = new PngSurface(Format.ARGB32, IMAGE_WIDTH, IMAGE_HEIGHT);
-			//PngSurface surface = new PngSurface(filename);
-			cr.setTargetSurface(surface);
+			Surface surface = new Surface();
+			Context cr = new Context(surface);
 			
 			cr.save();
 			Snippets.invokeSnippet(snip, i, cr, IMAGE_WIDTH, IMAGE_HEIGHT);
 			cr.restore();
-			surface.write(filename);
 			cr.dispose();
 		}
 	}




More information about the cairo-commit mailing list