Hi Nazmul.
thanks for the code.
still, would it be possible to get a complete test case
that I can compile and run?
If not, please run your application on your system
with -Dsun.java2d.trace=count and post the output.
I have some ideas about what could be slow, but I need
either a test or some trace output to confirm.
Also, what is this "TransitionEffect.blur" thing in your code?
Are you performing some per pixel effects - are those on the
resulting image, or something?
Thanks,
Dmitri
[EMAIL PROTECTED] wrote:
Hi Dimitri
Here's the code that was so slow with d3d enabled.
[code]
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// data
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
private float _phase = 0f;
private boolean _anim = false;
private SoftReference<BufferedImage> _imgCacheOld;
private SoftReference<BufferedImage> _imgCacheNew;
private Insets _insets;
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// methods
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
public void init(JComponent container, JComponent oldSheet, JComponent
newSheet) {
// TimedSout out = new TimedSout();
// out.sout("init with 2 sheets... start");
GUIUtils.renderNow(container, oldSheet);
GUIUtils.renderNow(container, newSheet);
// out.sout("init with 2 sheets... rendering complete");
_imgCacheOld = AppUtils.captureComponentToImage(true, oldSheet,
TransitionEffect._blurOldSheet, _imgCacheOld);
// out.sout("init with 2 sheets... copied 1st comp to image... this takes a LONG
TIME");
_imgCacheNew = AppUtils.captureComponentToImage(true, newSheet,
TransitionEffect._blurNewSheet, _imgCacheNew);
// out.sout("init with 2 sheets... copied 2st comp to image... this takes a LONG
TIME");
_insets = container.getInsets();
// out.sout("init with 2 sheets... end");
}
[/code]
The slowdown occurs when the components are copied. If you look at the top of
this thread you will find the code I use to copy a JComponent into a
BufferedImage. The TimedSout class is something I was using to capture the time
it took to perform each of these operations.
Thanks,
Take care,
Nazmul.
[Message sent by forum member 'nazmulidris' (nazmulidris)]
http://forums.java.net/jive/thread.jspa?messageID=272580
===========================================================================
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".