[email protected] wrote:
<p>When running a Java application and routing the output to another display using X Windows, I
see a trade-off between performance (frame rate) and horizontal image tearing. To remove the
complexities of my application from the issue, I'll use the <a
href=http://java.sun.com/products/java-media/2D/samples/java2demo/Java2Demo.html>Java 2D
Demo</a> as my example. </p>
Note that Java2Demo is not a good sample case as it uses most of
2d operations
<p>When I set the DISPLAY environment variable to another machine on my gigabit network and
launch the Java2D Demo, the performance is fairly slow. Going to the Transforms tab and enlarging the
lower panel - demos.Transforms.TransformAnim - for example, shows a fairly slow animation. Running
again with <a href=http://java.sun.com/javase/6/docs/technotes/guides/2d/flags.html>off-screen
pixmaps disabled</a> (-Dsun.java2d.pmoffscreen=false) results in a significant performance boost,
with the unpleasant side effect of horizontal tearing.</p>
<p>I realize I may be asking to have my cake and eat it too, but is there any way to
get the best of both worlds here? Or, if not the same performance without tearing, is there
any middle ground? Any fancy alternatives I could try to reduce tearing without the
performance hit seen when pixmaps are enabled. My app makes heavy use of moving images and
the tearing seen without pixmaps renders it almost unusable, while the performance hit when
using pixmaps makes a remote solution definitely unusable.</p>
[Message sent by forum member 'javajason83' (javajason83)]
Usually image-heavy applications would benefit from using X11 pixmaps for
offscreen rendering since at least 1-bit transparent and opaque images can be
cached
in pixmaps, and rendering to swing's back-buffer uses X11
rendering primitives whenever possible.
What kills performance over remote X is operations which require
readbacks from the Pixmap (like antialiasing, alpha compositing,
transforms, gradients).
You can change your application to behave better in remote X case.
Make sure that you use only 1-bit transparent and opaque images,
and minimize the use of AA and AC if possible. Cache rendering in
images. If you do cache images, don't touch them on every frame
(or they'll never get cached).
Until we have an accelerated rendering pipeline using xrender, for example,
that would be the only approach.
Thanks,
Dmitri
http://forums.java.net/jive/thread.jspa?messageID=321294
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".