|
Replies:
6
-
Last Post:
Apr 1, 2008 10:30 AM
by: turingpest
|
|
|
|
|
|
|
Updating Graphics2D for Java 6+
Posted:
Mar 20, 2008 11:53 AM
|
|
|
I recently submitted an RFE for Graphics2D to be updated. Does anyone on the Swing/AWT team think this is a possibility? What specifically is the reason for the great performance difference between fill(shape) and fillShape(...)? We can definitely see an increase in code clarity from where we are now.
http://forum.java.sun.com/thread.jspa?threadID=5277040
|
|
|
|
|
|
|
Re: Updating Graphics2D for Java 6+
Posted:
Mar 20, 2008 12:43 PM
in response to: turingpest
|
|
|
You realize that there is no way that it's going to be added to Graphics2D in Java 6, unless the 6u10 is named as what it really is - a major new version of Java SE.
|
|
|
|
|
|
|
|
Re: Updating Graphics2D for Java 6+
Posted:
Mar 20, 2008 1:15 PM
in response to: kirillcool
|
|
|
kirill, youve jumped the forum.java.sun ship huh? you realize that 6+ means anything above or including 6uX. ; ) youre right though, this is more likely for J7.
|
|
|
|
|
|
|
|
Re: Updating Graphics2D for Java 6+
Posted:
Mar 20, 2008 1:23 PM
in response to: turingpest
|
|
|
Jumped ship as in having 554 messages posted on java.net up until now?
|
|
|
|
|
|
|
|
Re: Updating Graphics2D for Java 6+
Posted:
Mar 20, 2008 1:37 PM
in response to: turingpest
|
|
|
This question is in the wrong forum. It belongs to Java2D - http://forums.java.net/jive/forum.jspa?forumID=69
But anyway, the difference between rendering a rectangle and a shape that looks like a rectangle (which is what Rectangle2D is) is that shape rendering in general is more computationally-intensive, and you don't want the code to be sprinkled with "instanceof" checks trying to figure out if some shape you're rendering is actually a Rectangle2D.
Dmitri
|
|
|
|
|
|
|
|
Re: Updating Graphics2D for Java 6+
Posted:
Mar 20, 2008 2:13 PM
in response to: trembovetski
|
|
|
Sorry, the RFE was to change the Graphics class which is in java.awt so I thought this was the right place to post it.
> is that shape rendering in general is more computationally-intensive,
I think this adds further weight to my RFE then. From my (humble attempt at) tests fill(shape) was 7.6 times slower than fillShape().
My RFE was essentially just to overload the draw() methods to take doubles and to add a drawPoint and drawTriangle (optimized over polygons because of lack of windings rules etc, and needed for 3d).
This way we can use doubles without the performance penalty of a shape.
Thanks for your input Dmitri!
|
|
|
|
|