Bug 27940 - CairoGraphics2D doesn't support custom Paint classes
Summary: CairoGraphics2D doesn't support custom Paint classes
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: awt (show other bugs)
Version: 0.92
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-07 20:18 UTC by Roman Kennke
Modified: 2006-09-14 15:12 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kennke 2006-06-07 20:18:52 UTC
When trying out the Metouia L&F (http://mlf.sourceforge.net/) I hit an UnsupportedOperationException in CairoGraphics2D.setPaint(). It tried to set a paint object of the type net.sourceforge.mlf.metouia.MetouiaGradients . We need to support custom paints somehow.
Comment 1 Cameron McCormack 2006-09-11 07:40:22 UTC
I agree, it would be very useful if CairoGraphics2D supported custom Paint objects.  This is needed for gradient paint servers in Batik (http://wiki.apache.org/xmlgraphics/GnuClasspathCompatibility).
Comment 2 cvs-commit@developer.classpath.org 2006-09-12 19:07:13 UTC
Subject: Bug 27940

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Changes by:	Francis Kung <fkung>	06/09/12 19:05:39

Modified files:
	gnu/java/awt/peer/gtk: CairoGraphics2D.java 
	gnu/java/awt/java2d: TexturePaintContext.java 
	.              : ChangeLog 
	native/jni/gtk-peer: gnu_java_awt_peer_gtk_CairoGraphics2D.c 
	include        : gnu_java_awt_peer_gtk_CairoGraphics2D.h 

Log message:
	2006-09-12  Francis Kung  <fkung@redhat.com>
	
		PR 27940
		* gnu/java/awt/java2d/TexturePaintContext.java
		(constructor): Fixed typo, getMinY instead of getMaxX.
		* gnu/java/awt/peer/gtk/CairoGraphics2D.java
		(setPaint): Implemented support for custom Paint classes.
		(setPaintPixels): Renamed from setTexturePixels, added repeat parameter.
		(setTexturePixels): Renamed to setPaintPixels, added repeat parameter.
		* include/gnu_java_awt_peer_gtk_CairoGraphics2D.h: Renamed setTexturePixels
		to setPaintPixels, and added repeat parameter.
		* native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c:
		 Renamed setTexturePixels to setPaintPixels, and added repeat parameter.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/peer/gtk/CairoGraphics2D.java?cvsroot=classpath&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/java/awt/java2d/TexturePaintContext.java?cvsroot=classpath&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.8533&r2=1.8534
http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_CairoGraphics2D.c?cvsroot=classpath&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/classpath/include/gnu_java_awt_peer_gtk_CairoGraphics2D.h?cvsroot=classpath&r1=1.8&r2=1.9



Comment 3 Francis Kung 2006-09-12 19:08:17 UTC
I've committed a patch to implement this in Classpath; let me know if there are any problems (I haven't tested it against Metouia or Batik).
Comment 4 david.gilbert 2006-09-12 22:15:58 UTC
I had to make a small correction (committed to CVS) to the null argument check in setPaint(), but now with your fix the JColorChooser demo in Sun's SwingSet2 demo suite works.  Thanks!
Comment 5 Cameron McCormack 2006-09-12 22:31:07 UTC
Hi Francis.

Fantastic, gradients work in Batik now.  Thanks!
Comment 6 Francis Kung 2006-09-14 15:12:48 UTC
fixed