Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Faster line drawing?



Hi Charles,

Thanks for that information.

I think I'm inclined to agree with you. There is a performance issue with Mac-Java's double buffering, and I would call it a bug.

As you suggested, I implemented my own double-buffering and it does seem faster:

18333 lines
RENDERING=RENDER_SPEED
ANTIALIASING=ANTIALIAS_ON

Draw to own image buffer: 470 ms
Draw to implicit (swing) buffer: 670 ms

I gained about 200ms using my own image buffer. Its not quite as dramatic as your example, but significant nonetheless. Interestingly, if I disable antialiasing it gets slower, not faster:

18333 lines
RENDERING=RENDER_SPEED
ANTIALIASING=ANTIALIAS_OFF

Draw to own image buffer: 610 ms
Draw to implicit (swing) buffer: 765 ms

I wonder about what's happening behind the scenes. It should always be faster to draw an aliased (non-antialiased) line.

Cheers,
Stewart

On Tuesday, November 26, 2002, at 12:17 AM, Burdick, Charles wrote:

I've found that Mac-Java's Swing double buffering is terrible. I had to explicitly double buffer a component to get quick repaints. Even then, if you resize the component, the screen goes blue and white for a second or so before it correctly repaints again. I entered a bug to Apple on it.

See the difference for yourself. Use the following JDesktopPane and add an internal window. Move around the internal window to force repaints.

In the first version, there is no explicit double buffering and the repaint action is unacceptably slow. It takes up to 2 seconds on my G4/400 with the screen maximized to move the JInternalFrame from upper left to lower right.

On Windows and Linux, I have no problem with this component and its paint speed.

In the second version, moving the JInternalFrame is reasonably smooth. However, maximizing creates a disastrous screen paint for about one second before it recreates and repaints the background. Repeated maximizing and restoring will show the flakiness of MRJs graphics through a painful variety of poor repaints.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.