[
https://issues.apache.org/jira/browse/PIVOT-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908832#action_12908832
]
Todd Volkert commented on PIVOT-633:
------------------------------------
Keep in mind that I tested the performance of the Graphics.drawRect() and
drawLine() methods vs the more advanced draw() methods back in the day, and the
older ones performed almost an order of magnitude better. I delved into the
native source code in the JDK, and they special case the simpler methods to go
super fast since they're easier to optimize. As such, I created the methods in
GraphicsUtilities to be able to know when scaling was being applied and "do the
right thing", allowing us to get the best of both worlds. This was part of a
larger effort in identifying performance bottlenecks. The overarching
conclusion of that work was that the *vast* majority of our time was spent in
paint() calls, and that optimizing paints was the path to success.
> Eliminate use of GraphicsUtilities.drawRect() and drawLine()
> ------------------------------------------------------------
>
> Key: PIVOT-633
> URL: https://issues.apache.org/jira/browse/PIVOT-633
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Reporter: Greg Brown
> Priority: Minor
> Fix For: 2.0
>
>
> These methods were originally created to provide better rendering behavior
> than the corresponding java.awt.Graphics#drawRect() and drawLine() classes.
> However, a better approach is to call Graphics2D#draw() with a Rectangle2D or
> a Line2D. This produces much better results when the display is scaled, since
> these primitives use true floating point values.
> A number of components including most buttons have already been updated to
> use the java.awt.geom classes, but many skins are still using
> GraphicsUtilities and should also be updated.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.