[cairo-commit] cairo-java/test/kapow Kapow.java,1.16,1.17

Jeffrey Morgan commit at pdx.freedesktop.org
Mon May 9 08:38:26 PDT 2005


Committed by: kuzman

Update of /cvs/cairo/cairo-java/test/kapow
In directory gabe:/tmp/cvs-serv8044a/test/kapow

Modified Files:
	Kapow.java 
Log Message:
added pattern hierarchy

Index: Kapow.java
===================================================================
RCS file: /cvs/cairo/cairo-java/test/kapow/Kapow.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Kapow.java	9 May 2005 14:47:03 -0000	1.16
+++ Kapow.java	9 May 2005 15:38:23 -0000	1.17
@@ -12,11 +12,11 @@
 import org.freedesktop.cairo.Context;
 import org.freedesktop.cairo.FontSlant;
 import org.freedesktop.cairo.FontWeight;
-import org.freedesktop.cairo.Pattern;
+import org.freedesktop.cairo.LinearGradient;
 import org.freedesktop.cairo.Point;
+import org.freedesktop.cairo.RadialGradient;
 import org.freedesktop.cairo.Surface;
 import org.freedesktop.cairo.TextExtents;
-import org.w3c.dom.css.RGBColor;
 
 /**
  */
@@ -50,11 +50,11 @@
 
 		makeStarPath();
 		cr.setSourceRGBA(0, 0, 0, 2);
-		Pattern pattern = new Pattern(IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2,
+        RadialGradient rg = new RadialGradient(IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2,
 					10, IMAGE_WIDTH / 2, IMAGE_HEIGHT / 2, 230);
-		pattern.addColorStop(0, 1, 1, 0.2, 1);
-		pattern.addColorStop(1, 1, 0, 0, 1);
-		cr.setSource(pattern);
+		rg.addColorStop(0, 1, 1, 0.2, 1);
+		rg.addColorStop(1, 1, 0, 0, 1);
+		cr.setSource(rg);
 		cr.fill();
 
 		makeStarPath();
@@ -70,11 +70,11 @@
 
 		makeTextPath(point, text);
 
-		pattern = new Pattern(IMAGE_WIDTH / 2 - 10, IMAGE_HEIGHT / 4,
+        LinearGradient lg = new LinearGradient(IMAGE_WIDTH / 2 - 10, IMAGE_HEIGHT / 4,
 					IMAGE_WIDTH / 2 + 10, 3 * IMAGE_HEIGHT / 4);
-		pattern.addColorStop(0, 1, 1, 1, 1);
-		pattern.addColorStop(1, 0, 0, 0.4, 1);
-		cr.setSource(pattern);
+		lg.addColorStop(0, 1, 1, 1, 1);
+		lg.addColorStop(1, 0, 0, 0.4, 1);
+		cr.setSource(lg);
 
 		cr.fill();
 




More information about the cairo-commit mailing list